sophware.home.io
Interface HomeStorage

All Known Implementing Classes:
FileHomeStorage, MemoryHomeStorage, NetworkHomeStorage, PersistentHomeStorage

public interface HomeStorage

The HomeStorage is the container used by the Home to store the objects associated with the home.


Method Summary
 void add(java.lang.Object dev)
          Adds the Object to the container.
 void close()
          Stop the device store.
 boolean contains(java.lang.Object obj)
          Check to see if object is in home storage
 void flush()
          flush the device store.
 java.lang.Object get(java.lang.Class c, java.lang.String name)
          Get the instance of a named class.
 HomeDevice get(DeviceAddress addr)
          Get the HomeDevice associated with an address.
 java.util.Enumeration<java.lang.Object> getAll()
          Get all HomeDevices in the container.
 java.util.Enumeration<java.lang.Object> getAll(java.lang.Class c)
          Get all Objects of a specific subtype
 void open()
          Start the device store.
 void remove(java.lang.Object dev)
          Remove the Object from the container.
 

Method Detail

open

void open()
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Start the device store.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

getAll

java.util.Enumeration<java.lang.Object> getAll()
Get all HomeDevices in the container.

Returns:
the HomeDevices in the container.

getAll

java.util.Enumeration<java.lang.Object> getAll(java.lang.Class c)
Get all Objects of a specific subtype

Parameters:
c - the class of the objects to be retrieved
Returns:
the Objects that are instances of c

get

HomeDevice get(DeviceAddress addr)
Get the HomeDevice associated with an address.

Parameters:
addr - the DeviceAddress of the device.
Returns:
the HomeDevice associated with the address or null if no device found.

get

java.lang.Object get(java.lang.Class c,
                     java.lang.String name)
Get the instance of a named class.

Parameters:
c - the class of the object to be retrieved
name - the name associated with the device
Returns:
the HomeDevice associated with the address or null if no device found.

contains

boolean contains(java.lang.Object obj)
Check to see if object is in home storage

Parameters:
obj - the Object.
Returns:
true if in storage, false otherwise.

add

void add(java.lang.Object dev)
Adds the Object to the container.

Parameters:
dev - the Object to be added.

remove

void remove(java.lang.Object dev)
Remove the Object from the container.

Parameters:
dev - the Object to be removed.

flush

void flush()
           throws java.io.IOException
flush the device store.

Throws:
java.io.IOException

close

void close()
           throws java.io.IOException
Stop the device store.

Throws:
java.io.IOException