com.sun.identity.sm
Class ServiceConfig

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

public class ServiceConfig
extends java.lang.Object

The class ServiceConfig provides interfaces to manage the configuration information of a service configuration. It provides methods to get and set configuration parameters for this service configuration.


Method Summary
 void addAttribute(java.lang.String attrName, java.util.Set values)
          Adds a configuration parameter to the service configuration.
 void addExportedOrganizationNames(java.util.Set names)
          Adds the organization names to the list of organization names that can import this service configutation.
 void addSubConfig(java.lang.String subConfigName, java.lang.String subConfigId, int priority, java.util.Map attrs)
          Adds a service sub-configuration with configuration parameters.
 java.util.Map getAttributes()
          Returns the service configuration parameters.
 java.util.Map getAttributesWithoutDefaults()
          Returns the service configuration parameters without inheriting the default values from service's schema.
 java.lang.String getComponentName()
          Returns the service component name.
 java.lang.String getDN()
          Returns the LDAP DN represented by this ServiceConfig object.
 java.util.Set getExportedOrganizationNames()
          Returns the organization names to which the service configuration is being exported.
 java.util.Set getExportedSubConfigNames(java.lang.String serviceId)
          Returns a set of exported fully qualified sub-configuration names that can be imported used locally as service configuration
 java.lang.String getLastModifiedTime()
          Returns the last modified time stamp of this configuration 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
 int getPriority()
          Returns the priority assigned to the service configuration.
 java.lang.String getSchemaID()
          Returns the service component's schema ID.
 java.lang.String getServiceName()
          Returns the name of this service configuration.
 ServiceConfig getSubConfig(java.lang.String subConfigName)
          Returns the service's sub-configuration given the service's sub-configuration name.
 java.util.Set getSubConfigNames()
          Returns the names of all service's sub-configurations.
 java.util.Set getSubConfigNames(java.lang.String pattern)
          Method to get names of service's sub-configurations that match the given pattern.
 java.util.Set getSubConfigNames(java.lang.String pattern, java.lang.String schemaName)
          Method to get names of service's sub-configurations that match the given pattern and belongs to the specified service schema name.
 java.lang.String getVersion()
          Returns the service version
 void importSubConfig(java.lang.String subConfigName, java.lang.String exportedSubConfigName)
          Imports a service sub-configuration to the list of localy defined sub-configuration.
 void removeAttribute(java.lang.String attrName)
          Removes a configuration parameter from the service configuration.
 void removeAttributes(java.util.Set attrNames)
          Removes a configuration parameters from the service configuration.
 void removeAttributeValues(java.lang.String attrName, java.util.Set values)
          Removes the specific values for the given configuration parameter.
 void removeSharedOrganizationNames(java.util.Set names)
          Removes the organization names from the list of organization names that can import the service configuration.
 void removeSubConfig(java.lang.String subConfigName)
          Removes the service sub-configuration.
 void replaceAttributeValue(java.lang.String attrName, java.lang.String oldValue, java.lang.String newValue)
          Replaces old value of the configuration parameter with new value.
 void replaceAttributeValues(java.lang.String attrName, java.util.Set oldValues, java.util.Set newValues)
          Replaces the old values of the configuration parameter with the new values.
 void setAttributes(java.util.Map attrs)
          Sets the service configuration parameters.
 void setExportedOrganizationNames(java.util.Set names)
          Sets the organization names that can import the service configuration.
 void setPriority(int priority)
          Sets the priority to the service configuration.
 java.lang.String toString()
          Returns String representation of the ServiceConfig object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getServiceName

public java.lang.String getServiceName()
Returns the name of this service configuration.
Returns:
the name of this service configuration

getVersion

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

getComponentName

public java.lang.String getComponentName()
Returns the service component name. It is "/" separated and the root component name is "/".
Returns:
service component name

getSchemaID

public java.lang.String getSchemaID()
Returns the service component's schema ID. For global and organization's root configurations it returns an empty string.
Returns:
service component's schema ID

getPriority

public int getPriority()
Returns the priority assigned to the service configuration.
Returns:
the priority assigned to the service configuration

setPriority

public void setPriority(int priority)
                 throws SSOException,
                        SMSException
Sets the priority to the service configuration.
Parameters:
priority - the priority to be assigned to the configuration
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

getSubConfigNames

public java.util.Set getSubConfigNames()
                                throws SMSException
