|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.network.VoogaClient
vooga.network.util.VoogaUtilsClient
public class VoogaUtilsClient
VoogaUtilsClient is the data management utility for local user data. It sends requests to VoogaUtilsServerThread and can synchronize user's data with other users' data.
Method Summary | |
---|---|
void |
connect(java.net.InetAddress host)
Connects to the server at the specified address. |
boolean |
containsData(java.lang.String table,
java.util.List<java.lang.String> key)
Determines whether or not there is data stored on the server associated with the given key. |
boolean |
containsData(java.lang.String table,
java.lang.String key)
Determines whether or not there is data stored on the server associated with the given key. |
boolean |
containsTable(java.lang.String table)
Asks server whether it contains particular table. |
void |
createDataTable(java.lang.String tableName)
Creates a new table on the server in which to store data. |
void |
eraseData(java.lang.String table,
java.util.List<java.lang.String> key)
Erases the data associated with the given key from the server |
void |
eraseData(java.lang.String table,
java.lang.String key)
|
java.util.Map<java.util.List<java.lang.String>,java.lang.Object> |
getAllData(java.lang.String table)
Gets a list of all objects stored on the server in the given table |
java.lang.Object |
getData(java.lang.String table,
java.util.List<java.lang.String> key)
Gets the data stored on the server associated with the given key. |
java.lang.Object |
getData(java.lang.String table,
java.lang.String key)
Gets the data stored on the server associated with the given key. |
long |
getNextAvailableID()
Requests the next available unique ID from the server, which is used for creating unique IDs for users, games, chat channels, etc. |
static VoogaUtilsClient |
getUtilsClient(VoogaModule module)
Retrieves the utilities client that has access to the given module's data on the server. |
protected void |
initializeConnection()
Performs any necessary set-up for a new connection. |
void |
run()
Keeps the client running as long as it is connected to the server. |
void |
storeData(java.lang.String table,
java.util.List<java.lang.String> key,
java.io.Serializable value)
Store a key-value pair on the server, where it can be retrieved later in this session or in future sessions, unless it is overwritten or deleted. |
void |
storeData(java.lang.String table,
java.lang.String key,
java.io.Serializable value)
Store a key-value pair on the server, where it can be retrieved later in this session or in future sessions, unless it is overwritten or deleted. |
DataObject |
synchronize(java.lang.String table,
java.util.List<java.lang.String> key,
DataObject obj)
Used by the LocalDataManager to synchronize local storage with the server via this utilities client. |
Methods inherited from class vooga.network.VoogaClient |
---|
allowConnection, blockConnection, connect, connect, disconnect, getMyInputStream, getMyName, getMyOutputStream, getMySocket, isConnected, setConnected, setMyName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static VoogaUtilsClient getUtilsClient(VoogaModule module) throws java.net.UnknownHostException
module
-
java.net.UnknownHostException
public long getNextAvailableID() throws java.io.IOException, java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
VoogaNetworkException
java.io.IOException
public void createDataTable(java.lang.String tableName) throws java.io.IOException, java.lang.ClassNotFoundException
tableName
-
java.io.IOException
java.lang.ClassNotFoundException
public void storeData(java.lang.String table, java.lang.String key, java.io.Serializable value) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The key to associate the value withvalue
- The Object to store on the server. This object needs to be
Serializable.
java.lang.ClassNotFoundException
java.io.IOException
public void storeData(java.lang.String table, java.util.List<java.lang.String> key, java.io.Serializable value) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The key to associate the value withvalue
- The Object to store on the server. This object needs to be
Serializable.
java.io.IOException
java.lang.ClassNotFoundException
public void eraseData(java.lang.String table, java.lang.String key) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void eraseData(java.lang.String table, java.util.List<java.lang.String> key) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The location from which to erase data.
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object getData(java.lang.String table, java.lang.String key) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The data location.
java.lang.ClassNotFoundException
java.io.IOException
public java.lang.Object getData(java.lang.String table, java.util.List<java.lang.String> key) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The data location.
java.lang.ClassNotFoundException
java.io.IOException
public boolean containsData(java.lang.String table, java.lang.String key) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The key or prefix to check.
java.lang.ClassNotFoundException
java.io.IOException
public boolean containsData(java.lang.String table, java.util.List<java.lang.String> key) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The key or prefix to check.
java.lang.ClassNotFoundException
java.io.IOException
public boolean containsTable(java.lang.String table) throws java.io.IOException, java.lang.ClassNotFoundException
table
- table name
java.io.IOException
java.lang.ClassNotFoundException
public java.util.Map<java.util.List<java.lang.String>,java.lang.Object> getAllData(java.lang.String table) throws java.io.IOException, java.lang.ClassNotFoundException
key
- The prefix to get data for.
java.lang.ClassNotFoundException
java.io.IOException
public DataObject synchronize(java.lang.String table, java.util.List<java.lang.String> key, DataObject obj) throws java.io.IOException, java.lang.ClassNotFoundException
table
- table namekey
- The prefix to get data forobj
- Object to be synchronized with.
java.io.IOException
java.lang.ClassNotFoundException
public void run()
protected void initializeConnection()
VoogaClient
initializeConnection
in class VoogaClient
public void connect(java.net.InetAddress host) throws java.io.IOException
VoogaClient
connect
in class VoogaClient
host
- The IP of an existing VoogaChatServer.
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |