JAFS API v2

org.openafs.jafs
Class Server.ExecutableTime

java.lang.Object
  |
  +--org.openafs.jafs.Server.ExecutableTime
All Implemented Interfaces:
Serializable
Enclosing class:
Server

public static final class Server.ExecutableTime
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static short EVERYDAY
           
(package private) static DecimalFormat formatter
           
static short FRIDAY
           
static short MONDAY
           
static short NEVER
           
static short NOW
           
static short SATURDAY
           
static short SUNDAY
           
static short THURSDAY
           
static short TUESDAY
           
static short WEDNESDAY
           
 
Constructor Summary
(package private) Server.ExecutableTime()
          Internal constructor used to construct an empty object that will be passed to JNI for member synchronization of the BOS Server executable time this object represents.
  Server.ExecutableTime(short type)
          Constructs an ExecutableTime object that represents either a "now" or "never" BOS Executable Restart Time.
  Server.ExecutableTime(short second, short minute, short hour)
          Constructs an ExecutableTime object that may be used to represent a daily BOS Executable Restart Time of a process.
  Server.ExecutableTime(short second, short minute, short hour, short day)
          Constructs an ExecutableTime object that may be used to represent the BOS Executable Restart Time of a process.
 
Method Summary
 boolean equals(Server.ExecutableTime time)
          Tests whether two ExecutableTime objects are equal, based on a comparison of each of their respective properties.
 short getDay()
          Returns a numeric representation of the day of this ExecutableTime object.
 String getDayString()
          Returns a String representation, name for the day of the week or "Everyday", of this object's day property.
 short getHour()
          Returns the hour of this ExecutableTime object, in 24 hour time.
 short getMinute()
          Returns the minute of this ExecutableTime object.
 short getSecond()
          Returns the second of this ExecutableTime object.
 boolean isNever()
          Returns whether or not the BOS restart time, represented by this ExecutableTime object, is set to "never" or not.
 boolean isNow()
          Returns whether or not the BOS restart time, represented by this ExecutableTime object, is set to "now" or not.
 String toString()
          Returns the String representation of time value of this ExecutableTime object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NEVER

public static final short NEVER
See Also:
Constant Field Values

NOW

public static final short NOW
See Also:
Constant Field Values

EVERYDAY

public static final short EVERYDAY
See Also:
Constant Field Values

SUNDAY

public static final short SUNDAY
See Also:
Constant Field Values

MONDAY

public static final short MONDAY
See Also:
Constant Field Values

TUESDAY

public static final short TUESDAY
See Also:
Constant Field Values

WEDNESDAY

public static final short WEDNESDAY
See Also:
Constant Field Values

THURSDAY

public static final short THURSDAY
See Also:
Constant Field Values

FRIDAY

public static final short FRIDAY
See Also:
Constant Field Values

SATURDAY

public static final short SATURDAY
See Also:
Constant Field Values

formatter

static final DecimalFormat formatter
Constructor Detail

Server.ExecutableTime

Server.ExecutableTime()
Internal constructor used to construct an empty object that will be passed to JNI for member synchronization of the BOS Server executable time this object represents.


Server.ExecutableTime

public Server.ExecutableTime(short type)
                      throws IllegalArgumentException
Constructs an ExecutableTime object that represents either a "now" or "never" BOS Executable Restart Time.

Valid values for the type parameter are ExecutableTime.NOW or ExecutableTime.NEVER. If a value other than these two is used an IllegalArgumentException will be thrown.

Parameters:
type - either ExecutableTime.NOW or ExecutableTime.NEVER
Throws:
IllegalArgumentException - If a value other than ExecutableTime.NOW or ExecutableTime.NEVER is used for the type parameter.
See Also:
isNow(), isNever(), Server.ExecutableTime(short, short, short)

Server.ExecutableTime

public Server.ExecutableTime(short second,
                             short minute,
                             short hour)
                      throws IllegalArgumentException
Constructs an ExecutableTime object that may be used to represent a daily BOS Executable Restart Time of a process.

