com.sun.identity.sm
Class ServiceSchemaManager

java.lang.Object
  |
  +--com.sun.identity.sm.ServiceSchemaManager

public class ServiceSchemaManager
extends java.lang.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 Summary
ServiceSchemaManager(SSOToken token, java.lang.String serviceName, java.lang.String version)
          Creates an instance of ServiceSchemaManager for the given service and version pair.
 
Method Summary
 java.lang.String addListener(ServiceListener listener)
          Registers for changes to service's schema.
 boolean equals(java.lang.Object o)
          Returns true if the given object equals this object.
 ServiceSchema getDynamicSchema()
          Returns the dynamic service configuration schema.
 ServiceSchema getGlobalSchema()
          Returns the global service configuration schema.
 java.lang.String getI18NFileName()
          Returns the I18N properties file name for the service.
 java.lang.String getI18NJarURL()
          Returns the URL of the JAR file that contains the I18N properties file.
 java.lang.String getI18NKey()
          Returns i18nKey of the schema.
 java.lang.String getName()
          Returns the name of the service.
 ServiceSchema getOrganizationSchema()
          Returns the organization service configuration schema.
 ServiceSchema getPolicySchema()
          Returns the policy service configuration schema.
 java.lang.String getPropertiesViewBeanURL()
          Returns URL of the view bean for the service
 java.io.InputStream getSchema()
          Returns the service schema in XML for this service.
 ServiceSchema getSchema(SchemaType type)
          Returns the configuration schema for the given schema type
 ServiceSchema getSchema(java.lang.String type)
          Returns the configuration schema for the given schema type
 java.util.Set getSchemaTypes()
          Returns the schema types available with this service.
 java.util.Set getServiceAttributeNames(SchemaType type)
          Returns the attribute schemas for the given schema type excluding status and service identifier attributes.
 java.lang.String getServiceHierarchy()
          Returns the service's hierarchy.
 ServiceSchema getUserSchema()
          Returns the user service configuration schema.
 java.lang.String getVersion()
          Returns the version of the service.
 void removeListener(java.lang.String listenerID)
          Removes the listener from the service for the given listener ID.
 void replaceSchema(java.io.InputStream xmlServiceSchema)
          Replaces the existing service schema with the given schema defined by the XML input stream that follows the SMS DTD.
 void setI18NFileName(java.lang.String url)
          Sets the I18N properties file name for the service
 void setI18NJarURL(java.lang.String url)
          Sets the URL of the JAR file that contains the I18N properties
 void setI18NKey(java.lang.String i18nKey)
          Sets the i18nKey of the schema.
 void setPropertiesViewBeanURL(java.lang.String url)
          Sets the URL of the view bean for the service.
 void setServiceHierarchy(java.lang.String newhierarchy)
          Sets the service's hierarchy
 java.lang.String toString()
          Returns the string representation of the Service Schema.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceSchemaManager

public ServiceSchemaManager(SSOToken token,
                            java.lang.String serviceName,
                            java.lang.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 java.lang.String getName()
Returns the name of the service.
Returns:
the name of the service

getVersion

public java.lang.String getVersion()
Returns the version of the service.
Returns:
the version of the service

getI18NFileName

public java.lang.String getI18NFileName()
Returns the I18N properties file name for the service.
Returns:
the I18N properties file name for the service

setI18NFileName

public void setI18NFileName(java.lang.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 java.lang.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(java.lang.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 java.lang.String getServiceHierarchy()
Returns the service's hierarchy.
Returns:
service hierarchy in slash format.

setServiceHierarchy

public void setServiceHierarchy(java.lang.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 java.lang.String getI18NKey()
Returns i18nKey of the schema.
Returns:
i18nKey of the schema.

setI18NKey

public void setI18NKey(java.lang.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 java.lang.String getPropertiesViewBeanURL()
Returns URL of the view bean for the service
Returns:
URL for view bean

setPropertiesViewBeanURL

public void setPropertiesViewBeanURL(java.lang.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.

getSchemaTypes

public java.util.Set 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(java.lang.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

getServiceAttributeNames

public java.util.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 java.io.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(java.io.InputStream xmlServiceSchema)
                   throws SSOException,
                          SMSException,
                          java.io.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
java.io.IOException - if an error occurred with the InputStream

equals

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

toString

public java.lang.String toString()
Returns the string representation of the Service Schema.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of the Service Schema.

addListener

public java.lang.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(java.lang.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


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.