Package com.sun.identity.policy
Class ResponseProviders
- java.lang.Object
-
- com.sun.identity.policy.ResponseProviders
-
public class ResponseProviders extends Object
The classResponseProvidersprovides methods to maintain a collection ofResponseProviderobjects that apply to a policy. This class provides methods to add, replace and removeResponseProviderobjects from thisResponseProviders. ThePolicyobject provides methods to setResponseProviders, which identifies response attributes that apply to the policy.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedResponseProviders(ResponseProviderTypeManager rpm, Node responseProvidersNode)Constructor used byPolicyto obtain an instance ofResponseProvidersfrom the XML documentResponseProviders(String name, String description)Constructor to obtain an instance ofResponseProvidersto hold collection of responseProviders represented asResponseProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResponseProvider(ResponseProvider responseProvider)Adds aResponseProviderobject to this instance ofResponseProviders.voidaddResponseProvider(String responseProviderName, ResponseProvider responseProvider)Adds aResponseProviderobject to this instance ofResponseProviders.Objectclone()Returns a deep copy of this object with the identical set ofResponseProviderobjectsbooleanequals(Object o)Checks if twoResponseProvidersare identical.StringgetDescription()Returns the description of this objectStringgetName()Returns the name of this objectResponseProvidergetResponseProvider(String responseProviderName)Returns theResponseProviderobject associated with the givenresponseProvidername.StringgetResponseProviderName(ResponseProvider responseProvider)Returns the name associated with the given responseProvider object.SetgetResponseProviderNames()Returns the names ofResponseProviderobjects contained in this object.ResponseProviderremoveResponseProvider(ResponseProvider responseProvider)Removes theResponseProviderobject identified by object'sequalsmethod.ResponseProviderremoveResponseProvider(String responseProviderName)Removes theResponseProviderobject identified by responseProvider's name.voidreplaceResponseProvider(String responseProviderName, ResponseProvider responseProvider)Replaces an existing responseProvider object having the same name with the new one.voidsetDescription(String description)Sets the description of this objectvoidsetName(String name)Sets the name of this objectStringtoString()Returns XML string representation of this objectprotected StringtoXML()
-
-
-
Constructor Detail
-
ResponseProviders
protected ResponseProviders(ResponseProviderTypeManager rpm, Node responseProvidersNode) throws InvalidFormatException, NameNotFoundException, PolicyException
Constructor used byPolicyto obtain an instance ofResponseProvidersfrom the XML document- Parameters:
rpm- Response Provider Type Manager.responseProvidersNode- node that represents the Response Providers.- Throws:
InvalidFormatExceptionNameNotFoundExceptionPolicyException
-
ResponseProviders
public ResponseProviders(String name, String description)
Constructor to obtain an instance ofResponseProvidersto hold collection of responseProviders represented asResponseProvider- Parameters:
name- name for the collection ofResponseProviderdescription- user friendly description for the collection ofResponseProvider
-
-
Method Detail
-
getName
public String getName()
Returns the name of this object- Returns:
- name of this object
-
getDescription
public String getDescription()
Returns the description of this object- Returns:
- description of this object
-
setName
public void setName(String name)
Sets the name of this object- Parameters:
name- name for this object
-
setDescription
public void setDescription(String description)
Sets the description of this object- Parameters:
description- description for this object
-
getResponseProviderNames
public Set getResponseProviderNames()
Returns the names ofResponseProviderobjects contained in this object.- Returns:
- names of
ResponseProvidercontained in this object
-
getResponseProvider
public ResponseProvider getResponseProvider(String responseProviderName) throws NameNotFoundException
Returns theResponseProviderobject associated with the givenresponseProvidername.- Parameters:
responseProviderName- name of theResponseProviderobject- Returns:
ResponseProviderobject corresponding toresponseProvidername- Throws:
NameNotFoundException- if aResponseProviderwith the given name is not present
-
addResponseProvider
public void addResponseProvider(ResponseProvider responseProvider) throws NameAlreadyExistsException
Adds aResponseProviderobject to this instance ofResponseProviders. Since the name is not provided it will be dynamically assigned such that it is unique within this instance of theResponseProviders. However if aResponseProviderentry with the same name already exists in theResponseProviders,NameAlreadyExistsExceptionwill be thrown.- Parameters:
responseProvider- instance of theResponseProviderobject to be added- Throws:
NameAlreadyExistsException- if aResponseProviderobject is present with the same name
-
addResponseProvider
public void addResponseProvider(String responseProviderName, ResponseProvider responseProvider) throws NameAlreadyExistsException
Adds aResponseProviderobject to this instance ofResponseProviders. If anotherResponseProviderwith the same name already exists in this objectNameAlreadyExistsExceptionwill be thrown.- Parameters:
responseProviderName- name for theResponseProviderinstanceresponseProvider- instance of theResponseProviderobject to be added- Throws:
NameAlreadyExistsException- if aResponseProviderobject is present with the same name
-
replaceResponseProvider
public void replaceResponseProvider(String responseProviderName, ResponseProvider responseProvider) throws NameNotFoundException
Replaces an existing responseProvider object having the same name with the new one. If aResponseProviderwith the given name does not exist,NameNotFoundExceptionwill be thrown.- Parameters:
responseProviderName- name for the responseProvider instanceresponseProvider- instance of the responseProvider object that will replace another responseProvider object having the given name- Throws:
NameNotFoundException- if a responseProvider instance with the given name is not present
-
removeResponseProvider
public ResponseProvider removeResponseProvider(String responseProviderName)
Removes theResponseProviderobject identified by responseProvider's name. If a responseProvider instance with the given name does not exist, the method will return silently.- Parameters:
responseProviderName- name of the responseProvider instance that will be removed from the responseProviders collection- Returns:
- the responseProvider that was just removed
-
removeResponseProvider
public ResponseProvider removeResponseProvider(ResponseProvider responseProvider)
Removes theResponseProviderobject identified by object'sequalsmethod. If a responseProvider instance does not exist, the method will return silently.- Parameters:
responseProvider- responseProvider object that will be removed from the responseProviders collection- Returns:
- the responseProvider that was just removed
-
getResponseProviderName
public String getResponseProviderName(ResponseProvider responseProvider)
Returns the name associated with the given responseProvider object. It uses theequalsmethod on the responseProvider to determine equality. If a responseProvider instance that matches the given responseProvider object is not present, the method returnsnull.- Parameters:
responseProvider- responseProvider object for which this method will return its associated name- Returns:
- user friendly name given to the responseProvider object;
nullif not present
-
equals
public boolean equals(Object o)
Checks if twoResponseProvidersare identical. Two responseProviders (or responseProviders collections) are identical only if both have the same set ofResponseProviderobjects.
-
clone
public Object clone()
Returns a deep copy of this object with the identical set ofResponseProviderobjects
-
toString
public String toString()
Returns XML string representation of this object
-
toXML
protected String toXML()
-
-