Class Requisition
- java.lang.Object
-
- org.opennms.netmgt.provision.persist.requisition.Requisition
-
- All Implemented Interfaces:
Serializable
,Comparable<Requisition>
public class Requisition extends Object implements Serializable, Comparable<Requisition>
Requisition class.
- Author:
- ranger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLGregorianCalendar
m_dateStamp
protected String
m_foreignSource
protected XMLGregorianCalendar
m_lastImport
protected List<RequisitionNode>
m_nodes
-
Constructor Summary
Constructors Constructor Description Requisition()
Constructor for Requisition.Requisition(String foreignSource)
Constructor for Requisition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Requisition obj)
compareTovoid
deleteNode(String foreignId)
deleteNodevoid
deleteNode(RequisitionNode node)
removeNodeboolean
equals(Object obj)
Date
getDate()
XMLGregorianCalendar
getDateStamp()
getDateStampString
getForeignSource()
getForeignSourceXMLGregorianCalendar
getLastImport()
getLastImportDate
getLastImportAsDate()
getLastImportRequisitionNode[]
getNode()
getNodeRequisitionNode
getNode(String foreignId)
getNodeint
getNodeCount()
getNodeCountOnmsNodeRequisition
getNodeRequistion(String foreignId)
getNodeRequistionList<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(Date date)
void
setDateStamp(XMLGregorianCalendar value)
setDateStampvoid
setForeignSource(String value)
setForeignSourcevoid
setLastImport(XMLGregorianCalendar value)
setLastImportvoid
setNodes(List<RequisitionNode> nodes)
setNodesvoid
setResource(org.springframework.core.io.Resource resource)
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 List<RequisitionNode> m_nodes
-
m_dateStamp
protected XMLGregorianCalendar m_dateStamp
-
m_foreignSource
protected String m_foreignSource
-
m_lastImport
protected XMLGregorianCalendar m_lastImport
-
-
Method Detail
-
getNode
public RequisitionNode getNode(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(String foreignId)
deleteNode
- Parameters:
foreignId
- aString
object.
-
getNode
public RequisitionNode[] getNode()
getNode
- Returns:
- an array of
RequisitionNode
objects.
-
getNodes
public List<RequisitionNode> getNodes()
getNodes
- Returns:
- a
List
object.
-
setNodes
public void setNodes(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 XMLGregorianCalendar getDateStamp()
getDateStamp
- Returns:
- a
XMLGregorianCalendar
object.
-
setDateStamp
public void setDateStamp(XMLGregorianCalendar value)
setDateStamp
- Parameters:
value
- aXMLGregorianCalendar
object.
-
updateDateStamp
public void updateDateStamp()
updateDateStamp
-
setForeignSource
public void setForeignSource(String value)
setForeignSource
- Parameters:
value
- aString
object.
-
getLastImport
public XMLGregorianCalendar getLastImport()
getLastImport
- Returns:
- a
XMLGregorianCalendar
object.
-
getLastImportAsDate
public Date getLastImportAsDate()
getLastImport
- Returns:
- a
XMLGregorianCalendar
object.
-
setLastImport
public void setLastImport(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(String foreignId)
getNodeRequistion
- Parameters:
foreignId
- aString
object.- Returns:
- a
OnmsNodeRequisition
object.
-
getNodeCount
public int getNodeCount()
getNodeCount
- Returns:
- a int.
-
compareTo
public int compareTo(Requisition obj)
compareTo
- Specified by:
compareTo
in interfaceComparable<Requisition>
- Parameters:
obj
- aRequisition
object.- Returns:
- a int.
-
validate
public void validate() throws ValidationException
Make sure that no data in the requisition is inconsistent. Nodes should be unique, interfaces should be unique per node, etc.- Throws:
ValidationException
-
getDate
public Date getDate()
-
setDate
public void setDate(Date date)
-
-