topdown.client
Class BankingApplication

java.lang.Object
  extended bytopdown.client.BankingApplication

public class BankingApplication
extends java.lang.Object

A client that interacts with the bank service to demonstrate various interactions. The client creates a service endpoint and subsequently uses that instance to invoke service methods.


Field Summary
private static java.lang.String DEMO_USER1
          A demo user.
private static java.lang.String DEMO_USER2
          A demo user.
private static java.lang.String DEMO_USER3
          A demo user.
private  BankServicePortClient m_endpoint
          The service endpoint.
 
Constructor Summary
BankingApplication(java.lang.String serviceURL)
          Creates an instance of the bank client.
 
Method Summary
private  void demoGoodAccount()
          Demonstrates successful interactions with the bank service.
private  void demoInsufficientFunds()
          Demonstrates an attempt to create an account with no initial funds.
private  void demoWithdrawalCap()
          Demonstrates an attempt to withdraw money from a generated account beyond the allowed withdrawl cap.
static void main(java.lang.String[] args)
          Runs the demo client.
private  void runDemo()
          Executes a number of demo interactions with the deployed service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEMO_USER1

private static java.lang.String DEMO_USER1
A demo user.


DEMO_USER2

private static java.lang.String DEMO_USER2
A demo user.


DEMO_USER3

private static java.lang.String DEMO_USER3
A demo user.


m_endpoint

private BankServicePortClient m_endpoint
The service endpoint.

Constructor Detail

BankingApplication

public BankingApplication(java.lang.String serviceURL)
                   throws java.lang.Exception
Creates an instance of the bank client.

Parameters:
serviceURL - the endpoint URL.
Throws:
java.lang.Exception - if any runtime exception is generated during the interactions with the service.
Method Detail

runDemo

private void runDemo()
              throws java.lang.Exception
Executes a number of demo interactions with the deployed service.

Throws:
java.lang.Exception - if any runtime exception is generated during the interactions with the service.

demoWithdrawalCap

private void demoWithdrawalCap()
                        throws java.lang.Exception
Demonstrates an attempt to withdraw money from a generated account beyond the allowed withdrawl cap.

Throws:
java.lang.Exception - if any runtime exception is generated during the interactions with the service.

demoInsufficientFunds

private void demoInsufficientFunds()
                            throws java.lang.Exception
Demonstrates an attempt to create an account with no initial funds.

Throws:
java.lang.Exception - if any runtime exception is generated during the interactions with the service.

demoGoodAccount

private void demoGoodAccount()
                      throws java.lang.Exception
Demonstrates successful interactions with the bank service.

Throws:
java.lang.Exception - if any runtime exception is generated during the interactions with the service.

main

public static void main(java.lang.String[] args)
Runs the demo client.

Parameters:
args - the URL for the service endpoint.