|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The class implemting this interface will be used by the Caltella Name Server (CNS). It is designed as a layer of abstraction for access to any kind of database system, running behind the CNS.
Since the metaphor of the Domain Name Server is used,
we implement bind(int, java.lang.String)
, unbind(int)
and lookup(int)
.
Method Summary | |
boolean |
bind(int id,
String address)
This binds the peers address to his id in the CNS,
now he is marked as online.
|
boolean |
checkPassword(int id,
String password)
This methode is used to check the peers identity. |
boolean |
connect()
This methode connects the CNS to his DB. |
String |
getEmail(int id)
Returns the email of the peer identified by id . |
String |
getFirstName(int id)
Returns the first Name of the peer identified by id . |
String |
getImageURL(int id)
Returns an URL to an image of the peer identified by id . |
String |
getLastName(int id)
Returns the Last Name of the peer identified by id . |
String[] |
getSearchFields()
This methode is used to get a list of searchable colums used for the search(java.lang.String, java.lang.String) method. |
boolean |
isOnline(int id)
Returns true if the peer identified by id is online. |
String |
lookup(int id)
Before we can send messages we need there address. |
int |
register(String firstName,
String lastName,
String email,
String password,
String Country,
String url)
The first time the user starts an Caltella client, we has to register. |
boolean |
removePeer(int id)
If ever called, this methode would remove the peer from the DB. |
int[] |
search(String column,
String searchString)
Search the DB for one or more peers and return there ID's |
boolean |
setAllAtOnce(int id,
String newFirstName,
String newLastName,
String newEmail,
String newPassword,
String newImageURL)
This is mainly used to decrease network and DB load by sending all data at once. |
boolean |
setEmail(int id,
String newEmail)
|
boolean |
setFirstName(int id,
String newFirstName)
|
boolean |
setImageURL(int id,
String newImageURL)
|
boolean |
setLastName(int id,
String newLastName)
|
boolean |
setPassword(int id,
String newPassword)
|
boolean |
unbind(int id)
This methode will change the peers status to offline. |
Method Detail |
public boolean connect()
public int register(String firstName, String lastName, String email, String password, String Country, String url)
public boolean removePeer(int id)
public boolean bind(int id, String address)
id
in the CNS,
now he is marked as online.
No password is needed since the other methodes don't need them ether.
id
- The peers id number
address A String of the form host:port
we get host using the
InetAddress.getLocalHost()
methode.
true
if binding was successfulInetAddress
,
unbind(int)
,
lookup(int)
public boolean unbind(int id)
status
to offline.
unbind(int)
public String lookup(int id)
search(java.lang.String, java.lang.String)
methode to get
the id
.
bind(int, String)
public boolean setFirstName(int id, String newFirstName)
public boolean setLastName(int id, String newLastName)
public boolean setEmail(int id, String newEmail)
public boolean setPassword(int id, String newPassword)
public boolean setImageURL(int id, String newImageURL)
public boolean setAllAtOnce(int id, String newFirstName, String newLastName, String newEmail, String newPassword, String newImageURL)
true
if successfulpublic String getFirstName(int id)
id
.
public String getLastName(int id)
id
.
public String getEmail(int id)
id
.
public String getImageURL(int id)
id
.
public boolean isOnline(int id)
true
if the peer identified by id
is online.
public boolean checkPassword(int id, String password)
public int[] search(String column, String searchString)
id
's of all peers matching the
searchString in the specified colum.getSearchFields()
public String[] getSearchFields()
search(java.lang.String, java.lang.String)
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |