Methods Summary |
---|
public void | checkinCDDisc(PhysicalID aPhysicalID)checkinCDDisc
CDDisc aCDDisc = collections.theCDDiscDataAccess.
findByPhysicalID( aPhysicalID );
if ( aCDDisc != null )
{
aCDDisc.endRental();
}
else
{
throw new CheckInDeviation( ERROR_CD_DISC_NOT_IN_COLLECTION );
}
|
public RentalContractDTO | checkoutCDDisc(PhysicalID aPhysicalID, CustomerID aCustomerID)checkoutCDDisc
CDDisc aCDDisc = collections.theCDDiscDataAccess.
findByPhysicalID( aPhysicalID );
Customer aCustomer = collections.theCustomerDataAccess.
findByCustomerID( aCustomerID );
if ( aCDDisc == null )
{
throw new CheckOutDeviation(
ERROR_CD_DISC_NOT_IN_COLLECTION );
}
if ( aCustomer == null )
{
throw new CheckOutDeviation(
ERROR_CUSTOMER_NOT_IN_COLLECTION );
}
return aCDDisc.startRental( aCustomer );
|
public void | dispose()dispose
collections.dispose();
|
public static com.samscdrental.controller.RentalOperations | getInstance()
if ( theInstance == null )
{
theInstance = new RentalOperations();
}
return theInstance;
|
public boolean | isCDDiscRented(PhysicalID aPhysicalID)isCDDiscRented
CDDisc aCDDisc = collections.theCDDiscDataAccess.
findByPhysicalID( aPhysicalID );
if ( aCDDisc != null )
{
return ( aCDDisc.isRented() );
}
else
{
throw new StatusDeviation( ERROR_CD_DISC_NOT_IN_COLLECTION );
}
|