com.ibm.commerce.programadapter.messagemapper

Class MessageMapperGroup

  • java.lang.Object
    • com.ibm.commerce.programadapter.messagemapper.MessageMapperGroup
  • All Implemented Interfaces:
    ComponentConfiguration


    public class MessageMapperGroup
    extends java.lang.Object
    implements ComponentConfiguration
    The Component which all messages will go through to be converted into a com.ibm.commerce.datatype.CommandProperty object. This is responsible for initializing all defined MessageMappers and calling the appropriate MessagMapper to convert the given object.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String _MESSAGE_MAPPER_ID
      The parameter used to store the identifier of the message mapper.
      static java.lang.String _MESSAGE_MAPPER_NAME
      The parameter used to store the name of the message mapper.
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
      static java.util.Vector messageMapperGroup
      The defined message mappers.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MessageMapperGroup()
      Creates the Message Mapper container object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void destroy()
      This destroy method will be called when the request servlet is stopped or destroyed.
      void enable(boolean val)
      This method is used to dynamically enable or disable a component.
      static CommandProperty getObjectForMessage(java.lang.Object message)
      Will call each MessageMessage in order they were configured in the component properties and return the first non null CommandProperty object.
      static CommandProperty getObjectForMessage(java.lang.Object message, java.lang.Integer deviceFmtId)
      Will return the result from the specified MessageMapper which was specified by the MessageMapper Identifier.
      static CommandProperty getObjectForMessage(java.lang.Object message, java.lang.String name)
      Will return the result from the specified MessageMapper which was specified by the MessageMapper name.
      void init(org.w3c.dom.Element node)
      The initilization method for the component.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values
      • messageMapperGroup

        public static java.util.Vector messageMapperGroup
        The defined message mappers.
      • _MESSAGE_MAPPER_NAME

        public static final java.lang.String _MESSAGE_MAPPER_NAME
        The parameter used to store the name of the message mapper.
        See Also:
        Constant Field Values
      • _MESSAGE_MAPPER_ID

        public static final java.lang.String _MESSAGE_MAPPER_ID
        The parameter used to store the identifier of the message mapper.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MessageMapperGroup

        public MessageMapperGroup()
        Creates the Message Mapper container object.
    • Method Detail

      • destroy

        public void destroy()
        This destroy method will be called when the request servlet is stopped or destroyed. Will call the destory method on each defined MessageMapper.
        Specified by:
        destroy in interface ComponentConfiguration
      • enable

        public void enable(boolean val)
        This method is used to dynamically enable or disable a component.
        Specified by:
        enable in interface ComponentConfiguration
        Parameters:
        val - whether to enable or disable the component.
      • getObjectForMessage

        public static CommandProperty getObjectForMessage(java.lang.Object message)
        Will call each MessageMessage in order they were configured in the component properties and return the first non null CommandProperty object. If no message mapper can convert the given object, then a null will be returned.
        Parameters:
        message - the object to check if a message mapper can create a command property representation.
        Returns:
        The command property representation of the message or null if no message mapper can understand the message.
      • getObjectForMessage

        public static CommandProperty getObjectForMessage(java.lang.Object message,
                                                          java.lang.Integer deviceFmtId)
        Will return the result from the specified MessageMapper which was specified by the MessageMapper Identifier.
        Parameters:
        message - the message to convert into a command property.
        message - the identifier of the message mapper to use.
        Returns:
        The command property representation of the message or null if no message mapper can understand the message.
      • getObjectForMessage

        public static CommandProperty getObjectForMessage(java.lang.Object message,
                                                          java.lang.String name)
        Will return the result from the specified MessageMapper which was specified by the MessageMapper name.
        Parameters:
        message - the message to convert into a command property object.
        message - the name of the message mapper to use.
        Returns:
        The command property representation of the message or null if no message mapper can understand the message.
      • init

        public void init(org.w3c.dom.Element node)
                  throws java.lang.Exception
        The initilization method for the component. This method will be called during initializtion of the Request Servlet.
        Specified by:
        init in interface ComponentConfiguration
        Parameters:
        node - a dom element node with the parameters for the component, null if no property is present
        Throws:
        java.lang.Exception - if there is a problem with intialization.