Package com.ibm.di.connector.disb
Class DISBJSONMessageTransformer
- java.lang.Object
-
- com.ibm.di.connector.disb.DISBJSONMessageTransformer
-
public class DISBJSONMessageTransformer extends java.lang.ObjectThis 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
Constructors Constructor Description DISBJSONMessageTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildItemAttributes(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 voidconvertJsonToOperation(com.ibm.json.java.OrderedJSONObject operJsonObj, BaseOperation operModelObj)Method to parse the Instance or Model Topic's JSON Operation contents.ConfigurationItemgetGuidConfigItem(java.lang.String jsonMessage)Method returns the GUID Life Cycle Topic's ConfigurationItem object after parsing the JSON message.OperationSetgetOperationSet(java.lang.String jsonMessage)Method returns the Instance or Model Topic's OperationSet object after parsing the JSON message.com.ibm.json.java.JSONObjectparseToJSONObject(java.io.InputStream data)Method returns the whole JSONObject after parsing the InputStream containing the JSON data.
-
-
-
Method Detail
-
parseToJSONObject
public com.ibm.json.java.JSONObject parseToJSONObject(java.io.InputStream data) throws java.lang.ExceptionMethod 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.ExceptionMethod 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.ExceptionMethod 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 OrderedJSONObjectciAttr- an empty LinkedHashMap that needs to be populated.- Throws:
java.lang.Exception- if a problem occurs.
-
-