Package com.sun.grid.jsv

# Class CheckpointSpecifier

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

All Implemented Interfaces:
  `Serializable`, `Cloneable`

public final class CheckpointSpecifier extends Object implements Cloneable, Serializable
The CheckpointSpecifier class represents the checkpointing environment settings for a job, including the name of the checkpoint environment to use and the frequency with which checkpoints should be taken.

Since:
  6.2u5
See Also:
  - `JobDescription.getCheckpointSpecifier()`
  - `JobDescription.setCheckpointSpecifier(com.sun.grid.jsv.CheckpointSpecifier)`
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`NEVER_STR`
String indicating that checkpoints should never be taken.
`static final byte`
`ON_MIN_CPU_INTERVAL`
Code indicating that checkpoints should be taken periodically at the minimum CPU interval as specified by the queue.
`static final String`
`ON_MIN_CPU_INTERVAL_STR`
String indicating that checkpoints should be taken periodically at the minimum CPU interval as specified by the queue.
`static final byte`
`ON_SHUTDOWN`
Code indicating that checkpoints should be taken when the execd shuts down
`static final String`
`ON_SHUTDOWN_STR`
Value indicating that checkpoints should be taken when the execd shuts down
`static final byte`
`ON_SUSPEND`
Code indicating that checkpoints should be taken the job is suspended.
`static final String`
`ON_SUSPEND_STR`
String indicating that checkpoints should be taken the job is suspended.

## Constructor Summary

Constructors
Constructor
Description
`CheckpointSpecifier()`

## Method Summary

Modifier and Type
Method
Description
`CheckpointSpecifier`
`clone()`
`boolean`
`equals(Object obj)`
`long`
`getInterval()`
Get the number of seconds between checkpoints.
`String`
`getName()`
Get the name of the checkpointing environment.
`byte`
`getOccasion()`
Get a byte value that represents the occasions when the job should be checkpointed.
`String`
`getOccasionString()`
Get an occasion string that represents the occasions when the job should be checkpointed.
`int`
`hashCode()`
`byte`
`never()`
Indicate that a checkpoint should never be taken.
`boolean`
`onMinCpuInterval(boolean set)`
Set whether a checkpoint should be taken periodically at the minimum CPU interval as specified by the queue.
`boolean`
`onShutdown(boolean set)`
Set whether a checkpoint should be taken when the execution daemon shuts down.
`boolean`
`onSuspend(boolean set)`
Set whether a checkpoint should be taken when the job is suspended.
`long`
`setInterval(int hours, int minutes, int seconds)`
Set the interval at which checkpoints should be taken.
`long`
`setInterval(long sec)`
Set the interval at which checkpoints should be taken.
`void`
`setName(String name)`
Set the name of the checkpointing environment.
`void`
`setOccasion(String value)`
Set the occasions when the job should be checkpointed according to a a String composed by combining the string values for the occasions when the job should be checkpointed.
`String`
`toString()`

### Methods inherited from class java.lang.Object

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

## Field Details

### NEVER_STR

public static final String NEVER_STR
String indicating that checkpoints should never be taken.

See Also:
  - Constant Field Values

### ON_SHUTDOWN

public static final byte ON_SHUTDOWN
Code indicating that checkpoints should be taken when the execd shuts down

See Also:
  - Constant Field Values

### ON_SHUTDOWN_STR

public static final String ON_SHUTDOWN_STR
Value indicating that checkpoints should be taken when the execd shuts down

See Also:
  - Constant Field Values

### ON_MIN_CPU_INTERVAL

public static final byte ON_MIN_CPU_INTERVAL
Code indicating that checkpoints should be taken periodically at the minimum CPU interval as specified by the queue.

See Also:
  - Constant Field Values

### ON_MIN_CPU_INTERVAL_STR

public static final String ON_MIN_CPU_INTERVAL_STR
String indicating that checkpoints should be taken periodically at the minimum CPU interval as specified by the queue.

See Also:
  - Constant Field Values

