public interface IPermission
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 | Instrument |
^/FX | true | false | true | null |
This example shows how to add permissions so that trading is permitted on the ^/FX namespace.
public class ExampleFXTradingPermissions
{
public IUserPermissions createStandardFXPermissions()
{
// Create an empty permission set.
IUserPermissions userPerms = new UserPermissions();
// Add in read and trading access for FX
userPerms.addPermission(new Permission("^/FX", true, false, true));
// Now add in permissions for the trade channel.
// For trading to work, the StreamLink client should contribute a field called "TradingInstrument"
// containing a subject under /FX
// When using a trade channel subject, the subject must have read and write permissions.
userPerms.addPermission(new Permission("^/TRADE/FX", true, true, false, "TradingInstrument"));
return userPerms;
}
}
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
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
getSubjectPattern() . |
boolean |
getWriteAllowed()
Gets a value indicating whether the user can contribute to (publish to) subjects matching
getSubjectPattern() . |
void |
setInstrumentField(java.lang.String instrumentField)
Sets the instrument field.
|
void |
setReadAllowed(boolean readAllowed)
Sets a value indicating whether the user can read subjects matching
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 tradeAllowed)
Sets a value indicating whether the user can trade on subjects matching
getSubjectPattern() . |
void |
setWriteAllowed(boolean writeAllowed)
Sets a value indicating whether the user can contribute to (publish to) subjects matching
getSubjectPattern() . |
java.lang.String getSubjectPattern()
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.
void setSubjectPattern(java.lang.String value)
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.
value
- the subject pattern to set.boolean getReadAllowed()
getSubjectPattern()
true
if reading is allowed, otherwise false
.void setReadAllowed(boolean readAllowed)
getSubjectPattern()
readAllowed
- boolean indicating if read is allowed.boolean getWriteAllowed()
getSubjectPattern()
.true
if contributing is allowed, otherwise false
.void setWriteAllowed(boolean writeAllowed)
getSubjectPattern()
.writeAllowed
- boolean value indicating if write is allowed.boolean getTradeAllowed()
getSubjectPattern()
.void setTradeAllowed(boolean tradeAllowed)
getSubjectPattern()
.tradeAllowed
- boolean value indicating if trading is allowed.java.lang.String getInstrumentField()
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.
void setInstrumentField(java.lang.String instrumentField)
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.
instrumentField
- the instrument field.Please send bug reports and comments to Caplin support