Package com.iplanet.ums.cos
Class COSManager
- java.lang.Object
-
- com.iplanet.ums.cos.COSManager
-
public class COSManager extends Object
This class has the responsibility of adding, removing and replacing COS definitions. It also provides search capabilities for COS definitions.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
COSManager(SSOToken token, Guid guid)
This constructor sets the parent Directory entry which identifies the location of COS definitions which will be managed.protected
COSManager(Principal principal, Guid guid)
This constructor sets the parent Directory entry which identifies the location of COS definitions which will be managed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDefinition(ICOSDefinition cosDef)
This method adds a COS definition to the persistent store.void
assignCOSDef(PersistentObject pObject, ICOSDefinition cosDef, COSTemplate cosTemplate)
Assigns a COS (as defined by a COS definition) to the persistent object.static COSManager
getCOSManager(SSOToken token, Guid guid)
This method returns an instance of a COS Manager.static COSManager
getCOSManager(Principal principal, Guid guid)
This method returns an instance of a COS Manager.ICOSDefinition
getDefinition(String name)
Returns COS definition given the name.Collection
getDefinitions()
Retrieves all COS definitions for the current organization.void
removeCOSAssignment(PersistentObject pObject, ICOSDefinition cosDef, COSTemplate cosTemplate)
Removes COS assignment from the persistent object.void
removeDefinition(String name)
Removes the COS definition.void
updateDefinition(ICOSDefinition cosDef)
Updates the contents of a COS definition with the new contents.
-
-
-
Constructor Detail
-
COSManager
protected COSManager(SSOToken token, Guid guid) throws UMSException
This constructor sets the parent Directory entry which identifies the location of COS definitions which will be managed. It also gets an instance of a SchemaManager which will be used to update schema entries for COS assignments.- Parameters:
token
- Authenticated principal's single sign on token.guid
- The unique identifier specifying where COS definitions will be managed.- Throws:
UMSException
- if the token authentication fails, or if the guid for the parent entry is not valid.
-
COSManager
protected COSManager(Principal principal, Guid guid) throws UMSException
This constructor sets the parent Directory entry which identifies the location of COS definitions which will be managed. It also gets an instance of a SchemaManager which will be used to update schema entries for COS assignments.- Parameters:
principal
- Authenticated principalguid
- The unique identifier specifying where COS definitions will be managed.- Throws:
UMSException
- The exception thrown if there is a problem determining the parent entry, or getting the SchemaManager instance.
-
-
Method Detail
-
getCOSManager
public static COSManager getCOSManager(SSOToken token, Guid guid) throws UMSException
This method returns an instance of a COS Manager.- Parameters:
token
- Authenticated principal's single sign on token.guid
- COS definitions will be managed under the level identified by this guid.- Throws:
UMSException
- The exception thrown from the COSManager constructor.
-
getCOSManager
public static COSManager getCOSManager(Principal principal, Guid guid) throws UMSException
This method returns an instance of a COS Manager.- Parameters:
principal
- Authenticated principal.guid
- COS definitions will be managed under the level identified by this guid.- Throws:
UMSException
- The exception thrown from the data layer.
-
addDefinition
public void addDefinition(ICOSDefinition cosDef) throws UMSException
This method adds a COS definition to the persistent store. The definition is added under the specified "guid" parameter.- Parameters:
cosDef
- The COS definition to be added.- Throws:
UMSException
- The exception thrown from the data layer.
-
removeDefinition
public void removeDefinition(String name) throws UMSException
Removes the COS definition.- Parameters:
name
- The name of the definition to be removed.- Throws:
UMSException
- The exception thrown from the data layer.
-
updateDefinition
public void updateDefinition(ICOSDefinition cosDef) throws UMSException
Updates the contents of a COS definition with the new contents. The COS definition must already exist in the persistent layer, before its contents can be replaced.- Parameters:
cosDef
- The COS definition containing new contents, which will replace the same definition in the persistent layer.- Throws:
UMSException
- The exception thrown from the data layer.
-
getDefinition
public ICOSDefinition getDefinition(String name) throws UMSException, COSNotFoundException
Returns COS definition given the name.- Parameters:
name
- Name of the COS definition.- Returns:
- A COS definition with the specified name.
- Throws:
UMSException
- if exception occurred at the data layer.COSNotFoundException
- if the COS object is not found.
-
getDefinitions
public Collection getDefinitions() throws UMSException
Retrieves all COS definitions for the current organization. This COSManager instance applies to an organization.- Returns:
- A collection of COS definition objects.
- Throws:
UMSException
- The exception thrown from the data layer.
-
assignCOSDef
public void assignCOSDef(PersistentObject pObject, ICOSDefinition cosDef, COSTemplate cosTemplate) throws UMSException
Assigns a COS (as defined by a COS definition) to the persistent object. The COS target persistent object could be a user, group, organization, organizationalunit, etc. The COS target object must be persistent before this method can be used.- Parameters:
pObject
- The COS target persistent object.cosDef
- A COS definition.cosTemplate
- A COS template. This only applies for COS and Indirect COS definitions. For pointer COS definitions, this parameter can be null.- Throws:
UMSException
- If a data layer exception occurs.
-
removeCOSAssignment
public void removeCOSAssignment(PersistentObject pObject, ICOSDefinition cosDef, COSTemplate cosTemplate) throws UMSException
Removes COS assignment from the persistent object. The COS target persistent object could be a user, group, organization, organizationalunit, etc. The COS target object must be persistent before this method can be used.- Parameters:
pObject
- The COS target persistent object.cosDef
- A COS definition.cosTemplate
- A COS template.- Throws:
UMSException
- The exception thrown if any of the following occur: o the target persistent object or COS definition parameter is null. o the target object is not persistent. o the COS definition is not one of the valid COS definitions. o an exception is propagated from any of the "remove" methods.
-
-