Package org.apache.tapestry5.services
Interface ClientDataEncoder
- All Known Implementing Classes:
ClientDataEncoderImpl
public interface ClientDataEncoder
A service used when a component or service needs to encode some amount of data on the client as a string. The string
may be a query parameter, hidden form field, or a portion of a URL. The default implementation converts the object
output stream into a Base64 string.
Starting in release 5.3.6, the encoded data incorporates an HMAC (hash based message authentication code) signature,
as a prefix. HMAC requires a secret key, configured using the
SymbolConstants.HMAC_PASSPHRASE
symbol.- Since:
- 5.1.0.1
-
Method Summary
Modifier and TypeMethodDescriptionCreates a sink for client data.decodeClientData
(String clientData) Decodes data previously obtained fromClientDataSink.getClientData()
.decodeEncodedClientData
(String clientData) Decodes client data obtained viaClientDataSink.getEncodedClientData()
.
-
Method Details
-
createSink
Creates a sink for client data. The sink provides an output stream and ultimately, a string representation of the data sent to the stream.- Returns:
- a new sink
-
decodeClientData
Decodes data previously obtained fromClientDataSink.getClientData()
.- Parameters:
clientData
- encoded client data- Returns:
- stream of decoded data
- Throws:
IOException
- if the client data has been corrupted (verified via the HMAC)
-
decodeEncodedClientData
Decodes client data obtained viaClientDataSink.getEncodedClientData()
.- Parameters:
clientData
- URLEncoded client data- Returns:
- stream of objects
- Throws:
IOException
- if the client data has been corrupted (verified via the HMAC)- Since:
- 5.1.0.4
-