|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectserver.DaoImpl
public class DaoImpl
This class implements the client side of a DAO. This DAO is general enough to deal with any object that is serializable. The client DAO is not in charge of opening the communication channel. Instead, it receives the in and out channels from an Invoker. In this way, the users of the DAO do not have to worry about closing this channel.
| Field Summary |
|---|
| Fields inherited from interface server.DAO |
|---|
ADD, DELETE, GET, HOST, PORT, SIZE, UPDATE |
| Constructor Summary | |
|---|---|
DaoImpl()
|
|
| Method Summary | |
|---|---|
void |
add(java.lang.Long key,
java.io.Serializable value)
Adds a new object into the database. |
void |
delete(java.lang.Long key)
Removes an object from the database. |
java.io.Serializable |
get(java.lang.Long key)
Returns a value, given a key. |
void |
setChannels(java.io.ObjectOutputStream newOut,
java.io.ObjectInputStream newIn)
This method establishes the channels that the DAO will use to communicate with the server side of the application. |
int |
size()
Informs the number of elements stored in the database. |
void |
update(java.lang.Long key,
java.io.Serializable value)
Updates an object in the database. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DaoImpl()
| Method Detail |
|---|
public final void setChannels(java.io.ObjectOutputStream newOut,
java.io.ObjectInputStream newIn)
newOut - channel to send data.newIn - channel to receive data.public final java.io.Serializable get(java.lang.Long key)
get in interface DAO<java.lang.Long,java.io.Serializable>key - the id of the object that must be found.
public final void add(java.lang.Long key,
java.io.Serializable value)
add in interface DAO<java.lang.Long,java.io.Serializable>key - the id of the object that will be inserted into the database.value - the value associated with the key K.public final void delete(java.lang.Long key)
delete in interface DAO<java.lang.Long,java.io.Serializable>key - the id of the object that will be removed.
public final void update(java.lang.Long key,
java.io.Serializable value)
update in interface DAO<java.lang.Long,java.io.Serializable>key - the id of the object that will be replaced.value - the new value of the object associated with the given key.public final int size()
size in interface DAO<java.lang.Long,java.io.Serializable>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||