public class StringSecureTicketCodec extends SecureTicketCodec.Base<String>
Implement SecureTicketCodec
on String
typed ticket
SecureTicketCodec.Base<T>
Constructor and Description |
---|
StringSecureTicketCodec() |
StringSecureTicketCodec(AppCrypto crypto) |
StringSecureTicketCodec(AppCrypto crypto,
Collection<String> keys) |
StringSecureTicketCodec(AppCrypto crypto,
String... keys) |
StringSecureTicketCodec(AppCrypto crypto,
String keys) |
StringSecureTicketCodec(Collection<String> keys) |
StringSecureTicketCodec(String... keys) |
StringSecureTicketCodec(String keys) |
Modifier and Type | Method and Description |
---|---|
protected String |
deserialize(String ticket,
Map<String,String> payload)
Decode the ticket and return the session ID and fill the payload map
|
boolean |
probeTicket(Object ticket)
Do sanity check on an object to quickly probe if it is a ticket that can be processed by this codec
|
protected String |
serialize(String id,
Map<String,String> payload)
Encode the session id and payload data into the ticket with type
<T> |
createTicket, parseTicket
public static final String MARKER
public StringSecureTicketCodec()
public StringSecureTicketCodec(Collection<String> keys)
public StringSecureTicketCodec(String... keys)
public StringSecureTicketCodec(String keys)
public StringSecureTicketCodec(AppCrypto crypto)
public StringSecureTicketCodec(AppCrypto crypto, Collection<String> keys)
protected String serialize(String id, Map<String,String> payload)
SecureTicketCodec.Base
Encode the session id and payload data into the ticket with type <T>
serialize
in class SecureTicketCodec.Base<String>
id
- the session idpayload
- the payload dataprotected String deserialize(String ticket, Map<String,String> payload)
SecureTicketCodec.Base
Decode the ticket and return the session ID and fill the payload map
Note if the ticket is invalid, the implementation shall return a null
id
and leave the payload
map untouched
deserialize
in class SecureTicketCodec.Base<String>
ticket
- the ticket to be decodedpayload
- a Map passed in to be filled with decoded payloadpublic boolean probeTicket(Object ticket)
SecureTicketCodec
Do sanity check on an object to quickly probe if it is a ticket that can be processed by this codec
ticket
- the object to be testedtrue
if the codec believe it can process the ticket or false
if not sureCopyright © 2014–2018 ActFramework. All rights reserved.