|
CreditCardPack | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.keyoti.creditCard.logic.ejb.CreditCardBean
CreditCardEJB Bean implementation class, mirrors CreditCard in functionality.
Please consult the local (CreditCardLocal) and
remote (CreditCard) component interfaces for general usage
information.
| Field Summary | |
protected String |
cardVerificationNumber
The card verification number, this is not persisted. |
protected javax.ejb.EntityContext |
context
|
| Constructor Summary | |
CreditCardBean()
|
|
| Method Summary | |
void |
ejbActivate()
|
String |
ejbCreate(String cardNumber)
|
void |
ejbLoad()
|
void |
ejbPassivate()
|
void |
ejbPostCreate(String cardNumber)
|
void |
ejbRemove()
|
void |
ejbStore()
|
String[] |
getBillingAddress()
Gets the card billing address |
String |
getCardName()
Gets the card name |
String |
getCardNumber()
Gets the card number |
CardType |
getCardType()
Gets the card type |
String |
getCardVerificationNumber()
Gets the Card Verification Number, this is not be stored in long term persistence. |
String |
getComments()
Gets the card comments |
Integer |
getExpiryMonth()
Gets the expiry month |
Integer |
getExpiryYear()
Gets the expiry year |
abstract String[] |
getIntBillingAddress()
Gets the card billing address. |
abstract String |
getIntCardName()
Gets the card owners name. |
abstract String |
getIntCardNumber()
Gets the card number. |
abstract CardType |
getIntCardType()
Gets the card type. |
abstract String |
getIntComments()
Gets the card comments. |
abstract Integer |
getIntExpiryMonth()
Gets the card expiry month (1->12). |
abstract Integer |
getIntExpiryYear()
Gets the card expiry year (0->99). |
abstract Integer |
getIntIssueNumber()
Gets the card issue number. |
abstract String |
getIntIssuer()
Gets the card issuer. |
abstract Integer |
getIntStartMonth()
Gets the card start month (1->12). |
abstract Integer |
getIntStartYear()
Gets the card start year (0->99). |
Integer |
getIssueNumber()
Gets the issue number |
String |
getIssuer()
Gets the card issuer |
Integer |
getStartMonth()
Gets the start month |
Integer |
getStartYear()
Gets the start year |
boolean |
isCardNameValid()
Determines if the card holders name is valid, this is a very simple method, that just checks if the card name field is longer than 0 chars and not null. |
boolean |
isCardNumberValid()
Determines if the card number is valid, according to a MOD10 check and character validity check. |
boolean |
isCardTypeValid()
Determines if the card type corresponds with the credit card number. |
boolean |
isCardVerificationNumberValid()
Determines if the card verification number is 3 or 4 digits long and only includes numeric characters. |
boolean |
isExpiryMonthValid()
Determines if the expiry month is valid, simply by checking that it is between 1 and 12 inclusive. |
boolean |
isExpiryYearValid()
Determines if the expiry year is valid , simply by checking that it is between 0 and 99 inclusive (since credit card expiry dates are 2 digits long). |
boolean |
isMinimumValid()
Convenience method, checks that card number, expiry date, type and card name are valid. |
boolean |
isStartMonthValid()
Determines if the start month is valid, simply by checking that it is between 1 and 12 inclusive. |
boolean |
isStartYearValid()
Determines if the start year is valid , simply by checking that it is between 0 and 99 inclusive (since credit card start dates are 2 digits long). |
void |
setBillingAddress(String[] billingAddress)
Sets the card billingAddress array. |
void |
setCardName(String cardName)
Sets the card owners name. |
void |
setCardType(CardType cardType)
Sets the card type. |
void |
setCardVerificationNumber(String cvn)
Sets the Card Verification Number (CVN), this is NOT stored in long term persistence. |
void |
setComments(String comments)
Sets the card comments. |
void |
setEntityContext(javax.ejb.EntityContext ctx)
|
void |
setExpiryMonth(int expiryMonth)
Sets the card expiry date month, using setExpiryMonth(Integer). |
void |
setExpiryMonth(Integer expiryMonth)
Sets the card expiry date month. |
void |
setExpiryYear(int expiryYear)
Sets the card expiry date year, using setExpiryYear(Integer). |
void |
setExpiryYear(Integer expiryYear)
Sets the card expiry date year, because credit cards usually specify 2 digit year values this is mirrored here. |
abstract void |
setIntBillingAddress(String[] billingAddress)
Sets the card billing address. |
abstract void |
setIntCardName(String cardName)
Sets the card owners name. |
abstract void |
setIntCardNumber(String cardNumber)
Sets the card number. |
abstract void |
setIntCardType(CardType type)
Sets the card type. |
abstract void |
setIntComments(String comments)
Sets the card comments. |
abstract void |
setIntExpiryMonth(Integer month)
Sets the card expiry month (1->12). |
abstract void |
setIntExpiryYear(Integer year)
Sets the card expiry year (0->99). |
abstract void |
setIntIssueNumber(Integer iN)
Sets the card issue number. |
abstract void |
setIntIssuer(String issuer)
Sets the card issuer. |
abstract void |
setIntStartMonth(Integer month)
Sets the card start month (1->12). |
abstract void |
setIntStartYear(Integer year)
Sets the card start year (0->99). |
void |
setIssueNumber(int issueNumber)
Sets the card issue number, using setIssueNumber(Integer). |
void |
setIssueNumber(Integer issueNumber)
Sets the card issue number. |
void |
setIssuer(String issuer)
Sets the card issuer's name. |
void |
setStartMonth(int startMonth)
Sets the card start date month, using setStartMonth(Integer). |
void |
setStartMonth(Integer startMonth)
Sets the card start date month. |
void |
setStartYear(int startYear)
Sets the card start date year, using setStartYear(Integer). |
void |
setStartYear(Integer startYear)
Sets the card start date year, because credit cards usually specify 2 digit year values this is mirrored here. |
void |
unsetEntityContext()
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected javax.ejb.EntityContext context
protected String cardVerificationNumber
setCardVerificationNumber(java.lang.String)| Constructor Detail |
public CreditCardBean()
| Method Detail |
public abstract String getIntCardNumber()
public abstract Integer getIntExpiryMonth()
public abstract Integer getIntExpiryYear()
public abstract Integer getIntStartMonth()
public abstract Integer getIntStartYear()
public abstract Integer getIntIssueNumber()
public abstract String getIntCardName()
public abstract CardType getIntCardType()
public abstract String getIntIssuer()
public abstract String getIntComments()
public abstract String[] getIntBillingAddress()
public abstract void setIntCardNumber(String cardNumber)
public abstract void setIntExpiryMonth(Integer month)
public abstract void setIntExpiryYear(Integer year)
public abstract void setIntStartMonth(Integer month)
public abstract void setIntStartYear(Integer year)
public abstract void setIntIssueNumber(Integer iN)
public abstract void setIntCardName(String cardName)
public abstract void setIntCardType(CardType type)
public abstract void setIntIssuer(String issuer)
public abstract void setIntComments(String comments)
public abstract void setIntBillingAddress(String[] billingAddress)
public String getCardNumber()
public String getCardName()
public CardType getCardType()
public Integer getExpiryMonth()
public Integer getExpiryYear()
public Integer getIssueNumber()
public Integer getStartMonth()
public Integer getStartYear()
public String getComments()
public String getIssuer()
public String[] getBillingAddress()
public String getCardVerificationNumber()
public void setCardName(String cardName)
cardName != nullgetCardName() == cardNamepublic void setCardType(CardType cardType)
cardType != nullgetCardType() == cardType
public void setExpiryMonth(Integer expiryMonth)
throws NullPointerException,
IllegalArgumentException
expiryMonth != null AND expiryMonth >= 1 AND expiryMonth <= 12getExpiryMonth() == expiryMonth AND isExpiryMonthValid() == truepublic void setExpiryYear(Integer expiryYear)
expiryYear != null AND expiryYear >= 0 AND expiryYear <= 99getExpiryYear() == expiryYear AND isExpiryYearValid() == true
public void setStartMonth(Integer startMonth)
throws NullPointerException,
IllegalArgumentException
startMonth != null AND startMonth >= 1 AND startMonth <= 12getStartMonth() == startMonth AND isStartMonthValid() == truepublic void setStartYear(Integer startYear)
startYear != null AND startYear >= 0 AND startYear <= 99getStartYear() == startYear AND isStartYearValid() == truepublic void setIssueNumber(Integer issueNumber)
issueNumber != null AND issueNumber >=0 AND issueNumber <= 999getIssueNumber() == issueNumber
public void setExpiryMonth(int expiryMonth)
throws IllegalArgumentException
setExpiryMonth(Integer)
public void setExpiryYear(int expiryYear)
throws IllegalArgumentException
setExpiryYear(Integer)
public void setStartMonth(int startMonth)
throws IllegalArgumentException
setStartMonth(Integer)
public void setStartYear(int startYear)
throws IllegalArgumentException
setStartYear(Integer)
public void setIssueNumber(int issueNumber)
throws IllegalArgumentException
setIssueNumber(Integer)
public void setCardVerificationNumber(String cvn)
throws IllegalArgumentException,
NullPointerException
cvn - the card verification number String.cvn != null AND ((3 <= cvn.length() <= 4 AND cvn.equals(LuhnChecker.getDigitsOnly(cvn))) OR cvn == "" )getCardVerificationNumber() == cvnpublic void setIssuer(String issuer)
issuer != nullgetIssuer() == issuerpublic void setComments(String comments)
comments != nullgetComments() == commentspublic void setBillingAddress(String[] billingAddress)
billingAddress != nullgetBillingAddress() == billingAddresspublic boolean isCardNumberValid()
return == LuhnChecker.isValid(getCardNumber())public boolean isCardNameValid()
return == getCardName().length() > 0public boolean isStartMonthValid()
public boolean isStartYearValid()
public boolean isExpiryMonthValid()
public boolean isExpiryYearValid()
public boolean isCardTypeValid()
CardTypepublic boolean isCardVerificationNumberValid()
return == (true AND getCardVerificationNumber() != null AND 3 <= getCardVerificationNumber().length() <= 4 AND LuhnChecker.getDigitsOnly(getCardVerificationNumber()).equals(getCardVerificationNumber())) OR falsepublic boolean isMinimumValid()
public String ejbCreate(String cardNumber)
throws javax.ejb.CreateException
public void ejbPostCreate(String cardNumber)
public void ejbRemove()
public void ejbActivate()
public void ejbPassivate()
public void setEntityContext(javax.ejb.EntityContext ctx)
public void unsetEntityContext()
public void ejbLoad()
public void ejbStore()
|
CreditCardPack | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||