Class ServiceSchemaManager

java.lang.Object
com.sun.identity.sm.ServiceSchemaManager

@Supported public class ServiceSchemaManager extends Object
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 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 of ServiceSchemaManager 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

      @Supported public String getName()
      Returns the name of the service.
      Returns:
      the name of the service
    • getVersion

      @Supported public String getVersion()
      Returns the version of the service.
      Returns:
      the version of the service
    • getI18NFileName

      @Supported public String getI18NFileName()
      Returns the I18N properties file name for the service.
      Returns:
      the I18N properties file name for the service
    • setI18NFileName

      @Supported public void setI18NFileName(String url) throws SMSException, SSOException
      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 operation
      SSOException - if the single sign on token is invalid or expired
    • getI18NJarURL

      @Supported public String 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 in CLASSPATH.
      Returns:
      the URL of the JAR file containing the I18N properties file.
    • setI18NJarURL

      @Supported public void setI18NJarURL(String url) throws SMSException, SSOException
      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 operation
      SSOException - if the single sign on token is invalid or expired
    • getServiceHierarchy

      @Supported public String getServiceHierarchy()
      Returns the service's hierarchy.
      Returns:
      service hierarchy in slash format.
    • setServiceHierarchy

      @Supported public void setServiceHierarchy(String newhierarchy) throws SMSException, SSOException
      Sets the service's hierarchy
      Parameters:
      newhierarchy - service hierarchy
      Throws:
      SMSException - if an error occurred while trying to perform the operation
      SSOException - if the single sign on token is invalid or expired
    • getI18NKey

      @Supported public String getI18NKey()
      Returns i18nKey of the schema.
      Returns:
      i18nKey of the schema.
    • setI18NKey

      @Supported public void setI18NKey(String i18nKey) throws SMSException, SSOException
      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

      @Supported public String getPropertiesViewBeanURL()
      Returns URL of the view bean for the service
      Returns:
      URL for view bean
    • setPropertiesViewBeanURL

      @Supported public void setPropertiesViewBeanURL(String url) throws SMSException, SSOException
      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

      @Supported public String getResourceName()
      Returns the service's resource name for CREST representation, or the service name if a resource name is not defined.
    • setResourceName

      @Supported public void setResourceName(String name) throws SMSException, SSOException
      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 operation
      SSOException - if the single sign on token is invalid or expired
    • getSchemaTypes

      @Supported public Set<SchemaType> getSchemaTypes() throws SMSException
      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

      @Supported public ServiceSchema getSchema(String type) throws SMSException
      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

      @Supported public ServiceSchema getSchema(SchemaType type) throws SMSException
      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

      @Supported public Set<String> getServiceAttributeNames(SchemaType type) throws SMSException
      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

      @Supported public ServiceSchema getGlobalSchema() throws SMSException
      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

      @Supported public ServiceSchema getOrganizationSchema() throws SMSException
      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

      @Supported public ServiceSchema getDynamicSchema() throws SMSException
      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

      @Supported public ServiceSchema getUserSchema() throws SMSException
      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

      @Supported public ServiceSchema getPolicySchema() throws SMSException
      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

      @Supported public InputStream getSchema() throws SMSException
      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 operation
      SSOException - if the single sign on token is invalid or expired
      IOException - if an error occurred with the InputStream
    • toString

      @Supported public String toString()
      Returns the string representation of the Service Schema.
      Overrides:
      toString in class Object
      Returns:
      the string representation of the Service Schema.
    • addListener

      @Supported public String addListener(ServiceListener listener)
      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

      @Supported public void removeListener(String listenerID)
      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