Methods Summary |
---|
public void | credit(short m)
if( !security.isCommandSecure(SecurityService.PROPERTY_INPUT_INTEGRITY)){
UserException.throwIt(CORRUPTED_DATA);
}
if(!security.isAuthenticated(SecurityService.PRINCIPAL_APP_PROVIDER)) {
UserException.throwIt(REQUEST_DENIED);
}
if(m<=0) UserException.throwIt(BAD_ARGUMENT);
if((short)(balance+m) > MAX_AMOUNT) UserException.throwIt(OVERFLOW);
balance +=m;
|
public void | debit(short m)
if( !security.isCommandSecure(SecurityService.PROPERTY_INPUT_INTEGRITY)){
UserException.throwIt(CORRUPTED_DATA);
}
if(!security.isAuthenticated(SecurityService.PRINCIPAL_CARDHOLDER)) {
UserException.throwIt(REQUEST_DENIED);
}
if(m<=0) UserException.throwIt(BAD_ARGUMENT);
if((short)(balance-m) < 0) UserException.throwIt(UNDERFLOW);
balance -=m;
|
public byte[] | getAccountNumber()
if( !security.isCommandSecure(SecurityService.PROPERTY_INPUT_INTEGRITY)){
UserException.throwIt(CORRUPTED_DATA);
}
if(!security.isAuthenticated(SecurityService.PRINCIPAL_CARDHOLDER)) {
UserException.throwIt(REQUEST_DENIED);
}
return number;
|
public short | getBalance()
if( !security.isCommandSecure(SecurityService.PROPERTY_INPUT_INTEGRITY)){
UserException.throwIt(CORRUPTED_DATA);
}
if(!security.isAuthenticated(SecurityService.PRINCIPAL_APP_PROVIDER)) {
UserException.throwIt(REQUEST_DENIED);
}
return balance;
|
public void | setAccountNumber(byte[] number)
if( !security.isCommandSecure(SecurityService.PROPERTY_INPUT_INTEGRITY)){
UserException.throwIt(CORRUPTED_DATA);
}
if(!security.isAuthenticated(SecurityService.PRINCIPAL_APP_PROVIDER)) {
UserException.throwIt(REQUEST_DENIED);
}
if(number.length != 5) UserException.throwIt(BAD_ARGUMENT);
Util.arrayCopy(number, (short)0, this.number, (short)0, (short)5);
|