Package org.forgerock.openam.upgrade
Class UpgradeUtils
- java.lang.Object
-
- org.forgerock.openam.upgrade.UpgradeUtils
-
@Supported public class UpgradeUtils extends Object
This class contains utilities to upgrade the service schema configuration to be compatible with OpenAM.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addAttributeDefaultValues(String serviceName, String subSchemaName, String schemaType, String attributeName, Set defaultValues)
Adds default values to an existing attribute.static void
addAttributeToSchema(ServiceSchema serviceSchema, Node attributeSchemaNode)
Adds new attribute schema to an existing service.static void
addAttributeToSchema(String serviceName, String subSchemaName, String schemaType, Node attributeSchemaNode, SSOToken adminToken)
Adds new attribute schema to an existing service.static void
addAttributeToSubSchema(String serviceName, String subSchemaName, String schemaType, String attributeSchemaFile)
Adds new attribute schema to a sub schema in an existing service.static void
createService(String fileName)
Creates a new service schema in the configuration store.static void
removeAttributeSchema(ServiceSchema serviceSchema, String attributeName)
Removes attribute schema from an existing service.static void
removeAttributeSchema(String serviceName, String subSchemaName, String schemaType, String attributeName, SSOToken adminToken)
Remove an attribute schema from an existing service.static void
replaceAttributeSchema(ServiceSchema serviceSchema, String attributeName, Node attributeSchemaNode)
Replace an attribute schema from an existing service with the new onestatic void
replaceAttributeSchema(String serviceName, String subSchemaName, String schemaType, String attributeName, SSOToken adminToken, Node attributeSchemaNode)
Replace an attribute schema from an existing service with the new one
-
-
-
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 servicesubSchemaName
- name of the subschemaschemaType
- the schemaTypeattributeName
- name of the attributedefaultValues
- 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 addadminToken
- 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 subschemaschemaType
- the schema type.attributeName
- attribute to removeadminToken
- 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 subschemaschemaType
- the schema type.attributeName
- attribute to updateadminToken
- admin SSOTokenattributeSchemaNode
- 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 updateattributeSchemaNode
- The attribute to update- Throws:
UpgradeException
- if there is an error updating the attribute schema.
-
-