Class Requisition
- java.lang.Object
-
- org.opennms.netmgt.provision.persist.requisition.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 Summary
Fields Modifier and Type Field Description protected javax.xml.datatype.XMLGregorianCalendar
m_dateStamp
protected java.lang.String
m_foreignSource
protected javax.xml.datatype.XMLGregorianCalendar
m_lastImport
protected java.util.List<RequisitionNode>
m_nodes
-
Constructor Summary
Constructors Constructor Description Requisition()
Constructor for Requisition.Requisition(java.lang.String foreignSource)
Constructor for Requisition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Requisition obj)
compareTovoid
deleteNode(java.lang.String foreignId)
deleteNodevoid
deleteNode(RequisitionNode node)
removeNodeboolean
equals(java.lang.Object obj)
java.util.Date
getDate()
javax.xml.datatype.XMLGregorianCalendar
getDateStamp()
getDateStampjava.lang.String
getForeignSource()
getForeignSourcejavax.xml.datatype.XMLGregorianCalendar
getLastImport()
getLastImportjava.util.Date
getLastImportAsDate()
getLastImportRequisitionNode[]
getNode()
getNodeRequisitionNode
getNode(java.lang.String foreignId)
getNodeint
getNodeCount()
getNodeCountOnmsNodeRequisition
getNodeRequistion(java.lang.String foreignId)
getNodeRequistionjava.util.List<RequisitionNode>
getNodes()
getNodesorg.springframework.core.io.Resource
getResource()
Get the resource (if any) this requisition is associated with.int
hashCode()
void
insertNode(RequisitionNode node)
insertNodevoid
putNode(RequisitionNode node)
putNodevoid
setDate(java.util.Date date)
void
setDateStamp(javax.xml.datatype.XMLGregorianCalendar value)
setDateStampvoid
setForeignSource(java.lang.String value)
setForeignSourcevoid
setLastImport(javax.xml.datatype.XMLGregorianCalendar value)
setLastImportvoid
setNodes(java.util.List<RequisitionNode> nodes)
setNodesvoid
setResource(org.springframework.core.io.Resource resource)
java.lang.String
toString()
void
updateDateStamp()
updateDateStampvoid
updateLastImported()
Update the last imported stamp to the current date and timevoid
validate()
Make sure that no data in the requisition is inconsistent.void
visit(RequisitionVisitor visitor)
visit
-
-
-
Field Detail
-
m_nodes
protected java.util.List<RequisitionNode> m_nodes
-
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
-
-
Method Detail
-
getNode
public RequisitionNode getNode(java.lang.String foreignId)
getNode
- Parameters:
foreignId
- aString
object.- Returns:
- a
RequisitionNode
object.
-
deleteNode
public void deleteNode(RequisitionNode node)
removeNode
- Parameters:
node
- aRequisitionNode
object.
-
deleteNode
public void deleteNode(java.lang.String foreignId)
deleteNode
- Parameters:
foreignId
- aString
object.
-
getNode
public RequisitionNode[] getNode()
getNode
- Returns:
- an array of
RequisitionNode
objects.
-
getNodes
public java.util.List<RequisitionNode> getNodes()
getNodes
- Returns:
- a
List
object.
-
setNodes
public void setNodes(java.util.List<RequisitionNode> nodes)
setNodes
- Parameters:
nodes
- aList
object.
-
insertNode
public void insertNode(RequisitionNode node)
insertNode
- Parameters:
node
- aRequisitionNode
object.
-
putNode
public void putNode(RequisitionNode node)
putNode
- Parameters:
node
- aRequisitionNode
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
- aXMLGregorianCalendar
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
- aString
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
- aXMLGregorianCalendar
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)
-
visit
public void visit(RequisitionVisitor visitor)
visit
- Parameters:
visitor
- aRequisitionVisitor
object.
-
getNodeRequistion
public OnmsNodeRequisition getNodeRequistion(java.lang.String foreignId)
getNodeRequistion
- Parameters:
foreignId
- aString
object.- Returns:
- a
OnmsNodeRequisition
object.
-
getNodeCount
public int getNodeCount()
getNodeCount
- Returns:
- a int.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(Requisition obj)
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<Requisition>
- Parameters:
obj
- aRequisition
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)
-
-