Class 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 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 principal
        guid - 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.
      • 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.