Class 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.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.
      static 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void init​(java.util.Properties properties)
      Default constructor
      java.lang.String lookupName​(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'"
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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
    • Constructor Detail

      • DefaultMessageNameCatalogue

        public DefaultMessageNameCatalogue()
    • Method Detail

      • init

        public void init​(java.util.Properties properties)
        Default constructor
        Specified by:
        init in interface MessageNameCatalogue
        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.IllegalArgumentException
        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'"
        Specified by:
        lookupName in interface MessageNameCatalogue
        Parameters:
        requestName - name
        payLoadObject - 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