suncertify.common
Class QueryInterfaceImpl_Stub

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteStub
              |
              +--suncertify.common.QueryInterfaceImpl_Stub
All Implemented Interfaces:
QueryInterface, java.rmi.Remote, java.io.Serializable

public final synchronized class QueryInterfaceImpl_Stub
extends java.rmi.server.RemoteStub
implements QueryInterface

See Also:
Serialized Form

Constructor Summary
QueryInterfaceImpl_Stub(java.rmi.server.RemoteRef)
           
 
Method Summary
 int create(java.lang.String[], java.lang.String)
          Creates a new record in the database (possibly reusing a deleted entry).
 void delete(int, java.lang.String)
          Deletes a record, making the record number and associated disk storage available for reuse.
 int[] find(java.lang.String[], java.lang.String)
          Returns an array of record numbers that match the specified criteria.
 boolean isLocked(int, java.lang.String)
          Determines if a record is currenly locked.
 void lock(int, java.lang.String)
          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)
          The method performs client login it is required as server needs to identify clients
 void logOut(java.lang.String)
          The method performs client logout - no others connections with such login will be available
 java.lang.String[] read(int, java.lang.String)
          Reads a record from the file.
 void unlock(int, java.lang.String)
          Releases the lock on a record.
 void update(int, java.lang.String[], java.lang.String)
          Modifies the fields of a record.
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryInterfaceImpl_Stub

public QueryInterfaceImpl_Stub(java.rmi.server.RemoteRef)
Method Detail

create

public int create(java.lang.String[],
                  java.lang.String)
           throws java.rmi.RemoteException,
                  ClientNotLoggedInException,
                  DuplicateKeyException
Description copied from interface: QueryInterface
Creates a new record in the database (possibly reusing a deleted entry). Inserts the given data, and returns the record number of the new record.

Specified by:
create in interface QueryInterface
Parameters:
- the array string representig values of the fields of the new record
- the unique identifier of the clienent thet is performing request
Returns:
index of the newly created record
Throws:
DuplicateKeyException - - thrown when record could not be created
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
java.rmi.RemoteException - - required for remote access

delete

public void delete(int,
                   java.lang.String)
            throws java.rmi.RemoteException,
                   ClientNotLoggedInException,
                   RecordNotFoundException
Description copied from interface: QueryInterface
Deletes a record, making the record number and associated disk storage available for reuse.

Specified by:
delete in interface QueryInterface
Parameters:
- the index of the record to delete
- the unique identifier of the clienent thet is performing request
Throws:
java.rmi.RemoteException - - required for remote access
RecordNotFoundException - is thrown if a specified record does not exist or is marked as deleted in the database file.
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)

find

public int[] find(java.lang.String[],
                  java.lang.String)
           throws java.rmi.RemoteException,
                  ClientNotLoggedInException,
                  RecordNotFoundException
Description copied from interface: QueryInterface
Returns an array of record numbers that match the specified criteria. Field n in the database file is described by criteria[n]. A null value in criteria[n] matches any field value. A non-null value in criteria[n] matches any field value that begins with criteria[n]. (For example, "Fred" matches "Fred" or "Freddy".)

Specified by:
find in interface QueryInterface
Parameters:
- String array representing the criteria for each record field
- the unique identifier of the clienent thet is performing request
Returns:
array containig indexes of all records meeting the criteria
Throws:
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)
RecordNotFoundException - is thrown if a specified record does not exist or is marked as deleted in the database file.

isLocked

public boolean isLocked(int,
                        java.lang.String)
                 throws java.rmi.RemoteException,
                        ClientNotLoggedInException,
                        RecordNotFoundException
Description copied from interface: QueryInterface
Determines if a record is currenly locked. Returns true if the record is locked, false otherwise.

Specified by:
isLocked in interface QueryInterface
Parameters:
- the index of the record to check
- the unique identifier of the clienent thet is performing request
Throws:
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
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

lock

public void lock(int,
                 java.lang.String)
          throws java.rmi.RemoteException,
                 ClientNotLoggedInException,
                 RecordNotFoundException
Description copied from interface: QueryInterface
Locks a record so that it can only be updated or deleted by this client. If the specified record is already locked, the current thread gives up the CPU and consumes no CPU cycles until the record is unlocked.

Specified by:
lock in interface QueryInterface
Parameters:
- the index of the record to lock
- the unique identifier of the clienent thet is performing request
Throws:
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
java.rmi.RemoteException - - required for remote access
RecordNotFoundException - is thrown if a specified record does not exist or is marked as deleted in the database file.

logIn

public java.lang.String logIn()
                       throws java.rmi.RemoteException
Description copied from interface: QueryInterface
The method performs client login it is required as server needs to identify clients

Specified by:
logIn in interface QueryInterface
Returns:
uniqe identifier that is required for all dataBase action invocations
Throws:
java.rmi.RemoteException - - required for remote access

logIn

public void logIn(java.lang.String)
           throws java.rmi.RemoteException
Description copied from interface: QueryInterface
The method performs client login it is required as server needs to identify clients

Specified by:
logIn in interface QueryInterface
Parameters:
- client login
Throws:
java.rmi.RemoteException - - required for remote access

logOut

public void logOut(java.lang.String)
            throws java.rmi.RemoteException,
                   ClientNotLoggedInException
Description copied from interface: QueryInterface
The method performs client logout - no others connections with such login will be available

Specified by:
logOut in interface QueryInterface
Parameters:
- uniqe client identifier
Throws:
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
java.rmi.RemoteException - - required for remote access

read

public java.lang.String[] read(int,
                               java.lang.String)
                        throws java.rmi.RemoteException,
                               ClientNotLoggedInException,
                               RecordNotFoundException
Description copied from interface: QueryInterface
Reads a record from the file. Returns an array where each element is a record value.

Specified by:
read in interface QueryInterface
Parameters:
- the index of the requested record
- the unique identifier of the clienent thet is performing request
Returns:
string array with the values of requested record fields
Throws:
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
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

unlock

public void unlock(int,
                   java.lang.String)
            throws java.rmi.RemoteException,
                   ClientNotLoggedInException,
                   RecordNotFoundException
Description copied from interface: QueryInterface
Releases the lock on a record.

Specified by:
unlock in interface QueryInterface
Parameters:
- the index of the record to lock
- the unique identifier of the clienent thet is performing request
Throws:
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
java.rmi.RemoteException - - required for remote access
RecordNotFoundException - is thrown if a specified record does not exist or is marked as deleted in the database file.

update

public void update(int,
                   java.lang.String[],
                   java.lang.String)
            throws java.rmi.RemoteException,
                   ClientNotLoggedInException,
                   RecordNotFoundException
Description copied from interface: QueryInterface
Modifies the fields of a record. The new value for field n appears in data[n].

Specified by:
update in interface QueryInterface
Parameters:
- the index of the record to operate on
- the new set of data for the requested record
- the unique identifier of the clienent thet is performing request
Throws:
ClientNotLoggedInException - - is thrown when client login passed as argument is not a valid client login (e.g. client has not been logged in)
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