|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The AMObject
interface provides methods to
manage various Sun Java System Access Manager objects and their attributes.
Field Summary | |
static int |
ACTIVE
Represents the status of an object as active |
static java.lang.String |
ACTIVE_VALUE
String representation of the "active" state |
static int |
ASSIGNABLE_DYNAMIC_GROUP
Represents a Dynamic Group object type |
static int |
DELETED
Represents the status of an object as "deleted" |
static java.lang.String |
DELETED_VALUE
String representation of the "deleted" state |
static int |
DYNAMIC_GROUP
Represents a Dynamic Group object type |
static int |
FILTERED_ROLE
Represents a Filtered Role object type |
static int |
GROUP
Represents a Group object type |
static int |
GROUP_CONTAINER
Represents a group container object type |
static int |
GROUP_PROFILE
Represents group profile Information |
static int |
INACTIVE
Represents the status of an object as inactive |
static java.lang.String |
INACTIVE_VALUE
String representation of the "inactive" state |
static int |
MANAGED_ROLE
Represents a Managed Role object type |
static int |
ORGANIZATION
Represents an Organization object type |
static int |
ORGANIZATIONAL_UNIT
Represents a Organizational Unit object type |
static int |
PEOPLE_CONTAINER
Represents a People Container object type |
static int |
POLICY
Represents Policy Information |
static int |
RESOURCE
Represents resource object type |
static int |
ROLE
Represents a Role object type |
static int |
ROLE_PROFILE
Represents role profile Information |
static int |
SERVICE
Represents Service Information |
static int |
STATIC_GROUP
Represents a Static Group object type |
static int |
TEMPLATE
Represents a Template object type |
static int |
UNDETERMINED_OBJECT_TYPE
Used to indicate the object type has not yet determined. |
static int |
UNKNOWN_OBJECT_TYPE
Represents an object type that cannot be identified |
static int |
USER
Represents a User object type |
Method Summary | |
void |
addEventListener(AMEventListener listener)
Registers a event listener that needs to be invoked when a relevant event occurs. |
void |
assignPolicies(java.lang.String serviceName,
java.util.Set policyDNs)
Deprecated. This method has been deprecated. Please use: com.sun.identity.policy package for creating and
managing policies. |
void |
assignServices(java.util.Map serviceNameAndAttrs)
Assign services to the entity (user/group/organization/organization unit). |
AMTemplate |
createPolicyTemplate(java.lang.String serviceName,
java.util.Map attributes)
Deprecated. use com.sun.identity.policy package for
creating and managing policies. |
AMTemplate |
createPolicyTemplate(java.lang.String serviceName,
java.util.Map attributes,
int priority)
Deprecated. use com.sun.identity.policy package for
creating and managing policies. |
AMTemplate |
createTemplate(int templateType,
java.lang.String serviceName,
java.util.Map attributes)
Creates a Template with no priority for the given service associated with this AMObject . |
AMTemplate |
createTemplate(int templateType,
java.lang.String serviceName,
java.util.Map attributes,
int priority)
Creates a Template with a priority for the given service associated with this AMObject . |
void |
delete()
Deletes the object. |
void |
delete(boolean recursive)
Deletes object(s). |
java.util.Set |
getAssignedServices()
Returns all service names that are assigned to the user/group/organization/organizational unit. |
java.util.Set |
getAttribute(java.lang.String attributeName)
Returns attribute value. |
byte[][] |
getAttributeByteArray(java.lang.String attributeName)
Returns attribute value. |
java.util.Map |
getAttributes()
Returns Map of all attributes. |
java.util.Map |
getAttributes(java.util.Set attributeNames)
Returns Map of specified attributes. |
java.util.Map |
getAttributesByteArray()
Returns Map of all attributes. |
java.util.Map |
getAttributesByteArray(java.util.Set attributeNames)
Returns Map of specified attributes. |
java.util.Map |
getAttributesFromDataStore()
Returns Map of all attributes directly from data store. |
java.util.Map |
getAttributesFromDataStore(java.util.Set attributeNames)
Returns Map of specified attributes directly from data store. |
java.lang.String |
getDN()
Returns the DN of the entry. |
java.lang.String |
getOrganizationDN()
Returns the object's organization. |
java.lang.String |
getParentDN()
Returns the parent DN of the entry. |
java.util.Map |
getPolicy(java.lang.String serviceName)
Deprecated. This method has been deprecated. Please use: com.sun.identity.policy package for creating and
managing policies. |
AMTemplate |
getPolicyTemplate(java.lang.String serviceName)
Deprecated. This method has been deprecated. Please use: com.sun.identity.policy package for creating and
managing policies. |
java.util.Map |
getServiceAttributes(java.lang.String serviceName)
Deprecated. This method has been deprecated. Please use service template objects to obtain service attributes. |
java.lang.String |
getServiceStatus(java.lang.String serviceName)
Get the status of the service for this entity (user/group/organization/ organizational unit). |
java.lang.String |
getStringAttribute(java.lang.String attributeName)
Returns string type attribute value. |
AMTemplate |
getTemplate(java.lang.String serviceName,
int templateType)
Returns the Template for the given service associated with this AMObject . |
boolean |
isExists()
Checks if the entry exists in the directory or not. |
void |
modifyService(java.lang.String serviceName,
java.util.Map attrMap)
Modify the service attributes of a service assigned to a entity (user/group/organization/organizational unit). |
void |
purge(boolean recursive,
int graceperiod)
This method will physically delete the entry from the data store. |
void |
removeAttributes(java.util.Set attributes)
Removes attributes in this AMObject . |
void |
removeEventListener(AMEventListener listener)
Unregisters a previously registered event listener. |
java.util.Set |
search(int level,
java.lang.String filter)
Search objects based on specified level and filter. |
void |
setAttributeByteArray(java.lang.String attrName,
byte[][] byteValues)
Sets byte attribute values in this AMObject . |
void |
setAttributes(java.util.Map attributes)
Sets attribute values in this AMObject . |
void |
setAttributesByteArray(java.util.Map attributes)
Sets byte attribute values in this AMObject . |
void |
setServiceStatus(java.lang.String serviceName,
java.lang.String status)
Set the status of the service for this entity (User/Organization /Group/Organizational Unit). |
void |
setStringAttribute(java.lang.String attributeName,
java.lang.String value)
Sets string type attribute value. |
void |
store()
Stores the change to directory server. |
void |
store(boolean addValues)
Stores the change to directory server. |
void |
unassignPolicies(java.lang.String serviceName,
java.util.Set policyDNs)
Deprecated. This method has been deprecated. Please use: com.sun.identity.policy package for creating and
managing policies. |
void |
unassignServices(java.util.Set serviceNames)
Unassigns services from the user/group/organization/ organizational unit. |
Field Detail |
public static final int USER
public static final int ORGANIZATION
public static final int ORGANIZATIONAL_UNIT
public static final int GROUP_CONTAINER
public static final int PEOPLE_CONTAINER
public static final int ROLE
public static final int MANAGED_ROLE
public static final int FILTERED_ROLE
public static final int GROUP
public static final int STATIC_GROUP
public static final int DYNAMIC_GROUP
public static final int ASSIGNABLE_DYNAMIC_GROUP
public static final int TEMPLATE
public static final int POLICY
public static final int SERVICE
public static final int ROLE_PROFILE
public static final int GROUP_PROFILE
public static final int RESOURCE
public static final int ACTIVE
public static final java.lang.String ACTIVE_VALUE
public static final int INACTIVE
public static final java.lang.String INACTIVE_VALUE
public static final int DELETED
public static final java.lang.String DELETED_VALUE
public static final int UNKNOWN_OBJECT_TYPE
public static final int UNDETERMINED_OBJECT_TYPE
Method Detail |
public java.lang.String getDN()
public java.lang.String getParentDN()
public void store() throws AMException, SSOException
setAttributes
so that the changes that are made can be permanently committed to
the LDAP data store.AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no longer valid.public void store(boolean addValues) throws AMException, SSOException
setAttributes
or any other set methods
provided.
so that the changes that are made can be permanently committed to
the LDAP data store.addValues
- If addValues
is true, then the attribute
values as set in the setAttributes
method are added
to any existing values for the same attribute in the directory.
Otherwise, the attribute values replace existing values in the
data store.AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no longer valid.public boolean isExists() throws SSOException
NOTE: This method internally invokes a call to the directory to verify the existence of the entry. There could be a performance overhead. Hence, please use your discretion while using this method.
SSOException
- if the single sign on token is no longer valid.public java.util.Map getAttributes() throws AMException, SSOException
AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no
longer valid.public java.util.Map getAttributesFromDataStore() throws AMException, SSOException
AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.util.Map getAttributesByteArray() throws AMException, SSOException
AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.util.Map getAttributes(java.util.Set attributeNames) throws AMException, SSOException
attributeNames
- The Set of attribute names.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.util.Map getAttributesFromDataStore(java.util.Set attributeNames) throws AMException, SSOException
attributeNames
- The Set of attribute names.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.util.Map getAttributesByteArray(java.util.Set attributeNames) throws AMException, SSOException
attributeNames
- The Set of attribute names.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.util.Set getAttribute(java.lang.String attributeName) throws AMException, SSOException
attributeName
- Attribute nameAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public byte[][] getAttributeByteArray(java.lang.String attributeName) throws AMException, SSOException
attributeName
- Attribute nameAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.lang.String getStringAttribute(java.lang.String attributeName) throws AMException, SSOException
attributeName
- Attribute nameAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public java.util.Map getServiceAttributes(java.lang.String serviceName) throws AMException, SSOException
serviceName
- Service nameAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.getTemplate(java.lang.String, int)
public AMTemplate createTemplate(int templateType, java.lang.String serviceName, java.util.Map attributes) throws java.lang.UnsupportedOperationException, AMException, SSOException
AMObject
.templateType
- the template type. Can be one of the following:
serviceName
- service nameattributes
- Map of attributes name-value pairs. if it is null
default values will be used.AMTemplate
the service template for this
AMObject
.AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no longer valid.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this method.public AMTemplate createTemplate(int templateType, java.lang.String serviceName, java.util.Map attributes, int priority) throws java.lang.UnsupportedOperationException, AMException, SSOException
AMObject
.templateType
- the template type. Can be one of the following:
serviceName
- service name.attributes
- Map of attributes name-value pairspriority
- template priority (0 is the highest priority)AMTemplate
the service template for this
AMObject
.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this
methodpublic AMTemplate getTemplate(java.lang.String serviceName, int templateType) throws java.lang.UnsupportedOperationException, AMException, SSOException
AMObject
.serviceName
- service name.templateType
- the template type. Can be one of the following:
AMTemplate
the service template for this
AMObject
.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this
methodpublic void assignPolicies(java.lang.String serviceName, java.util.Set policyDNs) throws AMException, SSOException
com.sun.identity.policy
package for creating and
managing policies.
serviceName
- service name.policyDNs
- Set of policy DN stringAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void unassignPolicies(java.lang.String serviceName, java.util.Set policyDNs) throws AMException, SSOException
com.sun.identity.policy
package for creating and
managing policies.
serviceName
- service name.policyDNs
- Set of policy DN stringAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void setAttributeByteArray(java.lang.String attrName, byte[][] byteValues) throws AMException, SSOException
AMObject
.
Note that this method sets or replaces the
attribute value with the new value supplied. Also, the attributes
changed by this method are not committed to the LDAP data store
unless the method store()
is called
explicitly.attrName
- the attribute namebyteValues
- attribute values in byte[][] formatAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void setAttributesByteArray(java.util.Map attributes) throws AMException, SSOException
AMObject
.
Note that this method sets or replaces the
attribute value with the new value supplied. Also, the attributes
changed by this method are not committed to the LDAP data store
unless the method store()
is called
explicitly.attributes
- Map where key is the attribute name and values
are in byte[][] format.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void setAttributes(java.util.Map attributes) throws AMException, SSOException
AMObject
.
Note that this method sets or replaces the
attribute value with the new value supplied. Also, the attributes
changed by this method are not committed to the LDAP data store
unless the method store()
is called
explicitly.attributes
- Map where key is the attribute name and value
is a Set of attribute values. Each of the attribute value must
be a string value.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void removeAttributes(java.util.Set attributes) throws AMException, SSOException
AMObject
.
The attributes are removed from the LDAP data storeattributes
- The Set of attribute namesAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void setStringAttribute(java.lang.String attributeName, java.lang.String value) throws AMException, SSOException
attributeName
- attribute namevalue
- value to be set for the attribute names.AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no longer valid.public void delete() throws AMException, SSOException
AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.delete(boolean)
,
purge(boolean, int)
public void delete(boolean recursive) throws AMException, SSOException
Organization, Group, User
purge()
should be used to physically delete this object.recursive
- if true delete the object and any objects under it,
otherwise, delete the object only.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.purge(boolean, int)
public java.util.Set search(int level, java.lang.String filter) throws AMException, SSOException
level
- The search level starting from the objectfilter
- The search filterAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.public void addEventListener(AMEventListener listener) throws SSOException
Object.equals()
method on the listener object
is used to determine duplicates.
listener
- listener object that will be called upon when an event
occurs.SSOException
- if errors were encountered in adding a new
SSOTokenListener
instancepublic void removeEventListener(AMEventListener listener)
listener
was not registered previously, the method simply
returns without doing anything.listener
- listener object that will be removed or unregistered.public AMTemplate createPolicyTemplate(java.lang.String serviceName, java.util.Map attributes) throws java.lang.UnsupportedOperationException, AMException, SSOException
com.sun.identity.policy
package for
creating and managing policies.
AMObject
. This is a convenience method
and is equivalent to
createTemplate(
AMTemplate.POLICY_TEMPLATE, serviceName, attributes)
.serviceName
- service name.attributes
- Map of attributes name-value pairs.AMTemplate
the service template for this
AMObject
.AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no longer valid.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this method.public AMTemplate createPolicyTemplate(java.lang.String serviceName, java.util.Map attributes, int priority) throws java.lang.UnsupportedOperationException, AMException, SSOException
com.sun.identity.policy
package for
creating and managing policies.
AMObject
. This is a convenience
method and is equivalent to
createTemplate(AMTemplate.POLICY_TEMPLATE, serviceName,
attributes, priority)
.serviceName
- service name.attributes
- Map of attributes name-value pairs.priority
- template priority (0 is the highest priority).AMTemplate
the service template for this
AMObject
.AMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer valid.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this method.public AMTemplate getPolicyTemplate(java.lang.String serviceName) throws java.lang.UnsupportedOperationException, AMException, SSOException
com.sun.identity.policy
package for creating and
managing policies.
getTemplate(serviceName, AMTemplate.POLICY_TEMPLATE)
.
AMUser
object will throw
UnsupportedOperationException
because this method is not
relevant for AMUser
.serviceName
- service name.AMTemplate
the policy template of the service for
this object.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this method.AMException
- if an error is encountered when trying to
access/retrieve data from the data store.SSOException
- if the single sign on token is no longer validpublic java.util.Map getPolicy(java.lang.String serviceName) throws java.lang.UnsupportedOperationException, AMException, SSOException
com.sun.identity.policy
package for creating and
managing policies.
serviceName
- service name.java.lang.UnsupportedOperationException
- if the class implementing this
interface does not support this
methodAMException
- if an error is encountered when trying to
access/retrieve data from the data storeSSOException
- if the single sign on token is no longer validpublic java.lang.String getOrganizationDN() throws AMException, SSOException
AMObject
instance
every time to obtain the organization DN is not recommended.AMException
- if an error is encountered when trying to
access/retrieve data from the data store or the object does not
have organization DN.SSOException
- if the single sign on token is no longer valid.public void assignServices(java.util.Map serviceNameAndAttrs) throws AMException, SSOException
serviceNameAndAttrs
.
serviceNameAndAttrs
is a map of keys which are
service names and values which are attribute-value maps.
Attribute values are validated against the respective service schemas
before being set. Any required attributes (as defined in the service
schema) not provided in the attribute Map, will be included
and set to default values (picked up from the service schema).
Only services which have been registered with the parent organization
of the entity (the organization itself, in case the entity is
an organization) will be assigned to the entity. So before
assigning a service to an entity, registerService()
should be used on the parent organization.serviceNameAndAttrs
- Map of Service name with Map of
Attribute-Value pairsAMException
- if an error is encounters when trying to
access/retrieve data from the data storeSSOException
- if the token is no longer validAMOrganization.registerService(java.lang.String, boolean, boolean)
public void modifyService(java.lang.String serviceName, java.util.Map attrMap) throws AMException, SSOException
ServiceCallback
classes, if any, are instantiated and the
validateAttribute()
method is called.serviceName
- Name of the service which has to be modifiedattrMap
- Map of attribute names and set of attribute values.AMException
- if an error occurs during validation or storingSSOException
- if the single sign on token is no longer valid.public void setServiceStatus(java.lang.String serviceName, java.lang.String status) throws AMException, SSOException
serviceName
- Name of service whose status attribute has to
be changedstatus
- One of the status values as defined in the service schemaAMException
- if a data store exception is encountered.SSOException
- if the single sign on token is no longer valid.public java.lang.String getServiceStatus(java.lang.String serviceName) throws AMException, SSOException
serviceName
- Name of serviceAMException
- if a data store exception is encounteredSSOException
- if single sign on token is no longer valid.public void unassignServices(java.util.Set serviceNames) throws AMException, SSOException
serviceNames
- Set of service namesAMException
- if there is an internal error in the access
management data store.SSOException
- if the single sign on token is no longer validpublic java.util.Set getAssignedServices() throws AMException, SSOException
AMException
- if there is an internal error in the access
management data store.SSOException
- if the single sign on token is no longer validpublic void purge(boolean recursive, int graceperiod) throws AMException, SSOException
delete()
will not. There is a big PERFORMANCE hit if this method
is used to delete a large Organization in the recursive
mode.recursive
- If true, then recursively delete the whole subtree.graceperiod
- If set to an integer greater than -1, it will verify
if the object was last modified at least that many days ago before
physically deleting it. Pre/Post Callback
plugins as
registered in the Administration Service, will be called upon
object deletion. If any of the pre-callback
classes
throw an exception, then the operation is aborted.AMException
- if there is an internal error in the access
management data store.SSOException
- if the single sign on token is no longer validdelete()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |