|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Remote interface for accessing Database. It have the same as DBMain interface but thay are additionally equipped with client login parameter and two additional method dataBase login and logout
| Method Summary | |
int |
create(java.lang.String[] data,
java.lang.String clientId)
Creates a new record in the database (possibly reusing a deleted entry). |
void |
delete(int recNo,
java.lang.String clientId)
Deletes a record, making the record number and associated disk storage available for reuse. |
int[] |
find(java.lang.String[] criteria,
java.lang.String clientId)
Returns an array of record numbers that match the specified criteria. |
boolean |
isLocked(int recNo,
java.lang.String clientId)
Determines if a record is currenly locked. |
void |
lock(int recNo,
java.lang.String clientId)
Locks a record so that it can only be updated or deleted by this client. |
java.lang.String |
logIn()
The method performs client login it is required as server needs to identify clients |
void |
logIn(java.lang.String string)
The method performs client login it is required as server needs to identify clients |
void |
logOut(java.lang.String clientId)
The method performs client logout - no others connections with such login will be available |
java.lang.String[] |
read(int recNo,
java.lang.String clientId)
Reads a record from the file. |
void |
unlock(int recNo,
java.lang.String clientId)
Releases the lock on a record. |
void |
update(int recNo,
java.lang.String[] data,
java.lang.String clientId)
Modifies the fields of a record. |
| Method Detail |
public java.lang.String[] read(int recNo,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
recNo - the index of the requested recordclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public void update(int recNo,
java.lang.String[] data,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
recNo - the index of the record to operate ondata - the new set of data for the requested recordclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public void delete(int recNo,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
recNo - the index of the record to deleteclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public int[] find(java.lang.String[] criteria,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
criteria - String array representing the criteria for each record fieldclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public int create(java.lang.String[] data,
java.lang.String clientId)
throws DuplicateKeyException,
ClientNotLoggedInException,
java.rmi.RemoteException
data - the array string representig values of the fields of the new recordclientId - the unique identifier of the clienent thet is performing request
DuplicateKeyException - - thrown when record could not be created
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public void lock(int recNo,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
recNo - the index of the record to lockclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public void unlock(int recNo,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
recNo - the index of the record to lockclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public boolean isLocked(int recNo,
java.lang.String clientId)
throws RecordNotFoundException,
ClientNotLoggedInException,
java.rmi.RemoteException
recNo - the index of the record to checkclientId - the unique identifier of the clienent thet is performing request
RecordNotFoundException - is thrown if a specified record does not exist or is
marked as deleted in the database file.
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public java.lang.String logIn()
throws java.rmi.RemoteException
java.rmi.RemoteException - - required for remote access
public void logOut(java.lang.String clientId)
throws java.rmi.RemoteException,
ClientNotLoggedInException
clientId - uniqe client identifier
java.rmi.RemoteException - - required for remote access
ClientNotLoggedInException - - is thrown when client login passed as argument is
not a valid client login (e.g. client has not been logged in)
public void logIn(java.lang.String string)
throws java.rmi.RemoteException
string - client login
java.rmi.RemoteException - - required for remote access
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||