org.opennms.netmgt.config.xmlrpcd
Class Subscription

java.lang.Object
  extended by org.opennms.netmgt.config.xmlrpcd.Subscription
All Implemented Interfaces:
Serializable

public class Subscription
extends Object
implements Serializable

Subscription defines a set of events that an external XMLRPC server interested, and need OpenNMS to give notification via XMLRPC protocol

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

Constructor Summary
Subscription()
           
 
Method Summary
 void addSubscribedEvent(int index, SubscribedEvent vSubscribedEvent)
           
 void addSubscribedEvent(SubscribedEvent vSubscribedEvent)
           
 Enumeration<SubscribedEvent> enumerateSubscribedEvent()
          Method enumerateSubscribedEvent.
 String getName()
          Returns the value of field 'name'.
 SubscribedEvent[] getSubscribedEvent()
          Method getSubscribedEvent.Returns the contents of the collection in an Array.
 SubscribedEvent getSubscribedEvent(int index)
          Method getSubscribedEvent.
 List<SubscribedEvent> getSubscribedEventCollection()
          Method getSubscribedEventCollection.Returns a reference to '_subscribedEventList'.
 int getSubscribedEventCount()
          Method getSubscribedEventCount.
 boolean isValid()
          Method isValid.
 Iterator<SubscribedEvent> iterateSubscribedEvent()
          Method iterateSubscribedEvent.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllSubscribedEvent()
           
 boolean removeSubscribedEvent(SubscribedEvent vSubscribedEvent)
          Method removeSubscribedEvent.
 SubscribedEvent removeSubscribedEventAt(int index)
          Method removeSubscribedEventAt.
 void setName(String name)
          Sets the value of field 'name'.
 void setSubscribedEvent(int index, SubscribedEvent vSubscribedEvent)
           
 void setSubscribedEvent(List<SubscribedEvent> vSubscribedEventList)
          Sets the value of '_subscribedEventList' by copying the given Vector.
 void setSubscribedEvent(SubscribedEvent[] vSubscribedEventArray)
           
 void setSubscribedEventCollection(List<SubscribedEvent> subscribedEventList)
          Deprecated.  
static Subscription 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

Subscription

public Subscription()
Method Detail

addSubscribedEvent

public void addSubscribedEvent(SubscribedEvent vSubscribedEvent)
                        throws IndexOutOfBoundsException
Parameters:
vSubscribedEvent -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addSubscribedEvent

public void addSubscribedEvent(int index,
                               SubscribedEvent vSubscribedEvent)
                        throws IndexOutOfBoundsException
Parameters:
index -
vSubscribedEvent -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

enumerateSubscribedEvent

public Enumeration<SubscribedEvent> enumerateSubscribedEvent()
Method enumerateSubscribedEvent.

Returns:
an Enumeration over all possible elements of this collection

getName

public String getName()
Returns the value of field 'name'. The field 'name' has the following description: Name of subscription

Returns:
the value of field 'Name'.

getSubscribedEvent

public SubscribedEvent getSubscribedEvent(int index)
                                   throws IndexOutOfBoundsException
Method getSubscribedEvent.

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

getSubscribedEvent

public SubscribedEvent[] getSubscribedEvent()
Method getSubscribedEvent.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

getSubscribedEventCollection

public List<SubscribedEvent> getSubscribedEventCollection()
Method getSubscribedEventCollection.Returns a reference to '_subscribedEventList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getSubscribedEventCount

public int getSubscribedEventCount()
Method getSubscribedEventCount.

Returns:
the size of this collection

isValid

public boolean isValid()
Method isValid.

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

iterateSubscribedEvent

public Iterator<SubscribedEvent> iterateSubscribedEvent()
Method iterateSubscribedEvent.

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

removeAllSubscribedEvent

public void removeAllSubscribedEvent()

removeSubscribedEvent

public boolean removeSubscribedEvent(SubscribedEvent vSubscribedEvent)
Method removeSubscribedEvent.

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

removeSubscribedEventAt

public SubscribedEvent removeSubscribedEventAt(int index)
Method removeSubscribedEventAt.

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

setName

public void setName(String name)
Sets the value of field 'name'. The field 'name' has the following description: Name of subscription

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

setSubscribedEvent

public void setSubscribedEvent(int index,
                               SubscribedEvent vSubscribedEvent)
                        throws IndexOutOfBoundsException
Parameters:
index -
vSubscribedEvent -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setSubscribedEvent

public void setSubscribedEvent(SubscribedEvent[] vSubscribedEventArray)
Parameters:
vSubscribedEventArray -

setSubscribedEvent

public void setSubscribedEvent(List<SubscribedEvent> vSubscribedEventList)
Sets the value of '_subscribedEventList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vSubscribedEventList - the Vector to copy.

setSubscribedEventCollection

public void setSubscribedEventCollection(List<SubscribedEvent> subscribedEventList)
Deprecated. 

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

Parameters:
subscribedEventList - the Vector to set.

unmarshal

public static Subscription 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.xmlrpcd.Subscription
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.