public interface ISubjectMapping
The patterns used within the permissioning system are Basic or Extended regular expressions. 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.
Regular expression captures can be used to perform substitution between the values returned by
getMapFromPattern()
and getMapToPattern()
. This functionality can be used to implement tiering for
StreamLink clients. For example, calling setMapFromPattern(java.lang.String)
to set ^/FX/(.*) and
setMapToPattern(java.lang.String)
to set ^/FX/TIER1/(1) causes all client requests within the /FX namespace to be
mapped to "TIER1" prices; thus a request for the subject /FX/EURGBP is mapped to /FX/TIER1/EURGBP.
This example demonstrates implementing tiering on FX instruments for a non-trading user.
public class SettingATierForAUser
{
public IUserPermissions createTieredPermission()
{
// Create an empty set of permissions.
IUserPermissions userPerms = new UserPermissions();
// Create a mapping so that any request for /FX/.* is mapped to /FX/TIER1/.*
userPerms.addMapping(new SubjectMapping("^/FX/(.*)", "/FX/TIER/(1)"));
// Add a read permission for /FX/TIER1/*
userPerms.addPermission(new Permission("^/FX/TIER1/.*", true, false, false));
return userPerms;
}
}
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMapFromPattern()
Gets the pattern that will match a request for a subject.
|
java.lang.String |
getMapToPattern()
Gets the pattern that client requests matching
getMapFromPattern() will be mapped to. |
void |
setMapFromPattern(java.lang.String value)
Sets the pattern that will match a request for a subject.
|
void |
setMapToPattern(java.lang.String value)
Sets the pattern that client requests matching
getMapFromPattern() will be mapped to. |
java.lang.String getMapFromPattern()
The pattern is an Extended regular expression and can contain captures.
void setMapFromPattern(java.lang.String value)
The pattern is an Extended regular expression and can contain captures.
value
- The pattern.java.lang.String getMapToPattern()
getMapFromPattern()
will be mapped to.
The pattern should contain references to capture registers.
void setMapToPattern(java.lang.String value)
getMapFromPattern()
will be mapped to.
The pattern should contain references to capture registers.
value
- The Pattern.Please send bug reports and comments to Caplin support