@Service public class HibernateAliasTokenService extends org.nrg.framework.orm.hibernate.AbstractHibernateEntityService<AliasToken,AliasTokenDAO> implements AliasTokenService
Constructor and Description |
---|
HibernateAliasTokenService() |
Modifier and Type | Method and Description |
---|---|
void |
deactivateAllTokensForUser(String xdatUserId)
Finds and deactivates all active tokens for a particular user.
|
List<AliasToken> |
findTokensForUser(String xdatUserId)
Finds all active tokens for a particular user.
|
protected AliasTokenDAO |
getDao()
Gets the
alias token DAO instance for this service. |
void |
invalidateToken(String alias)
Invalidates the token with the given alias.
|
AliasToken |
issueTokenForUser(String xdatUserId)
Issues a token to the user with the indicated name.
|
AliasToken |
issueTokenForUser(XdatUser xdatUser)
Issues a token to the indicated user.
|
AliasToken |
issueTokenForUser(XdatUser xdatUser,
boolean isSingleUse)
Issues a token to the indicated user.
|
AliasToken |
issueTokenForUser(XdatUser xdatUser,
boolean isSingleUse,
Set<String> validIPAddresses)
Issues a token to the indicated user.
|
AliasToken |
issueTokenForUser(XdatUser xdatUser,
Set<String> validIPAddresses)
Issues a token to the indicated user.
|
AliasToken |
locateToken(String alias)
Locates and returns the token indicated by the alias string.
|
String |
validateToken(String alias,
long secret)
Checks whether a token exists with the indicated alias and secret and no IP address restrictions.
|
String |
validateToken(String alias,
long secret,
String address)
Checks whether a token exists with the indicated alias and secret and an IP address matching one of the defined
IP addresses (if there are no IP address restrictions in the token, any given IP address will match).
|
afterPropertiesSet, create, create, delete, delete, getAll, getAllWithDisabled, getContext, getCount, getCountWithDisabled, getInitialize, newEntity, refresh, refresh, refresh, refresh, refresh, refresh, retrieve, setApplicationContext, setInitialize, update, validate
getCacheRegion, getParameterizedType, isMatchingType
@Transactional public List<AliasToken> findTokensForUser(String xdatUserId)
findTokensForUser
in interface AliasTokenService
xdatUserId
- The user ID from the XdatUser table.alias tokens
issued to the indicated user.@Transactional public void deactivateAllTokensForUser(String xdatUserId)
deactivateAllTokensForUser
in interface AliasTokenService
xdatUserId
- The user ID from the XdatUser table.@Transactional public AliasToken issueTokenForUser(String xdatUserId) throws Exception
AliasTokenService
issueTokenForUser
in interface AliasTokenService
xdatUserId
- The user ID from the XdatUser table.AliasToken
issued to the indicated user.Exception
- When something goes wrong.@Transactional public AliasToken issueTokenForUser(XdatUser xdatUser)
AliasTokenService
AliasTokenService.issueTokenForUser(XdatUser, boolean)
version of
this method, passing false by default for the boolean parameter.issueTokenForUser
in interface AliasTokenService
xdatUser
- The user requesting a token.AliasToken
issued to the indicated user.@Transactional public AliasToken issueTokenForUser(XdatUser xdatUser, boolean isSingleUse)
AliasTokenService
issueTokenForUser
in interface AliasTokenService
xdatUser
- The user requesting a token.isSingleUse
- Indicates whether the token should be disposed of once the token is used once.AliasToken
issued to the indicated user.@Transactional public AliasToken issueTokenForUser(XdatUser xdatUser, Set<String> validIPAddresses)
AliasTokenService
issueTokenForUser
in interface AliasTokenService
xdatUser
- The user requesting a token.validIPAddresses
- The list of IP addresses from which the alias token will be accepted.AliasToken
issued to the indicated user.@Transactional public AliasToken issueTokenForUser(XdatUser xdatUser, boolean isSingleUse, Set<String> validIPAddresses)
AliasTokenService
issueTokenForUser
in interface AliasTokenService
xdatUser
- The user requesting a token.isSingleUse
- Indicates whether the token should be disposed of once the token is used once.validIPAddresses
- The list of IP addresses from which the alias token will be accepted.AliasToken
issued to the indicated user.@Transactional public AliasToken locateToken(String alias)
token secret
and IP
addresses
have also been checked and validated against the requesting client.locateToken
in interface AliasTokenService
alias
- The alias for the requested token.@Transactional public String validateToken(String alias, long secret)
AliasTokenService
corresponding XDAT user login ID
. Otherwise, this method returns
null.validateToken
in interface AliasTokenService
alias
- The alias to check.secret
- The secret to validate the indicated alias.XDAT user login ID
of the matching token exists, or null if not.@Transactional public String validateToken(String alias, long secret, String address)
AliasTokenService
corresponding XDAT user login ID
. Otherwise, this method returns
null.validateToken
in interface AliasTokenService
alias
- The alias to check.secret
- The secret to validate the indicated alias.address
- The IP address to validate.XDAT user login ID
of the matching token exists, or null if not.@Transactional public void invalidateToken(String alias)
AliasTokenService
invalidateToken
in interface AliasTokenService
alias
- The alias of the token to be invalidated.protected AliasTokenDAO getDao()
alias token DAO
instance for this service.getDao
in class org.nrg.framework.orm.hibernate.AbstractHibernateEntityService<AliasToken,AliasTokenDAO>
alias token DAO
instance for this service.AbstractHibernateEntityService.getDao()
Copyright © 2015 Neuroinformatics Research Group. All rights reserved.