Class UpgradeUtils


  • @Supported
    public class UpgradeUtils
    extends Object
    This class contains utilities to upgrade the service schema configuration to be compatible with OpenAM.
    • Method Detail

      • createService

        @Supported
        public static void createService​(String fileName)
                                  throws UpgradeException
        Creates a new service schema in the configuration store. The service xml file passed should follow the SMS DTD.
        Parameters:
        fileName - Name of the service schema XML to be loaded.
        Throws:
        UpgradeException - if there is an error creating a service.
      • addAttributeToSubSchema

        @Supported
        public static void addAttributeToSubSchema​(String serviceName,
                                                   String subSchemaName,
                                                   String schemaType,
                                                   String attributeSchemaFile)
                                            throws UpgradeException
        Adds new attribute schema to a sub schema in an existing service.
        Parameters:
        serviceName - the service name.
        subSchemaName - the sub schema name.
        schemaType - the schema type.
        attributeSchemaFile - XML file containing attribute schema definition.
        Throws:
        UpgradeException - if there is an error adding the attribute schema.
      • addAttributeDefaultValues

        @Supported
        public static void addAttributeDefaultValues​(String serviceName,
                                                     String subSchemaName,
                                                     String schemaType,
                                                     String attributeName,
                                                     Set defaultValues)
                                              throws UpgradeException
        Adds default values to an existing attribute. The existing values in the attribute will be updated with new values.
        Parameters:
        serviceName - name of the service
        subSchemaName - name of the subschema
        schemaType - the schemaType
        attributeName - name of the attribute
        defaultValues - a set of values to be added to the attribute
        Throws:
        UpgradeException - If there is an error.
      • addAttributeToSchema

        @Supported
        public static void addAttributeToSchema​(String serviceName,
                                                String subSchemaName,
                                                String schemaType,
                                                Node attributeSchemaNode,
                                                SSOToken adminToken)
                                         throws UpgradeException
        Adds new attribute schema to an existing service.
        Parameters:
        serviceName - the service name.
        schemaType - the schema type.
        attributeSchemaNode - attribute to add
        adminToken - admin SSOToken
        Throws:
        UpgradeException - if there is an error adding the attribute schema.
      • addAttributeToSchema

        @Supported
        public static void addAttributeToSchema​(ServiceSchema serviceSchema,
                                                Node attributeSchemaNode)
                                         throws UpgradeException
        Adds new attribute schema to an existing service.
        Parameters:
        serviceSchema - The underlying service schema.
        attributeSchemaNode - The attribute is add
        Throws:
        UpgradeException - if there is an error adding the attribute schema.
      • removeAttributeSchema

        @Supported
        public static void removeAttributeSchema​(String serviceName,
                                                 String subSchemaName,
                                                 String schemaType,
                                                 String attributeName,
                                                 SSOToken adminToken)
                                          throws UpgradeException
        Remove an attribute schema from an existing service.
        Parameters:
        serviceName - the service name.
        subSchemaName - name of the subschema
        schemaType - the schema type.
        attributeName - attribute to remove
        adminToken - admin SSOToken
        Throws:
        UpgradeException - if there is an error removing the attribute schema.
      • removeAttributeSchema

        @Supported
        public static void removeAttributeSchema​(ServiceSchema serviceSchema,
                                                 String attributeName)
                                          throws UpgradeException
        Removes attribute schema from an existing service.
        Parameters:
        serviceSchema - The underlying service schema.
        attributeName - The attribute is remove
        Throws:
        UpgradeException - if there is an error removing the attribute schema.
      • replaceAttributeSchema

        @Supported
        public static void replaceAttributeSchema​(String serviceName,
                                                  String subSchemaName,
                                                  String schemaType,
                                                  String attributeName,
                                                  SSOToken adminToken,
                                                  Node attributeSchemaNode)
                                           throws UpgradeException
        Replace an attribute schema from an existing service with the new one
        Parameters:
        serviceName - the service name.
        subSchemaName - name of the subschema
        schemaType - the schema type.
        attributeName - attribute to update
        adminToken - admin SSOToken
        attributeSchemaNode - The attribute to update
        Throws:
        UpgradeException - if there is an error updating the attribute schema.
      • replaceAttributeSchema

        @Supported
        public static void replaceAttributeSchema​(ServiceSchema serviceSchema,
                                                  String attributeName,
                                                  Node attributeSchemaNode)
                                           throws UpgradeException
        Replace an attribute schema from an existing service with the new one
        Parameters:
        serviceSchema - The underlying service schema.
        attributeName - attribute to update
        attributeSchemaNode - The attribute to update
        Throws:
        UpgradeException - if there is an error updating the attribute schema.