|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.identity.sm.OrganizationConfigManager
The class OrganizationConfigManager
provides interfaces
to manage an organization's configuration data. It provides interfaces
to create and delete organizations, service attributes for organizations
and service configuration parameters.
The organization configuration can be managed in a hierarchical manner, and a forward slash "/" will be used to separate the name hierarchy. Hence the root of the organization hierarchy will be represented by a single forward slash "/", and sub-organizations will be separated by "/". For example "/a/b/c" would represent a "c" sub-organization within "b" which would be a sub-organization of "a".
Constructor Summary | |
OrganizationConfigManager(SSOToken token,
java.lang.String orgName)
Constructor to obtain an instance of OrganizationConfigManager
for an organization by providing an authenticated identity
of the user. |
Method Summary | |
void |
addAttributeValues(java.lang.String serviceName,
java.lang.String attrName,
java.util.Set values)
Adds organization attributes for the service. |
java.lang.String |
addListener(ServiceListener listener)
Registers for changes to organization's configuration. |
ServiceConfig |
addServiceConfig(java.lang.String serviceName,
java.util.Map attributes)
Adds a service configuration object for the given service name for this organization. |
void |
assignService(java.lang.String serviceName,
java.util.Map attributes)
Assigns the given service to the orgnization with the respective attributes. |
OrganizationConfigManager |
createSubOrganization(java.lang.String subOrgName,
java.util.Map attributes)
Creates a sub-organization under the current organization and sets the specified attributes. |
void |
deleteSubOrganization(java.lang.String subOrgName,
boolean recursive)
Deletes the given sub-organization. |
java.util.Set |
getAssignableServices()
Returns a set of service names that can be assigned to a realm. |
java.util.Set |
getAssignedServices()
Returns a set of service names that are assigned to a realm. |
java.util.Set |
getAssignedServices(boolean includeMandatory)
Returns a set of service names that are assigned to a realm. |
java.util.Map |
getAttributes(java.lang.String serviceName)
Returns the organization creation attributes for the service. |
java.util.Set |
getConfiguredServices()
Deprecated. This method has been deprecated, use
getAssignedServices() instead. |
java.lang.String |
getNamingAttrForOrg()
|
java.lang.String |
getOrganizationName()
Returns the fully qualified name of the organization from the root |
OrganizationConfigManager |
getParentOrgConfigManager()
Returns the OrganizationConfigManager of the parent
for the given organization name. |
java.util.Set |
getPeerOrganizationNames()
Returns the names of all peer-organizations. |
java.util.Map |
getServiceAttributes(java.lang.String serviceName)
Returns attributes configured for the service. |
ServiceConfig |
getServiceConfig(java.lang.String serviceName)
Returns the service configuration object for the given service name. |
java.util.Set |
getServiceSchemas()
Returns a set of service schemas to be used for creation of an organization. |
java.util.Set |
getSubOrganizationNames()
Returns the names of all sub-organizations. |
java.util.Set |
getSubOrganizationNames(java.lang.String pattern,
boolean recursive)
Returns names of sub-organizations matching the given pattern. |
OrganizationConfigManager |
getSubOrgConfigManager(java.lang.String subOrgName)
Returns the OrganizationConfigManager for the given
organization name. |
static void |
loadDefaultServices(SSOToken token,
OrganizationConfigManager ocm)
Loads default services to a newly created realm |
void |
modifyService(java.lang.String serviceName,
java.util.Map attributes)
Sets the attributes related to provided service. |
void |
removeAttribute(java.lang.String serviceName,
java.lang.String attrName)
Removes the given organization creation attribute for the service. |
void |
removeAttributeValues(java.lang.String serviceName,
java.lang.String attrName,
java.util.Set values)
Removes the given organization creation attribute values for the service. |
void |
removeListener(java.lang.String listenerID)
Removes the listener from the organization for the given listener ID. |
void |
removeServiceConfig(java.lang.String serviceName)
Removes the service configuration object for the given service name for this organization. |
void |
setAttributes(java.lang.String serviceName,
java.util.Map attributes)
Sets/Creates organization attributes for the service. |
void |
unassignService(java.lang.String serviceName)
Unassigns the service from the organization. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OrganizationConfigManager(SSOToken token, java.lang.String orgName) throws SMSException
OrganizationConfigManager
for an organization by providing an authenticated identity
of the user. The organization name would be "/" seperated to
represent organization hierarchy.token
- single sign on token of authenticated user identity.orgName
- name of the organization. The value of null
or "/" would represent the root organization.SMSException
- if an error has occurred while getting
the instance of OrganizationConfigManager
.Method Detail |
public java.lang.String getOrganizationName()
public java.util.Set getConfiguredServices() throws SMSException
getAssignedServices()
instead.
SMSException
- if there is an error accessing the data store
to read the configured services.public java.util.Set getServiceSchemas() throws SMSException
ServiceSchema
.ServiceSchema
to be used for
creation of an organization.SMSException
- if there is an error accessing the data store
to read the service schemas.public OrganizationConfigManager createSubOrganization(java.lang.String subOrgName, java.util.Map attributes) throws SMSException
OrganizationConfigManager
. The organization name must not have forward slash ("/").
For eg., the actual organization name 'iplanet' cannot be 'iplan/et'
because we are using '/' as the seperator here.
The attributes for the organization can be
null
; else would contain service name as the key
and another Map
as the value that would contain the
key-values pair for the services.subOrgName
- the name of the sub-organization.attributes
- Map of attributes for the organization per service.
The parameter Map attributes contains another Map
as its value, which then has attribute names and values.
The way it is arranged is:
Map::attributes --> Key: String::ServiceName
Value: Map::svcAttributes
Map::svcAttributes --> Key: String::AttributeName
Value: Set::AttributeValuesSMSException
- if creation of sub-organization failed, or
if creation of sub-organization is attempted when
configuration is not migrated to realms.public java.util.Set getSubOrganizationNames() throws SMSException
SMSException
- if there is an error accessing the data store
to read the sub-organization names.public java.util.Set getPeerOrganizationNames() throws SMSException
SMSException
- if there is an error accessing the data store
to read the peer-organization names.public java.util.Set getSubOrganizationNames(java.lang.String pattern, boolean recursive) throws SMSException
recursive
is set to
true
, search will be performed for the entire
sub-tree. The pattern can contain "*" as the wildcard to
represent zero or more characters.pattern
- pattern that will be used for searching,
where "*" will be the wildcard.recursive
- if set to true
the entire sub-tree will
be searched for the organization names.SMSException
- if there is an error accessing the data store
to read the sub-organization names.public void deleteSubOrganization(java.lang.String subOrgName, boolean recursive) throws SMSException
recursive
is set to true
,
then the suborganization and the sub-tree will be deleted.
If the parameter recursive
is set to false
then the sub-organization shall be deleted provided it is the leaf
node.
If there are entries beneath the sub-organization and if the parameter
recursive
is set to false
, then an exception
is thrown that this sub-organization cannot be deleted.subOrgName
- sub-organization name to be deleted.recursive
- if set to true
the entire
sub-tree will be deleted.SMSException
- if the sub-organization name cannot be found, or
if there are entries beneath the sub-organization
and if the parameter recursive
is set
to false
.public OrganizationConfigManager getSubOrgConfigManager(java.lang.String subOrgName) throws SMSException
OrganizationConfigManager
for the given
organization name.subOrgName
- the name of the organization.SMSException
- if the organization name
cannot be found or user doesn't have access to
that organization.public java.util.Map getAttributes(java.lang.String serviceName) throws SMSException
serviceName
- name of the service.SMSException
- if there is an error accessing the data store
to read the attributes of the service.public void addAttributeValues(java.lang.String serviceName, java.lang.String attrName, java.util.Set values) throws SMSException
serviceName
- name of the service.attrName
- name of the attribute.values
- values for the attribute.SMSException
- if we try to add a value to
an attribute which has the same value already.public void setAttributes(java.lang.String serviceName, java.util.Map attributes) throws SMSException
serviceName
- name of the service.attributes
- attribute-values pairs.SMSException
- if the serviceName cannot be found.public void removeAttribute(java.lang.String serviceName, java.lang.String attrName) throws SMSException
serviceName
- name of service.attrName
- name of attribute.SMSException
- if the organization attribute
for the service to be removed cannot be found, or
if the service name cannot be found.public void removeAttributeValues(java.lang.String serviceName, java.lang.String attrName, java.util.Set values) throws SMSException
serviceName
- name of service.attrName
- name of attribute.values
- attribute values to be removed.SMSException
- if the organization attribute
for the service to be removed cannot be found, or
if the service name cannot be found, or
if the value cannot be removed.public ServiceConfig getServiceConfig(java.lang.String serviceName) throws SMSException
serviceName
- name of a service.SMSException
- if there is an error accessing the data store
to read the service configuration, or
if the service name cannot be found.public ServiceConfig addServiceConfig(java.lang.String serviceName, java.util.Map attributes) throws SMSException
SMSException
will be thrown.serviceName
- name of the service.attributes
- service configuration attributes.SMSException
- if the service configuration
has been added already.public void removeServiceConfig(java.lang.String serviceName) throws SMSException
serviceName
- name of the service.SMSException
- if the service name cannot be found, or not
added to the organization.public java.lang.String addListener(ServiceListener listener)
listener
- callback object that will be invoked when organization
configuration has changedpublic void removeListener(java.lang.String listenerID)
listenerID
- the listener ID issued when the
listener was registeredpublic java.util.Set getAssignableServices() throws SMSException
SMSException
- if there is an error accessing the data store
to read the service configurationpublic java.util.Set getAssignedServices() throws SMSException
SMSException
- if there is an error accessing the data store
to read the service configurationpublic java.util.Set getAssignedServices(boolean includeMandatory) throws SMSException
includeMandatory
- true
to include mandatory
service names.SMSException
- if there is an error accessing the data store
to read the service configurationpublic void assignService(java.lang.String serviceName, java.util.Map attributes) throws SMSException
SMSException
will be thrown.serviceName
- name of the serviceattributes
- service configuration attributesSMSException
- if the service configuration
has been added already.public java.util.Map getServiceAttributes(java.lang.String serviceName) throws SMSException
serviceName
- name of the serviceSMSException
- if there is an error accessing the data store
to read the service configuration, or
if the service name cannot be found.public void unassignService(java.lang.String serviceName) throws SMSException
serviceName
- name of the serviceSMSException
- if the service name cannot be found or assigned,
or if the service is a mandatory service.public void modifyService(java.lang.String serviceName, java.util.Map attributes) throws SMSException
serviceName
- name of the serviceattributes
- attributes of the serviceSMSException
- if the service name cannot be found or not
assigned to the organization.public java.lang.String getNamingAttrForOrg()
public OrganizationConfigManager getParentOrgConfigManager() throws SMSException
OrganizationConfigManager
of the parent
for the given organization name.SMSException
- if user doesn't have access to that organization.public static void loadDefaultServices(SSOToken token, OrganizationConfigManager ocm) throws SMSException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |