public class StoredIDDataConnector extends BaseDataConnector
String value.
If a salt is supplied at construction time the generated IDs will be the Base64-encoded SHA-1 hash of the user's
principal name, the peer entity ID, and the salt.
If a DataSource is supplied the IDs are created and managed as described by StoredIDStore.| Modifier and Type | Field and Description |
|---|---|
private String |
generatedAttribute
ID of the attribute generated by this data connector.
|
private org.slf4j.Logger |
log
Class logger.
|
private StoredIDStore |
pidStore
Persistent identifier data store.
|
private byte[] |
salt
Salt used when computing the ID.
|
private String |
sourceAttribute
ID of the attribute whose first value is used when generating the computed ID.
|
| Constructor and Description |
|---|
StoredIDDataConnector(DataSource source,
int queryTimeout,
String generatedAttributeId,
String sourceAttributeId,
byte[] idSalt)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected StoredIDStore.PersistentIdEntry |
createPersistentId(String principalName,
String localEntityId,
String peerEntityId,
String localId)
Creates a persistent ID that is unique for a given local/peer/localId tuple.
|
String |
getGeneratedAttributeId()
Gets the ID of the attribute generated by this connector.
|
protected String |
getLocalId(ShibbolethResolutionContext resolutionContext)
Gets the local ID component of the persistent ID.
|
protected String |
getPeerEntityId(ShibbolethResolutionContext resolutionContext)
Gets the entity ID used for the peer.
|
byte[] |
getSalt()
Gets the salt used when computing the ID.
|
String |
getSourceAttributeId()
Gets the ID of the attribute whose first value is used when generating the computed ID.
|
protected String |
getStoredId(String principalName,
String localEntityId,
String peerEntityId,
String localId)
Gets the persistent ID stored in the database.
|
StoredIDStore |
getStoredIDStore()
Gets the data store used to manage stored IDs.
|
Map<String,BaseAttribute> |
resolve(ShibbolethResolutionContext resolutionContext)
Performs the attribute resolution for this plugin.
|
void |
validate()
Validate the internal state of this plug-in.
|
getFailoverDependencyId, setFailoverDependencyIdsgetDependencyIds, getId, getValuesFromAllDependencies, getValuesFromAttributeDependency, getValuesFromConnectorDependency, setIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDependencyIds, getIdprivate final org.slf4j.Logger log
private StoredIDStore pidStore
private String generatedAttribute
private String sourceAttribute
private byte[] salt
public StoredIDDataConnector(DataSource source, int queryTimeout, String generatedAttributeId, String sourceAttributeId, byte[] idSalt)
source - datasource used to communicate with the databasequeryTimeout - SQL qeury timeout in secondsgeneratedAttributeId - ID of the attribute generated by this data connectorsourceAttributeId - ID of the attribute whose first value is used when generating the computed IDidSalt - salt used when computing the IDpublic StoredIDStore getStoredIDStore()
public byte[] getSalt()
public String getSourceAttributeId()
public String getGeneratedAttributeId()
public void validate()
throws AttributeResolutionException
AttributeResolutionException - if the plug-in has an invalid internal statepublic Map<String,BaseAttribute> resolve(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolutionContext - the context for the resolutionAttributeResolutionException - the problem that occurred during the resolutionprotected String getStoredId(String principalName, String localEntityId, String peerEntityId, String localId) throws AttributeResolutionException
principalName - principal name of the user to whom the persistent ID belongslocalEntityId - ID of the local entity associated with the persistent IDpeerEntityId - ID of the peer entity associated with the persistent IDlocalId - principal the the persistent ID representsAttributeResolutionException - thrown if there is a problem retrieving or storing the persistent IDprotected String getLocalId(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolutionContext - current resolution contextAttributeResolutionException - thrown if there is a problem resolving the local idprotected String getPeerEntityId(ShibbolethResolutionContext resolutionContext)
resolutionContext - current attribute resolution contextprotected StoredIDStore.PersistentIdEntry createPersistentId(String principalName, String localEntityId, String peerEntityId, String localId) throws SQLException
ComputedIDDataConnector.
If an ID has been issued to the given tuple than a new, random type 4 UUID is generated as the persistent ID.principalName - principal name of the user to whom the persistent ID belongslocalEntityId - ID of the local entity associated with the persistent IDpeerEntityId - ID of the peer entity associated with the persistent IDlocalId - principal the the persistent ID representsSQLException - thrown if there is a problem communication with the databaseCopyright © 1999-2015. All Rights Reserved.