com.ibm.tivoli.maximo.fdmbo.map

Class ExternalJSONMapper

  • java.lang.Object
    • com.ibm.tivoli.maximo.fdmbo.map.ExternalJSONMapper


  • public class ExternalJSONMapper
    extends java.lang.Object
    JSON to Object Structure or Mbo Mapper
    • Field Detail

      • INTEGRATIONLOGGER

        public static final MXLogger INTEGRATIONLOGGER
        The Integration logger
    • Constructor Detail

      • ExternalJSONMapper

        public ExternalJSONMapper(java.lang.String mapName)
                           throws MXException
        Constructor
        Parameters:
        mapName - the map name
        Throws:
        MXException - MAXIMO exception
    • Method Detail

      • processJSON

        public MboRemote processJSON(com.ibm.json.java.JSONArtifact jsonData,
                                     java.lang.String messageType,
                                     java.lang.String mosName,
                                     UserInfo userInfo,
                                     MXTransaction mxTrans)
                              throws MXException,
                                     java.rmi.RemoteException
        Map JSON to object structure and process it to Maximo
        Parameters:
        jsonData - source JSON
        messageType - Message Type
        mosName - Object Structure
        userInfo - User Info object
        mxTrans - Reference to MXTransaction object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapJSONtoOS

        public StructureData mapJSONtoOS(com.ibm.json.java.JSONArtifact jsonData,
                                         java.lang.String interfaceName,
                                         UserInfo userInfo)
                                  throws MXException,
                                         java.rmi.RemoteException
        Map JSON to object structure
        Parameters:
        interfaceName - Enterprise Service name
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapJSONtoOS

        public StructureData mapJSONtoOS(com.ibm.json.java.JSONArtifact jsonData,
                                         java.lang.String messageType,
                                         java.lang.String mosName,
                                         UserInfo userInfo)
                                  throws MXException,
                                         java.rmi.RemoteException
        Map JSON to object structure and process it to Maximo
        Parameters:
        jsonData - source JSON
        messageType - Message Type
        mosName - Object Structure
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapJSONtoOS

        public StructureData mapJSONtoOS(com.ibm.json.java.JSONArtifact jsonData,
                                         java.lang.String messageType,
                                         java.lang.String mosName,
                                         UserInfo userInfo,
                                         boolean toJSON)
                                  throws MXException,
                                         java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • mapOSToJSON

        public com.ibm.json.java.JSONArtifact mapOSToJSON(StructureData strucIn,
                                                          UserInfo userInfo)
                                                   throws MXException,
                                                          java.rmi.RemoteException
        Map object structure XML to JSON
        Parameters:
        strucIn - StructureData object which reference to XML
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapOSToJSON

        public com.ibm.json.java.JSONArtifact mapOSToJSON(StructureData strucIn,
                                                          UserInfo userInfo,
                                                          boolean fromJSON)
                                                   throws MXException,
                                                          java.rmi.RemoteException
        Map object structure XML to JSON
        Parameters:
        strucIn - StructureData object which reference to XML
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapMboToJSON

        public com.ibm.json.java.JSONArtifact mapMboToJSON(MboRemote mbo,
                                                           UserInfo userInfo)
                                                    throws MXException,
                                                           java.rmi.RemoteException
        Map Mbo to JSON
        Parameters:
        mbo - reference to Mbo object
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapMboSetToJSON

        public com.ibm.json.java.JSONArtifact mapMboSetToJSON(MboSetRemote mboSet,
                                                              UserInfo userInfo)
                                                       throws MXException,
                                                              java.rmi.RemoteException
        Map MboSet to JSON
        Parameters:
        mboSet - reference to MboSet object
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapObjectIn

        protected boolean mapObjectIn(com.ibm.json.java.JSONObject jo,
                                      java.lang.String jsonData,
                                      StructureData data,
                                      JSONMapDetailInfo info,
                                      UserInfo userInfo)
                               throws MXException,
                                      java.rmi.RemoteException
        Map individual Map detail from JSON to Object Structure XML
        Parameters:
        jo - the JSON Object
        data - Refrence to StructureData object which currentData pointing to the processing level
        info - the JSONMapDetailInfo for this level
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapAttributesIn

        protected void mapAttributesIn(com.ibm.json.java.JSONObject jo,
                                       java.lang.String jsonData,
                                       StructureData outData,
                                       UserInfo userInfo,
                                       JSONMapDetailInfo info)
                                throws MXException,
                                       java.rmi.RemoteException
        Map individual properties from JSON to Object Structure XML
        Parameters:
        jo - the JSON Object
        data - Reference to StructureData object which currentData pointing to the processing level
        userInfo - UserInfo object
        info - the JSONMapDetailInfo for this level
        setObject - Business Object or Object Structure
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • formatConditionalValue

        public java.lang.String formatConditionalValue(java.util.List values,
                                                       java.lang.Object jo,
                                                       java.lang.String jsonData,
                                                       MboSetInfo msi)
                                                throws MXException,
                                                       java.rmi.RemoteException
        Find correct value based on condition and format it to process
        Parameters:
        values - All conditional values
        jo - processing object
        jsonData - Serialized JSON object
        msi - MboSetInfo object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • meetCondition

        public boolean meetCondition(java.lang.String condition,
                                     java.lang.Object jo,
                                     java.lang.String jsonData,
                                     MboSetInfo msi)
                              throws MXException,
                                     java.rmi.RemoteException
        Check if condition true or false
        Parameters:
        condition - condition
        jo - processing object
        jsonData - Serialized JSON object
        msi - MboSetInfo object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapObjectOut

        protected void mapObjectOut(StructureData strucIn,
                                    com.ibm.json.java.JSONObject jo,
                                    JSONMapDetailInfo info,
                                    UserInfo userInfo)
                             throws MXException,
                                    java.rmi.RemoteException
        Map individual Map detail from Object Structure XML to JSON
        Parameters:
        strucIn - Reference to StructureData object which currentData pointing to the processing level
        jo - the JSON Object
        info - the JSONMapDetailInfo for this level
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapObjectOut

        protected void mapObjectOut(MboRemote mbo,
                                    com.ibm.json.java.JSONObject jo,
                                    JSONMapDetailInfo info,
                                    UserInfo userInfo)
                             throws MXException,
                                    java.rmi.RemoteException
        Map individual Map detail from Object Structure XML to JSON
        Parameters:
        mbo - Reference to Mbo object
        jo - the JSON Object
        info - the JSONMapDetailInfo for this level
        userInfo - User Info object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • mapAttributesOut

        protected void mapAttributesOut(java.lang.Object inData,
                                        com.ibm.json.java.JSONObject jo,
                                        JSONMapDetailInfo info,
                                        MboSetInfo msi,
                                        UserInfo userInfo)
                                 throws MXException,
                                        java.rmi.RemoteException
        Map individual attributes from Object Structure XML to JSON Object
        Parameters:
        jo - the JSON Object
        inData - Reference to StructureData object or Mbo
        info - the JSONMapDetailInfo for this level
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception
      • setForInsert

        public void setForInsert(com.ibm.json.java.JSONObject jo,
                                 java.lang.String jsonData,
                                 MboSetRemote mboSet)
                          throws MXException,
                                 java.rmi.RemoteException
        Validate ORG and SITE for the inbound transaction.
        Parameters:
        jo - JSON object
        mboSet - MboSet to set org or sit id parameters
        jsonData - Serialized JSON object
        Throws:
        MXException - MAXIMO exception
        java.rmi.RemoteException - Remote exception