Class Requisition

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Requisition>

    public class Requisition
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Requisition>

    Requisition class.

    Author:
    ranger
    See Also:
    Serialized Form
    • Field Detail

      • m_dateStamp

        protected javax.xml.datatype.XMLGregorianCalendar m_dateStamp
      • m_foreignSource

        protected java.lang.String m_foreignSource
      • m_lastImport

        protected javax.xml.datatype.XMLGregorianCalendar m_lastImport
    • Constructor Detail

      • Requisition

        public Requisition()

        Constructor for Requisition.

      • Requisition

        public Requisition​(java.lang.String foreignSource)

        Constructor for Requisition.

        Parameters:
        foreignSource - a String object.
    • Method Detail

      • getNode

        public RequisitionNode getNode​(java.lang.String foreignId)

        getNode

        Parameters:
        foreignId - a String object.
        Returns:
        a RequisitionNode object.
      • deleteNode

        public void deleteNode​(java.lang.String foreignId)

        deleteNode

        Parameters:
        foreignId - a String object.
      • getNodes

        public java.util.List<RequisitionNode> getNodes()

        getNodes

        Returns:
        a List object.
      • setNodes

        public void setNodes​(java.util.List<RequisitionNode> nodes)

        setNodes

        Parameters:
        nodes - a List object.
      • getDateStamp

        public javax.xml.datatype.XMLGregorianCalendar getDateStamp()

        getDateStamp

        Returns:
        a XMLGregorianCalendar object.
      • setDateStamp

        public void setDateStamp​(javax.xml.datatype.XMLGregorianCalendar value)

        setDateStamp

        Parameters:
        value - a XMLGregorianCalendar object.
      • updateDateStamp

        public void updateDateStamp()

        updateDateStamp

      • getForeignSource

        public java.lang.String getForeignSource()

        getForeignSource

        Returns:
        a String object.
      • setForeignSource

        public void setForeignSource​(java.lang.String value)

        setForeignSource

        Parameters:
        value - a String object.
      • getLastImport

        public javax.xml.datatype.XMLGregorianCalendar getLastImport()

        getLastImport

        Returns:
        a XMLGregorianCalendar object.
      • getLastImportAsDate

        public java.util.Date getLastImportAsDate()

        getLastImport

        Returns:
        a XMLGregorianCalendar object.
      • setLastImport

        public void setLastImport​(javax.xml.datatype.XMLGregorianCalendar value)

        setLastImport

        Parameters:
        value - a XMLGregorianCalendar object.
      • updateLastImported

        public void updateLastImported()
        Update the last imported stamp to the current date and time
      • getResource

        public org.springframework.core.io.Resource getResource()
        Get the resource (if any) this requisition is associated with.
        Returns:
        a Resource representing the location of the requisition file
      • setResource

        public void setResource​(org.springframework.core.io.Resource resource)
      • getNodeRequistion

        public OnmsNodeRequisition getNodeRequistion​(java.lang.String foreignId)

        getNodeRequistion

        Parameters:
        foreignId - a String object.
        Returns:
        a OnmsNodeRequisition object.
      • getNodeCount

        public int getNodeCount()

        getNodeCount

        Returns:
        a int.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Requisition obj)

        compareTo

        Specified by:
        compareTo in interface java.lang.Comparable<Requisition>
        Parameters:
        obj - a Requisition object.
        Returns:
        a int.
      • validate

        public void validate()
                      throws javax.xml.bind.ValidationException
        Make sure that no data in the requisition is inconsistent. Nodes should be unique, interfaces should be unique per node, etc.
        Throws:
        javax.xml.bind.ValidationException
      • getDate

        public java.util.Date getDate()
      • setDate

        public void setDate​(java.util.Date date)