Class ScriptEntitlementInfoWrapper

java.lang.Object
com.sun.identity.saml2.plugins.scripted.wrappers.ScriptEntitlementInfoWrapper

@SupportedAll(scriptingApi=true) public class ScriptEntitlementInfoWrapper extends Object
This class wraps around an EntitlementInfo object for consumption in scripts. This prevents the script from calling into methods that are not exposed by the EntitlementInfo interface but may be available in the concrete class.
  • Constructor Details

    • ScriptEntitlementInfoWrapper

      public ScriptEntitlementInfoWrapper(com.sun.identity.entitlement.EntitlementInfo entitlementInfo)
      Create a new ScriptEntitlementInfoWrapper that wraps the provided EntitlementInfo.
      Parameters:
      entitlementInfo - the entitlement info object to be wrapped
  • Method Details

    • getName

      public String getName()
      Returns the name of the entitlement.
      Returns:
      the name of the entitlement
    • getResourceNames

      public List<String> getResourceNames()
      Returns resource names.
      Returns:
      resource names.
    • getResourceName

      public String getResourceName()
      Returns resource name.
      Returns:
      resource names.
    • getApplicationName

      public String getApplicationName()
      Returns application name.
      Returns:
      application name.
    • getActionValue

      public Boolean getActionValue(String name)
      Returns action value.
      Parameters:
      name - Name of the action.
      Returns:
      action values.
    • getActionValues

      public Map<String,Boolean> getActionValues()
      Returns action values.
      Returns:
      action values.
    • getActionValues

      public List<Object> getActionValues(String name)
      Returns action values.
      Parameters:
      name - Name of the action.
      Returns:
      action values.
    • getAdvices

      public Map<String,List<String>> getAdvices()
      Returns advices.
      Returns:
      Advices.
    • hasAdvice

      public boolean hasAdvice()
      Check whether this entitlement has advice.
      Returns:
      Whether this entitlement has any advice.
    • getAttributes

      public Map<String,List<String>> getAttributes()
      Returns attributes.
      Returns:
      Attributes.
    • getTTL

      public long getTTL()
      Returns the TTL.
      Returns:
      The TTL in ms
    • toJSONObject

      public org.json.JSONObject toJSONObject() throws org.json.JSONException
      Returns JSONObject mapping of the object.
      Returns:
      JSONObject mapping of the object
      Throws:
      org.json.JSONException - if can not map to JSONObject
    • getApplication

      public com.sun.identity.entitlement.Application getApplication(Subject adminSubject, String realm) throws EntitlementException
      Returns application for this entitlement.
      Parameters:
      adminSubject - Admin Subject.
      realm - Realm Name
      Returns:
      application for this entitlement.
      Throws:
      EntitlementException
    • getRequestedResourceNames

      public List<String> getRequestedResourceNames()
      Returns non normalised resource names. If this has not been set the resource names (which is most probably normalised) will be returned.
      Returns:
      Non normalised resource names or if that has not been set, the normalised resource names.
    • getRequestedResourceName

      public String getRequestedResourceName()
      Returns non normalised resource name. If this has not been set the resource name (which is most probably normalised) will be returned.
      Returns:
      Non normalised resource name or if that has not been set, the normalised resource name.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object