|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsophware.home.lang.Home
public class Home
Home is the central object that defines your automated
network.
This class contains a collection of HomeDevices and processes
all automation events.
The HomeStorage is a container for all of the objects.
The Home transmits HomeCommands
and receives HomeEvents.
HomeStorage,
Home,
Serialized Form| Field Summary | |
|---|---|
protected HomeStorage |
m_database
|
static java.io.PrintStream |
m_errorStream
The error stream to which all error messages are written |
protected static Home |
m_me
|
protected HomeReceiver |
m_receiver
|
protected static HomeTransmitter |
m_transmitter
|
| Constructor Summary | |
|---|---|
Home(HomeReceiver receiver)
Creates a Home with a receiver. |
|
Home(HomeReceiver receiver,
HomeStorage store)
Creates a Home with a receiver and storage. |
|
Home(HomeReceiver receiver,
HomeTransmitter transmitter)
Creates a Home with a transmitter and
receiver. |
|
Home(HomeReceiver receiver,
HomeTransmitter transmitter,
HomeStorage store)
Creates a Home with a transmitter,
receiver and storage. |
|
Home(HomeTransceiver transceiver)
Creates a Home with a transceiver. |
|
Home(HomeTransceiver transceiver,
HomeStorage store)
Creates a Home with a transceiver and storage. |
|
Home(HomeTransmitter transmitter)
Constructs a Home with a transmitter. |
|
Home(HomeTransmitter transmitter,
HomeStorage store)
Constructs a Home with a transmitter and storage. |
|
| Method Summary | |
|---|---|
void |
add(java.lang.Object obj)
Adds and object to the Home |
void |
addHomeListener(HomeListener listener)
Adds the given HomeListener to this Home. |
void |
distribute(HomeCommandStatus status)
Distributes HomeCommandStatus to the command listener. |
void |
distribute(HomeEvent event)
Distributes HomeEvents to the listeners. |
void |
flush()
Flushes the objects in HomeStorage |
java.lang.Object |
get(java.lang.Class c,
java.lang.String name)
Retrieves a named object of the given class |
HomeDevice |
get(DeviceAddress address)
Gets object with specified address |
java.util.Enumeration<java.lang.Object> |
getAll()
Gets all objects |
java.util.Enumeration<java.lang.Object> |
getAll(java.lang.Class c)
Gets all objects of the specified class |
void |
remove(java.lang.Object obj)
Removes the object from the Home |
void |
removeHomeListener(HomeListener listener)
Removes the given HomeListener from this
Home. |
void |
start()
Starts the Home and all associted resources |
void |
stop()
Stops the Home and all associted resources |
static int |
transmit(HomeCommand command)
Transmits the given HomeEvent on this interface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.io.PrintStream m_errorStream
protected static Home m_me
protected HomeStorage m_database
protected HomeReceiver m_receiver
protected static HomeTransmitter m_transmitter
| Constructor Detail |
|---|
public Home(HomeReceiver receiver)
Home with a receiver. Instances
created with this constructor
will only receive HomeEvents, they cannot transmit
HomeCommands.
- Parameters:
receiver - the HomeReceiver
public Home(HomeReceiver receiver,
HomeStorage store)
Home with a receiver and storage. Instances
created with this constructor
will only receive HomeEvents, they cannot transmit
HomeCommands.
- Parameters:
receiver - the HomeReceiverstore - the HomeStorage
public Home(HomeTransmitter transmitter)
Home with a transmitter. Instances
created with this constructor
will only transmit HomeCommands, they cannot receive
HomeEvents.
- Parameters:
transmitter - the HomeTransmitter
public Home(HomeTransmitter transmitter,
HomeStorage store)
Home with a transmitter and storage. Instances
created with this constructor
will only transmit HomeCommands, they cannot receive
HomeEvents.
- Parameters:
transmitter - the HomeTransmitterstore - the HomeStorage
public Home(HomeReceiver receiver,
HomeTransmitter transmitter)
Home with a transmitter and
receiver. Instances created with this constructor
may transmit HomeCommands and receive
HomeEvents.
- Parameters:
receiver - the HomeReceivertransmitter - the HomeTransmitter
public Home(HomeReceiver receiver,
HomeTransmitter transmitter,
HomeStorage store)
Home with a transmitter,
receiver and storage. Instances created with this constructor
may transmit HomeCommands and receive
HomeEvents.
- Parameters:
receiver - the HomeReceivertransmitter - the HomeTransmitterstore - the HomeStorage
public Home(HomeTransceiver transceiver)
Home with a transceiver.
Instances created with this constructor
may transmit HomeCommands and receive
HomeEvents.
- Parameters:
transceiver - the HomeTransceiver
public Home(HomeTransceiver transceiver,
HomeStorage store)
Home with a transceiver and storage.
Instances created with this constructor
may transmit HomeCommands and receive
HomeEvents.
- Parameters:
transceiver - the HomeTransceiverstore - the HomeStorage
| Method Detail |
|---|
public void start()
throws java.io.IOException,
HomeException
Home and all associted resources
java.io.IOException
HomeException
public void stop()
throws java.io.IOException,
HomeException
Home and all associted resources
java.io.IOException
HomeException
public static int transmit(HomeCommand command)
throws HomeException
HomeEvent on this interface.
command - the command to be transmitted
HomeExceptionpublic void distribute(HomeEvent event)
HomeEvents to the listeners.
event - the HomeEvent to be distributed to listenerspublic void distribute(HomeCommandStatus status)
HomeCommandStatus to the command listener.
status - the HomeCommandStatus to be distributed tothe command sourcepublic void addHomeListener(HomeListener listener)
HomeListener to this Home.
listener - listener to be addedpublic void removeHomeListener(HomeListener listener)
HomeListener from this
Home.
listener - listener to be removedpublic java.util.Enumeration<java.lang.Object> getAll(java.lang.Class c)
c - the classHomeStoragepublic java.util.Enumeration<java.lang.Object> getAll()
HomeStoragepublic HomeDevice get(DeviceAddress address)
address - the addressHomeStorage
public java.lang.Object get(java.lang.Class c,
java.lang.String name)
c - the classname - the object nameHomeStoragepublic void add(java.lang.Object obj)
obj - the object to be addedHomeStoragepublic void remove(java.lang.Object obj)
obj - the object to be removedHomeStorage
public void flush()
throws java.io.IOException
java.io.IOExceptionHomeStorage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||