Class CircleOfTrustManager


  • public class CircleOfTrustManager
    extends Object
    This class has methods to manage the circle of trust.
    • Constructor Detail

      • CircleOfTrustManager

        public CircleOfTrustManager()
                             throws COTException
        Constructor for COTManager.
        Throws:
        COTException - if unable to construct COTManager.
      • CircleOfTrustManager

        public CircleOfTrustManager​(Object callerToken)
                             throws COTException
        Constructor for COTManager.
        Parameters:
        callerToken - session token of the caller
        Throws:
        COTException - if unable to construct COTManager.
    • 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 trust
        protocolType - 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:
        SAML2CircleOfTrustDescriptor containing 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 the sun-fm-trusted-providers attribute 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-providers attribute.
        Throws:
        COTException - if there is an error retrieving the trusted providers. TODO : cache this