Class Repo
- java.lang.Object
-
- com.sun.identity.idm.IdRepo
-
- org.openidentityplatform.openam.cassandra.Repo
-
public class Repo extends IdRepo
-
-
Constructor Summary
Constructors Constructor Description Repo()
-
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<String,Set<String>> 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 name, Map<String,Set<String>> attrMap)Creates an identity.voiddelete(SSOToken token, IdType type, String name)Deletes an identity.Set<String>getAssignedServices(SSOToken token, IdType type, String name, Map<String,Set<String>> mapOfServicesAndOCs)Returns the set of services assigned to this identity.Map<String,Set<String>>getAttributes(SSOToken token, IdType type, String name)Returns all attributes and values of name objectMap<String,Set<String>>getAttributes(SSOToken token, IdType type, String name, Set<String> attrNames)Returns requested attributes and values of name object.Map<String,byte[][]>getBinaryAttributes(SSOToken token, IdType type, String name, Set<String> attrNames)Returns requested binary attributes as an array of bytes.Map<String,byte[][]>getBinaryServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set<String> attrNames)Returns the requested binary attribute values of the service attributes as an array of bytes.Set<String>getMembers(SSOToken token, IdType type, String name, IdType membersType)Returns the memberships of an identity.Set<String>getMemberships(SSOToken token, IdType type, String name, IdType membershipType)Returns the memberships of an identity.Map<String,Set<String>>getServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set<String> attrNames)Returns the attribute values of the service attributes.Set<IdOperation>getSupportedOperations(IdType type)Return supported operations for a given IdTypeSet<IdType>getSupportedTypes()voidinitialize(Map<String,Set<String>> 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<String,Set<String>> attrMap)Modifies the attribute values of the service attributes.voidremoveAttributes(SSOToken token, IdType type, String name, Set<String> attrNames)Removes the attributes from the identity.voidremoveListener()Removes the listener added usingaddListenermethod.RepoSearchResultssearch(SSOToken token, IdType type, String pattern, int maxTime, int maxResults, Set<String> returnAttrs, boolean returnAllAttrs, int filterOp, Map<String,Set<String>> avPairs, boolean recursive)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<String,Set<String>> attributes_in, boolean isAdd)Set the values of attributes of the identity.voidsetBinaryAttributes(SSOToken token, IdType type, String name, Map<String,byte[][]> 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<String,Set<String>> 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, getFullyQualifiedName
-
-
-
-
Method Detail
-
initialize
public void initialize(Map<String,Set<String>> configParams) throws IdRepoException
Description copied from class:IdRepoInitialization paramters as configred for a given plugin.- Overrides:
initializein classIdRepo- Throws:
IdRepoException
-
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.
-
getSupportedOperations
public Set<IdOperation> 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<IdType> 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.
-
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.
-
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.
-
getAttributes
public Map<String,Set<String>> 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.
-
getAttributes
public Map<String,Set<String>> getAttributes(SSOToken token, IdType type, String name, Set<String> 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.
-
getBinaryAttributes
public Map<String,byte[][]> getBinaryAttributes(SSOToken token, IdType type, String name, Set<String> 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.
-
create
public String create(SSOToken token, IdType type, String name, Map<String,Set<String>> 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.name- 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.
-
setAttributes
public void setAttributes(SSOToken token, IdType type, String name, Map<String,Set<String>> attributes_in, 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_in- 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.
-
setBinaryAttributes
public void setBinaryAttributes(SSOToken token, IdType type, String name, Map<String,byte[][]> 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.
-
removeAttributes
public void removeAttributes(SSOToken token, IdType type, String name, Set<String> 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.
-
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 SSOException, IdRepoException
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:
SSOException- If identity's single sign on token is invalid.IdRepoException- If there are repository related error conditions.
-
search
public RepoSearchResults search(SSOToken token, IdType type, String pattern, int maxTime, int maxResults, Set<String> returnAttrs, boolean returnAllAttrs, int filterOp, Map<String,Set<String>> avPairs, boolean recursive) throws IdRepoException, SSOException
- Throws:
IdRepoExceptionSSOException
-
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.
-
getMembers
public Set<String> 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<String> 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.
-
assignService
public void assignService(SSOToken token, IdType type, String name, String serviceName, SchemaType stype, Map<String,Set<String>> 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<String> getAssignedServices(SSOToken token, IdType type, String name, Map<String,Set<String>> 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.
-
unassignService
public void unassignService(SSOToken token, IdType type, String name, String serviceName, Map<String,Set<String>> 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.
-
getServiceAttributes
public Map<String,Set<String>> getServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set<String> 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<String,byte[][]> getBinaryServiceAttributes(SSOToken token, IdType type, String name, String serviceName, Set<String> 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.
-
modifyService
public void modifyService(SSOToken token, IdType type, String name, String serviceName, SchemaType sType, Map<String,Set<String>> 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.
-
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.
-
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
-
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
-
-