ParkNPark.interfaces
Class _ClientManagerStub

java.lang.Object
  extended by org.omg.CORBA.portable.ObjectImpl
      extended by ParkNPark.interfaces._ClientManagerStub
All Implemented Interfaces:
Serializable, Object, IDLEntity, ClientManager, ClientManagerOperations

public class _ClientManagerStub
extends ObjectImpl
implements ClientManager

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

See Also:
Serialized Form

Field Summary
private static String[] __ids
           
 
Constructor Summary
_ClientManagerStub()
           
 
Method Summary
 String[] _ids()
           
 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
 PaddedIntegerSeq 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
 PaddedVoid exitLot(int seq)
          Removes the client's car from the lot that it is currently in
 PaddedInteger getClientID()
          Returns the client's ID, which can be used in the client manager factory's getExistingClientManager() method
 PaddedInteger getCurrentLevel()
          Returns the car's current level number
 PaddedIntegerSeq getLots()
          Returns an array of valid lot numbers in the system, sorted by the lot number in ascending order
 PaddedInteger getMaxLevel()
          Returns the top level number of the car's current parking lot
 PaddedInteger getMinLevel()
          Returns the bottom level number of the car's current parking lot
 PaddedIntegerSeq getOtherLotAvailability(int lot)
          Returns an array of other lots that have availability, sorted by lot distance such that closer lots are listed first
 PaddedInteger moveDownLevel(int seq)
          Moves the car from its present level to the level beneath it
 PaddedInteger moveUpLevel(int seq)
          Moves the car from its present level to the level above it
private  void readObject(ObjectInputStream s)
           
private  void writeObject(ObjectOutputStream s)
           
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Field Detail

__ids

private static String[] __ids
Constructor Detail

_ClientManagerStub

public _ClientManagerStub()
Method Detail

getClientID

public PaddedInteger getClientID()
                          throws ServiceUnavailableException
Returns the client's ID, which can be used in the client manager factory's getExistingClientManager() method

Specified by:
getClientID in interface ClientManagerOperations
Returns:
The client's ID
Throws:
ServiceUnavailableException - Thrown when the log is closed and the server is shutting down

enterLot

public PaddedIntegerSeq 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

Specified by:
enterLot in interface ClientManagerOperations
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

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

Specified by:
exitLot in interface ClientManagerOperations
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

public PaddedIntegerSeq 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

Specified by:
getOtherLotAvailability in interface ClientManagerOperations
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

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

Specified by:
getLots in interface ClientManagerOperations
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

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

Specified by:
moveUpLevel in interface ClientManagerOperations
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

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

Specified by:
moveDownLevel in interface ClientManagerOperations
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

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

Specified by:
getCurrentLevel in interface ClientManagerOperations
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

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

Specified by:
getMaxLevel in interface ClientManagerOperations
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

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

Specified by:
getMinLevel in interface ClientManagerOperations
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

public 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

Specified by:
closeClientManager in interface ClientManagerOperations
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

_ids

public String[] _ids()
Specified by:
_ids in class ObjectImpl

readObject

private void readObject(ObjectInputStream s)
                 throws IOException
Throws:
IOException

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
Throws:
IOException