public interface PermissionMessage extends Message
Interface that represents a Permission message.
Permission messages are a type of DataSource subject that can be used to send information to both a StreamLink client and to the Authentication Module within the Liberator. They are intended to be used for conveying information about permissions that govern a client application's (and hence end-user's) access to data and functionality.
A Permission message can be conceived as a 2-dimensional array (like a
RecordType2Message
), or a table structure, with
the PermissionKey
as the secondary index and the field/value pairs as column
keys+values. The following table is an illustration of how they could be utilized by your
DataSource, Authentication Module, and StreamLink clients.
PermissionKey |
Read |
Write |
Delete |
PERMZONE1 | YES | YES | YES |
PERMZONE1 | YES | YES | NO |
PERMZONE1 | YES | NO | NO |
An instance of PermissionMessage
must define the key field for the permission
message. Any number of field/value pairs can then be defined after the key field.
Permission messages have the unique feature of being passed through the Authentication Module in the Liberator prior to being sent to StreamLink clients.
The Authentication Module can take actions based on the content of the permission messages it receives. For example, if a permission message determines the price tier to which a customer belongs, the Authentication Module could retain the tier information for future reference and prevent the message from being forwarded to the subscribing client (since this information should not be made available to customers).
Permission messages marked as "Global" are also passed into the Authentication Module within the Liberator when received from a DataSource. Such messages are typically used to provide the Authentication Module with authentication and authorization information about customers (such as username and password).
An object implementing this interface cannot be instantiated directly, but can be constructed
using the MessageFactory
that is available on the
Publisher
interface.
Modifier and Type | Method and Description |
---|---|
boolean |
containsField(java.lang.String fieldName)
Determines whether the permission message contains the specified field.
|
boolean |
getDeletePermissionKey()
Gets a value indicating whether this permission message specifies that the permission key
should be deleted from the Liberator's cache.
|
java.lang.String |
getField(java.lang.String fieldName)
Gets a specified field within this permission message.
|
java.util.List<Field> |
getFields()
Gets the fields within this permission message.
|
boolean |
getGlobal()
Gets a value indicating whether this
PermissionMessage is a global permission
message. |
java.lang.String |
getPermissionKey()
Gets the permission key.
|
void |
removeField(java.lang.String fieldName)
Removes all instances of the given field from this permission message.
|
void |
setDeletePermissionKey(boolean value)
Sets a value in this permission message indicating whether the permission key must be deleted
from Liberator's cache.
|
void |
setField(java.lang.String fieldName,
java.lang.String value)
Sets a specified field within this permission message.
|
void |
setGlobal(boolean value)
Sets a value indicating whether this
PermissionMessage is a global permission
message. |
void |
setPermissionKey(java.lang.String value)
Sets the permission key.
|
getSubject, isImage, setImage
java.lang.String getPermissionKey()
Gets the permission key.
void setPermissionKey(java.lang.String value)
Sets the permission key.
value
- The permission key.boolean getGlobal()
Gets a value indicating whether this PermissionMessage
is a global permission
message.
true
if global; otherwise, false
.void setGlobal(boolean value)
Sets a value indicating whether this PermissionMessage
is a global permission
message.
value
- true
if global; otherwise, false
.boolean getDeletePermissionKey()
Gets a value indicating whether this permission message specifies that the permission key should be deleted from the Liberator's cache.
true
if the permission key is to be deleted from the Liberator's cache;
otherwise, false
.void setDeletePermissionKey(boolean value)
Sets a value in this permission message indicating whether the permission key must be deleted from Liberator's cache.
value
- true
if the permission key must be deleted from the Liberator's cache;
otherwise, false
.void removeField(java.lang.String fieldName)
Removes all instances of the given field from this permission message.
fieldName
- The name of the field.boolean containsField(java.lang.String fieldName)
Determines whether the permission message contains the specified field.
fieldName
- The name of the field.true
if the message contains the field; otherwise, false
.java.lang.String getField(java.lang.String fieldName)
Gets a specified field within this permission message.
If multiple occurrences of the field have been added with the same name the method returns the value of the last occurrence.
fieldName
- The name of the field.void setField(java.lang.String fieldName, java.lang.String value)
Sets a specified field within this permission message.
If the field does not exist in the permission message, the method adds it, otherwise it updates the value of the existing field.
fieldName
- The name of the field.value
- The value of the field.java.util.List<Field> getFields()
Gets the fields within this permission message.
Please send bug reports and comments to Caplin support