org.opennms.netmgt.config.mailtransporttest
Class SendmailTest

java.lang.Object
  extended by org.opennms.netmgt.config.mailtransporttest.SendmailTest
All Implemented Interfaces:
Serializable

public class SendmailTest
extends Object
implements Serializable

This entity defines the test for sending mail. Attributes are used to derive values of java mail properties, or, they can be specified directly as key value pairs. Attributes will are easier to read but there isn't an attribute for every javamail property possible (some are fairly obscure).

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

Constructor Summary
SendmailTest()
           
 
Method Summary
 void addJavamailProperty(int index, JavamailProperty vJavamailProperty)
           
 void addJavamailProperty(JavamailProperty vJavamailProperty)
           
 void deleteAttemptInterval()
           
 void deleteDebug()
           
 void deleteUseAuthentication()
           
 void deleteUseJmta()
           
 Enumeration<JavamailProperty> enumerateJavamailProperty()
          Method enumerateJavamailProperty.
 long getAttemptInterval()
          Returns the value of field 'attemptInterval'.
 boolean getDebug()
          Returns the value of field 'debug'.
 JavamailProperty[] getJavamailProperty()
          Method getJavamailProperty.Returns the contents of the collection in an Array.
 JavamailProperty getJavamailProperty(int index)
          Method getJavamailProperty.
 List<JavamailProperty> getJavamailPropertyCollection()
          Method getJavamailPropertyCollection.Returns a reference to '_javamailPropertyList'.
 int getJavamailPropertyCount()
          Method getJavamailPropertyCount.
 SendmailHost getSendmailHost()
          Returns the value of field 'sendmailHost'.
 SendmailMessage getSendmailMessage()
          Returns the value of field 'sendmailMessage'.
 SendmailProtocol getSendmailProtocol()
          Returns the value of field 'sendmailProtocol'.
 boolean getUseAuthentication()
          Returns the value of field 'useAuthentication'.
 boolean getUseJmta()
          Returns the value of field 'useJmta'.
 UserAuth getUserAuth()
          Returns the value of field 'userAuth'.
 boolean hasAttemptInterval()
          Method hasAttemptInterval.
 boolean hasDebug()
          Method hasDebug.
 boolean hasUseAuthentication()
          Method hasUseAuthentication.
 boolean hasUseJmta()
          Method hasUseJmta.
 boolean isDebug()
          Returns the value of field 'debug'.
 boolean isUseAuthentication()
          Returns the value of field 'useAuthentication'.
 boolean isUseJmta()
          Returns the value of field 'useJmta'.
 boolean isValid()
          Method isValid.
 Iterator<JavamailProperty> iterateJavamailProperty()
          Method iterateJavamailProperty.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void removeAllJavamailProperty()
           
 boolean removeJavamailProperty(JavamailProperty vJavamailProperty)
          Method removeJavamailProperty.
 JavamailProperty removeJavamailPropertyAt(int index)
          Method removeJavamailPropertyAt.
 void setAttemptInterval(long attemptInterval)
          Sets the value of field 'attemptInterval'.
 void setDebug(boolean debug)
          Sets the value of field 'debug'.
 void setJavamailProperty(int index, JavamailProperty vJavamailProperty)
           
 void setJavamailProperty(JavamailProperty[] vJavamailPropertyArray)
           
 void setJavamailProperty(List<JavamailProperty> vJavamailPropertyList)
          Sets the value of '_javamailPropertyList' by copying the given Vector.
 void setJavamailPropertyCollection(List<JavamailProperty> javamailPropertyList)
          Deprecated.  
 void setSendmailHost(SendmailHost sendmailHost)
          Sets the value of field 'sendmailHost'.
 void setSendmailMessage(SendmailMessage sendmailMessage)
          Sets the value of field 'sendmailMessage'.
 void setSendmailProtocol(SendmailProtocol sendmailProtocol)
          Sets the value of field 'sendmailProtocol'.
 void setUseAuthentication(boolean useAuthentication)
          Sets the value of field 'useAuthentication'.
 void setUseJmta(boolean useJmta)
          Sets the value of field 'useJmta'.
 void setUserAuth(UserAuth userAuth)
          Sets the value of field 'userAuth'.
static SendmailTest 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

SendmailTest

public SendmailTest()
Method Detail

addJavamailProperty

public void addJavamailProperty(JavamailProperty vJavamailProperty)
                         throws IndexOutOfBoundsException
Parameters:
vJavamailProperty -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

addJavamailProperty

public void addJavamailProperty(int index,
                                JavamailProperty vJavamailProperty)
                         throws IndexOutOfBoundsException
Parameters:
index -
vJavamailProperty -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

deleteAttemptInterval

public void deleteAttemptInterval()

deleteDebug

public void deleteDebug()

deleteUseAuthentication

public void deleteUseAuthentication()

deleteUseJmta

public void deleteUseJmta()

enumerateJavamailProperty

public Enumeration<JavamailProperty> enumerateJavamailProperty()
Method enumerateJavamailProperty.

Returns:
an Enumeration over all possible elements of this collection

getAttemptInterval

public long getAttemptInterval()
Returns the value of field 'attemptInterval'.

Returns:
the value of field 'AttemptInterval'.

getDebug

public boolean getDebug()
Returns the value of field 'debug'.

Returns:
the value of field 'Debug'.

getJavamailProperty

public JavamailProperty getJavamailProperty(int index)
                                     throws IndexOutOfBoundsException
Method getJavamailProperty.

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

getJavamailProperty

public JavamailProperty[] getJavamailProperty()
Method getJavamailProperty.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

getJavamailPropertyCollection

