Framework Professional Edition Package


org.mbs.services.powermon
Class PowerStatus

java.lang.Object
  extended by org.mbs.services.powermon.PowerStatus
All Implemented Interfaces:
com.prosyst.util.io.Externalizable

public class PowerStatus
extends java.lang.Object
implements com.prosyst.util.io.Externalizable

Presents the power state of the system .

Author:
Teodor Todorov , Hristo Stanchev

Field Summary
static byte AC_OFF
          indicates that ac cabel is switched off
static byte AC_ON
          indicates that ac cabel is switched on
static byte BATTERY_CHARGING
          indicates that battery is charging at the moment
static byte BATTERY_CRITICAL
          indicates that the level of battery is too low (critical)
static byte BATTERY_HIGH
          indicates that the level of battery is high
static byte BATTERY_LOW
          indicates that the level of battery is low
static byte BATTERY_UNKNOWN
          indicates that the status ot the battery is unknown (when the type ot battery is unknown for example)
static byte NO_SYSTEM_BATTERY
          no battery
 
Constructor Summary
PowerStatus(byte b1, byte b2, int i1, int i2, int i3)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object bInfo)
          Checks whether this and the specified PowerStatus are equal.
 byte getACStatus()
          Returns the ac status of the system.
 byte getBatteryFlag()
          Returns the battery flag of the system.
 int getBatteryFullLifeTime()
          Returns the lifetime of the battery of the system, when at full charge.
 int getBatteryLevel()
          Returns the battery level of the system.
 int getBatteryTimeToLive()
          Returns the remaining lifetime of the battery of the system.
 byte[] getBytes()
          Representation of the PowerStatus as a byte[].
 void readObject(java.io.InputStream iStream)
          Use this method to deserialize the object state.
 java.lang.String toString()
          String representation of the PowerStatus.
 void writeObject(java.io.OutputStream oStream)
          Use this method to serialize the object state.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AC_OFF

public static final byte AC_OFF
indicates that ac cabel is switched off

See Also:
Constant Field Values

AC_ON

public static final byte AC_ON
indicates that ac cabel is switched on

See Also:
Constant Field Values

BATTERY_HIGH

public static final byte BATTERY_HIGH
indicates that the level of battery is high

See Also:
Constant Field Values

BATTERY_LOW

public static final byte BATTERY_LOW
indicates that the level of battery is low

See Also:
Constant Field Values

BATTERY_CRITICAL

public static final byte BATTERY_CRITICAL
indicates that the level of battery is too low (critical)

See Also:
Constant Field Values

BATTERY_CHARGING

public static final byte BATTERY_CHARGING
indicates that battery is charging at the moment

See Also:
Constant Field Values

NO_SYSTEM_BATTERY

public static final byte NO_SYSTEM_BATTERY
no battery

See Also:
Constant Field Values

BATTERY_UNKNOWN

public static final byte BATTERY_UNKNOWN
indicates that the status ot the battery is unknown (when the type ot battery is unknown for example)

See Also:
Constant Field Values
Constructor Detail

PowerStatus

public PowerStatus(byte b1,
                   byte b2,
                   int i1,
                   int i2,
                   int i3)
Constructor.

Parameters:
b1 -
b2 -
i1 -
i2 -
i3 -
Method Detail

getBatteryFlag

public byte getBatteryFlag()
Returns the battery flag of the system.

Returns:

getACStatus

public byte getACStatus()
Returns the ac status of the system.

Returns:

getBatteryLevel

public int getBatteryLevel()
Returns the battery level of the system.

Returns:

getBatteryTimeToLive

public int getBatteryTimeToLive()
Returns the remaining lifetime of the battery of the system.

Returns:

getBatteryFullLifeTime

public int getBatteryFullLifeTime()
Returns the lifetime of the battery of the system, when at full charge.

Returns:

equals

public boolean equals(java.lang.Object bInfo)
Checks whether this and the specified PowerStatus are equal.

Overrides:
equals in class java.lang.Object
Parameters:
bInfo -
Returns:

toString

public java.lang.String toString()
String representation of the PowerStatus.

Overrides:
toString in class java.lang.Object
Returns:

writeObject

public void writeObject(java.io.OutputStream oStream)
                 throws java.lang.Exception
Use this method to serialize the object state.

Specified by:
writeObject in interface com.prosyst.util.io.Externalizable
Parameters:
oStream -
Throws:
java.lang.Exception

readObject

public void readObject(java.io.InputStream iStream)
                throws java.lang.Exception
Use this method to deserialize the object state.

Specified by:
readObject in interface com.prosyst.util.io.Externalizable
Parameters:
iStream -
Throws:
java.lang.Exception

getBytes

public byte[] getBytes()
Representation of the PowerStatus as a byte[].

Returns:

Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved