|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.caplin.keymaster.KeyMaster
public class KeyMaster
Provides methods to generate the credentials token that can be passed back to the client, and that the client can use to log in to Liberator.
The instance of KeyMaster
that is used to generate to the token must be configured and obtained
by invoking the getKeyMaster(Properties)
method. A unique token that can be used to log in to Liberator
is obtained by invoking one of the generateToken() methods on that instance.
The name of the Logger
used by KeyMaster can also be obtained from the
LOGGERNAME
static field.
Field Summary | |
---|---|
static String |
LOGGERNAME
The name of the Logger used by KeyMaster. |
Method Summary | |
---|---|
String |
generateToken(String userName)
Generates a unique credentials token that the client can use to log in to Liberator. |
String |
generateToken(String userName,
Map<String,String> mappingData)
Generates a unique credentials token that the client can use to log in to Liberator. |
String |
generateToken(String userName,
String extraDataToSign)
Generates a unique credentials token that the client can use to log in to Liberator. |
String |
generateToken(String userName,
String extraDataToSign,
Map<String,String> mappingData)
Generates a unique credentials token that the client can use to log in to Liberator. |
static KeyMaster |
getKeyMaster(Properties props)
Gets a KeyMaster that has been configured with the specified properties. |
String |
getToken()
Deprecated. The use case of generating a token without a username will not be supported in future versions. Gets a unique token that a client can use to log into the Liberator. |
String |
getToken(String extraDataToSign)
Deprecated.
Use Gets a unique token that a client can use to log into the Liberator. The extraDataToSign argument can be used to sign extra information that can be passed to Liberator. This extra data will be signed as part of the generated token. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOGGERNAME
The name of the Logger
used by KeyMaster.
Method Detail |
---|
public static KeyMaster getKeyMaster(Properties props) throws WrappedException, InitialisationFailedException
Gets a KeyMaster
that has been configured with the specified properties.
props
- The properties that will be used to configure how the KeyMaster generates the
token.
KeyMaster
.
IllegalArgumentException
- If the props argument is null
.
WrappedException
- Wraps an Exception that was thrown whilst trying to initialise the
KeyMaster.
InitialisationFailedException
- If a required property is missing from the props
argument.public String getToken() throws WrappedException
The use case of generating a token without a username will not be supported in future versions.
Gets a unique token that a client can use to log into the Liberator.
WrappedException
- Wraps an Exception that was thrown whilst trying to generate the token.public String getToken(String extraDataToSign) throws WrappedException
Use generateToken(String, String)
instead.
Gets a unique token that a client can use to log into the Liberator.
The extraDataToSign argument can be used to sign extra information that can be passed to Liberator. This extra data will be signed as part of the generated token.
extraDataToSign
- extra data that will be signed as part of the token.
WrappedException
- Wraps an Exception that was thrown whilst trying to generate the token.public String generateToken(String userName) throws WrappedException
Generates a unique credentials token that the client can use to log in to Liberator.
The parameters passed to this method are signed and available as part of the token.
userName
- The username that is required to log in to Liberator.
WrappedException
- Wraps exceptions that KeyMaster throws when it attempts to generate the token.public String generateToken(String userName, String extraDataToSign) throws WrappedException
Generates a unique credentials token that the client can use to log in to Liberator.
The parameters passed to this method are signed and available as part of the token.
userName
- The username that is required to log in to Liberator.extraDataToSign
- Extra data that will be signed and included in the token.
WrappedException
- Wraps exceptions that KeyMaster throws when it attempts to generate the token.public String generateToken(String userName, Map<String,String> mappingData) throws WrappedException
Generates a unique credentials token that the client can use to log in to Liberator.
The parameters passed to this method are signed and available as part of the token.
Liberator can be configured to use the mappingData
passed to this method when it maps the
subject requests of trade subscriptions. For example, if mappingData
maps [“key”: “value”],
and if Liberator is configured to map /FX/
to /FX/%{key}
, Liberator will change all requests
for the subject /FX/
to /FX/value
. For further information about configuring Liberator, refer
to the Liberator Administration Guide document.
userName
- The username that is required to log in to Liberator.mappingData
- A map of key-value pairs. Each key in the map can only contain alphanumeric characters,
the underscore, and the period (full stop) character.
WrappedException
- Wraps exceptions that KeyMaster throws when it attempts to generate the token.public String generateToken(String userName, String extraDataToSign, Map<String,String> mappingData) throws WrappedException
Generates a unique credentials token that the client can use to log in to Liberator.
The parameters passed to this method are signed and available as part of the token.
Liberator can be configured to use the mappingData
passed to this method when it maps the
subject requests of trade subscriptions. For example, if mappingData
maps [“key”: “value”],
and if Liberator is configured to map /FX/
to /FX/%{key}
, Liberator will change all requests
for the subject /FX/
to /FX/value
. For further information about configuring Liberator, refer
to the Liberator Administration Guide document.
userName
- The username that is required to log in to Liberator.extraDataToSign
- Extra data that will be signed and included in the token.mappingData
- A map of key-value pairs. Each key in the map can only contain alphanumeric characters,
the underscore, and the period (full stop) character.
WrappedException
- Wraps exceptions that KeyMaster throws when it attempts to generate the token.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |