psdi.iface.mic

Class StructureData

    • Field Detail

      • byteData

        protected byte[] byteData
      • primaryObjectName

        protected java.lang.String primaryObjectName
      • osName

        protected java.lang.String osName
      • currentPosition

        protected int currentPosition
      • mainMbos

        protected java.util.ArrayList mainMbos
      • isPatch

        protected boolean isPatch
    • Constructor Detail

      • StructureData

        public StructureData()
        Default constructor.
      • StructureData

        public StructureData(java.lang.String operaton,
                             java.lang.String osName,
                             java.lang.String lang,
                             int size,
                             boolean isEvent,
                             boolean isResponse)
                      throws MXException,
                             java.rmi.RemoteException
        Construct the StructureData object. This is used to create object structure xml. Used only for internal xml format.
        Parameters:
        operaton - The operation of the service/channel
        osName - The sobject structure name.
        lang - The language of transaction.
        size - The object size.
        isEvent - Determines if thats an event.
        isResponse - Determines if thats a response.
        Throws:
        MXException, - RemoteException
        MXException
        java.rmi.RemoteException
      • StructureData

        public StructureData(org.jdom2.Document input)
                      throws MXException
        Construct the StructureData object with a prepared document. It will not break the data. If need to be broken call breakData() method
        Parameters:
        input - the jdom document
        Throws:
        MXException
      • StructureData

        public StructureData(byte[] data)
                      throws MXException
        Construct the StructureData object with a byte array. It will not break the data. If need to be broken call breakData() method
        Parameters:
        data - byte array for the MOS XML
        Throws:
        MXException
      • StructureData

        public StructureData(java.lang.String data)
                      throws MXException
        Construct the StructureData object with a string. It will not break the data. If need to be broken call breakData() method
        Parameters:
        data - string for the MOS XML
        Throws:
        MXException
    • Method Detail

      • isIR

        public boolean isIR()
        Deprecated. use isBroken
        is internal xml or not.
        Returns:
        boolean is internal xml or not
      • isBroken

        public boolean isBroken()
        Determine is dta broken or not.
        Returns:
        boolean is xml broken
      • addIntObject

        public void addIntObject()
                          throws MXException
        Deprecated. please use addObjectStructure().
        adds integration object
        Throws:
        MXException
      • addObjectStructure

        public void addObjectStructure()
                                throws MXException
        Adds object structure to the list of existing os records
        Throws:
        MXException
      • moveToNextIntObject

        public boolean moveToNextIntObject()
                                    throws MXException
        Deprecated. please use moveToNextObjectStructure().
        moves to the next mos. This call will break the data for that mos and will set the currentdata pointer. This method should be called only for internal xmls.
        Returns:
        boolean if last object or not
        Throws:
        MXException
      • moveToNextObjectStructure

        public boolean moveToNextObjectStructure()
                                          throws MXException
        moves to the next object structure . This call will break the data for that object structure and will set the currentdata pointer. This method should be called only for internal xmls.
        Returns:
        boolean if last object or not
        Throws:
        MXException
      • moveToPrevIntObject

        public boolean moveToPrevIntObject()
                                    throws MXException
        Deprecated. please use moveToPrevObjectStructure().
        moves to the previous integration object. This call will break the data for that integration object and will set the currentdata pointer. This method should be called only for internal xmls.
        Returns:
        boolean if last object or not
        Throws:
        MXException
      • moveToPrevObjectStructure

        public boolean moveToPrevObjectStructure()
                                          throws MXException
        moves to the previous object structure. This call will break the data for that object structure and will set the currentdata pointer. This method should be called only for internal xmls.
        Returns:
        boolean if first object or not
        Throws:
        MXException
      • moveToFirstIntObject

        public void moveToFirstIntObject()
                                  throws MXException
        Deprecated. please use moveToFirstObjectStruture().
        Reset Structure Data to point to first integration object. This will change the currentdata pointer and break that data.
        Throws:
        MXException
      • moveToFirstObjectStruture

        public void moveToFirstObjectStruture()
                                       throws MXException
        Reset Structure Data to point to first object structure. This will change the currentdata pointer and break that data.
        Throws:
        MXException
      • removeCurrentIntObject

        public void removeCurrentIntObject()
                                    throws MXException
        Deprecated. please use removeCurrentObjectStruture().
        Removed the current integration object from the Structure & re-positions cursor to previous integration object. If current position is 0 (i.e no integration objects exist after removal of the current integration object), then currentPosition will point to -1 and currentData will point to null after removal of the current integration object.
        Throws:
        MXException
      • removeCurrentObjectStructure

        public void removeCurrentObjectStructure()
                                          throws MXException
        Removed the current object structure from the Structure & re-positions cursor to previous one. If current position is 0 (i.e no integration objects exist after removal of the current mos), then currentPosition will point to -1 and currentData will point to null after removal of the current os.
        Throws:
        MXException
      • removeChildrenFromPrimaryObject

        public void removeChildrenFromPrimaryObject()
                                             throws java.rmi.RemoteException,
                                                    MXException
        Remove all children of the Primary Object Element
        Throws:
        MXException
        java.rmi.RemoteException
      • removeChildren

        public void removeChildren()
                            throws java.rmi.RemoteException,
                                   MXException
        Deprecated. 
        Remove all children of the Current Level
        Throws:
        MXException
        java.rmi.RemoteException
      • getData

        public org.jdom2.Document getData()
        Return data in jdom Documnet format
        Returns:
        Document object with whole data which is stored in StructureData object
      • hasDocument

        public boolean hasDocument()
        Determines if the StructureData instance has the data converted to a Document or is still in bytes format.
        Returns:
        true is the data is converted to a Document object and false otherwise
      • getDataAsBytes

        public byte[] getDataAsBytes()
        Return the whole documnet as bytes. This is costly method as it regenerates the byte data from the document each time the call is made.
        Returns:
        byte[] whole data which is stored in StructureData object
      • getDataAsString

        public java.lang.String getDataAsString()
      • getOriginalByteData

        public byte[] getOriginalByteData()
        Return the whole documnet as bytes. This is costly method as it regenerates the byte data from the document each time the call is made.
        Returns:
        byte[] whole data which is stored in StructureData object
      • clone

        public java.lang.Object clone()
        clones the StructureData object and the document inside it.
        Overrides:
        clone in class java.lang.Object
        Returns:
        Object a copy of the StructureData object
      • breakData

        public void breakData()
                       throws MXException
        Parses channel/ service documnet data and sets corresponding object variables.
        Throws:
        MXException
      • breakIntObject

        public void breakIntObject()
                            throws MXException
        Deprecated. please use breakMos().
        Parses integration object and sets global variables.
        Throws:
        MXException
      • breakObjectStructure

        public void breakObjectStructure()
                                  throws MXException
        Parses object structure and sets global variables.
        Throws:
        MXException
      • setMicData

        public StructureObject setMicData(org.jdom2.Element data)
        Set Element in the current element
        Parameters:
        data - Give reference Element to set to curent level.
        Returns:
        Structure Object which is a wrapper around one Element
      • createChildrenData

        public void createChildrenData(java.lang.String name,
                                       boolean setAsCurrent)
        Create Child level from current level
        Parameters:
        name - Name of the child level. This will move the current data pointer to the child level.
        setAsCurrent - boolean to identify setting chil as current lvel or not
      • setParentAsCurrent

        public boolean setParentAsCurrent()
        Set parent Element as current data.
        Returns:
        boolean If there is no parent returns false otherwise true and sets the currentdata pointer to the parent.
      • getChildrenData

        public java.util.List getChildrenData()
        Get child Elements as a list
        Overrides:
        getChildrenData in class StructureObject
        Returns:
        list of Element for children
      • getIntObjectList

        public java.util.List getIntObjectList()
        Deprecated. plase use getPrimaryObjectList()
        Get list of integration objects in the Structure data
        Returns:
        list of integration objects as Elements in the Structure data
      • getPrimaryObjectList

        public java.util.List getPrimaryObjectList()
        Get list of primary objects in mos in the Structure data
        Returns:
        list of object strutures as Elements in the Structure data
      • getHierarchyObjectList

        public java.util.List getHierarchyObjectList()
        Get list of hierarrchy objects in mos in the Structure data
        Returns:
        list of object strutures as Elements in the Structure data
      • processHierarchy

        public void processHierarchy(org.jdom2.Element parent,
                                     java.util.List hList)
        Get the object structure size
      • getSize

        public int getSize()
        Get the object structure size
        Returns:
        size of the object structure
      • isMultiIntObject

        public boolean isMultiIntObject()
        Deprecated. please use isMultiMos()
        checks whether XML has multiple integration objects
        Returns:
        whether XML has multiple integration objects
      • isMultiObjectStructure

        public boolean isMultiObjectStructure()
        checks whether XML has multiple object structures
        Returns:
        whether XML has multiple object structures
      • getPrimaryObjectName

        public java.lang.String getPrimaryObjectName()
        Get main object name in the Structure data (it can be alias)
        Returns:
        main object name in the Structure data (it can be alias)
      • getLanguage

        public java.lang.String getLanguage()
                                     throws MXException
        Get base language of the Maximo.
        Returns:
        Base Language of the Maximo
        Throws:
        MXException
      • getTransLanguage

        public java.lang.String getTransLanguage()
                                          throws MXException
        Get language of the transaction. If language is not set up for for the transaction will use local language
        Returns:
        Language of the transaction
        Throws:
        MXException
      • getPrimaryObject

        public org.jdom2.Element getPrimaryObject()
        Get primary object in the current level
        Returns:
        Reference to Element object with a primary object data
      • getPrimaryObjectAsObject

        public java.lang.Object getPrimaryObjectAsObject()
                                                  throws MXException
        Get primary object in the current level
        Returns:
        Reference to Element object with a primary object data
        Throws:
        MXException
      • getStructureObject

        public StructureObject getStructureObject(int pos)
        Get object structure in the current level
        Parameters:
        pos - Position of the object strucure in the list.
        Returns:
        Reference to Element object with a data
      • getAction

        public java.lang.String getAction()
        Get Action of the Structure Data
        Returns:
        Action of the Structure Data
      • isActionNull

        public boolean isActionNull()
        Determine whether Action of primary object of Structure Data is null
        Returns:
        true is Action is null or empty string, false otherwise
      • isPatch

        public boolean isPatch()
                        throws MXException
        Return is patch operation
        Returns:
        is patch
        Throws:
        MXException
      • setIsPatch

        public void setIsPatch(boolean isPatch)
                        throws MXException
        Sets is patch
        Parameters:
        isPatch - is patch.
        Throws:
        MXException
      • getMessageID

        public java.lang.String getMessageID()
        Get Message ID of the Structure Data
      • removeCurrentData

        public void removeCurrentData()
        Remove the CurrentData Element and set the parent as the current data
      • setPrimaryObject

        public void setPrimaryObject(org.jdom2.Element h)
        Set Primary Object Element object
        Parameters:
        h - Give reference Element to set to primary object.
      • setPrimaryObject

        public void setPrimaryObject(java.lang.String name)
        Set the primary object
        Parameters:
        name - name of the primary object
      • setCurrentPosition

        public void setCurrentPosition(int pos)
        Sets current position
        Parameters:
        pos - Position of the object strucure in the list.
      • getCurrentPosition

        public int getCurrentPosition()
        gets current position
        Returns:
        pos Position of the object strucure in the list.
      • getRootName

        public java.lang.String getRootName()
        gets root element name
        Returns:
        name of root element.
      • setAction

        public void setAction(java.lang.String action)
        Set object Element action
        Parameters:
        action - action value to be set.
      • setActionNull

        public void setActionNull()
        Set object Element action to null
      • setChildrenData

        public void setChildrenData(java.util.List l)
        Set child level data
        Parameters:
        l - Give reference to List of Element to set as child.
      • setAsCurrent

        public StructureObject setAsCurrent(org.jdom2.Element data)
        Set Element as the current level
        Parameters:
        data - Give reference to Element to set as current.
      • setAsCurrent

        public StructureObject setAsCurrent(java.lang.Object data)
        Set Element as the current level
        Parameters:
        data - Give reference to Element to set as current.
      • setAsCurrent

        public void setAsCurrent(java.util.List data,
                                 int i)
        Set Element of the list as the current level
        Parameters:
        i - the index.
      • setAsCurrent

        public StructureObject setAsCurrent()
        Sets current data
        Returns:
        Return current data as struture object.
      • setAsCurrent

        public StructureObject setAsCurrent(java.lang.String xPathExpression)
                                     throws MXException
        Sets current data
        Parameters:
        xPathExpression - Give XPath expression.
        Returns:
        Return data as structure object.
        Throws:
        MXException
      • getStructureObject

        public StructureObject getStructureObject(java.lang.String xPathExpression)
                                           throws MXException
        Get StructureObject using XPath expression
        Parameters:
        xPathExpression - Give XPath expression.
        Returns:
        Return data as structure object.
        Throws:
        MXException
      • getXPathData

        public java.lang.String getXPathData(java.lang.String xPathExpression)
                                      throws MXException
        Get Data using XPath expression
        Returns:
        Return value of XML field.
        Throws:
        MXException
      • getStructureObjectList

        public java.util.List getStructureObjectList(java.lang.String xPathExpression)
                                              throws MXException
        Get List of objects using XPath expression
        Returns:
        Return list of structure object.
        Throws:
        MXException
      • setMessageID

        public void setMessageID(java.lang.String id)
        Set message id
      • setMboArray

        public void setMboArray(java.util.ArrayList in)
        Set list of Main Mbos
      • setCurrentMbo

        public void setCurrentMbo(MboRemote mbo)
        Set main MBO fro current integration object
      • getCurrentMbo

        public MboRemote getCurrentMbo()
                                throws MXException
        Return Main MBO which associated with current noun
        Returns:
        Current Mbo
        Throws:
        MXException
      • getMboArray

        public java.util.ArrayList getMboArray()
        Return list of Main MBOs which associated with xml
        Returns:
        list of Main MBOs
      • getRealMbo

        public MboRemote getRealMbo(java.lang.String objectName)
                             throws MXException,
                                    java.rmi.RemoteException
        Return real Mbo for non-persistent top level Mbo
        Returns:
        real Mbo for non-persistent top level Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • setRealMbo

        public void setRealMbo(MboRemote rm)
        Sets real Mbo for non-persistent top level Mbo
        Parameters:
        rm - Mbo for non-persistent top level Mbo
      • clear

        public void clear()
        clear Mbo cache
      • getBuild

        public java.lang.String getBuild()
        Gets a build number
        Returns:
        the MAXIMO build number.
      • getMajorVersion

        public java.lang.String getMajorVersion()
        Deprecated. please use getBuild()
        Returns:
        the MAXIMO majorversion number.
      • getMinorVersion

        public java.lang.String getMinorVersion()
        Deprecated. please use getBuild()
        Returns:
        the MAXIMO minorversion number.
      • getDbBuild

        public java.lang.String getDbBuild()
        Deprecated. please use getBuild()
        Returns:
        the MAXIMO dbbuild number.
      • getJsonRequest

        public OslcRequest getJsonRequest()
        Return OslcRequest (will be used for JSON only)
        Returns:
        OslcRequest object
      • getMboFromMemory

        public MboRemote getMboFromMemory()
                                   throws java.rmi.RemoteException,
                                          MXException
        Return Mbo from memory
        Returns:
        OslcRequest object
        Throws:
        java.rmi.RemoteException
        MXException
      • setJsonRequest

        public void setJsonRequest(OslcRequest jsonRequest)
                            throws MXException
        Set OslcRequest (will be used for JSON only)
        Parameters:
        jsonRequest - OslcRequest object
        Throws:
        MXException
      • toString

        public java.lang.String toString()
        return a string for structure to be able to use the structure as a string anywhere such as in System.out.println
        Overrides:
        toString in class StructureObject