Package com.sun.identity.entitlement
Class NotSubject
- java.lang.Object
-
- com.sun.identity.entitlement.LogicalSubject
-
- com.sun.identity.entitlement.NotSubject
-
- All Implemented Interfaces:
EntitlementSubject
public class NotSubject extends LogicalSubject
This class wrapped on an Entitlement Subject object to provide boolean NOT. Membership ofNotSubjectis satisfied in the user is not a member of the nestedEntitlementSubject. We @JsonIgnore getESubjects and setESubjects (NOTE the 's' on the end) so that we don't indicate via JSON schema exposed that we take multiple subject types. We extend LogicalSubject but ensure that we are only allowing a singleEntitlementSubjectto be referenced by this class.
-
-
Constructor Summary
Constructors Constructor Description NotSubject()Constructs NotSubjectNotSubject(EntitlementSubject eSubject)Constructs NotSubjectNotSubject(EntitlementSubject eSubject, String pSubjectName)Constructs NotSubject
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Returnstrueif the passed in object is equal to this objectSubjectDecisionevaluate(String realm, SubjectAttributesManager mgr, Subject subject, String resourceName, Map<String,Set<String>> environment)ReturnsSubjectDecisionofEntitlementSubjectevaluation.EntitlementSubjectgetESubject()Returns nested EntitlementSubject.Set<EntitlementSubject>getESubjects()Returns the nested EntitlementSubject(s)StringgetPSubjectName()Returns OpenAM policy Subject nameSet<String>getRequiredAttributeNames()Returns required attribute names.Map<String,Set<String>>getSearchIndexAttributes()Returns search index attributes.StringgetState()Returns state of the object.inthashCode()Returns hash code of the objectbooleanisIdentity()Returnstrueis this subject is an identity object.voidsetESubject(EntitlementSubject eSubject)Sets nested EntitlementSubject.voidsetESubjects(Set<EntitlementSubject> eSubjects)Sets the nested EntitlementSubject(s)voidsetPSubjectName(String pSubjectName)Sets OpenAM policy Subject namevoidsetState(String state)Sets state of the objectorg.json.JSONObjecttoJSONObject()Returns JSONObject mapping of the objectStringtoString()Returns string representation of the object.
-
-
-
Constructor Detail
-
NotSubject
public NotSubject()
Constructs NotSubject
-
NotSubject
public NotSubject(EntitlementSubject eSubject)
Constructs NotSubject- Parameters:
eSubject- nested EntitlementSubject
-
NotSubject
public NotSubject(EntitlementSubject eSubject, String pSubjectName)
Constructs NotSubject- Parameters:
eSubject- eSubject nested EntitlementSubjectpSubjectName- subject name as used in OpenAM policy, this is relevant only when NotrESubject was created from OpenAM policy Subject
-
-
Method Detail
-
setState
public void setState(String state)
Sets state of the object- Specified by:
setStatein interfaceEntitlementSubject- Overrides:
setStatein classLogicalSubject- Parameters:
state- State of the object encoded as string
-
getState
public String getState()
Returns state of the object.- Specified by:
getStatein interfaceEntitlementSubject- Overrides:
getStatein classLogicalSubject- Returns:
- state of the object encoded as string.
-
evaluate
public SubjectDecision evaluate(String realm, SubjectAttributesManager mgr, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
ReturnsSubjectDecisionofEntitlementSubjectevaluation.- Parameters:
realm- Realm name.subject- EntitlementSubject who is under evaluation.resourceName- Resource name.environment- Environment parameters.- Returns:
SubjectDecisionofEntitlementSubjectevaluation- Throws:
EntitlementException- if any errors occur.
-
setESubject
public void setESubject(EntitlementSubject eSubject)
Sets nested EntitlementSubject.- Parameters:
eSubject- nested EntitlementSubject.
-
setESubjects
public void setESubjects(Set<EntitlementSubject> eSubjects)
Sets the nested EntitlementSubject(s)- Overrides:
setESubjectsin classLogicalSubject- Parameters:
eSubjects- the nested EntitlementSubject(s)
-
getESubject
public EntitlementSubject getESubject()
Returns nested EntitlementSubject.- Returns:
- nested EntitlementSubject.
-
getESubjects
public Set<EntitlementSubject> getESubjects()
Returns the nested EntitlementSubject(s)- Overrides:
getESubjectsin classLogicalSubject- Returns:
- the nested EntitlementSubject(s)
-
setPSubjectName
public void setPSubjectName(String pSubjectName)
Sets OpenAM policy Subject name- Overrides:
setPSubjectNamein classLogicalSubject- Parameters:
pSubjectName- subject name as used in OpenAM policy, this is relevant only when NotrESubject was created from OpenAM policy Subject
-
getPSubjectName
public String getPSubjectName()
Returns OpenAM policy Subject name- Overrides:
getPSubjectNamein classLogicalSubject- Returns:
- subject name as used in OpenAM policy, this is relevant only when NotrESubject was created from OpenAM policy Subject
-
toJSONObject
public org.json.JSONObject toJSONObject() throws org.json.JSONExceptionReturns JSONObject mapping of the object- Overrides:
toJSONObjectin classLogicalSubject- Returns:
- JSONObject mapping of the object
- Throws:
org.json.JSONException- if can not map to JSONObject
-
toString
public String toString()
Returns string representation of the object.- Overrides:
toStringin classLogicalSubject- Returns:
- string representation of the object.
-
equals
public boolean equals(Object obj)
Returnstrueif the passed in object is equal to this object- Overrides:
equalsin classLogicalSubject- Parameters:
obj- object to check for equality- Returns:
trueif the passed in object is equal to this object
-
hashCode
public int hashCode()
Returns hash code of the object- Overrides:
hashCodein classLogicalSubject- Returns:
- hash code of the object
-
getSearchIndexAttributes
public Map<String,Set<String>> getSearchIndexAttributes()
Returns search index attributes.- Specified by:
getSearchIndexAttributesin interfaceEntitlementSubject- Overrides:
getSearchIndexAttributesin classLogicalSubject- Returns:
- search index attributes.
-
getRequiredAttributeNames
public Set<String> getRequiredAttributeNames()
Returns required attribute names.- Specified by:
getRequiredAttributeNamesin interfaceEntitlementSubject- Overrides:
getRequiredAttributeNamesin classLogicalSubject- Returns:
- required attribute names.
-
isIdentity
public boolean isIdentity()
Returnstrueis this subject is an identity object.- Specified by:
isIdentityin interfaceEntitlementSubject- Overrides:
isIdentityin classLogicalSubject- Returns:
trueis this subject is an identity object.
-
-