public interface TokensManagement
As this is a low level interface it allows for external transaction steering. All methods will join an existing transaction if it is present.
Modifier and Type | Interface and Description |
---|---|
static interface |
TokensManagement.TokenExpirationListener
Receives notifications about expired tokens.
|
Modifier and Type | Method and Description |
---|---|
void |
addToken(String type,
String value,
byte[] contents,
Date created,
Date expires)
Adds a new token without owner
|
void |
addToken(String type,
String value,
pl.edu.icm.unity.types.basic.EntityParam owner,
byte[] contents,
Date created,
Date expires)
Adds a new token
|
void |
addTokenExpirationListener(TokensManagement.TokenExpirationListener listener,
String type)
Adds a new listenr which is notified about expired tokens of a specified type
|
List<pl.edu.icm.unity.base.token.Token> |
getAllTokens() |
List<pl.edu.icm.unity.base.token.Token> |
getAllTokens(String type) |
List<pl.edu.icm.unity.base.token.Token> |
getOwnedTokens(String type,
pl.edu.icm.unity.types.basic.EntityParam entity)
Returns all tokens of the entity
|
pl.edu.icm.unity.base.token.Token |
getTokenById(String type,
String value)
Returns a specified token
|
void |
removeToken(String type,
String value)
Removes the token
|
void |
updateToken(String type,
String value,
Date expires,
byte[] contents)
Update the token.
|
void addToken(String type, String value, pl.edu.icm.unity.types.basic.EntityParam owner, byte[] contents, Date created, Date expires) throws pl.edu.icm.unity.exceptions.IllegalIdentityValueException, pl.edu.icm.unity.exceptions.IllegalTypeException
type
- type or category of the tokenvalue
- owner
- contents
- created
- creation timestamp. It is guaranteed to be stored with second precision, though implementation
might also store the full time.expires
- precision as in created case.pl.edu.icm.unity.exceptions.IllegalIdentityValueException
pl.edu.icm.unity.exceptions.IllegalTypeException
void addToken(String type, String value, byte[] contents, Date created, Date expires) throws pl.edu.icm.unity.exceptions.IllegalTypeException
type
- type or category of the tokenvalue
- contents
- created
- creation timestamp. It is guaranteed to be stored with second precision, though implementation
might also store the full time.expires
- precision as in created case.pl.edu.icm.unity.exceptions.IllegalIdentityValueException
pl.edu.icm.unity.exceptions.IllegalTypeException
void removeToken(String type, String value)
type
- value
- void updateToken(String type, String value, Date expires, byte[] contents)
type
- value
- expires
- if null -> leave unchangedcontents
- if null -> leave unchangedpl.edu.icm.unity.base.token.Token getTokenById(String type, String value)
type
- value
- List<pl.edu.icm.unity.base.token.Token> getOwnedTokens(String type, pl.edu.icm.unity.types.basic.EntityParam entity) throws pl.edu.icm.unity.exceptions.IllegalIdentityValueException, pl.edu.icm.unity.exceptions.IllegalTypeException
type
- entity
- pl.edu.icm.unity.exceptions.IllegalTypeException
pl.edu.icm.unity.exceptions.IllegalIdentityValueException
List<pl.edu.icm.unity.base.token.Token> getAllTokens(String type)
type
- List<pl.edu.icm.unity.base.token.Token> getAllTokens()
void addTokenExpirationListener(TokensManagement.TokenExpirationListener listener, String type)
listener
- Copyright © 2018 Unity. All rights reserved.