Returns the names of all service's sub-configurations.
Returns:
set of names of all service's sub-configurations
Throws:
SMSException - if there is an error accessing the data store

getSubConfigNames

public java.util.Set getSubConfigNames(java.lang.String pattern)
                                throws SMSException
Method to get names of service's sub-configurations that match the given pattern.
Parameters:
pattern - pattern to match for sub-configuration names
Returns:
names of the service sub-configuration
Throws:
SMSException - if an error occurred while performing the operation.

getSubConfigNames

public java.util.Set getSubConfigNames(java.lang.String pattern,
                                       java.lang.String schemaName)
                                throws SMSException
Method to get names of service's sub-configurations that match the given pattern and belongs to the specified service schema name.
Parameters:
pattern - pattern to match for other entities.
schemaName - service schema name.
Returns:
names of the service sub-configuration
Throws:
SMSException - if an error occurred while performing the operation.

getExportedSubConfigNames

public java.util.Set getExportedSubConfigNames(java.lang.String serviceId)
                                        throws SMSException
Returns a set of exported fully qualified sub-configuration names that can be imported used locally as service configuration
Parameters:
serviceId - service schema identifier
Returns:
names of fully qualified applicable service sub-configurations
Throws:
SMSException - if an error occurred while performing the operation.

getSubConfig

public ServiceConfig getSubConfig(java.lang.String subConfigName)
                           throws SSOException,
                                  SMSException
Returns the service's sub-configuration given the service's sub-configuration name.
Parameters:
subConfigName - The name of the service's sub-configuration to retrieve.
Returns:
The ServiceConfig object corresponding to the specified name of the service's sub-configuration.
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

addSubConfig

public void addSubConfig(java.lang.String subConfigName,
                         java.lang.String subConfigId,
                         int priority,
                         java.util.Map attrs)
                  throws SMSException,
                         SSOException
Adds a service sub-configuration with configuration parameters.
Parameters:
subConfigName - the name of service sub-configuration to add
subConfigId - type of service sub-configuration
priority - the priority of the configuration
attrs - configuration parameters for the sub-configuration
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

removeSubConfig

public void removeSubConfig(java.lang.String subConfigName)
                     throws SMSException,
                            SSOException
Removes the service sub-configuration.
Parameters:
subConfigName - name of service sub-configuration to remove
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

importSubConfig

public void importSubConfig(java.lang.String subConfigName,
                            java.lang.String exportedSubConfigName)
                     throws SMSException,
                            SSOException
Imports a service sub-configuration to the list of localy defined sub-configuration. The imported sub-configuration name must be fully qualified, as obtained from getExportedSubConfigNames.
Parameters:
subConfigName - the name of service sub-configuration to add locally
exportedSubConfigName - the fully qualified name of the exported sub-configuration name
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

getAttributes

public java.util.Map getAttributes()
Returns the service configuration parameters. The keys in the Map contains the attribute names and their corresponding values in the Map is a Set that contains the values for the attribute. This method picks up the default values for any attributes not defined in the ServiceConfig. The default values for these attributes are picked up from the Service Schema. If there is no default value defined, then this method will still return the attribute-value pair, except that the Set will be a Collections.EMPTY_SET. This is distinct from an empty Set with no entries in it. AN empty set represents an attribute whose value has been set to an empty value by the application using the setAttributes() method.
Returns:
the Map where key is the attribute name and value is the Set of attribute values

getAttributesWithoutDefaults

public java.util.Map getAttributesWithoutDefaults()
Returns the service configuration parameters without inheriting the default values from service's schema. The keys in the Map contains the attribute names and their corresponding values in the Map is a Set that contains the values for the attribute.

setAttributes

public void setAttributes(java.util.Map attrs)
                   throws SMSException,
                          SSOException
Sets the service configuration parameters. The keys in the Map contains the attribute names and their corresponding values in the Map is a Set that contains the values for the attribute. This method will replace the existing attribute values with the given one. For attributes that are not specified in attrs, it will not be modified.
Parameters:
attrs - the Map where key is the attribute name and value is the Set of attribute values
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

addAttribute

public void addAttribute(java.lang.String attrName,
                         java.util.Set values)
                  throws SMSException,
                         SSOException
Adds a configuration parameter to the service configuration.
Parameters:
attrName - the name of the attribute to add
values - the set of values to add
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

removeAttribute

public void removeAttribute(java.lang.String attrName)
                     throws SMSException,
                            SSOException
