org.opennms.netmgt.config.modelimport
Class ModelImport

java.lang.Object
  extended by org.opennms.netmgt.config.modelimport.ModelImport
All Implemented Interfaces:
Serializable

public class ModelImport
extends Object
implements Serializable

Use this configuration file as an import of nodes, interfaces, and services to OpenNMS by-passing several phases of discovery and capabilities polling.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
ModelImport()
           
 
Method Summary
 void addNode(int index, Node vNode)
           
 void addNode(Node vNode)
           
 Enumeration<Node> enumerateNode()
          Method enumerateNode.
 Date getDateStamp()
          Returns the value of field 'dateStamp'.
 String getForeignSource()
          Returns the value of field 'foreignSource'.
 Date getLastImport()
          Returns the value of field 'lastImport'.
 Node[] getNode()
          Method getNode.Returns the contents of the collection in an Array.
 Node getNode(int index)
          Method getNode.
 List<Node> getNodeCollection()
          Method getNodeCollection.Returns a reference to '_nodeList'.
 int getNodeCount()
          Method getNodeCount.
 boolean isValid()
          Method isValid.
 Iterator<Node> iterateNode()
          Method iterateNode.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllNode()
           
 boolean removeNode(Node vNode)
          Method removeNode.
 Node removeNodeAt(int index)
          Method removeNodeAt.
 void setDateStamp(Date dateStamp)
          Sets the value of field 'dateStamp'.
 void setForeignSource(String foreignSource)
          Sets the value of field 'foreignSource'.
 void setLastImport(Date lastImport)
          Sets the value of field 'lastImport'.
 void setNode(int index, Node vNode)
           
 void setNode(List<Node> vNodeList)
          Sets the value of '_nodeList' by copying the given Vector.
 void setNode(Node[] vNodeArray)
           
 void setNodeCollection(List<Node> nodeList)
          Deprecated.  
static ModelImport unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelImport

public ModelImport()
Method Detail

addNode

public void addNode(Node vNode)
             throws IndexOutOfBoundsException
Parameters:
vNode -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addNode

public void addNode(int index,
                    Node vNode)
             throws IndexOutOfBoundsException
Parameters:
index -
vNode -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateNode

public Enumeration<Node> enumerateNode()
Method enumerateNode.

Returns:
an Enumeration over all possible elements of this collection

getDateStamp

public Date getDateStamp()
Returns the value of field 'dateStamp'.

Returns:
the value of field 'DateStamp'.

getForeignSource

public String getForeignSource()
Returns the value of field 'foreignSource'.

Returns:
the value of field 'ForeignSource'.

getLastImport

public Date getLastImport()
Returns the value of field 'lastImport'.

Returns:
the value of field 'LastImport'.

getNode

public Node getNode(int index)
             throws IndexOutOfBoundsException
Method getNode.

Parameters:
index -
Returns:
the value of the org.opennms.netmgt.config.modelimport.Node at the given index
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

getNode

public Node[] getNode()
Method getNode.Returns the contents of the collection in an Array.

Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.

Returns:
this collection as an Array

getNodeCollection

public List<Node> getNodeCollection()
Method getNodeCollection.Returns a reference to '_nodeList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getNodeCount

public int getNodeCount()
Method getNodeCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

iterateNode

public Iterator<Node> iterateNode()
Method iterateNode.

Returns:
an Iterator over all possible elements in this collection

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

removeAllNode

public void removeAllNode()

removeNode

public boolean removeNode(Node vNode)
Method removeNode.

Parameters:
vNode -
Returns:
true if the object was removed from the collection.

removeNodeAt

public Node removeNodeAt(int index)
Method removeNodeAt.

Parameters:
index -
Returns:
the element removed from the collection

setDateStamp

public void setDateStamp(Date dateStamp)
Sets the value of field 'dateStamp'.

Parameters:
dateStamp - the value of field 'dateStamp'.

setForeignSource

public void setForeignSource(String foreignSource)
Sets the value of field 'foreignSource'.

Parameters:
foreignSource - the value of field 'foreignSource'.

setLastImport

public void setLastImport(Date lastImport)
Sets the value of field 'lastImport'.

Parameters:
lastImport - the value of field 'lastImport'.

setNode

public void setNode(int index,
                    Node vNode)
             throws IndexOutOfBoundsException
Parameters:
index -
vNode -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setNode

public void setNode(Node[] vNodeArray)
Parameters:
vNodeArray -

setNode

public void setNode(List<Node> vNodeList)
Sets the value of '_nodeList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vNodeList - the Vector to copy.

setNodeCollection

public void setNodeCollection(List<Node> nodeList)
Deprecated. 

Sets the value of '_nodeList' by setting it to the given Vector. No type checking is performed.

Parameters:
nodeList - the Vector to set.

unmarshal

public static ModelImport unmarshal(Reader reader)
                             throws org.exolab.castor.xml.MarshalException,
                                    org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.modelimport.ModelImport
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright © 2008. All Rights Reserved.