public List<JavamailProperty> getJavamailPropertyCollection()
Method getJavamailPropertyCollection.Returns a reference to '_javamailPropertyList'. No type checking is performed on any modifications to the Vector.

Returns:
a reference to the Vector backing this class

getJavamailPropertyCount

public int getJavamailPropertyCount()
Method getJavamailPropertyCount.

Returns:
the size of this collection

getSendmailHost

public SendmailHost getSendmailHost()
Returns the value of field 'sendmailHost'. The field 'sendmailHost' has the following description: Define the host and port of the sendmail server. If you don't, defaults will be used and ${ipaddr} is replaced with the IP address of the service.

Returns:
the value of field 'SendmailHost'.

getSendmailMessage

public SendmailMessage getSendmailMessage()
Returns the value of field 'sendmailMessage'. The field 'sendmailMessage' has the following description: Define the to, from, subject, and body of a message. If not defined, one will be defined for your benefit (or confusion ;-)

Returns:
the value of field 'SendmailMessage'.

getSendmailProtocol

public SendmailProtocol getSendmailProtocol()
Returns the value of field 'sendmailProtocol'. The field 'sendmailProtocol' has the following description: Basically attributes that help setup the javamailer's confusion set of properties.

Returns:
the value of field 'SendmailProtocol'.

getUseAuthentication

public boolean getUseAuthentication()
Returns the value of field 'useAuthentication'.

Returns:
the value of field 'UseAuthentication'.

getUseJmta

public boolean getUseJmta()
Returns the value of field 'useJmta'.

Returns:
the value of field 'UseJmta'.

getUserAuth

public UserAuth getUserAuth()
Returns the value of field 'userAuth'. The field 'userAuth' has the following description: Configure user based authentication.

Returns:
the value of field 'UserAuth'.

hasAttemptInterval

public boolean hasAttemptInterval()
Method hasAttemptInterval.

Returns:
true if at least one AttemptInterval has been added

hasDebug

public boolean hasDebug()
Method hasDebug.

Returns:
true if at least one Debug has been added

hasUseAuthentication

public boolean hasUseAuthentication()
Method hasUseAuthentication.

Returns:
true if at least one UseAuthentication has been added

hasUseJmta

public boolean hasUseJmta()
Method hasUseJmta.

Returns:
true if at least one UseJmta has been added

isDebug

public boolean isDebug()
Returns the value of field 'debug'.

Returns:
the value of field 'Debug'.

isUseAuthentication

public boolean isUseAuthentication()
Returns the value of field 'useAuthentication'.

Returns:
the value of field 'UseAuthentication'.

isUseJmta

public boolean isUseJmta()
Returns the value of field 'useJmta'.

Returns:
the value of field 'UseJmta'.

isValid

public boolean isValid()
Method isValid.

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

iterateJavamailProperty

public Iterator<JavamailProperty> iterateJavamailProperty()
Method iterateJavamailProperty.

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

removeAllJavamailProperty

public void removeAllJavamailProperty()

removeJavamailProperty

public boolean removeJavamailProperty(JavamailProperty vJavamailProperty)
Method removeJavamailProperty.

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

removeJavamailPropertyAt

public JavamailProperty removeJavamailPropertyAt(int index)
Method removeJavamailPropertyAt.

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

setAttemptInterval

public void setAttemptInterval(long attemptInterval)
Sets the value of field 'attemptInterval'.

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

setDebug

public void setDebug(boolean debug)
Sets the value of field 'debug'.

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

setJavamailProperty

public void setJavamailProperty(int index,
                                JavamailProperty vJavamailProperty)
                         throws IndexOutOfBoundsException
Parameters:
index -
vJavamailProperty -
Throws:
IndexOutOfBoundsException - if the index given is outside the bounds of the collection

setJavamailProperty

public void setJavamailProperty(JavamailProperty[] vJavamailPropertyArray)
Parameters:
vJavamailPropertyArray -

setJavamailProperty

public void setJavamailProperty(List<JavamailProperty> vJavamailPropertyList)
Sets the value of '_javamailPropertyList' by copying the given Vector. All elements will be checked for type safety.

Parameters:
vJavamailPropertyList - the Vector to copy.

setJavamailPropertyCollection

public void setJavamailPropertyCollection(List<JavamailProperty> javamailPropertyList)
Deprecated. 

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

Parameters:
javamailPropertyList - the Vector to set.

setSendmailHost

public void setSendmailHost(SendmailHost sendmailHost)
Sets the value of field 'sendmailHost'. The field 'sendmailHost' has the following description: Define the host and port of the sendmail server. If you don't, defaults will be used and ${ipaddr} is replaced with the IP address of the service.

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

setSendmailMessage

public void setSendmailMessage(SendmailMessage sendmailMessage)
Sets the value of field 'sendmailMessage'. The field 'sendmailMessage' has the following description: Define the to, from, subject, and body of a message. If not defined, one will be defined for your benefit (or confusion ;-)

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

setSendmailProtocol

public void setSendmailProtocol(SendmailProtocol sendmailProtocol)
Sets the value of field 'sendmailProtocol'. The field 'sendmailProtocol' has the following description: Basically attributes that help setup the javamailer's confusion set of properties.

Parameters:
sendmailProtocol - the value of field 'sendmailProtocol'

setUseAuthentication

public void setUseAuthentication(boolean useAuthentication)
Sets the value of field 'useAuthentication'.

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

setUseJmta

public void setUseJmta(boolean useJmta)
Sets the value of field 'useJmta'.

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

setUserAuth

public void setUserAuth(UserAuth userAuth)
Sets the value of field 'userAuth'. The field 'userAuth' has the following description: Configure user based authentication.

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

unmarshal

public static SendmailTest 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.mailtransporttest.SendmailTest
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.