com.ibm.tivoli.maximo.oslc.provider

Class OslcRDFStructureObject

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    OslcRDFStructureData


    public class OslcRDFStructureObject
    extends StructureData
    SOSLC RDF Structure Object. It's a wrapper class around Resource to work with individual level
    • Field Detail

      • integrationLogger

        protected static final MXLogger integrationLogger
      • objectPath

        protected java.lang.String objectPath
      • messageType

        protected java.lang.String messageType
    • Constructor Detail

      • OslcRDFStructureObject

        public OslcRDFStructureObject(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 object 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
      • OslcRDFStructureObject

        public OslcRDFStructureObject(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
      • OslcRDFStructureObject

        public OslcRDFStructureObject(com.hp.hpl.jena.rdf.model.Resource data,
                                      java.lang.String mosName,
                                      java.lang.String path,
                                      java.lang.String messageType,
                                      UserInfo userInfo)
        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
      • OslcRDFStructureObject

        public OslcRDFStructureObject(org.jdom2.Element data)
        Construct the Structure Object object.
        Parameters:
        data - Current element.
      • OslcRDFStructureObject

        public OslcRDFStructureObject()
    • Method Detail

      • getName

        public java.lang.String getName()
        Get Name of the Element
        Overrides:
        getName in class StructureObject
        Returns:
        name of the element
      • getObjectPath

        public java.lang.String getObjectPath()
        Get Object Path of the object
        Returns:
        object path
      • getUserInfo

        public UserInfo getUserInfo()
        Get User Info object
        Returns:
        user info
      • createChildrenData

        public void createChildrenData(java.lang.String name)
        Create Child level from current level
        Overrides:
        createChildrenData in class StructureObject
        Parameters:
        name - Name of the child level. This will still maintain the current data pointer to the current level and not move to the child level.
      • getChildrenData

        public java.util.List getChildrenData(java.lang.String childPath)
        Get list of Elements for the given tag name
        Overrides:
        getChildrenData in class StructureObject
        Parameters:
        tag - The name of the child level.
        Returns:
        list of Elements for the given tag name
      • hasDetailData

        public boolean hasDetailData(java.lang.String childPath)
        Return TRUE or FALSE depending of null value in the column
        Overrides:
        hasDetailData in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Indicator for data to be null or not null
      • getChildrenData

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

        public boolean hasChildren()
        Get child Elements as a list
        Overrides:
        hasChildren in class StructureObject
        Returns:
        list of Element for children
      • isCurrentActionNull

        public boolean isCurrentActionNull()
        Determine whether Action of the current data of Structure Object is null
        Overrides:
        isCurrentActionNull in class StructureObject
        Returns:
        true is Action is null or empty string, false otherwise
      • getCurrentData

        public org.jdom2.Element getCurrentData()
        Return currentData Element
        Overrides:
        getCurrentData in class StructureObject
        Returns:
        Current Element
      • getCurrentRDFData

        protected com.hp.hpl.jena.rdf.model.Resource getCurrentRDFData()
        Return currentData Element
        Returns:
        Current Element
      • getParentData

        public org.jdom2.Element getParentData()
        Return parentData Element
        Overrides:
        getParentData in class StructureObject
        Returns:
        Parent object
      • getAttr

        public java.lang.String getAttr(java.lang.String col,
                                        java.lang.String attr)
        Return Attribute Value if Attribute found else return null
        Overrides:
        getAttr in class StructureObject
        Parameters:
        col - Give column name.
        attr - Give Attribute name.
        Returns:
        attribute value
      • getAttr

        public java.lang.String getAttr(java.lang.String attr)
        Return Attribute Value from current level if Attribute found else return null
        Overrides:
        getAttr in class StructureObject
        Parameters:
        attr - Give Attribute name.
        Returns:
        attribute value
      • removeFromCurrentData

        public void removeFromCurrentData(java.lang.String col)
        Remove a column from the current data
        Overrides:
        removeFromCurrentData in class StructureObject
        Parameters:
        col - Give element name to remove.
      • removeChildData

        public void removeChildData(java.lang.String childName,
                                    int index)
        Remove the specified child of the CurrentData Element at the specified index.
        Overrides:
        removeChildData in class StructureObject
        Parameters:
        childName - Give element name to remove.
        index - Give index of the element to remove.
      • removeChildren

        public void removeChildren(java.lang.String childName)
        Remove the specified child of the CurrentData Element
        Overrides:
        removeChildren in class StructureObject
        Parameters:
        childName - Give column name.
      • getCurrentData

        public java.lang.String getCurrentData(java.lang.String col)
                                        throws MXException
        Return value for the column name in CurrentData Element as String Value
        Overrides:
        getCurrentData in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getRowStamp

        public java.lang.String getRowStamp()
                                     throws MXException
        Return value for the column name in CurrentData Element as String Value
        Overrides:
        getRowStamp in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getCurrentDataAsBytes

        public byte[] getCurrentDataAsBytes(java.lang.String col)
                                     throws MXException
        Return value for the column name in CurrentData Element as byte Value
        Overrides:
        getCurrentDataAsBytes in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getCurrentDataAsBinaryText

        public java.lang.String getCurrentDataAsBinaryText(java.lang.String col)
                                                    throws MXException
        Return value for the column name in CurrentData Element as binary text
        Overrides:
        getCurrentDataAsBinaryText in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getParentData

        public java.lang.String getParentData(java.lang.String col)
        Return value for the column name from the parent Data Element as String Value
        Overrides:
        getParentData in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from parent level
      • isCurrentDataNull

        public boolean isCurrentDataNull(java.lang.String col)
                                  throws MXException
        Return TRUE or FALSE depending of null value in the column
        Overrides:
        isCurrentDataNull in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Indicator for data to be null or not null
        Throws:
        MXException
      • isGLDataNull

        public boolean isGLDataNull(java.lang.String col)
                             throws MXException
        Return TRUE or FALSE depending of null value in the GL column
        Overrides:
        isGLDataNull in class StructureObject
        Parameters:
        col - Give GL column name.
        Returns:
        Indicator for data to be null or not null
        Throws:
        MXException
      • isGLDataNull

        public boolean isGLDataNull(java.lang.String col,
                                    java.lang.String orgId)
                             throws MXException
        Return TRUE or FALSE depending of null value in the GL column
        Overrides:
        isGLDataNull in class StructureObject
        Parameters:
        col - Give GL column name.
        orgId - Give organization.
        Returns:
        Indicator for data to be null or not null
        Throws:
        MXException
      • isInCurrentData

        public boolean isInCurrentData(java.lang.String col)
        Return TRUE or FALSE depending of null value in the column
        Overrides:
        isInCurrentData in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Indicator for data to be null or not null
      • isCurrentDataChanged

        public boolean isCurrentDataChanged(java.lang.String col)
        Return TRUE or FALSE depending of null value in the column
        Overrides:
        isCurrentDataChanged in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Indicator for data to be null or not null
      • getCurrentDataAsDouble

        public double getCurrentDataAsDouble(java.lang.String col)
                                      throws MXException
        Return value for the column name in CurrentData Element as double
        Overrides:
        getCurrentDataAsDouble in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level as double
        Throws:
        MXException
      • getCurrentDataAsInt

        public int getCurrentDataAsInt(java.lang.String col)
                                throws MXException
        Return value for the column name in CurrentData Element as integer
        Overrides:
        getCurrentDataAsInt in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level as integer
        Throws:
        MXException
      • getCurrentDataAsLong

        public long getCurrentDataAsLong(java.lang.String col)
                                  throws MXException
        Return value for the column name in CurrentData Element as long
        Overrides:
        getCurrentDataAsLong in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level as long
        Throws:
        MXException
      • getCurrentDataAsDate

        public java.util.Date getCurrentDataAsDate(java.lang.String col)
                                            throws MXException
        Return value for the column name in CurrentData Element as date
        Overrides:
        getCurrentDataAsDate in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level as date
        Throws:
        MXException
      • getCurrentDataAsBoolean

        public boolean getCurrentDataAsBoolean(java.lang.String col)
                                        throws MXException
        Return value for the column name in CurrentData Element as boolean
        Overrides:
        getCurrentDataAsBoolean in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level as boolean
        Throws:
        MXException
      • getCurrentDataAsElement

        public org.jdom2.Element getCurrentDataAsElement(java.lang.String key)
        Return value for the column name in CurrentData Element as Element object
        Overrides:
        getCurrentDataAsElement in class StructureObject
        Parameters:
        key - Give key name.
        Returns:
        Column value from current level as Element object
      • getCurrentDataAsList

        public java.util.List getCurrentDataAsList(java.lang.String key)
        Return value for the column name in CurrentData Element as Element Array object
        Overrides:
        getCurrentDataAsList in class StructureObject
        Parameters:
        key - Give key name.
        Returns:
        Column value from current level as Element Array object
      • getGL

        public java.lang.String getGL(java.lang.String col)
                               throws MXException
        Return value for the GL column name in CurrentData Element as String Value
        Overrides:
        getGL in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getGL

        public java.lang.String getGL(java.lang.String col,
                                      java.lang.String orgId)
                               throws MXException
        Return value for the GL column name in CurrentData Element as String Value
        Overrides:
        getGL in class StructureObject
        Parameters:
        col - Give column name.
        orgId - Give organization.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getGLComponent

        public java.lang.String getGLComponent(java.lang.String col,
                                               int order,
                                               java.lang.String orgId)
                                        throws MXException
        Return value GL component for the specified order
        Overrides:
        getGLComponent in class StructureObject
        Parameters:
        col - Give column name.
        order - GL order.
        orgId - the ORGID.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getCurrentAction

        public java.lang.String getCurrentAction()
        Return value for the current level action
        Overrides:
        getCurrentAction in class StructureObject
        Returns:
        in CurrentData Element as String Value
      • setCurrentData

        public void setCurrentData(java.lang.String colname,
                                   java.lang.String data)
        Add element to Current Data Element object as string
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        col - Give column name.
        data - Give column value as string.
      • setCurrentData

        protected org.jdom2.Element setCurrentData(java.lang.String colname)
        Add element to Current Data Element object
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        colname - Give column name.
        Returns:
        element which was added
      • setCurrentAction

        public void setCurrentAction(java.lang.String action)
        Set current Element action
        Overrides:
        setCurrentAction in class StructureObject
        Parameters:
        action - action value to be set.
      • setCurrentDataNull

        public void setCurrentDataNull(java.lang.String colname)
        Set data in current data to null
        Overrides:
        setCurrentDataNull in class StructureObject
        Parameters:
        colname - Give column name.
      • setCurrentData

        public void setCurrentData(java.lang.String colname,
                                   java.util.Date data)
        Put element to Current Data Element object as date
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        colname - Give column name.
        data - Give column value as date.
      • setCurrentData

        public void setCurrentData(java.lang.String colname,
                                   double data)
        Put element to Current Data Element object as double
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        colname - Give column name.
        data - Give column value as double.
      • setCurrentData

        public void setCurrentData(java.lang.String colname,
                                   long data)
        Put element to Current Data Element object as long
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        colname - Give column name.
        data - Give column value as long.
      • setCurrentData

        public void setCurrentData(java.lang.String colname,
                                   int data)
        Put element to Current Data Element object as integer
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        colname - Give column name.
        data - Give column value as integer.
      • setCurrentData

        public void setCurrentData(java.lang.String colname,
                                   byte[] data)
                            throws MXException
        Put element to Current Data Element object as bytes
        Overrides:
        setCurrentData in class StructureObject
        Parameters:
        colname - Give column name.
        data - Give column value as bytes.
        Throws:
        MXException
      • setGL

        public void setGL(java.lang.String colname,
                          java.lang.String[] glSegments,
                          java.lang.String orgId)
                   throws MXException
        Construct and set the GLAccount from the given gl segments
        Overrides:
        setGL in class StructureObject
        Parameters:
        colname - the column name
        glSegments - the gl segments array
        orgId - the organization
        Throws:
        MXException
      • setGL

        public void setGL(java.lang.String colname,
                          java.lang.String glString)
        Construct and set the GLAccount from the given gl string
        Overrides:
        setGL in class StructureObject
        Parameters:
        colname - the column name
        glString - the gl segments array
      • getCurrentDataAsString

        public java.lang.String getCurrentDataAsString(java.lang.String col)
                                                throws MXException
        Return value for the column name in CurrentData Element as String Value
        Overrides:
        getCurrentDataAsString in class StructureObject
        Parameters:
        col - Give column name.
        Returns:
        Column value from current level
        Throws:
        MXException
      • getCurrentNamespacePrefix

        public java.lang.String getCurrentNamespacePrefix()
        Return current namespace value
        Overrides:
        getCurrentNamespacePrefix in class StructureObject
        Returns:
        Current Namespace prefix value
      • getCurrentNamespaceURI

        public java.lang.String getCurrentNamespaceURI()
        Return current namespace URI value
        Overrides:
        getCurrentNamespaceURI in class StructureObject
        Returns:
        Current Namespace value
      • setCurrentNamespace

        public void setCurrentNamespace(java.lang.String pref,
                                        java.lang.String uri)
        Set current Namespace value
        Overrides:
        setCurrentNamespace in class StructureObject
        Parameters:
        pref - Give Namespace prefix value.
        uri - Give Namespace uri value.
      • getNamespaces

        public java.util.Map getNamespaces()
        Get Map of all Namespaces
        Overrides:
        getNamespaces in class StructureObject
        Returns:
        map of Namespaces
      • setNamespaces

        public void setNamespaces(java.lang.String key,
                                  java.lang.String data)
        Set Map of all Namespaces
        Overrides:
        setNamespaces in class StructureObject
        Parameters:
        key - key to access namespace
        data - namespace
      • getOverrideType

        public int getOverrideType(java.lang.String col,
                                   int currentType)
                            throws MXException
        Return current type of the field
        Overrides:
        getOverrideType in class StructureObject
        Parameters:
        col - Give column name.
        currentType - max type
        Returns:
        max type.
        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 StructureData