Class DISBJSONMessageTransformer


  • public class DISBJSONMessageTransformer
    extends java.lang.Object
    This class is used to parse and transform the JSON Messages.

    Note: This class is for internal usage only. Any dependency from the end-user will not be supported. Changes to this class will happen without a warning.
    Since:
    7.1.1
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void buildItemAttributes​(com.ibm.json.java.OrderedJSONObject jsonItem, java.util.HashMap<java.lang.String,​java.lang.Object> ciAttr)
      Method to parse the CI attributes by making recursive calls to itself based on the OrderedJSONObject objects obtained.
      protected void convertJsonToOperation​(com.ibm.json.java.OrderedJSONObject operJsonObj, BaseOperation operModelObj)
      Method to parse the Instance or Model Topic's JSON Operation contents.
      ConfigurationItem getGuidConfigItem​(java.lang.String jsonMessage)
      Method returns the GUID Life Cycle Topic's ConfigurationItem object after parsing the JSON message.
      OperationSet getOperationSet​(java.lang.String jsonMessage)
      Method returns the Instance or Model Topic's OperationSet object after parsing the JSON message.
      com.ibm.json.java.JSONObject parseToJSONObject​(java.io.InputStream data)
      Method returns the whole JSONObject after parsing the InputStream containing the JSON data.
      • Methods inherited from class java.lang.Object

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

      • DISBJSONMessageTransformer

        public DISBJSONMessageTransformer()
    • Method Detail

      • parseToJSONObject

        public com.ibm.json.java.JSONObject parseToJSONObject​(java.io.InputStream data)
                                                       throws java.lang.Exception
        Method returns the whole JSONObject after parsing the InputStream containing the JSON data.
        Parameters:
        data - The InputStream containing the JSON Message
        Returns:
        The converted JSONObject from the JSON data stream
        Throws:
        java.lang.Exception - if a problem occurs.
      • getOperationSet

        public OperationSet getOperationSet​(java.lang.String jsonMessage)
                                     throws java.lang.Exception
        Method returns the Instance or Model Topic's OperationSet object after parsing the JSON message.
        Parameters:
        jsonMessage - The JSON message.
        Returns:
        an OperationSet object containing the Instance or Model Topic's Operation Set.
        Throws:
        java.lang.Exception - if a problem occurs.
      • getGuidConfigItem

        public ConfigurationItem getGuidConfigItem​(java.lang.String jsonMessage)
                                            throws java.lang.Exception
        Method returns the GUID Life Cycle Topic's ConfigurationItem object after parsing the JSON message.
        Parameters:
        jsonMessage - The JSON Message.
        Returns:
        ConfigurationItem object containing the GUIDLifeCycle Topic's ConfigurationItem object.
        Throws:
        java.lang.Exception - if a problem occurs.
      • convertJsonToOperation

        protected void convertJsonToOperation​(com.ibm.json.java.OrderedJSONObject operJsonObj,
                                              BaseOperation operModelObj)
                                       throws java.lang.Exception
        Method to parse the Instance or Model Topic's JSON Operation contents.
        Parameters:
        operJsonObj - The OrderedJSONObject containing the ConfigurationItem objects either in the form of OrderedJSONObject or in the form of JSONArray.
        operModelObj - The BaseOperation object containing either the create, modify,delete,refresh or reference objects.
        Throws:
        java.lang.Exception - if a problem occurs.
      • buildItemAttributes

        protected void buildItemAttributes​(com.ibm.json.java.OrderedJSONObject jsonItem,
                                           java.util.HashMap<java.lang.String,​java.lang.Object> ciAttr)
                                    throws java.lang.Exception
        Method to parse the CI attributes by making recursive calls to itself based on the OrderedJSONObject objects obtained. The contents may be the String,OrderedJSONObject or JSONArray objects.
        Parameters:
        jsonItem - The OrderedJSONObject
        ciAttr - an empty LinkedHashMap that needs to be populated.
        Throws:
        java.lang.Exception - if a problem occurs.