Class ServiceSchemaManager


  • 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 Detail

      • ServiceSchemaManager

        public ServiceSchemaManager​(String serviceName,
                                    SSOToken token)
                             throws SMSException,
                                    SSOException
        Constructor for service's schema manager to manage the attributes and sub configurations. Assumes service version number to be 1.0 .
        Throws:
        SMSException - if an error occurred while trying to perform the operation
        SSOException - if the single sign on token is invalid or expired
      • ServiceSchemaManager

        public ServiceSchemaManager​(SSOToken token,
                                    String serviceName,
                                    String version)
                             throws SMSException,
                                    SSOException
        Creates an instance of ServiceSchemaManager for the given service and version pair. It requires an 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.
        Throws:
        SMSException - if an error occurred while trying to perform the operation
        SSOException - if the single sign on token is invalid or expired
    • Method Detail

      • getName

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

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

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

        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

        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

        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

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

        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

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

        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

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

        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

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

        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
      • getRevisionNumber

        public int getRevisionNumber()
        iPlanet_PUBLIC-METHOD Returns the revision number of the service schema.
        Returns:
        the revision number of the service schema
      • setRevisionNumber

        public void setRevisionNumber​(int revisionNumber)
                               throws SMSException,
                                      SSOException
        iPlanet_PUBLIC-METHOD Sets the revision number for the service schema.
        Parameters:
        revisionNumber - revision number of the service schema.
        Throws:
        SMSException - if there is a problem setting the value in the data store.
        SSOException - If the user has an invalid SSO token.
      • getSchemaTypes

        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

        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

        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
      • getOrganizationCreationSchema

        public ServiceSchema getOrganizationCreationSchema()
                                                    throws SMSException
        Returns the organization creation configuration schema if present; else returns null
        Returns:
        service schema.
        Throws:
        SMSException - if an error occurred while trying to perform the operation
      • getServiceAttributeNames

        public Set 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

        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

        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

        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

        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

        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

        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

        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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object o)
        Returns true if the given object equals this object.
        Overrides:
        equals in class Object
        Parameters:
        o - object for comparison.
        Returns:
        true if the given object equals this object.
      • toString

        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

        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

        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
      • getLastModifiedTime

        public String getLastModifiedTime()
                                   throws SMSException,
                                          SSOException
        Returns the last modified time stamp of this service schema. This method is expensive because it does not cache the modified time stamp but goes directly to the data store to obtain the value of this entry
        Returns:
        The last modified time stamp as a string with the format of yyyyMMddhhmmss
        Throws:
        SMSException - if there is an error trying to read from the datastore.
        SSOException - if the single sign-on token of the user is invalid.
      • getPluginInterfaceNames

        public Set getPluginInterfaceNames()
        Returns the names of the plugin interfaces used by the service
        Returns:
        service's plugin interface names
      • getPluginInterface

        public PluginInterface getPluginInterface​(String pluginInterfaceName)
        Returns the PluginInterface object of the service for the specified plugin interface name
        Parameters:
        pluginInterfaceName - name of the plugin interface
        Returns:
        plugin interface configured for the service; else null
      • addPluginInterface

        public void addPluginInterface​(String interfaceName,
                                       String interfaceClass,
                                       String i18nKey)
                                throws SMSException,
                                       SSOException
        Adds a new plugin interface objct to service's schema.
        Parameters:
        interfaceName - name for the plugin interface
        interfaceClass - fully qualified interface class name
        i18nKey - I18N key that will by used by UI to get messages to display the interface name
        Throws:
        SMSException
        SSOException
      • getPluginSchemaNames

        public Set getPluginSchemaNames​(String interfaceName,
                                        String orgName)
                                 throws SMSException
        Returns the names of plugins configured for the plugin interface. If organization is null, returns the plugins configured for the "root" organization.
        Throws:
        SMSException
      • getPluginSchema

        public PluginSchema getPluginSchema​(String pluginSchemaName,
                                            String interfaceName,
                                            String orgName)
                                     throws SMSException
        Returns the PluginSchema object given the schema name and the interface name for the specified organization. If organization is null, returns the PluginSchema for the "root" organization.
        Throws:
        SMSException
      • isSSOTokenValid

        public boolean isSSOTokenValid()
        Returns true if admin token cached within this class is valid
        Returns:
        true is admin token is valid