mymobilesite.controller
Class Configurations

java.lang.Object
  extended by mymobilesite.controller.Configurations
All Implemented Interfaces:
java.lang.Runnable

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

The Configurations class must manage the things the user should be able to configure, which is the username. This should be stored until the next time the application is used and the language which can be changed. This class also holds static variables that are used by a variety of classes and that are collected so that it is simpler to change their values later.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
static java.lang.String FAULT_SCHEMA_URI
           
static java.lang.String IDP_URL
           
private  int index
           
static java.lang.String LANGUAGE
          These variables gives the application's default values for language and username.
static int LANGUAGE_INDEX
          The index in the RecordStore where language and username can be found.
static int NAME_LENGTH_CONSTRAINT
           
static java.lang.String RECORDSTORE_NAME
           
static java.lang.String REQUEST_SCHEMA_URI
           
static java.lang.String RESPONSE_SCHEMA_URI
           
static java.lang.String SERVICE_TYPE_URI
           
static long TIMESTAMP_DEVIATION_MILLIS
           
static java.lang.String USERNAME
           
static int USERNAME_INDEX
           
private  java.lang.String value
           
 
Constructor Summary
Configurations()
           
 
Method Summary
 void read()
          This method tries to read the content of the applications's recordstore.
 void run()
          This method is used when writing a value to the RecordStore.
 void write(int index, java.lang.String value)
          This method updates a record (recognised by the specified index) in the application's recordstore and updates the value in this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDP_URL

public static final java.lang.String IDP_URL
See Also:
Constant Field Values

RECORDSTORE_NAME

public static final java.lang.String RECORDSTORE_NAME
See Also:
Constant Field Values

SERVICE_TYPE_URI

public static final java.lang.String SERVICE_TYPE_URI
See Also:
Constant Field Values

REQUEST_SCHEMA_URI

public static final java.lang.String REQUEST_SCHEMA_URI
See Also:
Constant Field Values

RESPONSE_SCHEMA_URI

public static final java.lang.String RESPONSE_SCHEMA_URI
See Also:
Constant Field Values

FAULT_SCHEMA_URI

public static final java.lang.String FAULT_SCHEMA_URI
See Also:
Constant Field Values

NAME_LENGTH_CONSTRAINT

public static final int NAME_LENGTH_CONSTRAINT
See Also:
Constant Field Values

TIMESTAMP_DEVIATION_MILLIS

public static final long TIMESTAMP_DEVIATION_MILLIS
See Also:
Constant Field Values

LANGUAGE

public static java.lang.String LANGUAGE
These variables gives the application's default values for language and username.


USERNAME

public static java.lang.String USERNAME

LANGUAGE_INDEX

public static final int LANGUAGE_INDEX
The index in the RecordStore where language and username can be found.

See Also:
Constant Field Values

USERNAME_INDEX

public static final int USERNAME_INDEX
See Also:
Constant Field Values

index

private int index

value

private java.lang.String value
Constructor Detail

Configurations

public Configurations()
Method Detail

read

public void read()
This method tries to read the content of the applications's recordstore. If this is the first use of the appplication, this method creates the recordstore using default values. Otherwise it reads the values and stores them in the variables LANGUAGE and USERNAME.


write

public void write(int index,
                  java.lang.String value)
This method updates a record (recognised by the specified index) in the application's recordstore and updates the value in this class.

Parameters:
index - int The index in the recordstore that should be updated.
value - String The new value to put in the recordstore.

run

public void run()
This method is used when writing a value to the RecordStore. Since this is a time consuming operation compared to other things done at the same time, this runs in its own Thread.

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()