org.opengts.db
Class CustomParserAdapter

java.lang.Object
  extended by org.opengts.db.CustomParserAdapter
All Implemented Interfaces:
CustomParser

public class CustomParserAdapter
extends java.lang.Object
implements CustomParser


Field Summary
 
Fields inherited from interface org.opengts.db.CustomParser
ACCOUNT, COUNT, DATA, DATA_TYPE, DEVICE, DUPLEX, INDEX, PREFIX_, TRANSPORT
 
Constructor Summary
CustomParserAdapter()
           
 
Method Summary
static java.util.Map<java.lang.String,java.lang.Object> ClearTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> evMap)
          Removes the temperature variables from the specified EventData field map
static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map, Device device, java.lang.String transport, int dataType, byte[] data, int count, int index)
          Initialize CustomParser EventData field map with temporary variables
static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map, Device device, java.lang.String transport, int dataType, java.lang.String data, int count, int index)
          Initialize CustomParser EventData field map with temporary variables
static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map, Device device, java.lang.String transport, java.lang.String dataType, byte[] data, int count, int index)
          Initialize CustomParser EventData field map with temporary variables
static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map, Device device, java.lang.String transport, java.lang.String dataType, java.lang.String data, int count, int index)
          Initialize CustomParser EventData field map with temporary variables
 byte[] parseData(Account account, Device device, java.lang.String type, byte[] data, java.util.Map<java.lang.String,java.lang.Object> props)
          Callback to parse raw data received from a remote tracking device through its device communication server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomParserAdapter

public CustomParserAdapter()
Method Detail

InitTemporaryVars

public static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map,
                                                                                 Device device,
                                                                                 java.lang.String transport,
                                                                                 java.lang.String dataType,
                                                                                 byte[] data,
                                                                                 int count,
                                                                                 int index)
Initialize CustomParser EventData field map with temporary variables

Parameters:
map - The EventData field map to initialize
device - The current Device instance (may be null)
transport - Transport method (ie. "TCP", "UDP", "Satellite", etc)
dataType - The data type (as defined by the DCS)
data - The data
count - Total number of events this session
index - Index of current event within session
Returns:
The EventData field map

InitTemporaryVars

public static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map,
                                                                                 Device device,
                                                                                 java.lang.String transport,
                                                                                 int dataType,
                                                                                 byte[] data,
                                                                                 int count,
                                                                                 int index)
Initialize CustomParser EventData field map with temporary variables

Parameters:
map - The EventData field map to initialize
device - The current Device instance (may be null)
transport - Transport method (ie. "TCP", "UDP", "Satellite", etc)
dataType - The data type (as defined by the DCS)
data - The data
count - Total number of events this session
index - Index of current event within session
Returns:
The EventData field map

InitTemporaryVars

public static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map,
                                                                                 Device device,
                                                                                 java.lang.String transport,
                                                                                 java.lang.String dataType,
                                                                                 java.lang.String data,
                                                                                 int count,
                                                                                 int index)
Initialize CustomParser EventData field map with temporary variables

Parameters:
map - The EventData field map to initialize
device - The current Device instance (may be null)
transport - Transport method (ie. "TCP", "UDP", "Satellite", etc)
dataType - The data type (as defined by the DCS)
data - The data
count - Total number of events this session
index - Index of current event within session
Returns:
The EventData field map

InitTemporaryVars

public static java.util.Map<java.lang.String,java.lang.Object> InitTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> map,
                                                                                 Device device,
                                                                                 java.lang.String transport,
                                                                                 int dataType,
                                                                                 java.lang.String data,
                                                                                 int count,
                                                                                 int index)
Initialize CustomParser EventData field map with temporary variables

Parameters:
map - The EventData field map to initialize
device - The current Device instance (may be null)
transport - Transport method (ie. "TCP", "UDP", "Satellite", etc)
dataType - The data type (as defined by the DCS)
data - The data
count - Total number of events this session
index - Index of current event within session
Returns:
The EventData field map

ClearTemporaryVars

public static java.util.Map<java.lang.String,java.lang.Object> ClearTemporaryVars(java.util.Map<java.lang.String,java.lang.Object> evMap)
Removes the temperature variables from the specified EventData field map

Parameters:
evMap - The EventData field map
Returns:
The specified EventData field map

parseData

public byte[] parseData(Account account,
                        Device device,
                        java.lang.String type,
                        byte[] data,
                        java.util.Map<java.lang.String,java.lang.Object> props)
Callback to parse raw data received from a remote tracking device through its device communication server.

Specified by:
parseData in interface CustomParser
Parameters:
account - The assigned device Account instance
device - The assigned Device instance
type - The type of data contained in "data"
data - The byte array containing the raw data
props - A map where parsed data should be placed (to be inserted into the EventData record)
Returns:
The response which will be sent back to the device