|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.networkupstools.jnut.Device
public class Device
Class representing a device attached to a Client.
It can retrieve its description, its number of logins, its variable and command lists. A Device object can be retrieved from Client instance and can not be constructed directly.
Constructor Summary | |
---|---|
protected |
Device(java.lang.String name,
Client client)
Internally create a device. |
Method Summary | |
---|---|
Client |
getClient()
Return the client to which the device is connected. |
Command |
getCommand(java.lang.String name)
Return a command from its name. |
Command[] |
getCommandList()
Return the list of device commands from the NUT server. |
java.lang.String |
getDescription()
Retrieve the device description from UPSD and store it in cache. |
java.lang.String |
getName()
Return the device name. |
int |
getNumLogin()
Return the number of clients which have done LOGIN for this UPS. |
Variable[] |
getRWVariableList()
Return the list of device RW variables from the NUT server. |
Variable |
getVariable(java.lang.String name)
Return a variable from its name. |
Variable[] |
getVariableList()
Return the list of device variables from the NUT server. |
void |
login()
Log in to the ups. |
void |
master()
This function doesn't do much by itself. |
void |
setForcedShutdown()
Set the "forced shutdown" flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Device(java.lang.String name, Client client)
name
- Device name.client
- Client to which the device is attached.Method Detail |
---|
public Client getClient()
public java.lang.String getName()
public java.lang.String getDescription() throws java.io.IOException, NutException
java.io.IOException
NutException
public void login() throws java.io.IOException, NutException
Use this to log the fact that a system is drawing power from this UPS. The upsmon master will wait until the count of attached systems reaches 1 - itself. This allows the slaves to shut down first.
NOTE: You probably shouldn't send this command unless you are upsmon, or a upsmon replacement.
java.io.IOException
NutException
public void master() throws java.io.IOException, NutException
java.io.IOException
NutException
public void setForcedShutdown() throws java.io.IOException, NutException
upsmon in master mode is the primary user of this function. It sets this "forced shutdown" flag on any UPS when it plans to power it off. This is done so that slave systems will know about it and shut down before the power disappears.
Setting this flag makes "FSD" appear in a STATUS request for this UPS. Finding "FSD" in a status request should be treated just like a "OB LB".
It should be noted that FSD is currently a latch - once set, there is no way to clear it short of restarting upsd or dropping then re-adding it in the ups.conf. This may cause issues when upsd is running on a system that is not shut down due to the UPS event.
java.io.IOException
NutException
public int getNumLogin() throws java.io.IOException, NutException
java.io.IOException
NutException
public Variable[] getVariableList() throws java.io.IOException, NutException
java.io.IOException
NutException
public Variable[] getRWVariableList() throws java.io.IOException, NutException
java.io.IOException
NutException
public Variable getVariable(java.lang.String name) throws java.io.IOException, NutException
name
- Name of the queried variable.
java.io.IOException
NutException
public Command[] getCommandList() throws java.io.IOException, NutException
java.io.IOException
NutException
public Command getCommand(java.lang.String name) throws java.io.IOException, NutException
name
- Name of the queried command.
java.io.IOException
NutException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |