ParkNPark.interfaces
Interface ClientManagerOperations

All Known Subinterfaces:
ClientManager
All Known Implementing Classes:
_ClientManagerStub, ClientManagerImpl, ClientManagerPOA, FaultTolerantClientManager

public interface ClientManagerOperations

The interface that a single client uses to communicate with its server-side client manager instance


Method Summary
 void closeClientManager()
          Closes the client manager and frees server resources associated with it, including the client manager's activation in the server's CORBA portable object adapter
 int[] enterLot(int seq, int lot)
          Moves the client's car into the lot with the given lot number and returns an array of level numbers that have available spaces
 void exitLot(int seq)
          Removes the client's car from the lot that it is currently in
 int getClientID()
          Returns the client's ID, which can be used in the client manager factory's getExistingClientManager() method
 int getCurrentLevel()
          Returns the car's current level number
 int[] getLots()
          Returns an array of valid lot numbers in the system, sorted by the lot number in ascending order
 int getMaxLevel()
          Returns the top level number of the car's current parking lot
 int getMinLevel()
          Returns the bottom level number of the car's current parking lot
 int[] getOtherLotAvailability(int lot)
          Returns an array of other lots that have availability, sorted by lot distance such that closer lots are listed first
 int moveDownLevel(int seq)
          Moves the car from its present level to the level beneath it
 int moveUpLevel(int seq)
          Moves the car from its present level to the level above it
 

Method Detail

getClientID

int getClientID()
Returns the client's ID, which can be used in the client manager factory's getExistingClientManager() method

Returns:
The client's ID

enterLot

int[] enterLot(int seq,
               int lot)
               throws AlreadyInLotException,
                      LotNotFoundException,
                      LotFullException,
                      ServiceUnavailableException
Moves the client's car into the lot with the given lot number and returns an array of level numbers that have available spaces

Parameters:
seq - The latest sequence number of the client
lot - The lot number to enter
Returns:
An array of level numbers that have available spaces [Category: Baseline; Requirements: 1, 2, and 3]
Throws:
AlreadyInLotException - Thrown when the client's car is already in a lot
LotNotFoundException - Thrown if the given lot number is not known to the system
LotFullException - Thrown if the given lot is full
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the car from entering the lot

exitLot

void exitLot(int seq)
             throws NotInLotException,
                    NotOnExitLevelException,
                    ServiceUnavailableException
Removes the client's car from the lot that it is currently in

Parameters:
seq - The latest sequence number of the client
Throws:
NotInLotException - Thrown if the car is not in a lot
NotOnExitLevelException - Thrown if the car is in a lot but is not on a permitted exit level
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the car from exiting the lot [Category: Baseline; Requirement: 7]

getOtherLotAvailability

int[] getOtherLotAvailability(int lot)
                              throws LotNotFoundException,
                                     ServiceUnavailableException
Returns an array of other lots that have availability, sorted by lot distance such that closer lots are listed first

Parameters:
lot - The lot to get lot distances from
Returns:
An array of other lots that have availability [Category: Baseline; Requirement: 4]
Throws:
LotNotFoundException - Thrown if the given lot number is not known to the system
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the system from discovering the availability of other lots

getLots

int[] getLots()
              throws ServiceUnavailableException
Returns an array of valid lot numbers in the system, sorted by the lot number in ascending order

Returns:
An array of valid lot numbers in the system [Category: Baseline; Requirement: 12]
Throws:
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the system from discovering the its defined lots

moveUpLevel

int moveUpLevel(int seq)
                throws NotInLotException,
                       AtTopLevelException,
                       ServiceUnavailableException
Moves the car from its present level to the level above it

Parameters:
seq - The latest sequence number of the client
Returns:
The level number that the client's car is now on [Category: Baseline; Requirement: 6]
Throws:
NotInLotException - Thrown if the car is not in a lot
AtTopLevelException - Thrown if the car is already on the highest level
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the car from moving to the next highest level

moveDownLevel

int moveDownLevel(int seq)
                  throws NotInLotException,
                         AtBottomLevelException,
                         ServiceUnavailableException
Moves the car from its present level to the level beneath it

Parameters:
seq - The latest sequence number of the client
Returns:
The level number that the client's car is now on [Category: Baseline; Requirement: 6]
Throws:
NotInLotException - Thrown if the car is not in a lot
AtTopLevelException - Thrown if the car is already on the lowest level
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the car from moving to the lower level
AtBottomLevelException

getCurrentLevel

int getCurrentLevel()
                    throws NotInLotException,
                           ServiceUnavailableException
Returns the car's current level number

Returns:
The car's current level number [Category: Baseline; Requirement: 6]
Throws:
NotInLotException - Thrown if the car is not in a lot
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the system from returning the car's current level

getMaxLevel

int getMaxLevel()
                throws NotInLotException,
                       ServiceUnavailableException
Returns the top level number of the car's current parking lot

Returns:
The top level number of the car's current parking lot [Category: Baseline; Requirement: 6]
Throws:
NotInLotException - Thrown if the car is not in a lot
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the system from returning the current lot's highest level

getMinLevel

int getMinLevel()
                throws NotInLotException,
                       ServiceUnavailableException
Returns the bottom level number of the car's current parking lot

Returns:
The bottom level number of the car's current parking lot [Category: Baseline; Requirement: 6]
Throws:
NotInLotException - Thrown if the car is not in a lot
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the system from returning the current lot's lowest level

closeClientManager

void closeClientManager()
                        throws ServiceUnavailableException
Closes the client manager and frees server resources associated with it, including the client manager's activation in the server's CORBA portable object adapter

Throws:
ServiceUnavailableException - Thrown if the database cannot be contacted or if some other reason prevents the system from closing the client manager. The client manager remains open if this exception gets thrown