|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn<Map<String,BaseAttribute>>
edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.BaseDataConnector
edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.StoredIDDataConnector
public class StoredIDDataConnector
A data connector that generates persistent identifiers in one of two ways. The generated attribute has an ID of
peristentId and contains a single 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
.
Constructor Summary | |
---|---|
StoredIDDataConnector(DataSource source,
String generatedAttributeId,
String sourceAttributeId,
byte[] idSalt)
Constructor. |
Method Summary | |
---|---|
protected StoredIDStore.PersistentIdEntry |
createPersistentId(ShibbolethResolutionContext resolutionContext,
String localId,
byte[] salt)
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. |
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(ShibbolethResolutionContext resolutionContext)
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. |
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.BaseDataConnector |
---|
getFailoverDependencyId, setFailoverDependencyIds |
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn |
---|
getDependencyIds, getId, getValuesFromAllDependencies, getValuesFromAttributeDependency, getValuesFromConnectorDependency, setId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.ResolutionPlugIn |
---|
getDependencyIds, getId |
Constructor Detail |
---|
public StoredIDDataConnector(DataSource source, String generatedAttributeId, String sourceAttributeId, byte[] idSalt)
source
- datasource used to communicate with the databasegeneratedAttributeId
- 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 IDMethod Detail |
---|
public StoredIDStore getStoredIDStore()
public byte[] getSalt()
public String getSourceAttributeId()
public String getGeneratedAttributeId()
public Map<String,BaseAttribute> resolve(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolutionContext
- the context for the resolution
AttributeResolutionException
- the problem that occurred during the resolutionpublic void validate() throws AttributeResolutionException
AttributeResolutionException
- if the plug-in has an invalid internal stateprotected String getStoredId(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolutionContext
- current resolution context
AttributeResolutionException
- thrown if there is a problem retrieving or storing the persistent IDprotected String getLocalId(ShibbolethResolutionContext resolutionContext) throws AttributeResolutionException
resolutionContext
- current resolution context
AttributeResolutionException
- thrown if there is a problem resolving the local idprotected StoredIDStore.PersistentIdEntry createPersistentId(ShibbolethResolutionContext resolutionContext, String localId, byte[] salt) 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.
resolutionContext
- current resolution contextlocalId
- principal the the persistent ID representssalt
- salt used when computing a persistent ID via SHA-1 hash
SQLException
- thrown if there is a problem communication with the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |