Class IDFFMetaManager


  • public class IDFFMetaManager
    extends Object
    The IDFFMetaManager provides methods to manage the Service and Identity Provider and Affiliation Metadata , the Entity Configuration.
    • Field Detail

      • NAME_META_ALIAS_IN_URI

        public static final String NAME_META_ALIAS_IN_URI
        Constant used to identify meta alias.
        See Also:
        Constant Field Values
    • Constructor Detail

      • IDFFMetaManager

        public IDFFMetaManager​(Object session)
                        throws IDFFMetaException
        Constructor.
        Parameters:
        session - handle to the session object.
        Throws:
        IDFFMetaException - if there is an error creating this object.
    • Method Detail

      • createEntityDescriptor

        public void createEntityDescriptor​(String realm,
                                           com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)
                                    throws IDFFMetaException
        Creates the standard metadata entity descriptor. The metadata is created under the realm.
        Parameters:
        realm - The realm under which the entity resides.
        entityDescriptor - The standard entity descriptor object to be created.
        Throws:
        IDFFMetaException - if unable to create the entity descriptor.
      • getEntityDescriptor

        public com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement getEntityDescriptor​(String realm,
                                                                                                 String entityID)
                                                                                          throws IDFFMetaException
        Returns the standard metadata entity descriptor under the realm.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - identifier of the entity to be retrieved.
        Returns:
        EntityDescriptorElement for the entity or null if not found.
        Throws:
        IDFFMetaException - if unable to retrieve the entity descriptor.
      • setEntityDescriptor

        public void setEntityDescriptor​(String realm,
                                        com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)
                                 throws IDFFMetaException
        Sets the standard metadata entity descriptor under the realm. The EntiyDescriptor to be set should exist otherwise an error is thrown.
        Parameters:
        realm - The realm under which the entity resides.
        entityDescriptor - The standard entity descriptor object to be set.
        Throws:
        IDFFMetaException - if there is an error setting the entity descriptor.
        See Also:
        createEntityDescriptor(String, EntityDescriptorElement)
      • deleteEntityDescriptor

        public void deleteEntityDescriptor​(String realm,
                                           String entityID)
                                    throws IDFFMetaException
        Deletes the standard metadata entity descriptor under the realm.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - identifier of the entity to be deleted.
        Throws:
        IDFFMetaException - if there is an error deleting the entity descriptor.
      • deleteEntityConfig

        public void deleteEntityConfig​(String realm,
                                       String entityId)
                                throws IDFFMetaException
        Deletes the extended entity configuration.
        Parameters:
        realm - The realm under which the entity resides.
        entityId - The ID of the entity for whom the extended entity configuration will be deleted.
        Throws:
        IDFFMetaException - if unable to delete the entity descriptor.
      • getSPDescriptor

        public com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType getSPDescriptor​(String realm,
                                                                                      String entityID)
                                                                               throws IDFFMetaException
        Returns the Service Provider's Descriptor for the entity identifier. If there are more then one Service Providers the first one retrieved is returned.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - Entity Identifier to retrieve Service Provider from.
        Returns:
        SPDescriptorType for the provider. A null is returned if no Service Provider is found.
        Throws:
        IDFFMetaException - if there is an error retreiving the provider.
      • getIDPDescriptor

        public com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorType getIDPDescriptor​(String realm,
                                                                                        String entityID)
                                                                                 throws IDFFMetaException
        Returns Identity Provider's Descriptor for the entity identifier. If there are more then one Identity Providers the first one retrieved is returned.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - Entity Identifier to retrieve Identity Provider from.
        Returns:
        IDPDescriptorType for the entity. A null is returned if no Identity Provider is found.
        Throws:
        IDFFMetaException - if there is an error retreiving the provider.
      • getAffiliationDescriptor

        public com.sun.identity.liberty.ws.meta.jaxb.AffiliationDescriptorType getAffiliationDescriptor​(String realm,
                                                                                                        String entityID)
                                                                                                 throws IDFFMetaException
        Returns the Affiliation Descriptor for the entity identifier.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - Entity Identifier to retrieve Affiliation Descriptor from.
        Returns:
        AffiliationDescriptorType the Affliation descriptor.
        Throws:
        IDFFMetaException - if there is an error retreiving the affiliation.
      • createEntityConfig

        public void createEntityConfig​(String realm,
                                       com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)
                                throws IDFFMetaException
        Creates the extended entity configuration under the realm.
        Parameters:
        realm - The realm under which the entity configuration will be created.
        entityConfig - extended entity configuration to be created.
        Throws:
        IDFFMetaException - if unable to create the entity configuration.
      • getEntityConfig

        public com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement getEntityConfig​(String realm,
                                                                                                 String entityID)
                                                                                          throws IDFFMetaException
        Returns extended entity configuration under the realm.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - identifier of the entity whose config is to be retrieved.
        Returns:
        EntityConfigElement object of the entity or null if the entity configuration does not exist.
        Throws:
        IDFFMetaException - if unable to retrieve the entity configuration.
      • setEntityConfig

        public void setEntityConfig​(String realm,
                                    com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)
                             throws IDFFMetaException
        Sets the extended entity configuration under the realm. The EntityConfig should exist in order to set attributes in the EntityConfig.
        Parameters:
        realm - The realm under which the entity resides in
        entityConfig - The extended entity configuration object to be set.
        Throws:
        IDFFMetaException - if unable to set the entity configuration.
      • getSPDescriptorConfig

        public com.sun.identity.federation.jaxb.entityconfig.SPDescriptorConfigElement getSPDescriptorConfig​(String realm,
                                                                                                             String entityID)
                                                                                                      throws IDFFMetaException
        Returns Service Provider's Configuration for the entity identifier. If there are multiple service providers found then the first one retrieved is returned.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - ID of the entity to be retrieved.
        Returns:
        SPDescriptorConfigElement for the entity identifier . A null is returned if the configuration is not found.
        Throws:
        IDFFMetaException - if there is an error retrieving service provider configuration.
      • getIDPDescriptorConfig

        public com.sun.identity.federation.jaxb.entityconfig.IDPDescriptorConfigElement getIDPDescriptorConfig​(String realm,
                                                                                                               String entityID)
                                                                                                        throws IDFFMetaException
        Returns Identity Provider's Configuration for the entity identifier. If there are multiple identity providers found then the first one retrieved is returned.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - ID of the entity to be retrieved.
        Returns:
        IDPDescriptorConfigElement for the entity identifier . A null is returned if the configuration is not found.
        Throws:
        IDFFMetaException - if there is an error retrieving service provider configuration.
      • getAffiliationDescriptorConfig

        public com.sun.identity.federation.jaxb.entityconfig.AffiliationDescriptorConfigElement getAffiliationDescriptorConfig​(String realm,
                                                                                                                               String entityID)
                                                                                                                        throws IDFFMetaException
        Returns Affiliation Configuration for the entity identifier.
        Parameters:
        realm - The realm under which the entity resides.
        entityID - ID of the entity to be retrieved.
        Returns:
        AffiliationDescriptorConfigElement for the entity identifier . A null is returned if the configuration is not found.
        Throws:
        IDFFMetaException - if there is an error retrieving service provider configuration.
      • getAllEntities

        public Set getAllEntities​(String realm)
                           throws IDFFMetaException
        Returns all entities under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a Set of entity ID String.
        Throws:
        IDFFMetaException - if unable to retrieve the entity ids.
      • getAllHostedEntities

        public List getAllHostedEntities​(String realm)
                                  throws IDFFMetaException
        Returns all remote entities under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a List of entity identifiers as Strings.
        Throws:
        IDFFMetaException - if unable to retrieve the remote entity identifiers.
      • getAllRemoteEntities

        public List getAllRemoteEntities​(String realm)
                                  throws IDFFMetaException
        Returns all remote entities under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a List of entity identifiers as Strings.
        Throws:
        IDFFMetaException - if unable to retrieve the remote entity identifiers.
      • getAllHostedServiceProviderEntities

        public List getAllHostedServiceProviderEntities​(String realm)
                                                 throws IDFFMetaException
        Returns all hosted Service Provider Entity Identifiers under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a List of entity identifiers as Strings.
        Throws:
        IDFFMetaException - if unable to retrieve the entity ids.
      • getAllRemoteServiceProviderEntities

        public List getAllRemoteServiceProviderEntities​(String realm)
                                                 throws IDFFMetaException
        Returns all remote Service Provider Entity Identifiers under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a List of entity identifiers as Strings.
        Throws:
        IDFFMetaException - if unable to retrieve the entity ids.
      • getAllHostedIdentityProviderIDs

        public List getAllHostedIdentityProviderIDs​(String realm)
                                             throws IDFFMetaException
        Returns all hosted Identity Provider Entity Identifiers under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a List of identity provider entity identifiers. The values in the list are Strings.
        Throws:
        IDFFMetaException - if unable to retrieve the entity ids.
      • getAllRemoteIdentityProviderIDs

        public List getAllRemoteIdentityProviderIDs​(String realm)
                                             throws IDFFMetaException
        Returns all remote Identity Provider Identifiers under the realm.
        Parameters:
        realm - The realm under which the hosted entities reside.
        Returns:
        a List of remote identity provider identifiers. The values in the list are Strings.
        Throws:
        IDFFMetaException - if unable to retrieve the provider identifiers.
      • isTrustedProvider

        public boolean isTrustedProvider​(String realm,
                                         String hostedEntityID,
                                         String entityID)
        Checks whether two entities are in the same circle of trust.
        Parameters:
        realm - The realm under which the entity resides.
        hostedEntityID - the hosted entity identifier.
        entityID - the identifier of the entity to be checked for trust.
        Returns:
        true if both providers are in the same circle of trust.
      • getAllTrustedProviders

        public Set getAllTrustedProviders​(String hostedProviderMetaAlias)
        Returns a set of remote providers trusted by the hosted providers.
        Parameters:
        hostedProviderMetaAlias - the metaAlias of the hosted provider.
        Returns:
        a set of trusted remote providers. An empty set is returned if there is an error or no trusted providers are found.
      • isAffiliateMember

        public boolean isAffiliateMember​(String realm,
                                         String providerID,
                                         String affiliationID)
                                  throws IDFFMetaException
        Checks if the provider is a member of the Affiliation.
        Parameters:
        realm - The realm under which the entity resides.
        providerID - the provider's identitifer.
        affiliationID - the Affiliation identifier.
        Returns:
        true if the provider is a member of the affiliation.
        Throws:
        IDFFMetaException - if there is an error retreiving the affiliate information.
      • getAffiliateEntity

        public Set getAffiliateEntity​(String realm,
                                      String providerID)
        Returns a set of Affiliation Entity Descriptors of which the provider identifier is a member of.
        Parameters:
        realm - The realm under which the entity resides.
        providerID - the provider identifier.
        Returns:
        a set of Affliation Entity Descriptors. An empty set is returned if there are no affiliation descriptors found or if there is an retrieving the descriptors.
      • getEntityIDByMetaAlias

        public String getEntityIDByMetaAlias​(String metaAlias)
                                      throws IDFFMetaException
        Returns entity ID associated with the metaAlias.
        Parameters:
        metaAlias - The Meta Alias of the provider.
        Returns:
        entity ID associated with the metaAlias or null if not found.
        Throws:
        IDFFMetaException - if unable to retrieve the entity id.
      • getProviderRoleByMetaAlias

        public String getProviderRoleByMetaAlias​(String metaAlias)
                                          throws IDFFMetaException
        Returns entity role associated with the metaAlias.
        Parameters:
        metaAlias - The Meta Alias of the provider.
        Returns:
        role of the provider with the metaAlias or null if not found.
        Throws:
        IDFFMetaException - if unable to retrieve the entity role.
      • getEntityIDBySuccinctID

        public String getEntityIDBySuccinctID​(String realm,
                                              String succinctId)
                                       throws IDFFMetaException
        Returns entity ID associated with the succinct ID.
        Parameters:
        realm - The realm under which the entity resides.
        succinctId - Succinct ID of a IDP contained in the entity to be retrieved.
        Returns:
        Entity ID associated with the succinct ID, or null if could not be found.
        Throws:
        IDFFMetaException - if unable to retrieve the entity ID.