|
Message Security Layer (MSL) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.netflix.msl.msg.MessageServiceTokenBuilder
public class MessageServiceTokenBuilder
A message service token builder provides methods for intelligently manipulating the primary and peer service tokens that will be included in a message.
There are two categories of service tokens: primary and peer.
There are three levels of service token binding.
| Constructor Summary | |
|---|---|
MessageServiceTokenBuilder(MslContext ctx,
MessageContext msgCtx,
com.netflix.msl.msg.MessageBuilder builder)
Create a new message service token builder with the provided MSL and message contexts and message builder. |
|
| Method Summary | |
|---|---|
boolean |
addMasterBoundPeerServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
Adds a new master token bound peer service token to the message, replacing any existing peer service token with the same name. |
boolean |
addMasterBoundPrimaryServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
Adds a new master token bound primary service token to the message, replacing any existing primary service token with the same name. |
boolean |
addPeerServiceToken(ServiceToken serviceToken)
Adds a peer service token to the message, replacing any existing peer service token with the same name. |
boolean |
addPrimaryServiceToken(ServiceToken serviceToken)
Adds a primary service token to the message, replacing any existing primary service token with the same name. |
boolean |
addUnboundPeerServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
Adds a new unbound peer service token to the message, replacing any existing peer service token with the same name. |
boolean |
addUnboundPrimaryServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
Adds a new unbound primary service token to the message, replacing any existing primary service token with the same name. |
boolean |
addUserBoundPeerServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
Adds a new user ID token bound peer service token to the message, replacing any peer existing service token with the same name. |
boolean |
addUserBoundPrimaryServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
Adds a new user ID token bound primary service token to the message, replacing any existing primary service token with the same name. |
boolean |
deletePeerServiceToken(String name)
Mark a peer service token for deletion, if it exists. |
boolean |
deletePrimaryServiceToken(String name)
Mark a primary service token for deletion, if it exists. |
boolean |
excludePeerServiceToken(String name)
Exclude a peer service token from the message. |
boolean |
excludePrimaryServiceToken(String name)
Exclude a primary service token from the message. |
Set<ServiceToken> |
getPeerServiceTokens()
|
Set<ServiceToken> |
getPrimaryServiceTokens()
|
boolean |
isPeerMasterTokenAvailable()
|
boolean |
isPeerUserIdTokenAvailable()
|
boolean |
isPrimaryMasterTokenAvailable()
Returns true if the message has a primary master token available for adding master-bound primary service tokens. |
boolean |
isPrimaryUserIdTokenAvailable()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MessageServiceTokenBuilder(MslContext ctx,
MessageContext msgCtx,
com.netflix.msl.msg.MessageBuilder builder)
ctx - MSL context.msgCtx - message context.builder - message builder for message being built.| Method Detail |
|---|
public boolean isPrimaryMasterTokenAvailable()
public boolean isPrimaryUserIdTokenAvailable()
public boolean isPeerMasterTokenAvailable()
public boolean isPeerUserIdTokenAvailable()
public Set<ServiceToken> getPrimaryServiceTokens()
public Set<ServiceToken> getPeerServiceTokens()
public boolean addPrimaryServiceToken(ServiceToken serviceToken)
throws MslMessageException
serviceToken - primary service token.
MslMessageException - if the service token serial numbers do not
match the primary master token or primary user ID token of the
message being built.
public boolean addPeerServiceToken(ServiceToken serviceToken)
throws MslMessageException
serviceToken - peer service token.
MslMessageException - if the service token serial numbers do not
match the peer master token or peer user ID token of the message
being built.
public boolean addUnboundPrimaryServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
throws MslEncodingException,
MslCryptoException,
MslException
name - service token name.data - service token data.encrypt - true if the service token data should be encrypted.compressionAlgo - the compression algorithm. May be null
for no compression.
MslCryptoException - if there is an error encrypting or signing
the token data.
MslEncodingException - if there is an error encoding the JSON
data.
MslException - if there is an error compressing the data.
public boolean addUnboundPeerServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
throws MslEncodingException,
MslCryptoException,
MslException
name - service token name.data - service token data.encrypt - true if the service token data should be encrypted.compressionAlgo - the compression algorithm. May be null
for no compression.
MslCryptoException - if there is an error encrypting or signing
the token data.
MslEncodingException - if there is an error encoding the JSON
data.
MslException - if there is an error compressing the data.
public boolean addMasterBoundPrimaryServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
throws MslEncodingException,
MslCryptoException,
MslException
name - service token name.data - service token data.encrypt - true if the service token data should be encrypted.compressionAlgo - the compression algorithm. May be null
for no compression.
MslCryptoException - if there is an error encrypting or signing
the token data.
MslEncodingException - if there is an error encoding the JSON
data.
MslException - if there is an error compressing the data.
public boolean addMasterBoundPeerServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
throws MslEncodingException,
MslCryptoException,
MslException
name - service token name.data - service token data.encrypt - true if the service token data should be encrypted.compressionAlgo - the compression algorithm. May be null
for no compression.
MslCryptoException - if there is an error encrypting or signing
the token data.
MslEncodingException - if there is an error encoding the JSON
data.
MslException - if there is an error compressing the data.
public boolean addUserBoundPrimaryServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
throws MslEncodingException,
MslCryptoException,
MslException
name - service token name.data - service token data.encrypt - true if the service token data should be encrypted.compressionAlgo - the compression algorithm. May be null
for no compression.
MslCryptoException - if there is an error encrypting or signing
the token data.
MslEncodingException - if there is an error encoding the JSON
data.
MslException - if there is an error compressing the data.
public boolean addUserBoundPeerServiceToken(String name,
byte[] data,
boolean encrypt,
MslConstants.CompressionAlgorithm compressionAlgo)
throws MslEncodingException,
MslCryptoException,
MslException
name - service token name.data - service token data.encrypt - true if the service token data should be encrypted.compressionAlgo - the compression algorithm. May be null
for no compression.
MslCryptoException - if there is an error encrypting or signing
the token data.
MslEncodingException - if there is an error encoding the JSON
data.
MslException - if there is an error compressing the data.public boolean excludePrimaryServiceToken(String name)
Exclude a primary service token from the message.
The service token will not be sent in the built message. This is not the same as requesting the remote entity delete a service token.
name - service token name.
public boolean excludePeerServiceToken(String name)
Exclude a peer service token from the message.
The service token will not be sent in the built message. This is not the same as requesting the remote entity delete a service token.
name - service token name.
public boolean deletePrimaryServiceToken(String name)
Mark a primary service token for deletion, if it exists.
The service token will be sent in the built message with an empty value. This is not the same as requesting that a service token be excluded from the message.
name - service token name.
public boolean deletePeerServiceToken(String name)
Mark a peer service token for deletion, if it exists.
The service token will be sent in the built message with an empty value. This is not the same as requesting that a service token be excluded from the message.
name - service token name.
|
Message Security Layer (MSL) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||