Package com.sun.identity.sm
Class ServiceSchemaManager
java.lang.Object
com.sun.identity.sm.ServiceSchemaManager
The class
ServiceSchemaManager
provides interfaces to manage
the service's schema. It provides access to ServiceSchema
,
which represents a single "schema" in the service.-
Constructor Summary
ConstructorDescriptionServiceSchemaManager
(SSOToken token, String serviceName, String version, org.forgerock.openam.services.datastore.DataStoreId dataStoreId, boolean isSaved) Creates an instance ofServiceSchemaManager
for the given service and version pair. -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(ServiceListener listener) Registers for changes to service's schema.Returns the dynamic service configuration schema.Returns the global service configuration schema.Returns the I18N properties file name for the service.Returns the URL of the JAR file that contains the I18N properties file.Returns i18nKey of the schema.getName()
Returns the name of the service.Returns the organization service configuration schema.Returns the policy service configuration schema.Returns URL of the view bean for the serviceReturns the service's resource name for CREST representation, or the service name if a resource name is not defined.Returns the service schema in XML for this service.getSchema
(SchemaType type) Returns the configuration schema for the given schema typeReturns the configuration schema for the given schema typeReturns the schema types available with this service.Returns the attribute schemas for the given schema type excluding status and service identifier attributes.Returns the service's hierarchy.Returns the user service configuration schema.Returns the version of the service.void
removeListener
(String listenerID) Removes the listener from the service for the given listener ID.void
replaceSchema
(InputStream xmlServiceSchema) Replaces the existing service schema with the given schema defined by the XML input stream that follows the SMS DTD.void
setI18NFileName
(String url) Sets the I18N properties file name for the servicevoid
setI18NJarURL
(String url) Sets the URL of the JAR file that contains the I18N propertiesvoid
setI18NKey
(String i18nKey) Sets the i18nKey of the schema.void
Sets the URL of the view bean for the service.void
setResourceName
(String name) Sets the service's resource name for CREST representation.void
setServiceHierarchy
(String newhierarchy) Sets the service's hierarchytoString()
Returns the string representation of the Service Schema.
-
Constructor Details
-
ServiceSchemaManager
@Supported public ServiceSchemaManager(SSOToken token, String serviceName, String version, org.forgerock.openam.services.datastore.DataStoreId dataStoreId, boolean isSaved) throws SMSException Creates an instance ofServiceSchemaManager
for the given service and version pair. It requires a user identity, that will used to perform operations with. It is assumed that the application calling this constructor should authenticate the user.- Parameters:
token
- single sign on token of the user identity on whose behalf the operations are performed.serviceName
- the name of the service.version
- the version of the service.isSaved
- If this parameter is false, ServiceSchemaManager for the given service can be created before the service is saved into the data store.- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
-
Method Details
-
getName
Returns the name of the service.- Returns:
- the name of the service
-
getVersion
Returns the version of the service.- Returns:
- the version of the service
-
getI18NFileName
Returns the I18N properties file name for the service.- Returns:
- the I18N properties file name for the service
-
setI18NFileName
Sets the I18N properties file name for the service- Parameters:
url
- properties file name- Throws:
SMSException
- if an error occurred while trying to perform the operationSSOException
- if the single sign on token is invalid or expired
-
getI18NJarURL
Returns the URL of the JAR file that contains the I18N properties file. The method could return null, in which case the properties file should be inCLASSPATH
.- Returns:
- the URL of the JAR file containing the
I18N
properties file.
-
setI18NJarURL
Sets the URL of the JAR file that contains the I18N properties- Parameters:
url
- URL- Throws:
SMSException
- if an error occurred while trying to perform the operationSSOException
- if the single sign on token is invalid or expired
-
getServiceHierarchy
Returns the service's hierarchy.- Returns:
- service hierarchy in slash format.
-
setServiceHierarchy
Sets the service's hierarchy- Parameters:
newhierarchy
- service hierarchy- Throws:
SMSException
- if an error occurred while trying to perform the operationSSOException
- if the single sign on token is invalid or expired
-
getI18NKey
Returns i18nKey of the schema.- Returns:
- i18nKey of the schema.
-
setI18NKey
Sets the i18nKey of the schema.- Parameters:
i18nKey
-i18nKey
of the schema.- Throws:
SMSException
- if an error occurred while trying to perform the operation.SSOException
- if the single sign on token is invalid or expired.
-
getPropertiesViewBeanURL
Returns URL of the view bean for the service- Returns:
- URL for view bean
-
setPropertiesViewBeanURL
Sets the URL of the view bean for the service.- Parameters:
url
- of the view bean for the service.- Throws:
SMSException
- if an error occurred while trying to perform the operation.SSOException
- if the single sign on token is invalid or expired.
-
getResourceName
Returns the service's resource name for CREST representation, or the service name if a resource name is not defined. -
setResourceName
Sets the service's resource name for CREST representation.- Parameters:
name
- resource name for CREST representation- Throws:
SMSException
- if an error occurred while trying to perform the operationSSOException
- if the single sign on token is invalid or expired
-
getSchemaTypes
Returns the schema types available with this service.- Returns:
- set of
SchemaTypes
in this service. - Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getSchema
Returns the configuration schema for the given schema type- Parameters:
type
- schema type.- Returns:
- service schema.
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getSchema
Returns the configuration schema for the given schema type- Parameters:
type
- schema type.- Returns:
- service schema.
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getServiceAttributeNames
Returns the attribute schemas for the given schema type excluding status and service identifier attributes.- Parameters:
type
- schema type.- Returns:
- service schema.
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getGlobalSchema
Returns the global service configuration schema.- Returns:
- the global service configuration schema
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getOrganizationSchema
Returns the organization service configuration schema.- Returns:
- the organization service configuration schema
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getDynamicSchema
Returns the dynamic service configuration schema.- Returns:
- the dynamic service configuration schema
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getUserSchema
Returns the user service configuration schema.- Returns:
- the user service configuration schema
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getPolicySchema
Returns the policy service configuration schema.- Returns:
- the policy service configuration schema
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
getSchema
Returns the service schema in XML for this service.- Returns:
- the service schema in XML for this service
- Throws:
SMSException
- if an error occurred while trying to perform the operation
-
replaceSchema
@Supported public void replaceSchema(InputStream xmlServiceSchema) throws SSOException, SMSException, IOException Replaces the existing service schema with the given schema defined by the XML input stream that follows the SMS DTD.- Parameters:
xmlServiceSchema
- the XML format of the service schema- Throws:
SMSException
- if an error occurred while trying to perform the operationSSOException
- if the single sign on token is invalid or expiredIOException
- if an error occurred with theInputStream
-
toString
Returns the string representation of the Service Schema. -
addListener
Registers for changes to service's schema. The object will be called when schema for this service and version is changed.- Parameters:
listener
- callback object that will be invoked when schema changes.- Returns:
- an ID of the registered listener.
-
removeListener
Removes the listener from the service for the given listener ID. The ID was issued when the listener was registered.- Parameters:
listenerID
- the listener ID issued when the listener was registered
-