# Class MailSpecifier

java.lang.Object
com.sun.grid.jsv.MailSpecifier

All Implemented Interfaces:
  `Serializable, Cloneable`

public final class MailSpecifier extends Object implements Cloneable, Serializable
The MailSpecifier class represents the occasions when an email notification should be sent to the mail recipients list about the state of this job.

Since:
  6.2u5
See Also:
  - `JobDescription.getMailSpecifier()`
  - `JobDescription.setMailSpecifier(com.sun.grid.jsv.MailSpecifier)`
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`NEVER_STR`
String representing that email should never be set.
`static final int`
`ON_ABORT`
Code representing that email should be sent if the job is abourted.
`static final String`
`ON_ABORT_STR`
String representing that email should be sent if the job is abourted.
`static final int`
`ON_BEGIN`
Code representing that email should be sent when the job is started.
`static final String`
`ON_BEGIN_STR`
String representing that email should be sent when the job is started.
`static final int`
`ON_END`
Code representing that email should be sent when the job ends.
`static final String`
`ON_END_STR`
String representing that email should be sent when the job ends.
`static final int`
`ON_SUSPEND`
Code representing that email should be sent if the job is suspended.
`static final String`
`ON_SUSPEND_STR`
String representing that email should be sent if the job is suspended.

## Constructor Summary

Constructors
Constructor
Description
`MailSpecifier()`

## Method Summary

Modifier and Type
Method
Description
`MailSpecifier`
`clone()`
`boolean`
`equals(Object obj)`
`byte`
`getOccasion()`
Return a byte value that represents the occasions when email should be sent about a job.
`String`
`getOccasionString()`
Return a String value that represents the occasions when email should be sent about a job.
`int`
`hashCode()`
`byte`
`never()`
Indicate that email should never be sent about a job.
`boolean`
`onAbort(boolean set)`
Set whether email should be sent if the job is aborted.
`boolean`
`onBegin(boolean set)`
Set whether email should be sent when the job is started.
`boolean`
`onEnd(boolean set)`
Set whether email should be sent when the job end.
`boolean`
`onSuspend(boolean set)`
Set whether email should be sent if the job is suspended.
`void`
`setOccasion(String value)`
Set the occasions when email should be sent for a job according to a String composed of the string identifiers for the occasions when email should be sent.
`String`
`toString()`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### NEVER_STR

public static final String NEVER_STR
String representing that email should never be set.

See Also:
  - Constant Field Values

### ON_ABORT

public static final int ON_ABORT
Code representing that email should be sent if the job is abourted.

See Also:
  - Constant Field Values

### ON_ABORT_STR

public static final String ON_ABORT_STR
String representing that email should be sent if the job is abourted.

See Also:
  - Constant Field Values

### ON_BEGIN

public static final int ON_BEGIN
Code representing that email should be sent when the job is started.

See Also:
  - Constant Field Values

### ON_BEGIN_STR

public static final String ON_BEGIN_STR
String representing that email should be sent when the job is started.

See Also:
  - Constant Field Values

### ON_END

public static final int ON_END
Code representing that email should be sent when the job ends.

See Also:
  - Constant Field Values

### ON_END_STR

public static final String ON_END_STR
String representing that email should be sent when the job ends.

See Also:
  - Constant Field Values

### ON_SUSPEND

public static final int ON_SUSPEND
Code representing that email should be sent if the job is suspended.

See Also:
  - Constant Field Values

### ON_SUSPEND_STR

public static final String ON_SUSPEND_STR
String representing that email should be sent if the job is suspended.

See Also:
  - Constant Field Values

## Constructor Details

### MailSpecifier

public MailSpecifier()

## Method Details

### onBegin

public boolean onBegin(boolean set)
Set whether email should be sent when the job is started.

Parameters:
  `set` - whether email should be sent
Returns:
  the previous value

### onEnd

public boolean onEnd(boolean set)
Set whether email should be sent when the job end.

Parameters:
  `set` - whether email should be sent
Returns:
  the previous value

### onAbort

public boolean onAbort(boolean set)
Set whether email should be sent if the job is aborted.

Parameters:
  `set` - whether email should be sent
Returns:
  the previous value

### onSuspend

public boolean onSuspend(boolean set)
Set whether email should be sent if the job is suspended.

Parameters:
  `set` - whether email should be sent
Returns:
  the previous value

### never

public byte never()
Indicate that email should never be sent about a job. This method effectively clears the flags for all the other occasions. Susequent calls to other methods may add or set the occasions when email is sent.

Returns:
  the previous occasion value, as would be returned from getOccasion().
See Also:
  - `getOccasion()`

### getOccasion

public byte getOccasion()
Return a byte value that represents the occasions when email should be sent about a job. The byte value is composed by ORing together the code values for all of the occasions when email should be sent.

Returns:
  the occasion value
See Also:
  - `ON_ABORT`
  - `ON_BEGIN`
  - `ON_END`
  - `ON_SUSPEND`

### setOccasion

public void setOccasion(String value)
Set the occasions when email should be sent for a job according to a String composed of the string identifiers for the occasions when email should be sent.

Parameters:
  `value` - the occasion string
See Also:
  - `ON_ABORT_STR`
  - `ON_BEGIN_STR`
  - `ON_END_STR`
  - `ON_SUSPEND_STR`

### getOccasionString

public String getOccasionString()
Return a String value that represents the occasions when email should be sent about a job. The String value is composed by combining the string identifiers for all of the occasions when email should be sent.

Returns:
  the occasion string
See Also:
  - `ON_ABORT_STR`
  - `ON_BEGIN_STR`
  - `ON_END_STR`
  - `ON_SUSPEND_STR`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### clone

public MailSpecifier clone()

Overrides:
  `clone` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`