Class AgentsRepo
- java.lang.Object
-
- com.sun.identity.idm.IdRepo
-
- com.sun.identity.idm.plugins.internal.AgentsRepo
-
- All Implemented Interfaces:
ServiceListener
public class AgentsRepo extends IdRepo implements ServiceListener
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGENT_CONFIG_SERVICEstatic StringNAME-
Fields inherited from class com.sun.identity.idm.IdRepo
ADDMEMBER, AND_MOD, configMap, NO_MOD, OR_MOD, REMOVEMEMBER
-
Fields inherited from interface com.sun.identity.sm.ServiceListener
ADDED, MODIFIED, REMOVED
-
-
Constructor Summary
Constructors Constructor Description AgentsRepo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddListener(SSOToken token, IdRepoListener listener)Adds a listener for changes in the repositoryvoidassignService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map attrMap)This method is used to assign a service to the given identity.booleanauthenticate(Callback[] credentials)Returnstrueif the data store successfully authenticates the identity with the provided credentials.Stringcreate(SSOToken token, IdType type, String agentName, Map attrMap)Creates an identity.ServiceConfigcreateAgentGroupConfig(SSOToken token)voiddelete(SSOToken token, IdType type, String name)Deletes an identity.SetgetAssignedServices(SSOToken token, IdType type, String name, Map mapOfServicesAndOCs)Returns the set of services assigned to this identity.MapgetAttributes(SSOToken token, IdType type, String name)Returns all attributes and values of name objectMapgetAttributes(SSOToken token, IdType type, String name, Set attrNames)Returns requested attributes and values of name object.MapgetBinaryAttributes(SSOToken token, IdType type, String name, Set attrNames)Returns requested binary attributes as an array of bytes.MapgetBinaryServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set attrNames)Returns the requested binary attribute values of the service attributes as an array of bytes.StringgetFullyQualifiedName(SSOToken token, IdType type, String name)Returns the fully qualified name for the identity.SetgetMembers(SSOToken token, IdType type, String name, IdType membersType)Returns the memberships of an identity.SetgetMemberships(SSOToken token, IdType type, String name, IdType membershipType)Returns the memberships of an identity.MapgetServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set attrNames)Returns the attribute values of the service attributes.SetgetSupportedOperations(IdType type)Return supported operations for a given IdTypeSetgetSupportedTypes()voidglobalConfigChanged(String serviceName, String version, String groupName, String serviceComponent, int type)This method will be invoked when a service's global configuration data has been changed.voidinitialize(Map configParams)Initialization paramters as configred for a given plugin.booleanisActive(SSOToken token, IdType type, String name)Returns true if thenameobject is active.booleanisExists(SSOToken token, IdType type, String name)Returns true if thenameobject exists in the data store.voidmodifyMemberShip(SSOToken token, IdType type, String name, Set<String> members, IdType membersType, int operation)Modify membership of the identity.voidmodifyService(SSOToken token, IdType type, String name, String serviceName, SchemaType sType, Map attrMap)Modifies the attribute values of the service attributes.voidorganizationConfigChanged(String serviceName, String version, String orgName, String groupName, String serviceComponent, int type)This method will be invoked when a service's organization configuration data has been changed.voidremoveAttributes(SSOToken token, IdType type, String name, Set attrNames)Removes the attributes from the identity.voidremoveListener()Removes the listener added usingaddListenermethod.voidschemaChanged(String serviceName, String version)This method will be invoked when a service's schema has been changed.RepoSearchResultssearch(SSOToken token, IdType type, CrestQuery crestQuery, int maxTime, int maxResults, Set<String> returnAttrs, boolean returnAllAttrs, int filterOp, Map<String,Set<String>> avPairs, boolean recursive)Search for specific type of identities using a CrestQuery object instead of a string.voidsetActiveStatus(SSOToken token, IdType type, String name, boolean active)Sets the object's status toactive.voidsetAttributes(SSOToken token, IdType type, String name, Map attributes, boolean isAdd)Set the values of attributes of the identity.voidsetBinaryAttributes(SSOToken token, IdType type, String name, Map attributes, boolean isAdd)Set the values of binary attributes the identity.voidshutdown()This method is invoked just before the plugin is removed from the IdRepo cache of plugins.booleansupportsAuthentication()Returnstrueif the data store supports authentication of identities.voidunassignService(SSOToken token, IdType type, String name, String serviceName, Map attrMap)If the service is already assigned to the identity then this method unassigns the service and removes the related attributes from the entry.-
Methods inherited from class com.sun.identity.idm.IdRepo
changePassword, getConfiguration
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
AGENT_CONFIG_SERVICE
public static final String AGENT_CONFIG_SERVICE
- See Also:
- Constant Field Values
-
-
Method Detail
-
addListener
public int addListener(SSOToken token, IdRepoListener listener) throws IdRepoException, SSOException
Description copied from class:IdRepoAdds a listener for changes in the repository- Specified by:
addListenerin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.- Returns:
- status code
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
create
public String create(SSOToken token, IdType type, String agentName, Map attrMap) throws IdRepoException, SSOException
Description copied from class:IdRepoCreates an identity.- Specified by:
createin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.agentName- Name of the object of interest.attrMap- Map of attribute-values assoicated with this object.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
delete
public void delete(SSOToken token, IdType type, String name) throws IdRepoException, SSOException
Description copied from class:IdRepoDeletes an identity.- Specified by:
deletein classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getAttributes
public Map getAttributes(SSOToken token, IdType type, String name, Set attrNames) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns requested attributes and values of name object.- Specified by:
getAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.attrNames- Set of attribute names to be read- Returns:
- Map of attribute-values
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getAttributes
public Map getAttributes(SSOToken token, IdType type, String name) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns all attributes and values of name object- Specified by:
getAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.- Returns:
- Map of attribute-values
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getBinaryAttributes
public Map getBinaryAttributes(SSOToken token, IdType type, String name, Set attrNames) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns requested binary attributes as an array of bytes.- Specified by:
getBinaryAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.attrNames- Set of attribute names to be read- Returns:
- Map of attribute-values
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
setBinaryAttributes
public void setBinaryAttributes(SSOToken token, IdType type, String name, Map attributes, boolean isAdd) throws IdRepoException, SSOException
Description copied from class:IdRepoSet the values of binary attributes the identity.- Specified by:
setBinaryAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.attributes- Map of binary attribute-values to set or add.isAdd- iftrueadd the attribute-values; otherwise replaces the attribute-values.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getMembers
public Set getMembers(SSOToken token, IdType type, String name, IdType membersType) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns the memberships of an identity. For example, returns the groups or roles that a user belongs to. The list retrieved here for a user MUST be consistent with member queries against the corresponding groups.- Specified by:
getMembersin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.membersType- IdType of members of name object.- Returns:
- Set of of members belongs to
name - Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getMemberships
public Set getMemberships(SSOToken token, IdType type, String name, IdType membershipType) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns the memberships of an identity. For example, returns the groups or roles that a user belongs to.- Specified by:
getMembershipsin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.membershipType- IdType of memberships to return.- Returns:
- Set of objects that
nameis a member of. - Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getServiceAttributes
public Map getServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set attrNames) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns the attribute values of the service attributes.- Specified by:
getServiceAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.serviceName- Name of service.attrNames- Set of attribute names.- Returns:
- Map of attribute-values.
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getBinaryServiceAttributes
public Map getBinaryServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set attrNames) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns the requested binary attribute values of the service attributes as an array of bytes.- Specified by:
getBinaryServiceAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.serviceName- Name of service.attrNames- Set of attribute names.- Returns:
- Map of attribute-values.
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
isExists
public boolean isExists(SSOToken token, IdType type, String name) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns true if thenameobject exists in the data store.- Specified by:
isExistsin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.- Returns:
trueif name object is in data store elsefalse- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
modifyMemberShip
public void modifyMemberShip(SSOToken token, IdType type, String name, Set<String> members, IdType membersType, int operation) throws IdRepoException, SSOException
Description copied from class:IdRepoModify membership of the identity. Set of members is a set of unique identifiers of other identities.- Specified by:
modifyMemberShipin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.members- Set of names to be added as members of namemembersType- IdType of members.operation- operations to perform on members ADDMEMBER or REMOVEMEMBER.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
removeAttributes
public void removeAttributes(SSOToken token, IdType type, String name, Set attrNames) throws IdRepoException, SSOException
Description copied from class:IdRepoRemoves the attributes from the identity.- Specified by:
removeAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.attrNames- Set of attribute names to remove.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
removeListener
public void removeListener()
Description copied from class:IdRepoRemoves the listener added usingaddListenermethod. This is called by the IdRepo framework when the plugin is being shutdown due to configuration change, so that a new instance can be created with the new configuration map.- Specified by:
removeListenerin classIdRepo
-
search
public RepoSearchResults search(SSOToken token, IdType type, CrestQuery crestQuery, int maxTime, int maxResults, Set<String> returnAttrs, boolean returnAllAttrs, int filterOp, Map<String,Set<String>> avPairs, boolean recursive) throws IdRepoException, SSOException
Description copied from class:IdRepoSearch for specific type of identities using a CrestQuery object instead of a string. This function actually supersedes the one above, since the "pattern" parameter can be wrapped in the CrestQuery parameter of this function.- Specified by:
searchin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.crestQuery- pattern to search for, of typeCrestQuery.maxTime- maximum wait time for search.maxResults- maximum records to return.returnAttrs- Set of attribute names to return.returnAllAttrs- return all attributesfilterOp- filter condition.avPairs- additional search conditions.- Returns:
- RepoSearchResults
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
setAttributes
public void setAttributes(SSOToken token, IdType type, String name, Map attributes, boolean isAdd) throws IdRepoException, SSOException
Description copied from class:IdRepoSet the values of attributes of the identity.- Specified by:
setAttributesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.attributes- Map of attribute-values to set or add.isAdd- iftrueadd the attribute-values; otherwise replaces the attribute-values.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getSupportedOperations
public Set getSupportedOperations(IdType type)
Description copied from class:IdRepoReturn supported operations for a given IdType- Overrides:
getSupportedOperationsin classIdRepo- Parameters:
type- Identity type- Returns:
- set of IdOperation supported for this IdType.
-
getSupportedTypes
public Set getSupportedTypes()
- Overrides:
getSupportedTypesin classIdRepo- Returns:
- Returns a Set of IdTypes supported by this plugin. Returns the supported types of identities for this plugin. If a plugin does not override this method, it returns an empty set.
-
initialize
public void initialize(Map configParams) throws IdRepoException
Description copied from class:IdRepoInitialization paramters as configred for a given plugin.- Overrides:
initializein classIdRepo- Throws:
IdRepoException
-
isActive
public boolean isActive(SSOToken token, IdType type, String name) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns true if thenameobject is active.- Overrides:
isActivein classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.- Returns:
trueif name object is in active elsefalse- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
setActiveStatus
public void setActiveStatus(SSOToken token, IdType type, String name, boolean active) throws IdRepoException, SSOException
Description copied from class:IdRepoSets the object's status toactive.- Specified by:
setActiveStatusin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.active- true if setting to active; false otherwise.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
shutdown
public void shutdown()
Description copied from class:IdRepoThis method is invoked just before the plugin is removed from the IdRepo cache of plugins. This helps the plugin clean up after itself (connections, persistent searches etc.). This method should be overridden by plugins that need to do this.
-
globalConfigChanged
public void globalConfigChanged(String serviceName, String version, String groupName, String serviceComponent, int type)
Description copied from interface:ServiceListenerThis method will be invoked when a service's global configuration data has been changed. The parametergroupNamedenote the name of the configuration grouping (e.g. default) andserviceComponentdenotes the service's sub-component that changed (e.g./NamedPolicy,/Templates).- Specified by:
globalConfigChangedin interfaceServiceListener- Parameters:
serviceName- name of the service.version- version of the service.groupName- name of the configuration grouping.serviceComponent- name of the service components that changed.type- change type, i.e., ADDED, REMOVED or MODIFIED.
-
organizationConfigChanged
public void organizationConfigChanged(String serviceName, String version, String orgName, String groupName, String serviceComponent, int type)
Description copied from interface:ServiceListenerThis method will be invoked when a service's organization configuration data has been changed. The parametersorgName,groupNameandserviceComponentdenotes the organization name, configuration grouping name and service's sub-component that are changed respectively.- Specified by:
organizationConfigChangedin interfaceServiceListener- Parameters:
serviceName- name of the serviceversion- version of the serviceorgName- organization name as DNgroupName- name of the configuration groupingserviceComponent- the name of the service components that changedtype- change type, i.e., ADDED, REMOVED or MODIFIED
-
schemaChanged
public void schemaChanged(String serviceName, String version)
Description copied from interface:ServiceListenerThis method will be invoked when a service's schema has been changed.- Specified by:
schemaChangedin interfaceServiceListener- Parameters:
serviceName- name of the serviceversion- version of the service
-
getFullyQualifiedName
public String getFullyQualifiedName(SSOToken token, IdType type, String name) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns the fully qualified name for the identity. It is expected that the fully qualified name would be unique, hence it is recommended to prefix the name with the data store name or protocol. Used by IdRepo framework to check for equality of two identities- Overrides:
getFullyQualifiedNamein classIdRepo- Parameters:
token- administrator SSOToken that can be used by the datastore to determine the fully qualified nametype- type of the identityname- name of the identity- Returns:
- fully qualified name for the identity within the data store
- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
supportsAuthentication
public boolean supportsAuthentication()
Description copied from class:IdRepoReturnstrueif the data store supports authentication of identities. Used by IdRepo framework to authenticate identities.- Overrides:
supportsAuthenticationin classIdRepo- Returns:
trueif data store supports authentication of of identities; elsefalse
-
authenticate
public boolean authenticate(Callback[] credentials) throws IdRepoException, AuthLoginException
Description copied from class:IdRepoReturnstrueif the data store successfully authenticates the identity with the provided credentials. In case the data store requires additional credentials, the list would be returned via theIdRepoExceptionexception.- Overrides:
authenticatein classIdRepo- Parameters:
credentials- Array of callback objects containing information such as username and password.- Returns:
trueif data store authenticates the identity; elsefalse- Throws:
IdRepoExceptionAuthLoginException
-
modifyService
public void modifyService(SSOToken token, IdType type, String name, String serviceName, SchemaType sType, Map attrMap) throws IdRepoException, SSOException
Description copied from class:IdRepoModifies the attribute values of the service attributes.- Specified by:
modifyServicein classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.serviceName- Name of service.attrMap- map of attribute-values.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
unassignService
public void unassignService(SSOToken token, IdType type, String name, String serviceName, Map attrMap) throws IdRepoException, SSOException
Description copied from class:IdRepoIf the service is already assigned to the identity then this method unassigns the service and removes the related attributes from the entry.- Specified by:
unassignServicein classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.serviceName- Service name to remove.attrMap- Map of attribute-values to remove- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
assignService
public void assignService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map attrMap) throws IdRepoException, SSOException
Description copied from class:IdRepoThis method is used to assign a service to the given identity. The behavior of this method will be different, depending on how each plugin will implement the services model. The map of attribute-values has already been validated and default values have already been inherited by the framework. The plugin has to verify if the service is assigned (in which case it should throw an exception), and assign the service and the attributes to the identity (if supported).- Specified by:
assignServicein classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.serviceName- service to assignattrMap- Map of attribute-values.- Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
getAssignedServices
public Set getAssignedServices(SSOToken token, IdType type, String name, Map mapOfServicesAndOCs) throws IdRepoException, SSOException
Description copied from class:IdRepoReturns the set of services assigned to this identity. The framework has to check if the values are objectclasses, then map it to service names. Or if they are servicenames, then there is no mapping needed.- Specified by:
getAssignedServicesin classIdRepo- Parameters:
token- Single sign on token of identity performing the task.type- Identity type of this object.name- Name of the object of interest.- Returns:
- Set of name of services assigned to
name - Throws:
IdRepoException- If there are repository related error conditions.SSOException- If identity's single sign on token is invalid.
-
createAgentGroupConfig
public ServiceConfig createAgentGroupConfig(SSOToken token)
-
-