public class Permission extends java.lang.Object implements IPermission
IPermission
interface. You should create instances of this class if you want to use
the KeyMaster permissioning system.
The permissioning system can control read and write access to subjects selected by the specified SubjectPattern.
Within the Caplin Xaqua environment there is a dedicated trade channel (subject) per asset class, for each user. If the trade channel subject is within the ^/TRADE/FX namespace and you wish to permit trading for the user on subjects within the ^/FX/ namespace, then the permissions should be configured as follows:
SubjectPattern | ReadAllowed | WriteAllowed | TradeAllowed | InstrumentField |
^/TRADE/FX | true | true | false | InstrumentField |
^/FX | true | false | true | null |
Constructor and Description |
---|
Permission(java.lang.String subjectPattern)
Initializes a new instance of the
Permission class with a subject pattern. |
Permission(java.lang.String subjectPattern,
boolean allowRead,
boolean allowWrite,
boolean allowTrade)
Initializes a new instance of the
Permission class with permissions for a subject pattern. |
Permission(java.lang.String subjectPattern,
boolean allowRead,
boolean allowWrite,
boolean allowTrade,
java.lang.String instrumentField)
Initializes a new instance of the
Permission class with permissions for a subject pattern, and the
name of a field specifying an instrument that can be traded. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getInstrumentField()
Gets the instrument field.
|
boolean |
getReadAllowed()
Gets a value indicating whether the user can read subjects matching
IPermission.getSubjectPattern() |
java.lang.String |
getSubjectPattern()
Gets the regular expression representing the subjects that should have the permissions defined by this
IPermission.
|
boolean |
getTradeAllowed()
Gets a value indicating whether the user can trade on subjects matching
IPermission.getSubjectPattern() . |
boolean |
getWriteAllowed()
Gets a value indicating whether the user can contribute to (publish to) subjects matching
IPermission.getSubjectPattern() . |
void |
setInstrumentField(java.lang.String value)
Sets the instrument field.
|
void |
setReadAllowed(boolean value)
Sets a value indicating whether the user can read subjects matching
IPermission.getSubjectPattern() |
void |
setSubjectPattern(java.lang.String value)
Sets the regular expression representing the subjects that should have the permissions defined by this
IPermission.
|
void |
setTradeAllowed(boolean value)
Sets a value indicating whether the user can trade on subjects matching
IPermission.getSubjectPattern() . |
void |
setWriteAllowed(boolean value)
Sets a value indicating whether the user can contribute to (publish to) subjects matching
IPermission.getSubjectPattern() . |
java.lang.String |
toString()
Returns a String that represents this instance.
|
public Permission(java.lang.String subjectPattern)
Permission
class with a subject pattern. The initial permission settings deny all access to the subjects that match the subject pattern.
subjectPattern
- The subject pattern.public Permission(java.lang.String subjectPattern, boolean allowRead, boolean allowWrite, boolean allowTrade)
Permission
class with permissions for a subject pattern.subjectPattern
- The subject pattern.allowRead
- If set to true
, the user can read subjects matching subjectPattern
allowWrite
- If set to true
, the user can contribute to (publish to) subjects matching
subjectPattern
.allowTrade
- If set to true
, the user can trade on subjects matching subjectPattern
.public Permission(java.lang.String subjectPattern, boolean allowRead, boolean allowWrite, boolean allowTrade, java.lang.String instrumentField)
Permission
class with permissions for a subject pattern, and the
name of a field specifying an instrument that can be traded.subjectPattern
- The subject pattern.allowRead
- If set to true
, the user can read subjects matching subjectPattern
.allowWrite
- If set to true
, the user can contribute to (publish to) subjects matching
subjectPattern
.allowTrade
- If set to true
, the user can trade on subjects matching subjectPattern
.instrumentField
- The name of the field that will contain the name of the instrument being traded.public java.lang.String getSubjectPattern()
IPermission
The regular expression syntaxes supported by the Liberator are Basic and Extended. The full Java regular expressions syntax is not supported. However, the syntax for the most common regular expression operations is the same in each case. For more information on the various regular expression syntaxes, see www .regular-expressions.info.
getSubjectPattern
in interface IPermission
public void setSubjectPattern(java.lang.String value)
IPermission
The regular expression syntaxes supported by the Liberator are Basic and Extended. The full Java regular expressions syntax is not supported. However, the syntax for the most common regular expression operations is the same in each case. For more information on the various regular expression syntaxes, see www .regular-expressions.info.
setSubjectPattern
in interface IPermission
value
- the subject pattern to set.public boolean getReadAllowed()
IPermission
IPermission.getSubjectPattern()
getReadAllowed
in interface IPermission
true
if reading is allowed, otherwise false
.public void setReadAllowed(boolean value)
IPermission
IPermission.getSubjectPattern()
setReadAllowed
in interface IPermission
value
- boolean indicating if read is allowed.public boolean getWriteAllowed()
IPermission
IPermission.getSubjectPattern()
.getWriteAllowed
in interface IPermission
true
if contributing is allowed, otherwise false
.public void setWriteAllowed(boolean value)
IPermission
IPermission.getSubjectPattern()
.setWriteAllowed
in interface IPermission
value
- boolean value indicating if write is allowed.public boolean getTradeAllowed()
IPermission
IPermission.getSubjectPattern()
.getTradeAllowed
in interface IPermission
public void setTradeAllowed(boolean value)
IPermission
IPermission.getSubjectPattern()
.setTradeAllowed
in interface IPermission
value
- boolean value indicating if trading is allowed.public java.lang.String getInstrumentField()
IPermission
The instrument field must be present on StreamLink contributions to trade channels. It contains the name of a field specifying the name of an instrument that can be traded.
The default value of null implies that the field is not defined.
getInstrumentField
in interface IPermission
public void setInstrumentField(java.lang.String value)
IPermission
The instrument field must be present on StreamLink contributions to trade channels. It contains the name of a field specifying the name of an instrument that can be traded.
The default value of null implies that the field is not defined.
setInstrumentField
in interface IPermission
value
- the instrument field.public java.lang.String toString()
toString
in class java.lang.Object
Please send bug reports and comments to Caplin support