com.tekann.remotesync.pda
Class AppContext

java.lang.Object
  extended by com.tekann.remotesync.pda.AppContext

public class AppContext
extends java.lang.Object

Handle information about an application in a PDA.

Author:
ricardo

Field Summary
 java.lang.String creatorId
           
 int id
           
static java.lang.String RANGES_TABLE_NAME
           
static java.lang.String SETTINGS_TABLE_NAME
           
 
Method Summary
static boolean appContextTableExists(java.lang.String applicationId)
          Verifies if the appContextTable already exists.
 TableRange getCurrentRange(java.lang.String tableName)
          Gets the current range.
static AppContext getInstance()
          Gets the instance.
 java.lang.Object getProperty(java.lang.String name)
          Gets a property
 totalcross.util.Vector getPropertyNames()
          Gets a vector with all the added properties.
 int getRangedNextId(java.lang.String tableName, int pkid)
          Gets the next range ID.
 totalcross.util.Vector getTableRange(java.lang.String tableName)
          Gets the TableRange of a table
 void loadProperties()
          Load all the properties of the app_context table.
static AppContext newInstance()
          Creates a new instance.
 void removeProperty(java.lang.String name)
          Removes a property.
 void saveProperties()
          Drops if the app_context table exists and right after creates it again with all its properties.
 void setProperty(java.lang.String name, java.lang.Object value)
          Adds or replaces a property
 void setTableRange(java.lang.String tableName, totalcross.util.Vector range)
          Adds or replaces the TableRange of a Table.
 java.lang.String toXML()
          Returns a XML file representing the app_context table with all your properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANGES_TABLE_NAME

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

SETTINGS_TABLE_NAME

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

creatorId

public java.lang.String creatorId

id

public int id
Method Detail

appContextTableExists

public static boolean appContextTableExists(java.lang.String applicationId)
Verifies if the appContextTable already exists.

Parameters:
applicationId -
Returns:

getInstance

public static AppContext getInstance()
Gets the instance.

Returns:

newInstance

public static AppContext newInstance()
Creates a new instance.

Returns:

getCurrentRange

public TableRange getCurrentRange(java.lang.String tableName)
Gets the current range.

Parameters:
tableName -
Returns:

getProperty

public java.lang.Object getProperty(java.lang.String name)
Gets a property

Parameters:
name -
Returns:

getPropertyNames

public totalcross.util.Vector getPropertyNames()
Gets a vector with all the added properties.

Returns:

getRangedNextId

public int getRangedNextId(java.lang.String tableName,
                           int pkid)
                    throws java.lang.Exception
Gets the next range ID.

Parameters:
tableName -
pkid -
Returns:
Throws:
java.lang.Exception

getTableRange

public totalcross.util.Vector getTableRange(java.lang.String tableName)
Gets the TableRange of a table

Parameters:
tableName -
Returns:

loadProperties

public void loadProperties()
                    throws java.lang.Exception
Load all the properties of the app_context table.

Throws:
java.lang.Exception

removeProperty

public void removeProperty(java.lang.String name)
Removes a property.

Parameters:
name -

saveProperties

public void saveProperties()
                    throws java.lang.Exception
Drops if the app_context table exists and right after creates it again with all its properties.

Throws:
java.lang.Exception

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Adds or replaces a property

Parameters:
name -
value -

setTableRange

public void setTableRange(java.lang.String tableName,
                          totalcross.util.Vector range)
Adds or replaces the TableRange of a Table.

Parameters:
tableName -
range -

toXML

public java.lang.String toXML()
Returns a XML file representing the app_context table with all your properties.

Returns:
Um arquivo XML.