com.ibm.di.connector.disb
Class DISBJSONMessageTransformer

java.lang.Object
  extended by com.ibm.di.connector.disb.DISBJSONMessageTransformer

public class DISBJSONMessageTransformer
extends 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

Constructor Summary
DISBJSONMessageTransformer()
           
 
Method Summary
protected  void buildItemAttributes(com.ibm.json.java.OrderedJSONObject jsonItem, HashMap<String,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(String jsonMessage)
          Method returns the GUID Life Cycle Topic's ConfigurationItem object after parsing the JSON message.
 OperationSet getOperationSet(String jsonMessage)
          Method returns the Instance or Model Topic's OperationSet object after parsing the JSON message.
 com.ibm.json.java.JSONObject parseToJSONObject(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(InputStream data)
                                               throws 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:
Exception - if a problem occurs.

getOperationSet

public OperationSet getOperationSet(String jsonMessage)
                             throws 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:
Exception - if a problem occurs.

getGuidConfigItem

public ConfigurationItem getGuidConfigItem(String jsonMessage)
                                    throws 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:
Exception - if a problem occurs.

convertJsonToOperation

protected void convertJsonToOperation(com.ibm.json.java.OrderedJSONObject operJsonObj,
                                      BaseOperation operModelObj)
                               throws 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:
Exception - if a problem occurs.

buildItemAttributes

protected void buildItemAttributes(com.ibm.json.java.OrderedJSONObject jsonItem,
                                   HashMap<String,Object> ciAttr)
                            throws 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:
Exception - if a problem occurs.