Removes a configuration parameter from the service configuration.
Parameters:
attrName - the name of the attribute to remove
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

removeAttributes

public void removeAttributes(java.util.Set attrNames)
                      throws SMSException,
                             SSOException
Removes a configuration parameters from the service configuration.
Parameters:
attrNames - Set of attribute names to remove
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

removeAttributeValues

public void removeAttributeValues(java.lang.String attrName,
                                  java.util.Set values)
                           throws SMSException,
                                  SSOException
Removes the specific values for the given configuration parameter.
Parameters:
attrName - the name of the attribute
values - set of attribute values to remove from the given attribute
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

replaceAttributeValue

public void replaceAttributeValue(java.lang.String attrName,
                                  java.lang.String oldValue,
                                  java.lang.String newValue)
                           throws SMSException,
                                  SSOException
Replaces old value of the configuration parameter with new value.
Parameters:
attrName - the name of the attribute
oldValue - the old value to remove from the attribute
newValue - the new value to add to the attribute
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

replaceAttributeValues

public void replaceAttributeValues(java.lang.String attrName,
                                   java.util.Set oldValues,
                                   java.util.Set newValues)
                            throws SMSException,
                                   SSOException
Replaces the old values of the configuration parameter with the new values.
Parameters:
attrName - the name of the attribute
oldValues - the set of old values to remove from the attribute
newValues - the set of new values to add to the attribute
Throws:
SMSException - if there is an error occurred while performing the operation
SSOException - if the user's single sign-on is invalid or expired

getDN

public java.lang.String getDN()
Returns the LDAP DN represented by this ServiceConfig object.
Returns:
the LDAP DN represented by this ServiceConfig object.

getLastModifiedTime

public java.lang.String getLastModifiedTime()
                                     throws SMSException,
                                            SSOException
Returns the last modified time stamp of this configuration 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 data store
SSOException - if the single sign-on token of the user is invalid.

getExportedOrganizationNames

public java.util.Set getExportedOrganizationNames()
Returns the organization names to which the service configuration is being exported. The organization names would be fully qualified starting with a forward slash "/". To specify an entire sub-tree that can use the service configuration, a "*" would have to be appended after the final forward slash. For example "/a/b/c/*" would imply all sub-organization under "/a/b/c" can use this service configuration. Exporting implies privileges to read the service configuration data, but not to modify or delete.
Returns:
names of organizations to which service configuration configuration is exported

setExportedOrganizationNames

public void setExportedOrganizationNames(java.util.Set names)
                                  throws SMSException,
                                         SSOException
Sets the organization names that can import the service configuration. The organization names must be fully qualified, starting with a forward slash "/". To specify an entire sub-tree that can use the service configuration, a "*" would have to be appended after the final forward slash. For example "/a/b/c/*" would imply all sub-organization under "/a/b/c" can use this service configuration. Exporting implies privileges to read the service configuration data and not to modify or delete.
Parameters:
names - names of the organizations that can import the service configuration

addExportedOrganizationNames

public void addExportedOrganizationNames(java.util.Set names)
                                  throws SMSException,
                                         SSOException
Adds the organization names to the list of organization names that can import this service configutation. If one does not exist it will be created. The organization names must be fully qualified, starting with a forward slash "/". To specify an entire sub-tree that can use the service configuration, a "*" would have to be appended after the final forward slash. For example "/a/b/c/*" would imply all sub-organization under "/a/b/c" can use this service configuration. Exporting implies privileges to read the service configuration data and not to modify or delete.
Parameters:
names - names of the organizations that can import the service configuration

removeSharedOrganizationNames

public void removeSharedOrganizationNames(java.util.Set names)
                                   throws SMSException,
                                          SSOException
Removes the organization names from the list of organization names that can import the service configuration. If the organization has already imported the service configutation, it would have to be undone before the organization name can be removed from the list. The organization names must be fully qualified, starting with a forward slash "/". To specify an entire sub-tree that can use the service configuration, a "*" would have to be appended after the final forward slash. For example "/a/b/c/*" would imply all sub-organization under "/a/b/c" can use this service configuration.
Parameters:
names - names of the organizations that will be removed from the list of organization names that can import the service configutation

toString

public java.lang.String toString()
Returns String representation of the ServiceConfig object. It returns attributes defined and sub configurations.
Overrides:
toString in class java.lang.Object
Returns:
String representation of the ServiceConfig object.


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