Package com.sun.identity.cot
Class CircleOfTrustManager
- java.lang.Object
-
- com.sun.identity.cot.CircleOfTrustManager
-
public class CircleOfTrustManager extends Object
This class has methods to manage the circle of trust.
-
-
Constructor Summary
Constructors Constructor Description CircleOfTrustManager()Constructor forCOTManager.CircleOfTrustManager(Object callerToken)Constructor forCOTManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId)Adds entity identifier to a circle of trust under the realm.voidaddCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId, boolean addToEntityConfig)Adds entity identifier to a circle of trust under the realm.voidcreateCircleOfTrust(String realm, CircleOfTrustDescriptor cotDescriptor)Creates a circle of trust.voiddeleteCircleOfTrust(String realm, String cotName)Deletes the circle of trust under the realm.SetgetAllActiveCirclesOfTrust(String realm)Returns a set of names of all active circle of trusts.SetgetAllCirclesOfTrust(String realm)Returns a set of names of all circle of trusts.CircleOfTrustDescriptorgetCircleOfTrust(String realm, String name)Returns the circle of trust under the realm.MapgetIDFFCOTProviderMapping(String realm)Returns a map of circle of trust name and the value of thesun-fm-trusted-providersattribute The key in the map is the circle of trust name and value is a set of providers retreived from the attribute.booleanisInCircleOfTrust(String realm, String name, String protocolType, String entityId)Determines if entity is in the circle of trust under the realm.SetlistCircleOfTrustMember(String realm, String cotName, String protocolType)Lists trusted providers in a circle of trust under the realm.voidmodifyCircleOfTrust(String realm, CircleOfTrustDescriptor cotDescriptor)Modifies the attributes of a circle of trust.voidremoveCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId)Removes entity from circle of trust under the realm.voidremoveCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId, boolean rmEntityConfig)Removes entity from circle of trust under the realm.
-
-
-
Constructor Detail
-
CircleOfTrustManager
public CircleOfTrustManager() throws COTExceptionConstructor forCOTManager.- Throws:
COTException- if unable to constructCOTManager.
-
CircleOfTrustManager
public CircleOfTrustManager(Object callerToken) throws COTException
Constructor forCOTManager.- Parameters:
callerToken- session token of the caller- Throws:
COTException- if unable to constructCOTManager.
-
-
Method Detail
-
createCircleOfTrust
public void createCircleOfTrust(String realm, CircleOfTrustDescriptor cotDescriptor) throws COTException
Creates a circle of trust.- Parameters:
realm- the realm under which the circle of trust will be created.cotDescriptor- the circle of trust descriptor object to be created.- Throws:
COTException- if unable to create the circle of trust.
-
modifyCircleOfTrust
public void modifyCircleOfTrust(String realm, CircleOfTrustDescriptor cotDescriptor) throws COTException
Modifies the attributes of a circle of trust.- Parameters:
realm- the realm the circle of trust is in.cotDescriptor- circle of trust descriptor that contains the new set of attributes- Throws:
COTException- if unable to modify the circle of trust.
-
getAllCirclesOfTrust
public Set getAllCirclesOfTrust(String realm) throws COTException
Returns a set of names of all circle of trusts.- Parameters:
realm- The realm under which the circle of trust resides.- Returns:
- Set of names of all circle of trusts.
- Throws:
COTException- if unable to read circle of trust.
-
addCircleOfTrustMember
public void addCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId) throws COTException
Adds entity identifier to a circle of trust under the realm.- Parameters:
realm- The realm under which the circle of trust will be modified.cotName- the name of the circle of trust.protocolType- the federation protcol type the entity supports.entityId- the entity identifier.- Throws:
COTException- if unable to add member to the circle of trust.
-
addCircleOfTrustMember
public void addCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId, boolean addToEntityConfig) throws COTException
Adds entity identifier to a circle of trust under the realm.- Parameters:
realm- The realm under which the circle of trust will be modified.cotName- the name of the circle of trust.protocolType- the federation protcol type the entity supports.entityId- the entity identifier.addToEntityConfig- if true, add the cotname to the entity config.- Throws:
COTException- if unable to add member to the circle of trust.
-
removeCircleOfTrustMember
public void removeCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId) throws COTException
Removes entity from circle of trust under the realm.- Parameters:
realm- the realm to which the circle of trust belongs.cotName- the circle of trust name.protocolType- the federation protocol type.entityId- the entity identifier.- Throws:
COTException- if there is an error removing entity from the circle of trust.
-
removeCircleOfTrustMember
public void removeCircleOfTrustMember(String realm, String cotName, String protocolType, String entityId, boolean rmEntityConfig) throws COTException
Removes entity from circle of trust under the realm.- Parameters:
realm- the realm to which the circle of trust belongs.cotName- the circle of trust name.protocolType- the federation protocol type.entityId- the entity identifier.rmEntityConfig- flag indicate needs to remove cot from entity config or not.- Throws:
COTException- if there is an error removing entity from the circle of trust.
-
listCircleOfTrustMember
public Set listCircleOfTrustMember(String realm, String cotName, String protocolType) throws COTException
Lists trusted providers in a circle of trust under the realm.- Parameters:
realm- The realm under which the circle of trust will be modified.cotName- the name of the circle of trustprotocolType- the federation protocol for the entities.- Returns:
- Set of trusted providers or null if no member in the circle of trust
- Throws:
COTException- if unable to list member in the circle of trust.
-
deleteCircleOfTrust
public void deleteCircleOfTrust(String realm, String cotName) throws COTException
Deletes the circle of trust under the realm.- Parameters:
realm- The realm under which the circle of trust resides.cotName- Name of the circle of trust.- Throws:
COTException- if unable to delete the circle of trust.
-
getCircleOfTrust
public CircleOfTrustDescriptor getCircleOfTrust(String realm, String name) throws COTException
Returns the circle of trust under the realm.- Parameters:
realm- The realm under which the circle of trust resides.name- Name of the circle of trust.- Returns:
SAML2CircleOfTrustDescriptorcontaining the attributes of the given CircleOfTrust.- Throws:
COTException- if unable to retrieve the circle of trust.
-
getAllActiveCirclesOfTrust
public Set getAllActiveCirclesOfTrust(String realm) throws COTException
Returns a set of names of all active circle of trusts.- Parameters:
realm- The realm under which the circle of trust resides.- Returns:
- Set of names of all active circle of trusts.
- Throws:
COTException- if the names of circle of trusts cannot be read.
-
isInCircleOfTrust
public boolean isInCircleOfTrust(String realm, String name, String protocolType, String entityId)
Determines if entity is in the circle of trust under the realm.- Parameters:
realm- The realm under which the circle of trust resides.name- Name of the Circle of Trust.protocolType- the federation protocol type of the entity.entityId- the entity identifier.- Returns:
- true if the entity is in the specified circle of trust
-
getIDFFCOTProviderMapping
public Map getIDFFCOTProviderMapping(String realm) throws COTException
Returns a map of circle of trust name and the value of thesun-fm-trusted-providersattribute The key in the map is the circle of trust name and value is a set of providers retreived from the attribute.- Returns:
- a map where the key is the cirle of trust name
and value is Set of providers retrieved from
the
sun-fm-trusted-providersattribute. - Throws:
COTException- if there is an error retrieving the trusted providers. TODO : cache this
-
-