Class DefaultMessageNameCatalogue
- java.lang.Object
-
- org.certificateservices.messages.csmessages.DefaultMessageNameCatalogue
-
- All Implemented Interfaces:
MessageNameCatalogue
public class DefaultMessageNameCatalogue extends java.lang.Object implements MessageNameCatalogue
Class in charge of looking up the name of a specific PKI messages.The main method is lookupName and by default is the simple name of the payload class (with the exception if a PKIResponse object which generates a name of "FailureResponse"). returned. But this can be overloaded by the setting "csmessage.name" + the name of the payload element in lowercase.
For example to overload the name of a message with payload isIssuerRequest should the setting be "csmessage.name.isissuerrequest"
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOLD_SETTING_MESSAGE_NAME_PREFIXThe prefix for overloading pkimessage names, all settings should start with this and append the name of the payload element in lowercase.static java.lang.StringSETTING_MESSAGE_NAME_PREFIXThe prefix for overloading pkimessage names, all settings should start with this and append the name of the payload element in lowercase.-
Fields inherited from interface org.certificateservices.messages.csmessages.MessageNameCatalogue
REQUESTNAME_CRLFORWARD
-
-
Constructor Summary
Constructors Constructor Description DefaultMessageNameCatalogue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(java.util.Properties properties)Default constructorjava.lang.StringlookupName(java.lang.String requestName, java.lang.Object payLoadObject)Method that looks up the name for a specific setting used to populate the 'name' attribute in the header, the name is equivalent to the settings starting with "pkimessage.name.'messagename'"
-
-
-
Field Detail
-
SETTING_MESSAGE_NAME_PREFIX
public static final java.lang.String SETTING_MESSAGE_NAME_PREFIX
The prefix for overloading pkimessage names, all settings should start with this and append the name of the payload element in lowercase.For example to overload the name of a message with payload isIssuerRequest should the setting be "pkimessage.name.isissuerrequest"
- See Also:
- Constant Field Values
-
OLD_SETTING_MESSAGE_NAME_PREFIX
public static final java.lang.String OLD_SETTING_MESSAGE_NAME_PREFIX
The prefix for overloading pkimessage names, all settings should start with this and append the name of the payload element in lowercase.For example to overload the name of a message with payload isIssuerRequest should the setting be "pkimessage.name.isissuerrequest"
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(java.util.Properties properties)
Default constructor- Specified by:
initin interfaceMessageNameCatalogue- Parameters:
properties- the properties file of the PKI message parser.
-
lookupName
public java.lang.String lookupName(java.lang.String requestName, java.lang.Object payLoadObject) throws MessageProcessingException, java.lang.IllegalArgumentExceptionMethod that looks up the name for a specific setting used to populate the 'name' attribute in the header, the name is equivalent to the settings starting with "pkimessage.name.'messagename'"- Specified by:
lookupNamein interfaceMessageNameCatalogue- Parameters:
requestName- namepayLoadObject- the setting to look-up the name for.- Returns:
- the name of the message to use.
- Throws:
MessageProcessingException- if name lookup failed etc.java.lang.IllegalArgumentException- if name lookup failed due to bad request data
-
-