com.sun.identity.sm
Class ServiceConfigManager

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

public class ServiceConfigManager
extends java.lang.Object

The class ServiceConfigurationManager provides interfaces to manage the service's configuration data. It provides access to ServiceConfig which represents a single "configuration" in the service. It manages configuration data only for GLOBAL and ORGANIZATION types.


Constructor Summary
ServiceConfigManager(SSOToken token, java.lang.String serviceName, java.lang.String version)
          Creates an instance of ServiceConfigManager for the given service and version.
 
Method Summary
 void addConfiguration(java.io.InputStream in)
          Adds instances, global and organization configurations
 java.lang.String addListener(ServiceListener listener)
          Register for changes to service's configuration.
 void deleteOrganizationConfig(java.lang.String orgName)
          Deletes the organization configuration data for the given organization.
 boolean equals(java.lang.Object o)
          Compares this object with the given object.
 ServiceConfig getGlobalConfig(java.lang.String instanceName)
          Returns the global configuration for the given service instance.
 java.util.Set getGroupNames()
          Returns the configuration group names
 ServiceInstance getInstance(java.lang.String instanceName)
          Returns the service instance given the instance name
 java.util.Set getInstanceNames()
          Returns the service instance names
 java.lang.String getName()
          Returns the name of the service.
 ServiceConfig getOrganizationConfig(java.lang.String orgName, java.lang.String instanceName)
          Returns the organization configuration for the given organization and instance name.
 java.lang.String getVersion()
          Returns the service version.
 void removeGlobalConfiguration(java.lang.String groupName)
          Deletes the global configuration data for the given group name.
 void removeInstance(java.lang.String instanceName)
          Removes the instance form the service
 void removeListener(java.lang.String listenerID)
          Removes the listener from the service for the given listener ID.
 void removeOrganizationConfiguration(java.lang.String orgName, java.lang.String groupName)
          Deletes the organization's group configuration data.
 java.lang.String toString()
          Returns String representation of the service's configuration data, along with instances and groups.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceConfigManager

public ServiceConfigManager(SSOToken token,
                            java.lang.String serviceName,
                            java.lang.String version)
                     throws SMSException,
                            SSOException
Creates an instance of ServiceConfigManager for the given service and version. 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:
ssoToken - the user identity on whose behalf the operations are performed.
serviceName - the name of the service
version - the version of the service
Throws:
SMSException -  
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 service version.
Returns:
the version of the service

getInstanceNames

public java.util.Set getInstanceNames()
                               throws SMSException
Returns the service instance names
Returns:
the service instance names
Throws:
SMSException -  

getGroupNames

public java.util.Set getGroupNames()
                            throws SMSException
Returns the configuration group names
Returns:
the service configuration group names
Throws:
SMSException -  

getInstance

public ServiceInstance getInstance(java.lang.String instanceName)
                            throws SMSException,
                                   SSOException
Returns the service instance given the instance name
Parameters:
instanceName - the name of the service instance
Returns:
service instance for the given instance name
Throws:
SMSException -  

removeInstance

public void removeInstance(java.lang.String instanceName)
                    throws SMSException,
                           SSOException
Removes the instance form the service
Parameters:
instanceName - the service instance name
Throws:
SMSException -  

getGlobalConfig

public ServiceConfig getGlobalConfig(java.lang.String instanceName)
                              throws SMSException,
                                     SSOException
Returns the global configuration for the given service instance.
Parameters:
instanceName - the service instance name
Returns:
the global configuration for the given service instance
Throws:
SMSException -  

getOrganizationConfig

public ServiceConfig getOrganizationConfig(java.lang.String orgName,
                                           java.lang.String instanceName)
                                    throws SMSException,
                                           SSOException
Returns the organization configuration for the given organization and instance name.
Parameters:
orgName - the name of the organization
instanceName - the service configuration instance name
Returns:
the organization configuration for the given organization
Throws:
SMSException -  

addConfiguration

public void addConfiguration(java.io.InputStream in)
                      throws SMSException,
                             SSOException
Adds instances, global and organization configurations

removeGlobalConfiguration

public void removeGlobalConfiguration(java.lang.String groupName)
                               throws SMSException,
                                      SSOException
Deletes the global configuration data for the given group name. If group name is null, it used the default group name.

deleteOrganizationConfig

public void deleteOrganizationConfig(java.lang.String orgName)
                              throws SMSException,
                                     SSOException
Deletes the organization configuration data for the given organization. It removes all the groups within the organization.

removeOrganizationConfiguration

public void removeOrganizationConfiguration(java.lang.String orgName,
                                            java.lang.String groupName)
                                     throws SMSException,
                                            SSOException
Deletes the organization's group configuration data.

addListener

public java.lang.String addListener(ServiceListener listener)
Register for changes to service's configuration. The object will be called when configuration for this service and version is changed.
Parameters:
serviceListener - callback object that will be invoked when schema changes

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

equals

public boolean equals(java.lang.Object o)
Compares this object with the given object.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns String representation of the service's configuration data, along with instances and groups.
Overrides:
toString in class java.lang.Object