com.sun.identity.sm
Class ServiceManager

java.lang.Object
  extended bycom.sun.identity.sm.ServiceManager

public class ServiceManager
extends java.lang.Object

The ServiceManager class provides methods to register/remove services and to list currently registered services. It also provides methods to obtain an instance of ServiceSchemaManager and an instance of ServiceConfigManager.


Constructor Summary
ServiceManager(SSOToken token)
          Creates an instance of ServiceManager.
 
Method Summary
 void clearCache()
          Removes all the SMS cached entries.
 ServiceConfigManager getConfigManager(java.lang.String serviceName, java.lang.String version)
          Returns the ServiceConfigManager for the given service name and version.
 ServiceSchemaManager getSchemaManager(java.lang.String serviceName, java.lang.String version)
          Returns the ServiceSchemaManager for the given service name and version.
 java.util.Set getServiceNames()
          Returns all the service names that have been registered.
 java.util.Set getServiceVersions(java.lang.String serviceName)
          Returns all versions supported by the service.
static boolean isRealmEnabled()
          Returns true if current service configuration uses the realm model to store the configuration data.
 java.util.Set registerServices(java.io.InputStream xmlServiceSchema)
          Registers one or more services, defined by the XML input stream that follows the SMS DTD.
 void removeService(java.lang.String serviceName, java.lang.String version)
          Removes the service schema and configuration for the given service name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceManager

public ServiceManager(SSOToken token)
               throws SSOException,
                      SMSException
Creates an instance of ServiceManager. The SSOToken is used to identify the user performing service operations.

Parameters:
token - the authenticated single sign on token.
Throws:
SSOException - if the user's single sign on token is invalid or expired
SMSException - if an error occurred while performing the operation
Method Detail

getSchemaManager

public ServiceSchemaManager getSchemaManager(java.lang.String serviceName,
                                             java.lang.String version)
                                      throws SMSException,
                                             SSOException
Returns the ServiceSchemaManager for the given service name and version.

Parameters:
serviceName - the name of the service
version - the version of the service
Returns:
the ServiceSchemaManager for the given service name and version
Throws:
SSOException - if the user's single sign on token is invalid or expired
SMSException - if an error occurred while performing the operation

getConfigManager

public ServiceConfigManager getConfigManager(java.lang.String serviceName,
                                             java.lang.String version)
                                      throws SMSException,
                                             SSOException
Returns the ServiceConfigManager for the given service name and version.

Parameters:
serviceName - the name of the service
version - the version of the service
Returns:
the ServiceConfigManager for the given service name and version.
Throws:
SSOException - if the user's single sign on token is invalid or expired
SMSException - if an error occurred while performing the operation

getServiceNames

public java.util.Set getServiceNames()
                              throws SMSException
Returns all the service names that have been registered.

Returns:
the set of names of services that have been registered
Throws:
SMSException - if an error occurred while performing the operation

getServiceVersions

public java.util.Set getServiceVersions(java.lang.String serviceName)
                                 throws SMSException
Returns all versions supported by the service.

Parameters:
serviceName - service name.
Returns:
the set of versions supported by the service
Throws:
SMSException - if an error occurred while performing the operation

registerServices

public java.util.Set registerServices(java.io.InputStream xmlServiceSchema)
                               throws SMSException,
                                      SSOException
Registers one or more services, defined by the XML input stream that follows the SMS DTD.

Parameters:
xmlServiceSchema - the input stream of service metadata in XML conforming to SMS DTD.
Returns:
set of registered service names.
Throws:
SMSException - if an error occurred while performing the operation
SSOException - if the user's single sign on token is invalid or expired

removeService

public void removeService(java.lang.String serviceName,
                          java.lang.String version)
                   throws SMSException,
                          SSOException
Removes the service schema and configuration for the given service name.

Parameters:
serviceName - the name of the service
version - the version of the service
Throws:
SMSException - if an error occurred while performing the operation
SSOException - if the user's single sign on token is invalid or expired

clearCache

public void clearCache()
Removes all the SMS cached entries. This method should be called to clear the cache for example, if ACIs for the SMS entries are changed in the directory. Also, this clears the SMS entries only in this JVM instance. If multiple instances (of JVM) are running this method must be called within each instance.


isRealmEnabled

public static boolean isRealmEnabled()
Returns true if current service configuration uses the realm model to store the configuration data.

Returns:
true is realm model is used for storing configuration data; false otherwise.


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