Parameters:
second - the second field for this representation of a BOS Server restart time value (range: 0-59)
minute - the minute field for this representation of a BOS Server restart time value (range: 0-59)
hour - the hour field for this representation of a BOS Server restart time value (range: 0-23)
Throws:
IllegalArgumentException - If any of the parameters values are out of range of their respective fields.
See Also:
Server.ExecutableTime(short, short, short, short), getSecond(), getMinute(), getHour()

Server.ExecutableTime

public Server.ExecutableTime(short second,
                             short minute,
                             short hour,
                             short day)
Constructs an ExecutableTime object that may be used to represent the BOS Executable Restart Time of a process.

Parameters:
second - the second field for this representation of a BOS Server restart time value (range: 0-59)
minute - the minute field for this representation of a BOS Server restart time value (range: 0-59)
hour - the hour field for this representation of a BOS Server restart time value (range: 0-23)
day - the day field for this representation of a BOS Server restart time value.
Throws:
IllegalArgumentException - If any of the parameters values are out of range of their respective fields.
See Also:
Server.ExecutableTime(short, short, short), getSecond(), getMinute(), getHour(), getDay()
Method Detail

getSecond

public short getSecond()
                throws IllegalStateException
Returns the second of this ExecutableTime object.

Returns:
the second of this ExecutableTime object.
Throws:
IllegalStateException - If the executable time this object represents has a value of "now" or "never".

getMinute

public short getMinute()
                throws IllegalStateException
Returns the minute of this ExecutableTime object.

Returns:
the minute of this ExecutableTime object.
Throws:
IllegalStateException - If the executable time this object represents has a value of "now" or "never".

getHour

public short getHour()
              throws IllegalStateException
Returns the hour of this ExecutableTime object, in 24 hour time.

Returns:
the hour of this ExecutableTime object.
Throws:
IllegalStateException - If the executable time this object represents has a value of "now" or "never".

getDay

public short getDay()
             throws IllegalStateException
Returns a numeric representation of the day of this ExecutableTime object. If it is daily, the value of ExecutableTime.EVERYDAY is returned.

Possible return values are:
ExecutableTime.EVERYDAY

ExecutableTime.SUNDAY
ExecutableTime.MONDAY
ExecutableTime.TUESDAY
ExecutableTime.WEDNESDAY
ExecutableTime.THURSDAY
ExecutableTime.FRIDAY
ExecutableTime.SATURDAY

Returns:
a numeric representation of the day of this ExecutableTime object.
Throws:
IllegalStateException - If the executable time this object represents has a value of "now" or "never".

getDayString

public String getDayString()
                    throws IllegalStateException
Returns a String representation, name for the day of the week or "Everyday", of this object's day property.

Possible return values are:

 Sunday
 Monday
 Tuesday
 Wednesday
 Thursday
 Friday
 Saturday
 
 Everyday
 

Returns:
the day of this ExecutableTime object.
Throws:
IllegalStateException - If the executable time this object represents has a value of "now" or "never".
See Also:
getDay()

isNow

public boolean isNow()
Returns whether or not the BOS restart time, represented by this ExecutableTime object, is set to "now" or not. This means that at some point in the past, when someone set it to "now", the bosserver restarted all its processes, and never again.

Returns:
whether or not the restart time is "now"

isNever

public boolean isNever()
Returns whether or not the BOS restart time, represented by this ExecutableTime object, is set to "never" or not. This means that the bosserver will never restart its processes.

Returns:
whether or not the restart time is "never"

equals

public boolean equals(Server.ExecutableTime time)
Tests whether two ExecutableTime objects are equal, based on a comparison of each of their respective properties. If "now" or "never" is set in either object, only those properties are analyzed.

Parameters:
time - the ExecutableTime to test against
Returns:
whether the specifed ExecutableTime is the same as this ExecutableTime as defined above

toString

public String toString()
Returns the String representation of time value of this ExecutableTime object.

Possible return values:

  • "Now"
  • "Never"
  • Day and time string in the form:
         <day> at <hh>:<MM>[:<ss>]

    Example Return Values:
     Sunday at 04:00
     Sunday at 05:10:30
     Everyday at 20:00

    Overrides:
    toString in class Object
    Returns:
    the String representation of this ExecutableTime object

  • JAFS API v2