|
||||||||||
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.dataConnector.StoredIDStore
public class StoredIDStore
Represents as persistent, database-backed, store of identifiers. The DDL for the database is CREATE TABLE shibpid {localEntity VARCHAR NOT NULL, peerEntity VARCHAR NOT NULL, principalName VARCHAR NOT NULL, localId VARCHAR NOT NULL, persistentId VARCHAR NOT NULL, peerProvidedId VARCHAR, creationDate TIMESTAMP NOT NULL, deactivationDate TIMESTAMP} .
Nested Class Summary | |
---|---|
class |
StoredIDStore.PersistentIdEntry
Data object representing a persistent identifier entry in the database. |
Field Summary | |
---|---|
private String |
createTimeColumn
Name of the creation time column. |
private DataSource |
dataSource
JDBC data source for retrieving connections. |
private String |
deactivateIdSQL
SQL used to deactivate an ID. |
private String |
deactivationTimeColumn
Name of the deactivation time column. |
private String |
idEntrySelectSQL
Partial select query for ID entries. |
private String |
localEntityColumn
Name of the local entity ID column. |
private String |
localIdColumn
Name of the local ID column. |
private org.slf4j.Logger |
log
Class logger. |
private String |
peerEntityColumn
Name of the peer entity ID name column. |
private String |
peerProvidedIdColumn
ID, provided by peer, associated with the persistent ID. |
private String |
persistentIdColumn
Name of the persistent ID column. |
private String |
principalNameColumn
Name of the principal name column. |
private int |
queryTimeout
Timeout of SQL queries in seconds. |
private String |
table
Name of the database table. |
Constructor Summary | |
---|---|
StoredIDStore(DataSource source,
int timeout)
Constructor. |
Method Summary | |
---|---|
protected List<StoredIDStore.PersistentIdEntry> |
buildIdentifierEntries(ResultSet resultSet)
Builds a list of StoredIDStore.PersistentIdEntry s from a result set. |
void |
deactivatePersistentId(String persistentId,
Timestamp deactivation)
Deactivates a given persistent ID. |
StoredIDStore.PersistentIdEntry |
getActivePersistentIdEntry(String persistentId)
Gets the persistent ID entry for the given ID. |
StoredIDStore.PersistentIdEntry |
getActivePersistentIdEntry(String localEntity,
String peerEntity,
String localId)
Gets the currently active identifier entry for a (principal, peer, local) tuple. |
StoredIDStore.PersistentIdEntry |
getActivePersistentIdEntry(String localEntity,
String peerEntity,
String localId,
boolean isActive)
|
List<StoredIDStore.PersistentIdEntry> |
getDeactivatedPersistentIdEntries(String localEntity,
String peerEntity,
String localId)
Gets the list of deactivated IDs for a given (principal, peer, local) tuple. |
int |
getNumberOfPersistentIdEntries(String localEntity,
String peerEntity,
String localId)
Gets the number of persistent ID entries for a (principal, peer, local) tuple. |
List<StoredIDStore.PersistentIdEntry> |
getPersistentIdEntries(String localEntity,
String peerEntity,
String localId)
Gets all the persistent ID entries for a (principal, peer, local) tuple. |
StoredIDStore.PersistentIdEntry |
getPersistentIdEntry(String persistentId,
boolean onlyActiveId)
Gets the persistent ID entry for the given ID. |
void |
storePersistentIdEntry(StoredIDStore.PersistentIdEntry entry)
Stores a persistent ID entry into the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final org.slf4j.Logger log
private DataSource dataSource
private int queryTimeout
private final String table
private final String localEntityColumn
private final String peerEntityColumn
private final String principalNameColumn
private final String localIdColumn
private final String persistentIdColumn
private final String peerProvidedIdColumn
private final String createTimeColumn
private final String deactivationTimeColumn
private final String idEntrySelectSQL
private final String deactivateIdSQL
Constructor Detail |
---|
public StoredIDStore(DataSource source, int timeout)
source
- datasource used to communicate with the databasetimeout
- SQL query timeout in secondsMethod Detail |
---|
public int getNumberOfPersistentIdEntries(String localEntity, String peerEntity, String localId) throws SQLException
localEntity
- entity ID of the ID issuerpeerEntity
- entity ID of the peer the ID is forlocalId
- local ID part of the persistent ID
SQLException
- thrown if there is a problem communication with the databasepublic List<StoredIDStore.PersistentIdEntry> getPersistentIdEntries(String localEntity, String peerEntity, String localId) throws SQLException
localId
- local ID part of the persistent IDpeerEntity
- entity ID of the peer the ID is forlocalEntity
- entity ID of the ID issuer
SQLException
- thrown if there is a problem communication with the databasepublic StoredIDStore.PersistentIdEntry getActivePersistentIdEntry(String persistentId) throws SQLException
persistentId
- the persistent ID
SQLException
- thrown if there is a problem communication with the databasepublic StoredIDStore.PersistentIdEntry getPersistentIdEntry(String persistentId, boolean onlyActiveId) throws SQLException
persistentId
- the persistent IDonlyActiveId
- true if only an active ID should be returned, false if a deactivated ID may be returned
SQLException
- thrown if there is a problem communication with the databasepublic StoredIDStore.PersistentIdEntry getActivePersistentIdEntry(String localEntity, String peerEntity, String localId, boolean isActive) throws SQLException
SQLException
public StoredIDStore.PersistentIdEntry getActivePersistentIdEntry(String localEntity, String peerEntity, String localId) throws SQLException
localId
- local ID part of the persistent IDpeerEntity
- entity ID of the peer the ID is forlocalEntity
- entity ID of the ID issuer
SQLException
- thrown if there is a problem communication with the databasepublic List<StoredIDStore.PersistentIdEntry> getDeactivatedPersistentIdEntries(String localEntity, String peerEntity, String localId) throws SQLException
localId
- local component of the IdpeerEntity
- entity ID of the peer the ID is forlocalEntity
- entity ID of the ID issuer
SQLException
- thrown if there is a problem communication with the databasepublic void storePersistentIdEntry(StoredIDStore.PersistentIdEntry entry) throws SQLException
entry
- entry to persist
SQLException
- thrown is there is a problem writing to the databasepublic void deactivatePersistentId(String persistentId, Timestamp deactivation) throws SQLException
persistentId
- ID to deactivatedeactivation
- deactivation time, if null the current time is used
SQLException
- thrown if there is a problem communication with the databaseprotected List<StoredIDStore.PersistentIdEntry> buildIdentifierEntries(ResultSet resultSet) throws SQLException
StoredIDStore.PersistentIdEntry
s from a result set.
resultSet
- the result set
StoredIDStore.PersistentIdEntry
s
SQLException
- thrown if there is a problem reading the information from the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |