001 package org.cocome.tradingsystem.systests.interfaces; 002 003 /** 004 * This is the interface used for a bank. There is exactly one bank in the 005 * entire system which is used for all credit card checks. The bank is not 006 * checked for events but is just used to manage credit cards (so we know which 007 * ones are valid). 008 * 009 * @author Benjamin Hummel 010 * @author $Author: hummel $ 011 * @version $Rev: 47 $ 012 * @levd.rating GREEN Rev: 47 013 */ 014 public interface IBank { 015 016 /** 017 * Create a new credit card for this bank. If a card of this number already 018 * exists, the old card will be replaced. 019 * 020 * @param cardNumber 021 * the number for this card. 022 * @param pinNumber 023 * the secret pin code for the credit card. 024 * @param availableMoney 025 * the amount of money in cents associated with this card. 026 */ 027 void createCreditCard(int cardNumber, int pinNumber, int availableMoney) 028 throws Exception; 029 030 /** 031 * Returns the amount of money (in cents) available for this card. 032 * 033 * @param cardNumber 034 * the number for this card. 035 */ 036 int getAvailableMoney(int cardNumber) throws Exception; 037 038 /** 039 * Deletes the given credit card. If the card does not exist, nothing 040 * happens. 041 * 042 * @param cardNumber 043 * the number of card to be deleted. 044 */ 045 void deleteCreditCard(int cardNumber) throws Exception; 046 }