org.opennms.netmgt.config.notificationCommands
Class NotificationCommands

java.lang.Object
  extended by org.opennms.netmgt.config.notificationCommands.NotificationCommands
All Implemented Interfaces:
Serializable

public class NotificationCommands
extends Object
implements Serializable

Top-level element for the notificationCommands.xml configuration file.

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

Constructor Summary
NotificationCommands()
           
 
Method Summary
 void addCommand(Command vCommand)
           
 void addCommand(int index, Command vCommand)
           
 Enumeration<Command> enumerateCommand()
          Method enumerateCommand.
 Command[] getCommand()
          Method getCommand.Returns the contents of the collection in an Array.
 Command getCommand(int index)
          Method getCommand.
 List<Command> getCommandCollection()
          Method getCommandCollection.Returns a reference to '_commandList'.
 int getCommandCount()
          Method getCommandCount.
 Header getHeader()
          Returns the value of field 'header'.
 boolean isValid()
          Method isValid.
 Iterator<Command> iterateCommand()
          Method iterateCommand.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllCommand()
           
 boolean removeCommand(Command vCommand)
          Method removeCommand.
 Command removeCommandAt(int index)
          Method removeCommandAt.
 void setCommand(Command[] vCommandArray)
           
 void setCommand(int index, Command vCommand)
           
 void setCommand(List<Command> vCommandList)
          Sets the value of '_commandList' by copying the given Vector.
 void setCommandCollection(List<Command> commandList)
          Deprecated.  
 void setHeader(Header header)
          Sets the value of field 'header'.
static NotificationCommands 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

NotificationCommands

public NotificationCommands()
Method Detail

addCommand

public void addCommand(Command vCommand)
                throws IndexOutOfBoundsException
Parameters:
vCommand -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addCommand

public void addCommand(int index,
                       Command vCommand)
                throws IndexOutOfBoundsException
Parameters:
index -
vCommand -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateCommand

public Enumeration<Command> enumerateCommand()
Method enumerateCommand.

Returns:
an Enumeration over all possible elements of this collection

getCommand

public Command getCommand(int index)
                   throws IndexOutOfBoundsException
Method getCommand.

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

getCommand

public Command[] getCommand()
Method getCommand.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

getCommandCollection

public List<Command> getCommandCollection()
Method getCommandCollection.Returns a reference to '_commandList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getCommandCount

public int getCommandCount()
Method getCommandCount.

Returns:
the size of this collection

getHeader

public Header getHeader()
Returns the value of field 'header'.

Returns:
the value of field 'Header'.

isValid

public boolean isValid()
Method isValid.

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

iterateCommand

public Iterator<Command> iterateCommand()
Method iterateCommand.

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

removeAllCommand

public void removeAllCommand()

removeCommand

public boolean removeCommand(Command vCommand)
Method removeCommand.

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

removeCommandAt

public Command removeCommandAt(int index)
Method removeCommandAt.

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

setCommand

public void setCommand(int index,
                       Command vCommand)
                throws IndexOutOfBoundsException
Parameters:
index -
vCommand -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setCommand

public void setCommand(Command[] vCommandArray)
Parameters:
vCommandArray -

setCommand

public void setCommand(List<Command> vCommandList)
Sets the value of '_commandList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vCommandList - the Vector to copy.

setCommandCollection

public void setCommandCollection(List<Command> commandList)
Deprecated. 

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

Parameters:
commandList - the Vector to set.

setHeader

public void setHeader(Header header)
Sets the value of field 'header'.

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

unmarshal

public static NotificationCommands 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.notificationCommands.NotificationCommands
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.