st
Class Session

java.lang.Object
  |
  +--st.Session
All Implemented Interfaces:
java.lang.Runnable

public class Session
extends java.lang.Object
implements java.lang.Runnable

Helper for managing the shopping session with the server.


Constructor Summary
Session(SmartTicket st)
           
 
Method Summary
 void cancelSeats()
          Cancel the purchase.
 void close()
          Close the session.
 void confirmSeats(java.lang.String creditCardCheck)
          Confirm the purchase.
 void createUser(java.lang.String userID, java.lang.String password, int zipCode, java.lang.String creditCard, byte previewMode)
          Create a new user account.
 boolean isNewUser()
          Indicate whether the session is for a new user (one who doesn't have an account).
 void loadLocales(LocaleList ll)
          Load the list of locales available for this application.
 void loadLocations(LocationList ll, int movieID)
          Load the locations for the given movie.
 void loadMessages(int localeID)
          Load into the record store the localized messages for the locale with the given ID.
 void loadMovies(MovieList ml)
          Load movie data.
 void loadPoster(ImageCanvas ic, java.lang.String posterURL)
          Load a poster.
 void loadSeatingPlan(SeatingCanvas sc, int showID, java.lang.String movieTitle, java.lang.String showtime)
          Load the given seating canvas with the data of the seating plan for the given show.
 void loadShowtimes(ShowtimeList sl, int movieID, int locationID)
          Load showtimes for the given movie at the given location.
 void login()
          Login to server.
 void open()
          Open the session.
 javax.microedition.rms.RecordStore openMessageStore(boolean create)
          Open the record store for storing localized messages.
 void reserveSeats(ConfirmForm cf, int[] selectedSeats, java.lang.String movieTitle, java.lang.String showtime)
          Reserve the selected seats.
 void run()
          run method for this session - from here we call the individual methods that service the requests
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session(SmartTicket st)
Method Detail

run

public void run()
run method for this session - from here we call the individual methods that service the requests
Specified by:
run in interface java.lang.Runnable

open

public void open()
Open the session. Remember to call close() when you are done.

isNewUser

public boolean isNewUser()
Indicate whether the session is for a new user (one who doesn't have an account).

close

public void close()
Close the session. The session should have been opened using open().

login

public void login()
Login to server.

loadLocales

public void loadLocales(LocaleList ll)
Load the list of locales available for this application.
Parameters:
ll - the list to populate with locale data.

loadMessages

public void loadMessages(int localeID)
Load into the record store the localized messages for the locale with the given ID.

createUser

public void createUser(java.lang.String userID,
                       java.lang.String password,
                       int zipCode,
                       java.lang.String creditCard,
                       byte previewMode)
Create a new user account. This method saves some information locally and some information on the server.
Parameters:
userID - the user name.
password - the user's password.
zipCode - the user's zipCode.
creditCard - the user's credit card number.
previewMode - the user's preview mode preference.

loadMovies

public void loadMovies(MovieList ml)
Load movie data.
Parameters:
ml - the movie list to populate with the data.

loadPoster

public void loadPoster(ImageCanvas ic,
                       java.lang.String posterURL)
Load a poster.
Parameters:
ic - the ImageCanvas on which to display the poster.
posterURL - the URL of the poster.

loadLocations

public void loadLocations(LocationList ll,
                          int movieID)
Load the locations for the given movie.
Parameters:
ll - the location list to populate.
movieID - the ID of the movie.

loadShowtimes

public void loadShowtimes(ShowtimeList sl,
                          int movieID,
                          int locationID)
Load showtimes for the given movie at the given location.
Parameters:
sl - the list to populate with showtime data.
movieID - the ID of the movie.
locationID - the ID of the location.

loadSeatingPlan

public void loadSeatingPlan(SeatingCanvas sc,
                            int showID,
                            java.lang.String movieTitle,
                            java.lang.String showtime)
Load the given seating canvas with the data of the seating plan for the given show.
Parameters:
sc - the seating canvas which needs the data.
showID - the ID of the show.
movieTitle - the title of the movie (for display).
showtime - the time of the movie (for display).

reserveSeats

public void reserveSeats(ConfirmForm cf,
                         int[] selectedSeats,
                         java.lang.String movieTitle,
                         java.lang.String showtime)
Reserve the selected seats.
Parameters:
cf - the confirmation form into which the confirmation data should be loaded.
selectedSeats - the indices of the selected seats in the byte array representing the seating plan.
movieTitle - the title of the movie (for display).
showtime - the time of the showing (for display).

confirmSeats

public void confirmSeats(java.lang.String creditCardCheck)
Confirm the purchase.
Parameters:
creditCardCheck - the last four digits of the credit card number, as a security check.

cancelSeats

public void cancelSeats()
Cancel the purchase.

openMessageStore

public javax.microedition.rms.RecordStore openMessageStore(boolean create)
                                                    throws javax.microedition.rms.RecordStoreException
Open the record store for storing localized messages.


Copyright © 2002 Sun Microsystems Inc. All rights reserved.