org.opengts.db
Class EntityManager

java.lang.Object
  extended by org.opengts.db.EntityManager

public abstract class EntityManager
extends java.lang.Object


Nested Class Summary
static class EntityManager.EntityType
           
 
Constructor Summary
EntityManager()
           
 
Method Summary
abstract  java.lang.String[] getAttachedEntityDescriptions(java.lang.String accountID, java.lang.String deviceID, long entityType)
           
abstract  java.lang.String[] getAttachedEntityIDs(java.lang.String accountID, java.lang.String deviceID, long entityType)
           
static EntityManager.EntityType getDefaultEntityType()
          Returns the default EntityType
abstract  java.lang.String getEntityDescription(java.lang.String accountID, java.lang.String entityID, long entityType)
           
static EntityManager.EntityType getEntityType(EntityManager.EntityType et)
          Returns the specified EntityType, or the default EntityType if the specified EntityType is null.
static EntityManager.EntityType getEntityTypeForStatusCode(int sc, EntityManager.EntityType dft)
          Returns the best EntityType for the specified status code
static EntityManager.EntityType getEntityTypeFromCode(long etc, EntityManager.EntityType dft)
          Returns the EntityType for the specified value, or the default EntityType if the specified value is not in the defined list of EntityTypes.
static EntityManager.EntityType getEntityTypeFromName(java.lang.String etn)
          Returns the named EntityType, or the default EntityType of the specified name is null or invalid.
static EntityManager.EntityType getEntityTypeFromName(java.lang.String etn, EntityManager.EntityType dft)
          Returns the named EntityType, or the specified default EntityType of the name is null or invalid.
static int[] getStatusCodesForEntityType(EntityManager.EntityType etype)
          Returns a 2-element array of connect/disconnect StatusCodes that most closely match the specified EntityType.
abstract  boolean insertEntityChange(EventData event)
           
abstract  boolean isEntityAttached(java.lang.String accountID, java.lang.String deviceID, java.lang.String entityID, long entityType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityManager

public EntityManager()
Method Detail

getDefaultEntityType

public static EntityManager.EntityType getDefaultEntityType()
Returns the default EntityType

Returns:
The default EntityType

getEntityType

public static EntityManager.EntityType getEntityType(EntityManager.EntityType et)
Returns the specified EntityType, or the default EntityType if the specified EntityType is null.

Parameters:
et - An EntityType
Returns:
A non-null EntityType

getEntityTypeFromName

public static EntityManager.EntityType getEntityTypeFromName(java.lang.String etn)
Returns the named EntityType, or the default EntityType of the specified name is null or invalid.

Parameters:
etn - The name of the EntityType
Returns:
A non-null EntityType

getEntityTypeFromCode

public static EntityManager.EntityType getEntityTypeFromCode(long etc,
                                                             EntityManager.EntityType dft)
Returns the EntityType for the specified value, or the default EntityType if the specified value is not in the defined list of EntityTypes.

Parameters:
etc - An EntityType code value
dft - The default EntityType to return if the specified name is invalid.
Returns:
A non-null EntityType

getEntityTypeFromName

public static EntityManager.EntityType getEntityTypeFromName(java.lang.String etn,
                                                             EntityManager.EntityType dft)
Returns the named EntityType, or the specified default EntityType of the name is null or invalid.

Parameters:
etn - The name of the EntityType
dft - The default EntityType to return if the specified name is invalid.
Returns:
A non-null EntityType

getStatusCodesForEntityType

public static int[] getStatusCodesForEntityType(EntityManager.EntityType etype)
Returns a 2-element array of connect/disconnect StatusCodes that most closely match the specified EntityType.

Parameters:
etype - The EntityType
Returns:
A non-null 2-element array of connect/disconnect StatusCodes

getEntityTypeForStatusCode

public static EntityManager.EntityType getEntityTypeForStatusCode(int sc,
                                                                  EntityManager.EntityType dft)
Returns the best EntityType for the specified status code


insertEntityChange

public abstract boolean insertEntityChange(EventData event)

getAttachedEntityIDs

public abstract java.lang.String[] getAttachedEntityIDs(java.lang.String accountID,
                                                        java.lang.String deviceID,
                                                        long entityType)
                                                 throws DBException
Throws:
DBException

getAttachedEntityDescriptions

public abstract java.lang.String[] getAttachedEntityDescriptions(java.lang.String accountID,
                                                                 java.lang.String deviceID,
                                                                 long entityType)
                                                          throws DBException
Throws:
DBException

getEntityDescription

public abstract java.lang.String getEntityDescription(java.lang.String accountID,
                                                      java.lang.String entityID,
                                                      long entityType)

isEntityAttached

public abstract boolean isEntityAttached(java.lang.String accountID,
                                         java.lang.String deviceID,
                                         java.lang.String entityID,
                                         long entityType)