Package com.sun.identity.federation.meta
Class IDFFMetaManager
- java.lang.Object
-
- com.sun.identity.federation.meta.IDFFMetaManager
-
public class IDFFMetaManager extends Object
TheIDFFMetaManagerprovides methods to manage the Service and Identity Provider and Affiliation Metadata , the Entity Configuration.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME_META_ALIAS_IN_URIConstant used to identify meta alias.
-
Constructor Summary
Constructors Constructor Description IDFFMetaManager(Object session)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateEntityConfig(String realm, com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)Creates the extended entity configuration under the realm.voidcreateEntityDescriptor(String realm, com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)Creates the standard metadata entity descriptor.voiddeleteEntityConfig(String realm, String entityId)Deletes the extended entity configuration.voiddeleteEntityDescriptor(String realm, String entityID)Deletes the standard metadata entity descriptor under the realm.SetgetAffiliateEntity(String realm, String providerID)Returns a set of Affiliation Entity Descriptors of which the provider identifier is a member of.com.sun.identity.liberty.ws.meta.jaxb.AffiliationDescriptorTypegetAffiliationDescriptor(String realm, String entityID)Returns the Affiliation Descriptor for the entity identifier.com.sun.identity.federation.jaxb.entityconfig.AffiliationDescriptorConfigElementgetAffiliationDescriptorConfig(String realm, String entityID)Returns Affiliation Configuration for the entity identifier.SetgetAllEntities(String realm)Returns all entities under the realm.ListgetAllHostedEntities(String realm)Returns all remote entities under the realm.ListgetAllHostedIdentityProviderIDs(String realm)Returns all hosted Identity Provider Entity Identifiers under the realm.ListgetAllHostedServiceProviderEntities(String realm)Returns all hosted Service Provider Entity Identifiers under the realm.ListgetAllRemoteEntities(String realm)Returns all remote entities under the realm.ListgetAllRemoteIdentityProviderIDs(String realm)Returns all remote Identity Provider Identifiers under the realm.ListgetAllRemoteServiceProviderEntities(String realm)Returns all remote Service Provider Entity Identifiers under the realm.SetgetAllTrustedProviders(String hostedProviderMetaAlias)Returns a set of remote providers trusted by the hosted providers.com.sun.identity.federation.jaxb.entityconfig.EntityConfigElementgetEntityConfig(String realm, String entityID)Returns extended entity configuration under the realm.com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElementgetEntityDescriptor(String realm, String entityID)Returns the standard metadata entity descriptor under the realm.StringgetEntityIDByMetaAlias(String metaAlias)Returns entity ID associated with the metaAlias.StringgetEntityIDBySuccinctID(String realm, String succinctId)Returns entity ID associated with the succinct ID.com.sun.identity.liberty.ws.meta.jaxb.IDPDescriptorTypegetIDPDescriptor(String realm, String entityID)Returns Identity Provider's Descriptor for the entity identifier.com.sun.identity.federation.jaxb.entityconfig.IDPDescriptorConfigElementgetIDPDescriptorConfig(String realm, String entityID)Returns Identity Provider's Configuration for the entity identifier.StringgetProviderRoleByMetaAlias(String metaAlias)Returns entity role associated with the metaAlias.com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorTypegetSPDescriptor(String realm, String entityID)Returns the Service Provider's Descriptor for the entity identifier.com.sun.identity.federation.jaxb.entityconfig.SPDescriptorConfigElementgetSPDescriptorConfig(String realm, String entityID)Returns Service Provider's Configuration for the entity identifier.booleanisAffiliateMember(String realm, String providerID, String affiliationID)Checks if the provider is a member of the Affiliation.booleanisTrustedProvider(String realm, String hostedEntityID, String entityID)Checks whether two entities are in the same circle of trust.voidsetEntityConfig(String realm, com.sun.identity.federation.jaxb.entityconfig.EntityConfigElement entityConfig)Sets the extended entity configuration under the realm.voidsetEntityDescriptor(String realm, com.sun.identity.liberty.ws.meta.jaxb.EntityDescriptorElement entityDescriptor)Sets the standard metadata entity descriptor under the realm.
-
-
-
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:
EntityDescriptorElementfor 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:
SPDescriptorTypefor 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:
IDPDescriptorTypefor 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:
AffiliationDescriptorTypethe 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:
EntityConfigElementobject 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 inentityConfig- 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:
SPDescriptorConfigElementfor 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:
IDPDescriptorConfigElementfor 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:
AffiliationDescriptorConfigElementfor 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
Setof entity IDString. - 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
Listof 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
Listof 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
Listof 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
Listof 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
Listof 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
Listof 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.
-
-