AdminProperties

public class AdminProperties

A class to wrap the admin.main properties file for easier handling.

Author:Joel Matsumoto

Fields

ADMIN

public static final String ADMIN

The base element for the admin properties file.

CUTOFF_BEFORE

public static final String CUTOFF_BEFORE

DAY

public static final String DAY

EMAIL

public static final String EMAIL

HCPATH

public static final String HCPATH

Properties within the housecleaning element.

HOUSECLEANING

public static final String HOUSECLEANING

Properties within the admin element

LAST_RUN

public static final String LAST_RUN

NEXT_RUN

public static final String NEXT_RUN

ON

public static final String ON

PASSWORD

public static final String PASSWORD

PORT

public static final String PORT

REASON_FAILED

public static final String REASON_FAILED

SMTP

public static final String SMTP

STATUS

public static final String STATUS

TIME

public static final String TIME

USERNAME

public static final String USERNAME

Constructors

AdminProperties

public AdminProperties(PropertyTree tree)

Methods

getCutoff

public int getCutoff()

Return the ‘cutoff’ property if set, else if null or invalid, throw an exception.

Throws:
Returns:

int

getDay

public int getDay()

Return the ‘day’ property or throw an exception if an invalid integer

Throws:
Returns:

int

getElementHC

public String getElementHC(String name)

getEmail

public String getEmail()

Return the ‘email’ property if set or return an empty String. If null throw an exception.

Throws:
Returns:

String

getLastRun

public String getLastRun()

Return the ‘lastrun’ property if set, else return an empty String. If null, throw an exception.

Throws:
Returns:

String

getNextRun

public String getNextRun()

Return the ‘nextrun’ property if set, else return an empty String. If null, throw an exception.

Throws:
Returns:

String

getPassword

public String getPassword()

getPort

public int getPort()

Return the ‘port’ property if set or throw an exception if null/invalid. If the value is not set, will return the deafult, 25;

Throws:
Returns:

int

getReason

public String getReason()

Return the ‘reason’ property if set, else return an empty String. If null, throw an exception.

Throws:
Returns:

String

getSmtp

public String getSmtp()

Return the ‘smtp’ property if set or return an empty String. If null, throw an exception.

Throws:
Returns:

String

getStatus

public String getStatus()

Return the ‘status’ property if set, else return an empty String. If null, throw an exception.

Throws:
Returns:

String

getTime

public String getTime()

Return the ‘time’ property.

Throws:
Returns:

String

getUsername

public String getUsername()

Return the ‘username’ property if set, else return an empty String. If null, throw an exception.

Throws:
Returns:

String

isOn

public boolean isOn()

Return a boolean depending on if the value is set to ON/OFF or return false if none set/null/invalid.

Returns:boolean

setCutoff

public void setCutoff(int cutoff)

Set the property ‘cutoff’.

Parameters:
  • cutoff

setDay

public void setDay(int day)

Set the property ‘day’. 1-7 Sun-Sat

Parameters:
  • day

setElementHC

public void setElementHC(String name, String value)

setEmail

public void setEmail(String email)

Set the property ‘email’.

Parameters:
  • email

setLastRun

public void setLastRun(String lastrun)

Set the property ‘lastrun’.

Parameters:
  • lastrun

setNextRun

public void setNextRun(String nextrun)

Set the property ‘nextrun’.

Parameters:
  • nextrun

setOn

public void setOn(boolean b)

Set the property ‘on’.

Parameters:
  • b

setPassword

public void setPassword(String password)

setPort

public void setPort(int port)

Set the property ‘port’.

Parameters:
  • port

setReason

public void setReason(String reason)

Set the property ‘reason’.

Parameters:
  • reason

setSmtp

public void setSmtp(String smtp)

Set the property ‘smtp’.

Parameters:
  • smtp

setStatus

public void setStatus(String status)

Set the property ‘status’.

Parameters:
  • status

setTime

public void setTime(String time)

Set the property ‘time’.

Parameters:
  • time

setUsername

public void setUsername(String username)

Set the property ‘username’.

Parameters:
  • username

write

public void write()

Writes the property tree to url asscoaited with the component

Throws:

write

public void write(URL u)

Writes to the specified url.

Parameters:
  • u
Throws: