Class OA2SQLTStore<V extends OA2ServiceTransaction>
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.sql.SQLDatabase
-
- edu.uiuc.ncsa.security.storage.sql.SQLStore<V>
-
- org.oa4mp.delegation.common.storage.transactions.SQLBaseTransactionStore<V>
-
- org.oa4mp.delegation.server.storage.SQLServiceTransactionStore<V>
-
- org.oa4mp.server.api.admin.transactions.DSSQLTransactionStore<V>
-
- org.oa4mp.server.loader.oauth2.storage.transactions.OA2SQLTStore<V>
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Store<V>,Map<edu.uiuc.ncsa.security.core.Identifier,V>,TransactionStore<V>,RefreshTokenStore<V>,RFC8628Store<V>,OA2TStoreInterface<V>,UsernameFindable<V>
public class OA2SQLTStore<V extends OA2ServiceTransaction> extends DSSQLTransactionStore<V> implements OA2TStoreInterface<V>
Created by Jeff Gaynor
on 3/25/14 at 10:30 AM
-
-
Field Summary
-
Fields inherited from class org.oa4mp.delegation.server.storage.SQLServiceTransactionStore
DEFAULT_TABLENAME
-
Fields inherited from class org.oa4mp.delegation.common.storage.transactions.SQLBaseTransactionStore
tokenForge
-
-
Constructor Summary
Constructors Constructor Description OA2SQLTStore(TokenForge tokenForge, edu.uiuc.ncsa.security.storage.sql.ConnectionPool connectionPool, edu.uiuc.ncsa.security.storage.sql.internals.Table table, javax.inject.Provider<V> idp, edu.uiuc.ncsa.security.storage.data.MapConverter converter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Vget(String token, String clientID, boolean isAccessToken)Vget(AccessTokenImpl accessToken, edu.uiuc.ncsa.security.core.Identifier clientID)Vget(RefreshTokenImpl refreshToken, edu.uiuc.ncsa.security.core.Identifier clientID)Vget(RefreshToken refreshToken)List<edu.uiuc.ncsa.security.core.Identifier>getAllClientID()List<edu.uiuc.ncsa.security.core.Identifier>getByClientID(edu.uiuc.ncsa.security.core.Identifier clientID)Returns the ids of all transactions for a given client.VgetByIDTokenID(edu.uiuc.ncsa.security.core.Identifier idTokenIdentifier)Get a transaction by its ID token identifier.VgetByProxyID(edu.uiuc.ncsa.security.core.Identifier proxyID)VgetByRefreshToken(RefreshToken refreshToken)VgetByUserCode(String userCode)List<V>getByUsername(String username)StringgetCreationTSField()List<RFC8628State>getPending()Since this is potentially a very intensive operation run only once at startup this has been tweaked to exactly let the database grab the minimum and process it here.VgetSingleValue(String targetString, String preparedStatement)TokenInfoRecordMapgetTokenInfo(String username)booleanhasUserCode(String userCode)TODO - Improve this with a specific query later.-
Methods inherited from class org.oa4mp.delegation.server.storage.SQLServiceTransactionStore
getCreatedTransactions, register, toString
-
Methods inherited from class org.oa4mp.delegation.common.storage.transactions.SQLBaseTransactionStore
get, get, getTransaction, getTransactionTable
-
Methods inherited from class edu.uiuc.ncsa.security.storage.sql.SQLStore
checkColumns, checkTable, clear, containsKey, containsValue, crappySQLParser, crappySQLParser, create, depopulate, doRegisterStatement, entrySet, get, getAll, getDerbyMostRecent, getMapConverter, getMostRecent, getMostRecentStatement, getTable, getXMLConverter, isEmpty, keySet, populate, put, putAll, remove, remove, removeByID, save, search, search, search, search, setUpdateValues, size, size, size, update, update, update, values
-
Methods inherited from class edu.uiuc.ncsa.security.storage.sql.SQLDatabase
destroyConnection, getConnection, getConnectionPool, releaseConnection, rsToMap, setConnectionPool
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from interface edu.uiuc.ncsa.security.core.Store
create, getAll, getMostRecent, getXMLConverter, register, remove, removeByID, save, search, search, search, search, size, update, update
-
Methods inherited from interface org.oa4mp.delegation.common.storage.TransactionStore
get, get, getMapConverter
-
-
-
-
Constructor Detail
-
OA2SQLTStore
public OA2SQLTStore(TokenForge tokenForge, edu.uiuc.ncsa.security.storage.sql.ConnectionPool connectionPool, edu.uiuc.ncsa.security.storage.sql.internals.Table table, javax.inject.Provider<V> idp, edu.uiuc.ncsa.security.storage.data.MapConverter converter)
-
-
Method Detail
-
getCreationTSField
public String getCreationTSField()
- Overrides:
getCreationTSFieldin classDSSQLTransactionStore<V extends OA2ServiceTransaction>
-
get
public V get(RefreshToken refreshToken)
- Specified by:
getin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Specified by:
getin interfaceRefreshTokenStore<V extends OA2ServiceTransaction>
-
getByRefreshToken
public V getByRefreshToken(RefreshToken refreshToken)
-
get
public V get(AccessTokenImpl accessToken, edu.uiuc.ncsa.security.core.Identifier clientID)
- Specified by:
getin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>
-
get
public V get(RefreshTokenImpl refreshToken, edu.uiuc.ncsa.security.core.Identifier clientID)
- Specified by:
getin interfaceRefreshTokenStore<V extends OA2ServiceTransaction>
-
getByClientID
public List<edu.uiuc.ncsa.security.core.Identifier> getByClientID(edu.uiuc.ncsa.security.core.Identifier clientID)
Returns the ids of all transactions for a given client. On usage of this is stopping a runaway client, so there may be a huge number of hits for this.- Specified by:
getByClientIDin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Parameters:
clientID-- Returns:
-
getAllClientID
public List<edu.uiuc.ncsa.security.core.Identifier> getAllClientID()
- Specified by:
getAllClientIDin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>
-
getByUsername
public List<V> getByUsername(String username)
- Specified by:
getByUsernamein interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Specified by:
getByUsernamein interfaceUsernameFindable<V extends OA2ServiceTransaction>
-
getTokenInfo
public TokenInfoRecordMap getTokenInfo(String username)
- Specified by:
getTokenInfoin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>
-
getPending
public List<RFC8628State> getPending()
Since this is potentially a very intensive operation run only once at startup this has been tweaked to exactly let the database grab the minimum and process it here.- Specified by:
getPendingin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Specified by:
getPendingin interfaceRFC8628Store<V extends OA2ServiceTransaction>- Returns:
-
getByProxyID
public V getByProxyID(edu.uiuc.ncsa.security.core.Identifier proxyID)
- Specified by:
getByProxyIDin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Specified by:
getByProxyIDin interfaceTransactionStore<V extends OA2ServiceTransaction>- Overrides:
getByProxyIDin classDSSQLTransactionStore<V extends OA2ServiceTransaction>
-
getByIDTokenID
public V getByIDTokenID(edu.uiuc.ncsa.security.core.Identifier idTokenIdentifier)
Description copied from interface:OA2TStoreInterfaceGet a transaction by its ID token identifier. Note that to get the token itself, you must useOA2ServiceTransaction.getUserMetaData().- Specified by:
getByIDTokenIDin interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Returns:
-
getByUserCode
public V getByUserCode(String userCode)
- Specified by:
getByUserCodein interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Specified by:
getByUserCodein interfaceRFC8628Store<V extends OA2ServiceTransaction>
-
hasUserCode
public boolean hasUserCode(String userCode)
TODO - Improve this with a specific query later.- Specified by:
hasUserCodein interfaceOA2TStoreInterface<V extends OA2ServiceTransaction>- Specified by:
hasUserCodein interfaceRFC8628Store<V extends OA2ServiceTransaction>- Parameters:
userCode-- Returns:
-
-