psdi.common.emailstner

Class LSNRParser

  • java.lang.Object
    • psdi.common.emailstner.LSNRParser


  • public class LSNRParser
    extends java.lang.Object
    A class to represent the parsing API for the email listener
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.util.Hashtable msgHash 
    • Constructor Summary

      Constructors 
      Constructor and Description
      LSNRParser() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int emailFormatMode(MboRemote inboundComm)
      Method to return format mode for the message body.
      java.lang.String getActionName(MboRemote inboundComm, int formatMode)
      Returns the action name specified in message body
      java.util.Hashtable getAttributeValues(MboRemote inboundComm, int formatMode)
      Returns a hashtable of mbo attribute name and value specified in message body
      java.lang.String getObjectName(MboRemote inboundComm, int formatMode)
      Get the object name for the formatted name
      java.lang.String[] getPrimaryKeyCols(MboRemote inboundComm)
      Gets the array of key columns for the object specified in message body
      java.lang.String getResultColumnsForQuery(MboRemote inboundComm, int formatMode)
      Returns a string containing all result columns for query action separated by comma.
      java.lang.String getWhereClauseForQuery(MboRemote inboundComm, int formatMode)
      Returns the where condition specified in message body
      boolean isPrimaryKeyProvided(MboRemote inboundComm, java.lang.String objectName, java.util.Hashtable has)
      Checks if primary keys are provided for the object secified in message body
      java.util.Hashtable readFormattedMessageToHashtable(MboRemote inboundComm, int formatMode)
      Parse the message body and puts attribute and value into hashtable.
      • Methods inherited from class java.lang.Object

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

      • msgHash

        public java.util.Hashtable msgHash
    • Constructor Detail

      • LSNRParser

        public LSNRParser()
    • Method Detail

      • emailFormatMode

        public int emailFormatMode(MboRemote inboundComm)
                            throws LSNRParseException
        Method to return format mode for the message body.
        Parameters:
        InboundCommMbo -
        Returns:
        format mode 0-Freeform,1-Attribute-Value,2-XML mode
        Throws:
        LSNRParseException
      • getObjectName

        public java.lang.String getObjectName(MboRemote inboundComm,
                                              int formatMode)
                                       throws LSNRParseException
        Get the object name for the formatted name
        Parameters:
        inboundComm -
        formatMode - 1 for attribute-value or 2 for XML
        Returns:
        String Object Name
        Throws:
        LSNRParseException
        See Also:
        emailFormatMode
      • getActionName

        public java.lang.String getActionName(MboRemote inboundComm,
                                              int formatMode)
                                       throws LSNRParseException
        Returns the action name specified in message body
        Parameters:
        inboundComm -
        formatMode - 1 for attribute-value or 2 for XML
        Returns:
        action name
        Throws:
        LSNRParseException
        See Also:
        emailFormatMode
      • isPrimaryKeyProvided

        public boolean isPrimaryKeyProvided(MboRemote inboundComm,
                                            java.lang.String objectName,
                                            java.util.Hashtable has)
                                     throws LSNRParseException
        Checks if primary keys are provided for the object secified in message body
        Parameters:
        inboundComm -
        objectName -
        hash - table without listener key words
        Returns:
        true if primary keys are prvided, else false
        Throws:
        LSNRParseException
        See Also:
        getAttributeValues
      • getPrimaryKeyCols

        public java.lang.String[] getPrimaryKeyCols(MboRemote inboundComm)
                                             throws LSNRParseException
        Gets the array of key columns for the object specified in message body
        Parameters:
        inboundComm -
        Returns:
        key array
        Throws:
        LSNRParseException
      • getAttributeValues

        public java.util.Hashtable getAttributeValues(MboRemote inboundComm,
                                                      int formatMode)
                                               throws LSNRParseException
        Returns a hashtable of mbo attribute name and value specified in message body
        Parameters:
        inboundComm -
        formatMode - 1 for attribute-value or 2 for XML
        Returns:
        (attribute name->value) hashtable without listener key words
        Throws:
        LSNRParseException
        See Also:
        emailFormatMode
      • readFormattedMessageToHashtable

        public java.util.Hashtable readFormattedMessageToHashtable(MboRemote inboundComm,
                                                                   int formatMode)
                                                            throws LSNRParseException
        Parse the message body and puts attribute and value into hashtable.
        Parameters:
        inboundComm -
        formatMode - 1 for attribute-value or 2 for XML
        Returns:
        hashtable with all attribute and value
        Throws:
        LSNRParseException
        See Also:
        emailFormatMode
      • getWhereClauseForQuery

        public java.lang.String getWhereClauseForQuery(MboRemote inboundComm,
                                                       int formatMode)
                                                throws LSNRParseException
        Returns the where condition specified in message body
        Parameters:
        inboundComm -
        formatMode - 1 for attribute-value or 2 for XML
        Returns:
        where clause
        Throws:
        LSNRParseException
        See Also:
        emailFormatMode
      • getResultColumnsForQuery

        public java.lang.String getResultColumnsForQuery(MboRemote inboundComm,
                                                         int formatMode)
                                                  throws LSNRParseException
        Returns a string containing all result columns for query action separated by comma.
        Parameters:
        inboundComm -
        formatMode - 1 for attribute-value or 2 for XML
        Returns:
        String of result columns
        Throws:
        LSNRParseException
        See Also:
        emailFormatMode