### ON_SUSPEND

public static final byte ON_SUSPEND
Code indicating that checkpoints should be taken the job is suspended.

See Also:
  - Constant Field Values

### ON_SUSPEND_STR

public static final String ON_SUSPEND_STR
String indicating that checkpoints should be taken the job is suspended.

See Also:
  - Constant Field Values

## Constructor Details

### CheckpointSpecifier

public CheckpointSpecifier()

## Method Details

### getName

public String getName()
Get the name of the checkpointing environment.

Returns:
  the name

### setName

public void setName(String name)
Set the name of the checkpointing environment.

Parameters:
  `name` - the name

### onShutdown

public boolean onShutdown(boolean set)
Set whether a checkpoint should be taken when the execution daemon shuts down. Setting this value to true will also set the checkpointing interval to 0.

Parameters:
  `set` - whether to take a checkpoint
Returns:
  the previous value
See Also:
  - `getInterval()`

### onMinCpuInterval

public boolean onMinCpuInterval(boolean set)
Set whether a checkpoint should be taken periodically at the minimum CPU interval as specified by the queue. Setting this value to true will also set the checkpointing interval to 0.

Parameters:
  `set` - whether to take a checkpoint
Returns:
  the previous value
See Also:
  - `getInterval()`

### onSuspend

public boolean onSuspend(boolean set)
Set whether a checkpoint should be taken when the job is suspended. Setting this value to true will also set the checkpointing interval to 0.

Parameters:
  `set` - whether to take a checkpoint
Returns:
  the previous value
See Also:
  - `getInterval()`

### never

public byte never()
Indicate that a checkpoint should never be taken.

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

### setInterval

public long setInterval(long sec)
Set the interval at which checkpoints should be taken. If the value is 0, periodic checkpoints will not be taken. If the value is non-zero, the checkpoint occasion will be set to "never".

Parameters:
  `sec` - the number of seconds between checkpoints
Returns:
  the previous value
See Also:
  - `getOccasion()`

### setInterval

public long setInterval(int hours, int minutes, int seconds)
Set the interval at which checkpoints should be taken. If the value is 0, periodic checkpoints will not be taken. If the value is non-zero, the checkpoint occasion will be set to "never".

Parameters:
  `hours` - the number of hours between checkpoints -- this value is combined to the number of minutes and seconds
  `minutes` - the number of minutes between checkpoints -- this value is combined to the number of hours and seconds
  `seconds` - the number of seconds between checkpoints -- this value is combined to the number of minutes and hours
Returns:
  the previous value
See Also:
  - `getOccasion()`

### getInterval

public long getInterval()
Get the number of seconds between checkpoints.

Returns:
  the number of seconds

### getOccasion

public byte getOccasion()
Get a byte value that represents the occasions when the job should be checkpointed. This value is composed by ORing together the code for the occasions when the job should be checkpointed. If the occasion value is non-zero, the checkpointing interval will be set to 0.

Returns:
  the occasion value
See Also:
  - `ON_MIN_CPU_INTERVAL`
  - `ON_SHUTDOWN`
  - `ON_SUSPEND`
  - `getInterval()`

### setOccasion

public void setOccasion(String value)
Set the occasions when the job should be checkpointed according to a a String composed by combining the string values for the occasions when the job should be checkpointed. If the occasion value is not NEVER, the checkpointing interval will be set to 0.

Parameters:
  `value` - the occasion string
See Also:
  - `ON_MIN_CPU_INTERVAL_STR`
  - `ON_SHUTDOWN_STR`
  - `ON_SUSPEND_STR`
  - `getInterval()`

### getOccasionString

public String getOccasionString()
Get an occasion string that represents the occasions when the job should be checkpointed. This value is composed by combining the string values for the occasions when the job should be checkpointed.

Returns:
  the occasion string
See Also:
  - `ON_MIN_CPU_INTERVAL_STR`
  - `ON_SHUTDOWN_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 CheckpointSpecifier clone()

Overrides:
  `clone` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`