org.opengts.db
Class DCServerConfig

java.lang.Object
  extended by org.opengts.db.DCServerConfig
All Implemented Interfaces:
java.lang.Comparable

public class DCServerConfig
extends java.lang.Object
implements java.lang.Comparable


Nested Class Summary
static class DCServerConfig.Command
           
static class DCServerConfig.CommandArg
           
static class DCServerConfig.CommandProtocol
           
static class DCServerConfig.EventCode
          Device event code to status code translation
 
Field Summary
static java.lang.String COMMAND_CONFIG
           
static java.lang.String COMMAND_DIAGNOSTIC
           
static java.lang.String COMMAND_GEOZONE
           
static java.lang.String COMMAND_GFMI
           
static java.lang.String COMMAND_INTERNAL
           
static java.lang.String COMMAND_PING
           
static char[] CSV_SEP
           
static java.lang.String DEFAULT_ARG_NAME
           
static java.lang.String DEFAULT_PROP_GROUP_ID
           
static java.lang.String[] DIAG_LOG
           
static long F_COMMAND_SMS
           
static long F_COMMAND_TCP
           
static long F_COMMAND_UDP
           
static long F_HAS_INPUTS
           
static long F_HAS_OUTPUTS
           
static long F_JAR_OPTIONAL
           
static long F_NONE
           
static long F_STD_PERSONAL
           
static long F_STD_VEHICLE
           
static long F_XMIT_SAT
           
static long F_XMIT_SMS
           
static long F_XMIT_TCP
           
static long F_XMIT_UDP
           
static char[] GP_SEP
           
static java.lang.String JSONKey_AclDefault
           
static java.lang.String JSONKey_AclName
           
static java.lang.String JSONKey_AllowQueue
           
static java.lang.String JSONKey_Args
           
static java.lang.String JSONKey_AuditCode
           
static java.lang.String JSONKey_Commands
           
static java.lang.String JSONKey_CommandString
           
static java.lang.String JSONKey_DCS
           
static java.lang.String JSONKey_DefaultValue
           
static java.lang.String JSONKey_Description
           
static java.lang.String JSONKey_DisplayLength
           
static java.lang.String JSONKey_Enabled
           
static java.lang.String JSONKey_ExpectAck
           
static java.lang.String JSONKey_ExpectAckCode
           
static java.lang.String JSONKey_MaximumLength
           
static java.lang.String JSONKey_MaximumRouteAge
           
static java.lang.String JSONKey_Name
           
static java.lang.String JSONKey_Protocol
           
static java.lang.String JSONKey_ReadOnly
           
static java.lang.String JSONKey_ResourceName
           
static java.lang.String JSONKey_StateBitMask
           
static java.lang.String JSONKey_StateBitValue
           
static java.lang.String JSONKey_Types
           
static java.lang.String[] KEYARG_GPLAT
           
static java.lang.String[] KEYARG_GPLON
           
static java.lang.String[] KEYARG_GPS
           
static java.lang.String[] KEYARG_HEX16
           
static java.lang.String[] KEYARG_HEX32
           
static java.lang.String[] KEYARG_HEX64
           
static java.lang.String[] KEYARG_HEX8
           
static java.lang.String[] KEYARG_INT
           
static java.lang.String[] KEYARG_NOSPACE
           
static java.lang.String[] KEYARG_QUOTE
           
static java.lang.String P_COMMAND_SMS
           
static java.lang.String P_COMMAND_TCP
           
static java.lang.String P_COMMAND_UDP
           
static java.lang.String P_HAS_INPUTS
           
static java.lang.String P_HAS_OUTPUTS
           
static java.lang.String P_JAR_OPTIONAL
           
static java.lang.String P_NONE
           
static java.lang.String P_XMIT_SAT
           
static java.lang.String P_XMIT_SMS
           
static java.lang.String P_XMIT_TCP
           
static java.lang.String P_XMIT_UDP
           
static int[] STARTSTOP_ENGINE
           
static int[] STARTSTOP_IGNITION
           
static int[] STARTSTOP_PARK
           
static int[] STARTSTOP_STARTSTOP
           
static java.lang.String VERSION_HASH
           
 
Constructor Summary
DCServerConfig()
          Blank Constructor
DCServerConfig(java.lang.String name, java.lang.String desc, int[] tcpPorts, int[] udpPorts, int commandPort, long flags, java.lang.String... uniqPfx)
          Constructor
 
Method Summary
 void addCommand(java.lang.String cmdName, java.lang.String cmdDesc, boolean cmdEnable, java.lang.String[] cmdTypes, java.lang.String cmdAclName, AclEntry.AccessLevel cmdAclDft, java.lang.String cmdString, boolean hasArgs, java.util.Collection<DCServerConfig.CommandArg> cmdArgList, java.lang.String cmdProto, long maxRteAge, boolean allowQueue, boolean expectAck, int expAckCode, long stateMask, boolean stateVal, int cmdSCode)
           
 void addRecommendedConfigPropertyKey(java.lang.String key)
          Adds a recommended runtime configiuration property key to this DCS
static double CalculateBatteryLevel(double voltage, double[] range)
          Calculates/returns the battery level based on the specified voltage range
 int compareTo(java.lang.Object other)
          Compares another DCServerConfig instance to this instance.
static byte[] convertToBytes(java.lang.String s)
          Convenience for converting the initial/final packet to a byte array.
 ServerSocketThread createServerSocketThread_SAT(int port)
          Create SAT ServerSocketThread
 ServerSocketThread createServerSocketThread_SAT(int port, boolean useSSL)
          Create SAT ServerSocketThread
 ServerSocketThread createServerSocketThread_TCP(int port)
          Create TCP ServerSocketThread
 ServerSocketThread createServerSocketThread_TCP(int port, boolean useSSL)
          Create TCP ServerSocketThread
 ServerSocketThread createServerSocketThread_UDP(int port)
          Create UDP ServerSocketThread
 boolean equals(java.lang.Object other)
          Returns true if the 'other' DCServerCOnfig is equal to this DCServerConfig based on the name.
static int getAckResponsePort(DCServerConfig dcsc, int dft)
          Gets the "ACK Response Port"
 int getAckResponsePort(int dft)
          Gets the "ACK Response Port"
static double getActualFuelLevel(DCServerConfig dcs, Device dev, double preLevel)
          Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.
static double getActualFuelLevel(DCServerConfig dcs, Device dev, double preLevel, FuelLevelProfile dft)
          Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.
 double getActualFuelLevel(Device dev, double preLevel)
          Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.
 double getActualFuelLevel(Device dev, double preLevel, FuelLevelProfile dft)
          Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.
 long getAttributeFlags()
          Gets the server attribute flags
static long GetAttributeFlags(RTProperties rtp)
          Gets the attribute flag mask for the specified RTProperties instance.
static double getBatteryLevelFromVolts(DCServerConfig dcs, Device dev, double battVolts)
          Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.
static double getBatteryLevelFromVolts(DCServerConfig dcs, Device dev, double battVolts, BatteryLevelProfile dft)
          Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.
 double getBatteryLevelFromVolts(Device dev, double battVolts)
          Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.
 double getBatteryLevelFromVolts(Device dev, double battVolts, BatteryLevelProfile dft)
          Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.
 BatteryLevelProfile getBatteryLevelProfile(BatteryLevelProfile dft)
          Gets the default BatteryLevelProfile config
static BatteryLevelProfile getBatteryLevelProfile(DCServerConfig dcsc, BatteryLevelProfile dft)
          Gets the default BatteryLevelProfile config
 BatteryLevelProfile getBatteryLevelProfile(Device dev, BatteryLevelProfile dft)
          Gets the BatteryLevelProfile config
 BatteryLevelProfile getBatteryLevelProfile(java.lang.String grpID, BatteryLevelProfile dft)
          Gets the BatteryLevelProfile config.
static double[] getBatteryLevelRange(DCServerConfig dcsc, double[] dft)
          Gets the "Battery Level Range" config
 double[] getBatteryLevelRange(double[] dft)
          Gets the "Battery Level Range" config
 java.lang.String getBindAddress()
          Gets the server bind address
 boolean getBooleanProperty(Device dev, java.lang.String[] key, boolean dft)
          Gets the Boolean value for the specified property key
 boolean getBooleanProperty(Device dev, java.lang.String key, boolean dft)
          Gets the Boolean value for the specified property key
 boolean getBooleanProperty(java.lang.String[] key, boolean dft)
          Gets the Boolean value for the specified property key
 boolean getBooleanProperty(java.lang.String key, boolean dft)
          Gets the Boolean value for the specified property key
 boolean getCheckLastOdometer(boolean dft)
          Gets the "Check Last Odometer" config
static boolean getCheckLastOdometer(DCServerConfig dcsc, boolean dft)
          Gets the "Check Last Odometer" config
 java.lang.Class<?> getClassProperty(Device dev, java.lang.String[] key, java.lang.Class<?> dft)
          Gets the Class for the specified property key
 java.lang.Class<?> getClassProperty(Device dev, java.lang.String key, java.lang.Class<?> dft)
          Gets the Class for the specified property key
 java.lang.Class<?> getClassProperty(java.lang.String[] key, java.lang.Class<?> dft)
          Gets the Class for the specified property key
 java.lang.Class<?> getClassProperty(java.lang.String key, java.lang.Class<?> dft)
          Gets the Class for the specified property key
 int getClientCommandPort_tcp(int dft)
          Gets the "Client Command Port"
 int getClientCommandPort_udp(int dft)
          Gets the "Client Command Port"
 java.lang.Class<? extends ClientPacketHandler> getClientPacketHandlerClass(java.lang.Class<? extends ClientPacketHandler> dftC)
          Gets the "ClientPacketHandler" subclass
 DCServerConfig.Command getCommand(java.lang.String name)
          Returns the named command
static int getCommandAckBit(DCServerConfig dcsc, java.lang.String bitName, int dft)
          Gets the "Command ACK bit" config
 int getCommandAckBit(java.lang.String bitName, int dft)
          Gets the "Command ACK bit" config
 int getCommandAuditStatusCode(java.lang.String cmdName, int code)
          Gets the status-code for the specified command.
 java.lang.String getCommandDescription(java.lang.String cmdName, java.lang.String dft)
          Gets the "Command Description" for the specified command
 java.util.Map<java.lang.String,java.lang.String> getCommandDescriptionMap(BasicPrivateLabel privLabel, User user, java.lang.String type)
          Gets the command's (name,description) map
 java.lang.String getCommandDispatcherHost(Device device)
          Gets the device command listen host
 int getCommandDispatcherPort()
          Gets the device command listen port (returns '0' if not supported)
 java.lang.String[] getCommandList()
          Gets a list of command names
 java.util.Map<java.lang.String,DCServerConfig.Command> getCommandMap(BasicPrivateLabel privLabel, User user, java.lang.String type)
          Gets the command's (name,description) map
 java.lang.Class<? extends CommandPacketHandler> getCommandPacketHandlerClass(java.lang.Class<? extends CommandPacketHandler> dftC)
          Gets the "CommandPacketHandler" subclass
 DCServerConfig.CommandProtocol getCommandProtocol()
          Gets the command protocol to use when communicating with remote devices
static DCServerConfig.CommandProtocol getCommandProtocol(java.lang.String v)
          Gets the CommandProtocol Enum value, based on the value of the specified String
 JSON._Object getCommands_JSON(BasicPrivateLabel privLabel, User user, java.lang.String type)
          Gets the commands as a JSON object
 AclEntry.AccessLevel getCommandsAccessLevelDefault()
          Gets the Commands Acl AccessLevel default
 java.lang.String getCommandsAclName()
          Gets the Commands Acl name
 java.lang.String getCommandString(java.lang.String cmdName, java.lang.String dft)
          Gets the "Command String" for the specified command
 java.io.File getConfigFile(java.lang.String xDft)
          Gets the config-file from this which this DCServerConfig was created
 CustomParser getCustomParserInstance(Device dev, java.lang.String[] key, CustomParser dft)
          Returns the CustomParser instance specified by the property key
 CustomParser getCustomParserInstance(Device dev, java.lang.String key, CustomParser dft)
          Returns the CustomParser instance specified by the property key
 CustomParser getCustomParserInstance(java.lang.String[] key, CustomParser dft)
          Returns the CustomParser instance specified by the property key
 CustomParser getCustomParserInstance(java.lang.String key, CustomParser dft)
          Returns the CustomParser instance specified by the property key
 boolean getDebugMode(boolean dft)
          Gets the "Debug Mode" config
static boolean getDebugMode(DCServerConfig dcsc, boolean dft)
          Gets the "Debug Mode" config
 RTProperties getDefaultProperties()
          Returns the default RTProperties instance
 java.lang.String getDescription()
          Gets the server description
 boolean getDigitalInputState(long mask, int bit)
          Returns the state of the indicated input bit within the mask for this device type.
 boolean getDigitalOutputState(long mask, int bit)
          Returns the state of the indicated output bit within the mask for this device type.
 double getDoubleProperty(Device dev, java.lang.String[] key, double dft)
          Gets the Double value for the specified property key
 double getDoubleProperty(Device dev, java.lang.String key, double dft)
          Gets the Double value for the specified property key
 double getDoubleProperty(java.lang.String[] key, double dft)
          Gets the Double value for the specified property key
 double getDoubleProperty(java.lang.String key, double dft)
          Gets the Double value for the specified property key
 boolean getEstimateOdometer(boolean dft)
          Gets the "Estimate Odometer" flag
static boolean getEstimateOdometer(DCServerConfig dcsc, boolean dft)
          Gets the "Estimate Odometer" flag
 DCServerConfig.EventCode getEventCode(int code)
          Returns the EventCode instance for the specified code
 DCServerConfig.EventCode getEventCode(long code)
          Returns the EventCode instance for the specified code
 DCServerConfig.EventCode getEventCode(java.lang.String code)
          Returns the EventCode instance for the specified code
 boolean getEventCodeEnabled()
          Gets the "Event Code Map Enable" config
 java.util.Map<java.lang.String,EventDataAnalog> getEventDataAnalogMap()
          Gets the previously initialized EventDataAnalog conversion map.
 byte[] getFinalPacket(byte[] dft)
          Gets the "Final Packet" byte array
 java.lang.String getFinalPacketString(java.lang.String dft)
          Gets the "Final Packet" String
static FuelLevelProfile getFuelLevelProfile(DCServerConfig dcsc, FuelLevelProfile dft)
          Gets the default FuelLevelProfile config
 FuelLevelProfile getFuelLevelProfile(Device dev, FuelLevelProfile dft)
          Gets the FuelLevelProfile config
 FuelLevelProfile getFuelLevelProfile(FuelLevelProfile dft)
          Gets the default FuelLevelProfile config
 FuelLevelProfile getFuelLevelProfile(java.lang.String grpID, FuelLevelProfile dft)
          Gets the FuelLevelProfile config.
 boolean getGeozoneSkipOldEvents(boolean dft)
          Gets the "Geozone Skip Old Events" state
static boolean getGeozoneSkipOldEvents(DCServerConfig dcsc, boolean dft)
          Gets the "Geozone Skip Old Events" state
 boolean getIgnoreDeviceOdometer(boolean dft)
          Gets the "Ignore Device Odometer" flag
static boolean getIgnoreDeviceOdometer(DCServerConfig dcsc, boolean dft)
          Gets the "Ignore Device Odometer" flag
 boolean getIgnoreEventsWithInvalidGPS(boolean dft)
          Gets the "Ignore Events with Invalid GPS" config
static boolean getIgnoreEventsWithInvalidGPS(DCServerConfig dcsc, boolean dft)
          Gets the "Ignore Events with Invalid GPS" config
 boolean getIgnoreInvalidGPSFlag(boolean dft)
          Gets the "Ignore Invalid GPS Location Flag" config
static boolean getIgnoreInvalidGPSFlag(DCServerConfig dcsc, boolean dft)
          Gets the "Ignore Invalid GPS Location Flag" config
 byte[] getInitialPacket(byte[] dft)
          Gets the "Initial Packet" byte array
 java.lang.String getInitialPacketString(java.lang.String dft)
          Gets the "Initial Packet" String
 int[] getIntArrayProperty(Device dev, java.lang.String[] key, int[] dft)
          Gets the Integer array for the specified property key
 int[] getIntArrayProperty(Device dev, java.lang.String key, int[] dft)
          Gets the Integer array for the specified property key
 int[] getIntArrayProperty(java.lang.String[] key, int[] dft)
          Gets the Integer array for the specified property key
 int[] getIntArrayProperty(java.lang.String key, int[] dft)
          Gets the Integer array for the specified property key
 int getIntProperty(Device dev, java.lang.String[] key, int dft)
          Gets the Integer value for the specified property key
 int getIntProperty(Device dev, java.lang.String key, int dft)
          Gets the Integer value for the specified property key
 int getIntProperty(java.lang.String[] key, int dft)
          Gets the Integer value for the specified property key
 int getIntProperty(java.lang.String key, int dft)
          Gets the Integer value for the specified property key
static java.io.File getLogFilePath(java.lang.String dcsName)
          Return log file path for the specified DCS name
 long getLongProperty(Device dev, java.lang.String[] key, long dft)
          Gets the Long value for the specified property key
 long getLongProperty(Device dev, java.lang.String key, long dft)
          Gets the Long value for the specified property key
 long getLongProperty(java.lang.String[] key, long dft)
          Gets the Long value for the specified property key
 long getLongProperty(java.lang.String key, long dft)
          Gets the Long value for the specified property key
static double getMaximumAccuracyMeters(DCServerConfig dcsc, double dft)
          Gets the "Maximum Accuracy Meters"
 double getMaximumAccuracyMeters(double dft)
          Gets the "Maximum Accuracy Meters"
static double getMaximumHDOP(DCServerConfig dcsc, double dft)
          Gets the "Maximum HDOP"
 double getMaximumHDOP(double dft)
          Gets the "Maximum HDOP"
static double getMinimumMovedMeters(DCServerConfig dcsc, double dft)
          Gets the "Minimum Moved Meters"
 double getMinimumMovedMeters(double dft)
          Gets the "Minimum Moved Meters"
static int getMinimumSatelliteCount(DCServerConfig dcsc, int dft)
          Gets the "Minimum Satellite Count"
 int getMinimumSatelliteCount(int dft)
          Gets the "Minimum Satellite Count"
static double getMinimumSpeedKPH(DCServerConfig dcsc, double dft)
          Gets the "Minimum Speed KPH"
 double getMinimumSpeedKPH(double dft)
          Gets the "Minimum Speed KPH"
 java.lang.String getName()
          Gets the server name/id
 java.lang.String getPortsString()
          Returns a String representation of the ports utilized.
 java.lang.StringBuffer getPortsString(java.lang.StringBuffer sb)
          Returns a StringBuffer representation of the ports utilized.
 RTProperties getProperties(Device device)
          Gets the RTProperties instance for the specified group name.
 RTProperties getProperties(Device device, RTProperties dftRTP)
          Gets the RTProperties instance for the specified group name.
 RTProperties getProperties(java.lang.String grpID)
          Gets the RTProperties instance for the specified group name.
 RTProperties getProperties(java.lang.String grpID, boolean createNewGroup)
          Gets the RTProperties instance for the specified group name.
 RTProperties getProperties(java.lang.String grpID, RTProperties dftRTP)
          Gets the RTProperties instance for the specified group name.
 RTProperties getPropertiesForKey(Device device, java.lang.String key)
          Gets the RTProperties instance that contains the specified key.
 RTProperties getPropertiesForKey(Device device, java.lang.String[] key)
          Gets the RTProperties instance that contains the specified key.
 RTProperties getPropertiesForKey(java.lang.String grpID, java.lang.String key)
          Gets the RTProperties instance that contains the specified key.
 RTProperties getPropertiesForKey(java.lang.String grpID, java.lang.String[] key)
          Gets the RTProperties instance that contains the specified key.
 java.lang.String getPropertiesID(Device device)
          Gets the DCS properties ID for the specific device.
 java.lang.String getPropertiesID(Device device, java.lang.String dftID)
          Gets the DCS properties ID for the specific device.
 java.util.Set<java.lang.String> getPropertyGroupNames()
          Returns a set of RTProperties group names
 java.util.Set<java.lang.String> getPropertyKeys(java.lang.String prefix)
          Returns a set of all property keys that match the specified prefix.
static java.lang.String getPSJavaCommand_jar(java.lang.String name, java.lang.String display)
          Returns the "psjava" command relative to GTS_HOME, and returning the specified information for the named jar file
static java.lang.String getPSJavaCommand()
          Returns the "psjava" command relative to GTS_HOME
 java.util.Set<java.lang.String> getRecommendedConfigPropertyKeys()
          Returns the recommended runtime configuration property key set
 java.lang.String getRemoteLogging()
          Gets the remote logging attribute string for this DCS
 java.io.File[] getRunningJarPath()
          Return running jar file path
static java.io.File[] getRunningJarPath(java.lang.String name)
          Returns the file path for the named running DCServerConfig jar files.
This method will return 'null' if no DCServerConfig jar files with the specified name are currently running.
All matching running DCServerConfig entries will be returned.
static int[] getRunningJarPID(java.lang.String name)
          Returns the Process-ID (PID) for the named running DCServerConfig jar files.
This method will return 'null' if no DCServerConfig jar files with the specified name are currently running, or if unable to determine the PID.
All matching running DCServerConfig entries will be returned.
 java.net.InetAddress getSatPortBindAddress(int port)
          Get SAT Port bind address
 int[] getSatPorts()
          Gets the default SAT port for this server
 boolean getSaveRawDataPackets(boolean dft)
          Gets the "Save Raw Data Packet" config
static boolean getSaveRawDataPackets(DCServerConfig dcsc, boolean dft)
          Gets the "Save Raw Data Packet" config
 boolean getSaveSessionStatistics(boolean dft)
          Gets the "Save Session Statistics" config
static boolean getSaveSessionStatistics(DCServerConfig dcsc, boolean dft)
          Gets the "Save Session Statistics" config
 boolean getShowURL(boolean dft)
          Gets the "Show URL" config
static boolean getShowURL(DCServerConfig dcsc, boolean dft)
          Gets the "Show URL" config
static long getSimulateDigitalInputs(DCServerConfig dcsc, long dft)
          Gets the "Simulate Geozones" mask
 long getSimulateDigitalInputs(long dft)
          Gets the "Simulate Geozones" mask
 boolean getSimulateGeozones(boolean dft)
          Gets the "Simulate Geozones" state
static boolean getSimulateGeozones(DCServerConfig dcsc, boolean dft)
          Gets the "Simulate Geozones" state
 int[] getStartStopStatusCodes()
          Gets the start/stop status codes, or null if no start/stop status codes have been defined.
 boolean getStartStopSupported(boolean dft)
          Gets the "Start/Stop StatusCode supported" config
static boolean getStartStopSupported(DCServerConfig dcsc, boolean dft)
          Gets the "Start/Stop StatusCode supported" config
 boolean getStatusLocationInMotion(boolean dft)
          Gets the "Status Location/InMotion Translation" config
static boolean getStatusLocationInMotion(DCServerConfig dcsc, boolean dft)
          Gets the "Status Location/InMotion Translation" config
 java.lang.String[] getStringArrayProperty(Device dev, java.lang.String[] key, java.lang.String[] dft)
          Gets the String-array value for the specified property key
 java.lang.String[] getStringArrayProperty(Device dev, java.lang.String key, java.lang.String[] dft)
          Gets the String-array value for the specified property key
 java.lang.String[] getStringArrayProperty(java.lang.String[] key, java.lang.String[] dft)
          Gets the String-array value for the specified property key
 java.lang.String[] getStringArrayProperty(java.lang.String key, java.lang.String[] dft)
          Gets the String-array value for the specified property key
 java.lang.String getStringProperty(Device dev, java.lang.String[] key, java.lang.String dft)
          Gets the String value for the specified property key
 java.lang.String getStringProperty(Device dev, java.lang.String key, java.lang.String dft)
          Gets the String value for the specified property key
 java.lang.String getStringProperty(java.lang.String[] key, java.lang.String dft)
          Gets the String value for the specified property key
 java.lang.String getStringProperty(java.lang.String key, java.lang.String dft)
          Gets the String value for the specified property key
 long getTcpIdleTimeoutMS(long dft)
          Gets the "TCP idle timeout"
 long getTcpPacketTimeoutMS(long dft)
          Gets the "TCP packet timeout"
 java.net.InetAddress getTcpPortBindAddress(int port)
          Get TCP Port bind address
 int[] getTcpPorts()
          Gets the default TCP port for this server
 long getTcpSessionTimeoutMS(long dft)
          Gets the "TCP session timeout"
 java.lang.Class<?> getTrackServerAdapterClass(java.lang.Class<?> tsaC, java.lang.Class<?> dftC)
          Gets the "TrackServerAdapter" subclass
 long getUdpIdleTimeoutMS(long dft)
          Gets the "UDP idle timeout"
 long getUdpPacketTimeoutMS(long dft)
          Gets the "UDP packet timeout"
 java.net.InetAddress getUdpPortBindAddress(int port)
          Get UDP Port bind address
 int[] getUdpPorts()
          Gets the default UDP port for this server
 long getUdpSessionTimeoutMS(long dft)
          Gets the "UDP session timeout"
 java.lang.String[] getUniquePrefix()
          Gets the array of allowed UniqueID prefixes
 java.lang.String[] getUniquePrefix(java.lang.String[] dftPfx)
          Gets the array of allowed UniqueID prefixes
 boolean getUseAltCurrentTimestamp(boolean dft)
          Gets the "Use Alternate Current Timestamp for Event" config
static boolean getUseAltCurrentTimestamp(DCServerConfig dcsc, boolean dft)
          Gets the "Use Alternate Current Timestamp for Event" config
 boolean getUseLastValidGPSLocation(boolean dft)
          Gets the "Use Last Valid GPS Location" config
static boolean getUseLastValidGPSLocation(DCServerConfig dcsc, boolean dft)
          Gets the "Use Last Valid GPS Location" config
 boolean getUseSSL()
          Gets whether to use SSL on TCP connections
static java.lang.String GetVersionHash()
           
 boolean hasDigitalInputs()
          Returns true if this device supports digital inputs
 boolean hasDigitalOutputs()
          Returns true if this device supports digital outputs
 int hashCode()
          Return hashCode based on the DCServerConfig name
 boolean hasProperty(Device dev, java.lang.String[] key, boolean inclDft)
          Returns true is the property key has been defined.
 boolean hasProperty(java.lang.String[] key, boolean inclDft)
          Returns true is the property key has been defined.
 java.util.Map<java.lang.String,EventDataAnalog> initEventDataAnalogMap(java.lang.String keyPfx)
          Creates/Returns an EventDataAnalog conversion map.
 java.util.Map<java.lang.String,EventDataAnalog> initEventDataAnalogMap(java.lang.String keyPfx, java.lang.Class<? extends EventDataAnalog> edaClass)
          Creates/Returns an EventDataAnalog conversion map.
 boolean isAttributeFlag(long mask)
          Returns true if the indicate mask is non-zero
 boolean isJarOptional()
          Returns true if this DCS requires a Jar file
static Device loadDeviceUniqueID(DCServerConfig dcsc, java.lang.String modemID)
          Load device record from unique-id.
 Device loadDeviceUniqueID(java.lang.String modemID)
          Load device record from unique-id.
 java.lang.String normalizeKey(java.lang.String key)
          Prepend DCS name to key
 java.lang.String[] normalizeKeys(java.lang.String[] key)
          Prepend DCS name to keys
static OrderedMap<java.lang.String,DCServerConfig.Command> ParseCommandMap_JSON(JSON._Object commands)
          Sets the commands, based on the specified JSON object
 boolean printEventCodeMap()
          Prints the EventCodeMap
static void printEventDataAnalog(DCServerConfig dcsc, int width)
          Prints the defined EventDataAnalog headers
 boolean serverJarExists()
          Returns true if the named server is defined in the current installation.
 void setAttributeFlags(long f)
          Sets the server attribute flags
protected  void setBindAddress(java.lang.String b)
          Sets the server bind address
 void setCommandDispatcherHost(java.lang.String cmdHost)
          Sets the device command listen host (may be null to use default bind-address)
 void setCommandDispatcherPort(int cmdPort)
          Sets the device command listen port
 void setCommandDispatcherPort(int cmdPort, boolean checkRTP)
          Sets the device command listen port
 void setCommandProtocol(DCServerConfig.CommandProtocol proto)
          Sets the command protocol to use when communicating with remote devices
 void setCommandProtocol(java.lang.String proto)
          Sets the command protocol to use when communicating with remote devices
 void setCommandsAclName(java.lang.String aclName, AclEntry.AccessLevel dft)
          Sets the Commands Acl name
 void setConfigFile(java.io.File xmlFile)
          Sets the config-file from which this DCServerConfig was created
 void setDescription(java.lang.String d)
          Sets the server description
 void setEventCodeEnabled(boolean enabled)
          Sets the "Event Code Map Enable" config
 void setEventCodeMap(java.util.Map<java.lang.Object,DCServerConfig.EventCode> codeMap)
          Sets the EventCodeMap
static boolean setEventDataAnalogField(DCServerConfig dcsc, int aNdx, EventData evdb, double value)
          Converts/Sets the EventData field value
 boolean setEventDataAnalogField(int aNdx, EventData evdb, double value)
          Converts/Sets the EventData field value
protected  void setName(java.lang.String n)
          Sets the server name/id
 void setRemoteLogging(java.lang.String logAttr)
          Sets the remote logging attributes for this DCS
 void setSatPorts(java.net.InetAddress bindAddr, int[] sat, boolean checkRTP)
          Sets the default SAT port for this server
 void setStartStopStatusCodes(int[] startStopCodes)
          Sets the start and stop status codes.
 void setStartStopStatusCodes(int startCode, int stopCode)
          Sets the start and stop status codes.
 void setStartStopStatusCodes(java.lang.String ssKey)
          Sets the start and stop status codes.
 void setTcpPorts(java.net.InetAddress bindAddr, int[] tcp, boolean checkRTP)
          Sets the default TCP port for this server
 void setUdpPorts(java.net.InetAddress bindAddr, int[] udp, boolean checkRTP)
          Sets the default UDP port for this server
 void setUniquePrefix(java.lang.String[] pfx)
          Sets the array of allowed UniqueID prefixes
 void setUseSSL(boolean useSSL)
          Sets whether to use SSL on TCP connections
static ServerSocketThread startCommandHandler(int port, java.lang.Class<? extends CommandPacketHandler> handler)
          Start Command Listener
 boolean startRemoteLogging()
          Starts the RemoteLogServer if remote logging is enabled
static boolean startRemoteLogging(DCServerConfig dcsc)
          Starts the RemoteLogServer if remote logging is enabled
static void startServerSocketThread(ServerSocketThread sst, java.lang.String type)
          Start ServerSocketThread
 java.lang.String toString()
          Returns a String representation of this instance
 java.lang.String toString(boolean inclName)
          Returns a String representation of this instance
 int translateStatusCode(int code, int dftStatusCode)
          Translates the specified device status code into a GTS status code
 int translateStatusCode(java.lang.String code, int dftStatusCode)
          Translates the specified device status code into a GTS status code
 boolean userHasAccessToCommand(BasicPrivateLabel privLabel, User user, java.lang.String commandName)
          Returns True if the specified user has access to the named command
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PROP_GROUP_ID

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

P_NONE

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

P_HAS_INPUTS

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

P_HAS_OUTPUTS

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

P_COMMAND_SMS

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

P_COMMAND_UDP

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

P_COMMAND_TCP

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

P_XMIT_TCP

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

P_XMIT_UDP

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

P_XMIT_SMS

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

P_XMIT_SAT

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

P_JAR_OPTIONAL

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

F_NONE

public static final long F_NONE
See Also:
Constant Field Values

F_HAS_INPUTS

public static final long F_HAS_INPUTS
See Also:
Constant Field Values

F_HAS_OUTPUTS

public static final long F_HAS_OUTPUTS
See Also:
Constant Field Values

F_COMMAND_TCP

public static final long F_COMMAND_TCP
See Also:
Constant Field Values

F_COMMAND_UDP

public static final long F_COMMAND_UDP
See Also:
Constant Field Values

F_COMMAND_SMS

public static final long F_COMMAND_SMS
See Also:
Constant Field Values

F_XMIT_TCP

public static final long F_XMIT_TCP
See Also:
Constant Field Values

F_XMIT_UDP

public static final long F_XMIT_UDP
See Also:
Constant Field Values

F_XMIT_SMS

public static final long F_XMIT_SMS
See Also:
Constant Field Values

F_XMIT_SAT

public static final long F_XMIT_SAT
See Also:
Constant Field Values

F_JAR_OPTIONAL

public static final long F_JAR_OPTIONAL
See Also:
Constant Field Values

F_STD_VEHICLE

public static final long F_STD_VEHICLE
See Also:
Constant Field Values

F_STD_PERSONAL

public static final long F_STD_PERSONAL
See Also:
Constant Field Values

VERSION_HASH

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

COMMAND_CONFIG

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

COMMAND_PING

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

COMMAND_GEOZONE

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

COMMAND_GFMI

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

COMMAND_DIAGNOSTIC

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

COMMAND_INTERNAL

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

DIAG_LOG

public static final java.lang.String[] DIAG_LOG

DEFAULT_ARG_NAME

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

KEYARG_HEX8

public static final java.lang.String[] KEYARG_HEX8

KEYARG_HEX16

public static final java.lang.String[] KEYARG_HEX16

KEYARG_HEX32

public static final java.lang.String[] KEYARG_HEX32

KEYARG_HEX64

public static final java.lang.String[] KEYARG_HEX64

KEYARG_INT

public static final java.lang.String[] KEYARG_INT

KEYARG_QUOTE

public static final java.lang.String[] KEYARG_QUOTE

KEYARG_GPS

public static final java.lang.String[] KEYARG_GPS

KEYARG_GPLAT

public static final java.lang.String[] KEYARG_GPLAT

KEYARG_GPLON

public static final java.lang.String[] KEYARG_GPLON

KEYARG_NOSPACE

public static final java.lang.String[] KEYARG_NOSPACE

JSONKey_DCS

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

JSONKey_Commands

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

JSONKey_Name

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

JSONKey_Description

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

JSONKey_ReadOnly

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

JSONKey_ResourceName

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

JSONKey_DefaultValue

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

JSONKey_DisplayLength

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

JSONKey_MaximumLength

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

JSONKey_Enabled

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

JSONKey_Types

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

JSONKey_AclName

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

JSONKey_AclDefault

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

JSONKey_Protocol

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

JSONKey_CommandString

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

JSONKey_MaximumRouteAge

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

JSONKey_AllowQueue

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

JSONKey_ExpectAck

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

JSONKey_ExpectAckCode

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

JSONKey_StateBitMask

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

JSONKey_StateBitValue

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

JSONKey_AuditCode

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

JSONKey_Args

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

GP_SEP

public static final char[] GP_SEP

CSV_SEP

public static final char[] CSV_SEP

STARTSTOP_STARTSTOP

public static final int[] STARTSTOP_STARTSTOP

STARTSTOP_IGNITION

public static final int[] STARTSTOP_IGNITION

STARTSTOP_ENGINE

public static final int[] STARTSTOP_ENGINE

STARTSTOP_PARK

public static final int[] STARTSTOP_PARK
Constructor Detail

DCServerConfig

public DCServerConfig()
Blank Constructor


DCServerConfig

public DCServerConfig(java.lang.String name,
                      java.lang.String desc,
                      int[] tcpPorts,
                      int[] udpPorts,
                      int commandPort,
                      long flags,
                      java.lang.String... uniqPfx)
Constructor

Method Detail

GetAttributeFlags

public static long GetAttributeFlags(RTProperties rtp)
Gets the attribute flag mask for the specified RTProperties instance.

Parameters:
rtp - The RTProperties instance constructed from the "Attributes" tag in the DCS "dcserver_XXXX.xml" file.
Returns:
The attribute flag mask

GetVersionHash

public static final java.lang.String GetVersionHash()

getCommandProtocol

public static DCServerConfig.CommandProtocol getCommandProtocol(java.lang.String v)
Gets the CommandProtocol Enum value, based on the value of the specified String

Parameters:
v - The command protocol name
Returns:
The CommandProtocol Enum value

getPSJavaCommand

public static java.lang.String getPSJavaCommand()
Returns the "psjava" command relative to GTS_HOME

Returns:
The "psjava" command relative to GTS_HOME

getPSJavaCommand_jar

public static java.lang.String getPSJavaCommand_jar(java.lang.String name,
                                                    java.lang.String display)
Returns the "psjava" command relative to GTS_HOME, and returning the specified information for the named jar file

Parameters:
name - The DCServerConfig name
display - The type of information to return ("pid", "name", "user")
Returns:
The returned 'display' information for the specified DCServerConfig

getRunningJarPath

public static java.io.File[] getRunningJarPath(java.lang.String name)
Returns the file path for the named running DCServerConfig jar files.
This method will return 'null' if no DCServerConfig jar files with the specified name are currently running.
All matching running DCServerConfig entries will be returned.

Parameters:
name - The DCServerConfig name
Returns:
The matching running jar file paths, or null if no matching server enteries are running.

getRunningJarPID

public static int[] getRunningJarPID(java.lang.String name)
Returns the Process-ID (PID) for the named running DCServerConfig jar files.
This method will return 'null' if no DCServerConfig jar files with the specified name are currently running, or if unable to determine the PID.
All matching running DCServerConfig entries will be returned.

Parameters:
name - The DCServerConfig name
Returns:
The matching running jar file PID, or null if no matching server enteries are running.

getLogFilePath

public static java.io.File getLogFilePath(java.lang.String dcsName)
Return log file path for the specified DCS name


setBindAddress

protected void setBindAddress(java.lang.String b)
Sets the server bind address


getBindAddress

public java.lang.String getBindAddress()
Gets the server bind address


setName

protected void setName(java.lang.String n)
Sets the server name/id


getName

public java.lang.String getName()
Gets the server name/id


setDescription

public void setDescription(java.lang.String d)
Sets the server description


getDescription

public java.lang.String getDescription()
Gets the server description


setConfigFile

public void setConfigFile(java.io.File xmlFile)
Sets the config-file from which this DCServerConfig was created


getConfigFile

public java.io.File getConfigFile(java.lang.String xDft)
Gets the config-file from this which this DCServerConfig was created


setRemoteLogging

public void setRemoteLogging(java.lang.String logAttr)
Sets the remote logging attributes for this DCS

Parameters:
logAttr - The remote log attributes in the form "[[HOST]:]PORT[/BUFFERSIZE]"

getRemoteLogging

public java.lang.String getRemoteLogging()
Gets the remote logging attribute string for this DCS

Returns:
The remote logging attribute string for this DCS

startRemoteLogging

public boolean startRemoteLogging()
Starts the RemoteLogServer if remote logging is enabled

Returns:
True if started, false otherwise

startRemoteLogging

public static boolean startRemoteLogging(DCServerConfig dcsc)
Starts the RemoteLogServer if remote logging is enabled

Parameters:
dcsc - The DCServerConfig instance
Returns:
True if started, false otherwise

setAttributeFlags

public void setAttributeFlags(long f)
Sets the server attribute flags


getAttributeFlags

public long getAttributeFlags()
Gets the server attribute flags


isAttributeFlag

public boolean isAttributeFlag(long mask)
Returns true if the indicate mask is non-zero


setUseSSL

public void setUseSSL(boolean useSSL)
Sets whether to use SSL on TCP connections


getUseSSL

public boolean getUseSSL()
Gets whether to use SSL on TCP connections


setTcpPorts

public void setTcpPorts(java.net.InetAddress bindAddr,
                        int[] tcp,
                        boolean checkRTP)
Sets the default TCP port for this server


getTcpPortBindAddress

public java.net.InetAddress getTcpPortBindAddress(int port)
Get TCP Port bind address


getTcpPorts

public int[] getTcpPorts()
Gets the default TCP port for this server


createServerSocketThread_TCP

public ServerSocketThread createServerSocketThread_TCP(int port)
                                                throws java.net.SocketException,
                                                       java.io.IOException
Create TCP ServerSocketThread

Throws:
java.net.SocketException
java.io.IOException

createServerSocketThread_TCP

public ServerSocketThread createServerSocketThread_TCP(int port,
                                                       boolean useSSL)
                                                throws java.net.SocketException,
                                                       java.io.IOException
Create TCP ServerSocketThread

Throws:
java.net.SocketException
java.io.IOException

setUdpPorts

public void setUdpPorts(java.net.InetAddress bindAddr,
                        int[] udp,
                        boolean checkRTP)
Sets the default UDP port for this server


getUdpPortBindAddress

public java.net.InetAddress getUdpPortBindAddress(int port)
Get UDP Port bind address


getUdpPorts

public int[] getUdpPorts()
Gets the default UDP port for this server


createServerSocketThread_UDP

public ServerSocketThread createServerSocketThread_UDP(int port)
                                                throws java.net.SocketException,
                                                       java.io.IOException
Create UDP ServerSocketThread

Throws:
java.net.SocketException
java.io.IOException

setSatPorts

public void setSatPorts(java.net.InetAddress bindAddr,
                        int[] sat,
                        boolean checkRTP)
Sets the default SAT port for this server


getSatPortBindAddress

public java.net.InetAddress getSatPortBindAddress(int port)
Get SAT Port bind address


getSatPorts

public int[] getSatPorts()
Gets the default SAT port for this server


createServerSocketThread_SAT

public ServerSocketThread createServerSocketThread_SAT(int port)
                                                throws java.net.SocketException,
                                                       java.io.IOException
Create SAT ServerSocketThread

Throws:
java.net.SocketException
java.io.IOException

createServerSocketThread_SAT

public ServerSocketThread createServerSocketThread_SAT(int port,
                                                       boolean useSSL)
                                                throws java.net.SocketException,
                                                       java.io.IOException
Create SAT ServerSocketThread

Throws:
java.net.SocketException
java.io.IOException

setStartStopStatusCodes

public void setStartStopStatusCodes(java.lang.String ssKey)
Sets the start and stop status codes.

Parameters:
ssKey - The start status code key ("ignition", "parked", "startStop")

setStartStopStatusCodes

public void setStartStopStatusCodes(int startCode,
                                    int stopCode)
Sets the start and stop status codes.

Parameters:
startCode - The start status code
stopCode - The stop status code

setStartStopStatusCodes

public void setStartStopStatusCodes(int[] startStopCodes)
Sets the start and stop status codes.

Parameters:
startStopCodes - An array containing 2 elements. The first element is the start status code, and the second element is the stop status code.

getStartStopStatusCodes

public int[] getStartStopStatusCodes()
Gets the start/stop status codes, or null if no start/stop status codes have been defined. If non-null, element '0' will always contain the start code, and element '1' will contain the stop code.

Returns:
The start/stop status codes, or null if no codes defined.

startCommandHandler

public static ServerSocketThread startCommandHandler(int port,
                                                     java.lang.Class<? extends CommandPacketHandler> handler)
                                              throws java.lang.Throwable
Start Command Listener

Parameters:
port - The listen port
handler - The command handler class
Throws:
java.lang.Throwable

startServerSocketThread

public static void startServerSocketThread(ServerSocketThread sst,
                                           java.lang.String type)
Start ServerSocketThread

Parameters:
sst - The ServerSocketThread to start
type - The short 'type' name of the socket listener

loadDeviceUniqueID

public static Device loadDeviceUniqueID(DCServerConfig dcsc,
                                        java.lang.String modemID)
Load device record from unique-id.

Parameters:
dcsc - The DCS DCServerConfig instance. If null, this method will return null.
modemID - The unique modem ID (IMEI, ESN, etc)
Returns:
The Device record, or null if "dcsc" is null, or if the modemID is not found.

loadDeviceUniqueID

public Device loadDeviceUniqueID(java.lang.String modemID)
Load device record from unique-id. This is the main method used by most DCS modules to load the Device record instance from the specified modemID.

Parameters:
modemID - The unique modem ID (IMEI, ESN, etc)
Returns:
The Device record, or null if "dcsc" is null, or if the modemID is not found.

serverJarExists

public boolean serverJarExists()
Returns true if the named server is defined in the current installation.


isJarOptional

public boolean isJarOptional()
Returns true if this DCS requires a Jar file


getTrackServerAdapterClass

public java.lang.Class<?> getTrackServerAdapterClass(java.lang.Class<?> tsaC,
                                                     java.lang.Class<?> dftC)
Gets the "TrackServerAdapter" subclass

Parameters:
tsaC - The "TrackServerAdapter" class
dftC - The default "TrackServerAdapter" subclass
Returns:
The "TrackServerAdapter" class

getCommandPacketHandlerClass

public java.lang.Class<? extends CommandPacketHandler> getCommandPacketHandlerClass(java.lang.Class<? extends CommandPacketHandler> dftC)
Gets the "CommandPacketHandler" subclass

Parameters:
dftC - The default "CommandPacketHandler" subclass
Returns:
The "CommandPacketHandler" subclass

getClientPacketHandlerClass

public java.lang.Class<? extends ClientPacketHandler> getClientPacketHandlerClass(java.lang.Class<? extends ClientPacketHandler> dftC)
Gets the "ClientPacketHandler" subclass

Parameters:
dftC - The default "ClientPacketHandler" subclass
Returns:
The "ClientPacketHandler" subclass

setCommandProtocol

public void setCommandProtocol(java.lang.String proto)
Sets the command protocol to use when communicating with remote devices

Parameters:
proto - The CommandProtocol

setCommandProtocol

public void setCommandProtocol(DCServerConfig.CommandProtocol proto)
Sets the command protocol to use when communicating with remote devices

Parameters:
proto - The CommandProtocol

getCommandProtocol

public DCServerConfig.CommandProtocol getCommandProtocol()
Gets the command protocol to use when communicating with remote devices

Returns:
The Command Protocol

getClientCommandPort_udp

public int getClientCommandPort_udp(int dft)
Gets the "Client Command Port"

Parameters:
dft - The default Client Command Port
Returns:
The Client Command Port

getClientCommandPort_tcp

public int getClientCommandPort_tcp(int dft)
Gets the "Client Command Port"

Parameters:
dft - The default Client Command Port
Returns:
The Client Command Port

getAckResponsePort

public int getAckResponsePort(int dft)
Gets the "ACK Response Port"

Parameters:
dft - The ACK response port
Returns:
The ack response port

getAckResponsePort

public static int getAckResponsePort(DCServerConfig dcsc,
                                     int dft)
Gets the "ACK Response Port"

Parameters:
dcsc - The DCServerConfig instance
dft - The ACK response port
Returns:
The ack response port

getTcpIdleTimeoutMS

public long getTcpIdleTimeoutMS(long dft)
Gets the "TCP idle timeout"

Parameters:
dft - The default timeout value
Returns:
The default timeout value

getTcpPacketTimeoutMS

public long getTcpPacketTimeoutMS(long dft)
Gets the "TCP packet timeout"

Parameters:
dft - The default timeout value
Returns:
The default timeout value

getTcpSessionTimeoutMS

public long getTcpSessionTimeoutMS(long dft)
Gets the "TCP session timeout"

Parameters:
dft - The default timeout value
Returns:
The default timeout value

getUdpIdleTimeoutMS

public long getUdpIdleTimeoutMS(long dft)
Gets the "UDP idle timeout"

Parameters:
dft - The default timeout value
Returns:
The default timeout value

getUdpPacketTimeoutMS

public long getUdpPacketTimeoutMS(long dft)
Gets the "UDP packet timeout"

Parameters:
dft - The default timeout value
Returns:
The default timeout value

getUdpSessionTimeoutMS

public long getUdpSessionTimeoutMS(long dft)
Gets the "UDP session timeout"

Parameters:
dft - The default timeout value
Returns:
The default timeout value

getUniquePrefix

public java.lang.String[] getUniquePrefix(java.lang.String[] dftPfx)
Gets the array of allowed UniqueID prefixes

Parameters:
dftPfx - The default list of prefixes
Returns:
The array of allowed UniqueID prefixes

getUniquePrefix

public java.lang.String[] getUniquePrefix()
Gets the array of allowed UniqueID prefixes

Returns:
The array of allowed UniqueID prefixes

setUniquePrefix

public void setUniquePrefix(java.lang.String[] pfx)
Sets the array of allowed UniqueID prefixes

Parameters:
pfx - The default UniqueID prefixes

getMinimumMovedMeters

public double getMinimumMovedMeters(double dft)
Gets the "Minimum Moved Meters"

Parameters:
dft - The default minimum distance
Returns:
The Minimum Moved Meters

getMinimumMovedMeters

public static double getMinimumMovedMeters(DCServerConfig dcsc,
                                           double dft)
Gets the "Minimum Moved Meters"

Parameters:
dcsc - The DCServerConfig instance
dft - The default minimum distance
Returns:
The Minimum Moved Meters

getMinimumSpeedKPH

public double getMinimumSpeedKPH(double dft)
Gets the "Minimum Speed KPH"

Parameters:
dft - The default minimum speed
Returns:
The Minimum Speed KPH

getMinimumSpeedKPH

public static double getMinimumSpeedKPH(DCServerConfig dcsc,
                                        double dft)
Gets the "Minimum Speed KPH"

Parameters:
dcsc - The DCServerConfig instance
dft - The default minimum speed
Returns:
The Minimum Speed KPH

getEstimateOdometer

public boolean getEstimateOdometer(boolean dft)
Gets the "Estimate Odometer" flag

Parameters:
dft - The default estimate odometer flag
Returns:
The Estimate Odometer flag

getEstimateOdometer

public static boolean getEstimateOdometer(DCServerConfig dcsc,
                                          boolean dft)
Gets the "Estimate Odometer" flag

Parameters:
dcsc - The DCServerConfig instance
dft - The default estimate odometer flag
Returns:
The Estimate Odometer flag

getIgnoreDeviceOdometer

public boolean getIgnoreDeviceOdometer(boolean dft)
Gets the "Ignore Device Odometer" flag

Parameters:
dft - The default ignore device odometer flag
Returns:
The Ignore Device Odometer flag

getIgnoreDeviceOdometer

public static boolean getIgnoreDeviceOdometer(DCServerConfig dcsc,
                                              boolean dft)
Gets the "Ignore Device Odometer" flag

Parameters:
dcsc - The DCServerConfig instance
dft - The default ignore device odometer flag
Returns:
The ignore device Odometer flag

getSimulateGeozones

public boolean getSimulateGeozones(boolean dft)
Gets the "Simulate Geozones" state

Parameters:
dft - The default Simulate Geozones state
Returns:
The Simulate Geozones state

getSimulateGeozones

public static boolean getSimulateGeozones(DCServerConfig dcsc,
                                          boolean dft)
Gets the "Simulate Geozones" state

Parameters:
dcsc - The DCServerConfig instance
dft - The default Simulate Geozones state
Returns:
The Simulate Geozones state

getGeozoneSkipOldEvents

public boolean getGeozoneSkipOldEvents(boolean dft)
Gets the "Geozone Skip Old Events" state

Parameters:
dft - The default Geozone Skip Old Events state
Returns:
The Geozone Skip Old Events state

getGeozoneSkipOldEvents

public static boolean getGeozoneSkipOldEvents(DCServerConfig dcsc,
                                              boolean dft)
Gets the "Geozone Skip Old Events" state

Parameters:
dcsc - The DCServerConfig instance
dft - The default Geozone Skip Old Events state
Returns:
The Geozone Skip Old Events state

getMaximumHDOP

public double getMaximumHDOP(double dft)
Gets the "Maximum HDOP"

Parameters:
dft - The default maximum HDOP
Returns:
The Maximum HDOP

getMaximumHDOP

public static double getMaximumHDOP(DCServerConfig dcsc,
                                    double dft)
Gets the "Maximum HDOP"

Parameters:
dcsc - The DCServerConfig instance
dft - The default maximum HDOP
Returns:
The Maximum HDOP

getMinimumSatelliteCount

public int getMinimumSatelliteCount(int dft)
Gets the "Minimum Satellite Count"

Parameters:
dft - The default minimum satellite count
Returns:
The Minimum Satellite Count

getMinimumSatelliteCount

public static int getMinimumSatelliteCount(DCServerConfig dcsc,
                                           int dft)
Gets the "Minimum Satellite Count"

Parameters:
dcsc - The DCServerConfig instance
dft - The default minimum satellite count
Returns:
The Minimum Satellite Count

getMaximumAccuracyMeters

public double getMaximumAccuracyMeters(double dft)
Gets the "Maximum Accuracy Meters"

Parameters:
dft - The default maximum accuracy meters
Returns:
The Maximum accuracy meters

getMaximumAccuracyMeters

public static double getMaximumAccuracyMeters(DCServerConfig dcsc,
                                              double dft)
Gets the "Maximum Accuracy Meters"

Parameters:
dcsc - The DCServerConfig instance
dft - The default maximum accuracy meters
Returns:
The Maximum accuracy meters

getCheckLastOdometer

public boolean getCheckLastOdometer(boolean dft)
Gets the "Check Last Odometer" config

Parameters:
dft - The default "Check Last Odometer" state
Returns:
The "Check Last Odometer" state

getCheckLastOdometer

public static boolean getCheckLastOdometer(DCServerConfig dcsc,
                                           boolean dft)
Gets the "Check Last Odometer" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Check Last Odometer" state
Returns:
The "Check Last Odometer" state

getSaveRawDataPackets

public boolean getSaveRawDataPackets(boolean dft)
Gets the "Save Raw Data Packet" config

Parameters:
dft - The default "Save Raw Data Packet" state
Returns:
The "Save Raw Data Packet" state

getSaveRawDataPackets

public static boolean getSaveRawDataPackets(DCServerConfig dcsc,
                                            boolean dft)
Gets the "Save Raw Data Packet" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Save Raw Data Packet" state
Returns:
The "Save Raw Data Packet" state

getFuelLevelProfile

public FuelLevelProfile getFuelLevelProfile(java.lang.String grpID,
                                            FuelLevelProfile dft)
Gets the FuelLevelProfile config. A copy of the retrieved FuelLevelProfile will be saved in a cache map for quicker retrieval on subsequent called to this method.

Parameters:
grpID - DCS properties group ID
dft - The default FuelLevelProfile
Returns:
The FuelLevelProfile

getFuelLevelProfile

public FuelLevelProfile getFuelLevelProfile(Device dev,
                                            FuelLevelProfile dft)
Gets the FuelLevelProfile config

Parameters:
dev - The device instance
dft - The default FuelLevelProfile
Returns:
The FuelLevelProfile

getActualFuelLevel

public double getActualFuelLevel(Device dev,
                                 double preLevel,
                                 FuelLevelProfile dft)
Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.

Parameters:
dev - The Device instance
preLevel - The fuel-level before conversion
dft - The default FuelLevelProfile to use
Returns:
The converted fuel-level. Will return the pre-converted-level if a FuelLevelProfile is not defined.

getActualFuelLevel

public double getActualFuelLevel(Device dev,
                                 double preLevel)
Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.

Parameters:
dev - The Device instance
preLevel - The fuel-level before conversion
Returns:
The converted fuel-level. Will return the pre-converted-level if a FuelLevelProfile is not defined.

getActualFuelLevel

public static double getActualFuelLevel(DCServerConfig dcs,
                                        Device dev,
                                        double preLevel,
                                        FuelLevelProfile dft)
Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.

Parameters:
dcs - The DCServerConfig instance
dev - The Device instance
preLevel - The fuel-level before conversion
dft - The default FuelLevelProfile to use
Returns:
The converted fuel-level. Will return the pre-converted-level if a FuelLevelProfile is not defined.

getActualFuelLevel

public static double getActualFuelLevel(DCServerConfig dcs,
                                        Device dev,
                                        double preLevel)
Converts and returns the actual fuel level based on the Device or Config FuelLevelProfile.

Parameters:
dcs - The DCServerConfig instance
dev - The Device instance
preLevel - The fuel-level before conversion
Returns:
The converted fuel-level. Will return the pre-converted-level if a FuelLevelProfile is not defined.

getFuelLevelProfile

public FuelLevelProfile getFuelLevelProfile(FuelLevelProfile dft)
Gets the default FuelLevelProfile config

Parameters:
dft - The default FuelLevelProfile
Returns:
The FuelLevelProfile

getFuelLevelProfile

public static FuelLevelProfile getFuelLevelProfile(DCServerConfig dcsc,
                                                   FuelLevelProfile dft)
Gets the default FuelLevelProfile config

Parameters:
dcsc - The DCServerConfig instance
dft - The default FuelLevelProfile
Returns:
The FuelLevelProfile

getBatteryLevelProfile

public BatteryLevelProfile getBatteryLevelProfile(java.lang.String grpID,
                                                  BatteryLevelProfile dft)
Gets the BatteryLevelProfile config. A copy of the retrieved BatteryLevelProfile will be saved in a cache map for quicker retrieval on subsequent called to this method.

Parameters:
grpID - DCS properties group ID
dft - The default BatteryLevelProfile return if no BatteryLevelProfile is defined
Returns:
The BatteryLevelProfile

getBatteryLevelProfile

public BatteryLevelProfile getBatteryLevelProfile(Device dev,
                                                  BatteryLevelProfile dft)
Gets the BatteryLevelProfile config

Parameters:
dev - The device instance
dft - The default BatteryLevelProfile
Returns:
The BatteryLevelProfile

getBatteryLevelFromVolts

public double getBatteryLevelFromVolts(Device dev,
                                       double battVolts,
                                       BatteryLevelProfile dft)
Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.

Parameters:
dev - The Device instance
battVolts - The battery volts
dft - The default BatteryLevelProfile to use
Returns:
The battery-level. Returns 0.0 if a BatteryLevelProfile is not defined.

getBatteryLevelFromVolts

public double getBatteryLevelFromVolts(Device dev,
                                       double battVolts)
Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.

Parameters:
dev - The Device instance
battVolts - The battery volts
Returns:
The battery-level. Returns 0.0 if a BatteryLevelProfile is not defined.

getBatteryLevelFromVolts

public static double getBatteryLevelFromVolts(DCServerConfig dcs,
                                              Device dev,
                                              double battVolts,
                                              BatteryLevelProfile dft)
Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.

Parameters:
dcs - The DCServerConfig instance
dev - The Device instance
battVolts - The battery volts
dft - The default BatteryLevelProfile to use
Returns:
The battery-level. Returns 0.0 if a BatteryLevelProfile is not defined.

getBatteryLevelFromVolts

public static double getBatteryLevelFromVolts(DCServerConfig dcs,
                                              Device dev,
                                              double battVolts)
Converts and returns the actual battery level based on the Device or Config BatteryLevelProfile.

Parameters:
dcs - The DCServerConfig instance
dev - The Device instance
battVolts - The battery volts
Returns:
The battery-level. Returns 0.0 if a BatteryLevelProfile is not defined.

getBatteryLevelProfile

public BatteryLevelProfile getBatteryLevelProfile(BatteryLevelProfile dft)
Gets the default BatteryLevelProfile config

Parameters:
dft - The default BatteryLevelProfile
Returns:
The BatteryLevelProfile

getBatteryLevelProfile

public static BatteryLevelProfile getBatteryLevelProfile(DCServerConfig dcsc,
                                                         BatteryLevelProfile dft)
Gets the default BatteryLevelProfile config

Parameters:
dcsc - The DCServerConfig instance
dft - The default BatteryLevelProfile
Returns:
The BatteryLevelProfile

getStartStopSupported

public boolean getStartStopSupported(boolean dft)
Gets the "Start/Stop StatusCode supported" config

Parameters:
dft - The default "Start/Stop StatusCode supported" state
Returns:
The "Start/Stop StatusCode supported" state

getStartStopSupported

public static boolean getStartStopSupported(DCServerConfig dcsc,
                                            boolean dft)
Gets the "Start/Stop StatusCode supported" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Start/Stop StatusCode supported" state
Returns:
The "Start/Stop StatusCode supported" state

getStatusLocationInMotion

public boolean getStatusLocationInMotion(boolean dft)
Gets the "Status Location/InMotion Translation" config

Parameters:
dft - The default "Status Location/InMotion Translation" state
Returns:
The "Status Location/InMotion Translation" state

getStatusLocationInMotion

public static boolean getStatusLocationInMotion(DCServerConfig dcsc,
                                                boolean dft)
Gets the "Status Location/InMotion Translation" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Status Location/InMotion Translation" state
Returns:
The "Status Location/InMotion Translation" state

getIgnoreInvalidGPSFlag

public boolean getIgnoreInvalidGPSFlag(boolean dft)
Gets the "Ignore Invalid GPS Location Flag" config

Parameters:
dft - The default "Ignore Invalid GPS Location Flag" state
Returns:
The "Ignore Invalid GPS Location Flag" state

getIgnoreInvalidGPSFlag

public static boolean getIgnoreInvalidGPSFlag(DCServerConfig dcsc,
                                              boolean dft)
Gets the "Ignore Invalid GPS Location Flag" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Ignore Invalid GPS Location Flag" state
Returns:
The "Ignore Invalid GPS Location Flag" state

getIgnoreEventsWithInvalidGPS

public boolean getIgnoreEventsWithInvalidGPS(boolean dft)
Gets the "Ignore Events with Invalid GPS" config

Parameters:
dft - The default "Ignore Events with Invalid GPS" state
Returns:
The "Ignore Events with Invalid GPS" state

getIgnoreEventsWithInvalidGPS

public static boolean getIgnoreEventsWithInvalidGPS(DCServerConfig dcsc,
                                                    boolean dft)
Gets the "Ignore Events with Invalid GPS" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Ignore Events with Invalid GPS" state
Returns:
The "Ignore Events with Invalid GPS" state

getUseLastValidGPSLocation

public boolean getUseLastValidGPSLocation(boolean dft)
Gets the "Use Last Valid GPS Location" config

Parameters:
dft - The default "Use Last Valid GPS Location" state
Returns:
The "Use Last Valid GPS Location" state

getUseLastValidGPSLocation

public static boolean getUseLastValidGPSLocation(DCServerConfig dcsc,
                                                 boolean dft)
Gets the "Use Last Valid GPS Location" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Use Last Valid GPS Location" state
Returns:
The "Use Last Valid GPS Location" state

getUseAltCurrentTimestamp

public boolean getUseAltCurrentTimestamp(boolean dft)
Gets the "Use Alternate Current Timestamp for Event" config

Parameters:
dft - The default "Use Alternate Current Timestamp for Event" state
Returns:
The "Use Alternate Current Timestamp for Event" state

getUseAltCurrentTimestamp

public static boolean getUseAltCurrentTimestamp(DCServerConfig dcsc,
                                                boolean dft)
Gets the "Use Alternate Current Timestamp for Event" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Use Alternate Current Timestamp for Event" state
Returns:
The "Use Alternate Current Timestamp for Event" state

getSaveSessionStatistics

public boolean getSaveSessionStatistics(boolean dft)
Gets the "Save Session Statistics" config

Parameters:
dft - The default "Save Session Statistics" state
Returns:
The "Save Session Statistics" state

getSaveSessionStatistics

public static boolean getSaveSessionStatistics(DCServerConfig dcsc,
                                               boolean dft)
Gets the "Save Session Statistics" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Save Session Statistics" state
Returns:
The "Save Session Statistics" state

getDebugMode

public boolean getDebugMode(boolean dft)
Gets the "Debug Mode" config

Parameters:
dft - The default "Debug Mode" state
Returns:
The "Debug Mode" state

getDebugMode

public static boolean getDebugMode(DCServerConfig dcsc,
                                   boolean dft)
Gets the "Debug Mode" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Debug Mode" state
Returns:
The "Debug Mode" state

getShowURL

public boolean getShowURL(boolean dft)
Gets the "Show URL" config

Parameters:
dft - The default "Show URL" state
Returns:
The "Show URL" state

getShowURL

public static boolean getShowURL(DCServerConfig dcsc,
                                 boolean dft)
Gets the "Show URL" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Show URL" state
Returns:
The "Show URL" state

getCommandAckBit

public int getCommandAckBit(java.lang.String bitName,
                            int dft)
Gets the "Command ACK bit" config

Parameters:
dft - The default "Command ACK bit"
Returns:
The "Command ACK bit"

getCommandAckBit

public static int getCommandAckBit(DCServerConfig dcsc,
                                   java.lang.String bitName,
                                   int dft)
Gets the "Command ACK bit" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Command ACK bit"
Returns:
The "Command ACK bit"

getBatteryLevelRange

public double[] getBatteryLevelRange(double[] dft)
Gets the "Battery Level Range" config

Parameters:
dft - The default "Battery Level Range" min/max values
Returns:
The "Battery Level Range" min/max values

getBatteryLevelRange

public static double[] getBatteryLevelRange(DCServerConfig dcsc,
                                            double[] dft)
Gets the "Battery Level Range" config

Parameters:
dcsc - The DCServerConfig instance
dft - The default "Battery Level Range" min/max values
Returns:
The "Battery Level Range" min/max values

CalculateBatteryLevel

public static double CalculateBatteryLevel(double voltage,
                                           double[] range)
Calculates/returns the battery level based on the specified voltage range

Parameters:
voltage - The current battery voltage
range - The allowed voltage range
Returns:
The battery level percent

getSimulateDigitalInputs

public long getSimulateDigitalInputs(long dft)
Gets the "Simulate Geozones" mask

Parameters:
dft - The default Simulate Geozones mask
Returns:
The Simulate Geozones mask

getSimulateDigitalInputs

public static long getSimulateDigitalInputs(DCServerConfig dcsc,
                                            long dft)
Gets the "Simulate Geozones" mask

Parameters:
dcsc - The DCServerConfig instance
dft - The default Simulate Geozones mask
Returns:
The Simulate Geozones mask

hasDigitalInputs

public boolean hasDigitalInputs()
Returns true if this device supports digital inputs

Returns:
True if this device supports digital inputs

hasDigitalOutputs

public boolean hasDigitalOutputs()
Returns true if this device supports digital outputs

Returns:
True if this device supports digital outputs

initEventDataAnalogMap

public java.util.Map<java.lang.String,EventDataAnalog> initEventDataAnalogMap(java.lang.String keyPfx,
                                                                              java.lang.Class<? extends EventDataAnalog> edaClass)
Creates/Returns an EventDataAnalog conversion map.

Parameters:
keyPfx - The analog property prefix (such as "analog."). The analog property entries are assumed to be 1-based (ie. "analog.1" is the first entry.
edaClass - The EventDataAnalog subclass from which the map entries are created.

initEventDataAnalogMap

public java.util.Map<java.lang.String,EventDataAnalog> initEventDataAnalogMap(java.lang.String keyPfx)
Creates/Returns an EventDataAnalog conversion map.

Parameters:
keyPfx - The analog property prefix (such as "analog."). The analog property entries are assumed to be 1-based (ie. "analog.1" is the first entry). If null, the default analog property key prefix will be used.

getEventDataAnalogMap

public java.util.Map<java.lang.String,EventDataAnalog> getEventDataAnalogMap()
Gets the previously initialized EventDataAnalog conversion map.

Returns:
The previously initialized EventDataAnalog conversion map, or null if not yet initialized.

setEventDataAnalogField

public boolean setEventDataAnalogField(int aNdx,
                                       EventData evdb,
                                       double value)
Converts/Sets the EventData field value


setEventDataAnalogField

public static boolean setEventDataAnalogField(DCServerConfig dcsc,
                                              int aNdx,
                                              EventData evdb,
                                              double value)
Converts/Sets the EventData field value


printEventDataAnalog

public static void printEventDataAnalog(DCServerConfig dcsc,
                                        int width)
Prints the defined EventDataAnalog headers


convertToBytes

public static byte[] convertToBytes(java.lang.String s)
Convenience for converting the initial/final packet to a byte array. If the string begins with "0x" the the remain string is assumed to be hex

Returns:
The byte array

getInitialPacketString

public java.lang.String getInitialPacketString(java.lang.String dft)
Gets the "Initial Packet" String

Parameters:
dft - The default "Initial Packet" String
Returns:
The "Initial Packet" String

getInitialPacket

public byte[] getInitialPacket(byte[] dft)
Gets the "Initial Packet" byte array

Parameters:
dft - The default "Initial Packet" byte array
Returns:
The "Initial Packet" byte array

getFinalPacketString

public java.lang.String getFinalPacketString(java.lang.String dft)
Gets the "Final Packet" String

Parameters:
dft - The default "Final Packet" String
Returns:
The "Final Packet" String

getFinalPacket

public byte[] getFinalPacket(byte[] dft)
Gets the "Final Packet" byte array

Parameters:
dft - The default "Final Packet" byte array
Returns:
The "Final Packet" byte array

setEventCodeEnabled

public void setEventCodeEnabled(boolean enabled)
Sets the "Event Code Map Enable" config

Parameters:
enabled - The "Event Code Map Enable" state

getEventCodeEnabled

public boolean getEventCodeEnabled()
Gets the "Event Code Map Enable" config

Returns:
The "Event Code Map Enable" state

setEventCodeMap

public void setEventCodeMap(java.util.Map<java.lang.Object,DCServerConfig.EventCode> codeMap)
Sets the EventCodeMap


printEventCodeMap

public boolean printEventCodeMap()
Prints the EventCodeMap


getEventCode

public DCServerConfig.EventCode getEventCode(int code)
Returns the EventCode instance for the specified code

Parameters:
code - The code
Returns:
The EventCode

getEventCode

public DCServerConfig.EventCode getEventCode(long code)
Returns the EventCode instance for the specified code

Parameters:
code - The code
Returns:
The EventCode

getEventCode

public DCServerConfig.EventCode getEventCode(java.lang.String code)
Returns the EventCode instance for the specified code

Parameters:
code - The code
Returns:
The EventCode

translateStatusCode

public int translateStatusCode(int code,
                               int dftStatusCode)
Translates the specified device status code into a GTS status code

Parameters:
code - The code to translate
dftStatusCode - The default code returned if no translation is defined
Returns:
The translated GTS status code

translateStatusCode

public int translateStatusCode(java.lang.String code,
                               int dftStatusCode)
Translates the specified device status code into a GTS status code

Parameters:
code - The code to translate
dftStatusCode - The default code returned if no translation is defined
Returns:
The translated GTS status code

setCommandDispatcherHost

public void setCommandDispatcherHost(java.lang.String cmdHost)
Sets the device command listen host (may be null to use default bind-address)

Parameters:
cmdHost - The device command listen host

getCommandDispatcherHost

public java.lang.String getCommandDispatcherHost(Device device)
Gets the device command listen host

Returns:
The device command listen host

setCommandDispatcherPort

public void setCommandDispatcherPort(int cmdPort,
                                     boolean checkRTP)
Sets the device command listen port

Parameters:
cmdPort - The device command listen port
checkRTP - True to allow the RTConfig propertiesto override this value

setCommandDispatcherPort

public void setCommandDispatcherPort(int cmdPort)
Sets the device command listen port

Parameters:
cmdPort - The device command listen port

getCommandDispatcherPort

public int getCommandDispatcherPort()
Gets the device command listen port (returns '0' if not supported)

Returns:
The device command listen port

setCommandsAclName

public void setCommandsAclName(java.lang.String aclName,
                               AclEntry.AccessLevel dft)
Sets the Commands Acl name

Parameters:
aclName - The Commands Acl name

getCommandsAclName

public java.lang.String getCommandsAclName()
Gets the Commands Acl name

Returns:
The Commands Acl name

getCommandsAccessLevelDefault

public AclEntry.AccessLevel getCommandsAccessLevelDefault()
Gets the Commands Acl AccessLevel default

Returns:
The Commands Acl AccessLevel default

userHasAccessToCommand

public boolean userHasAccessToCommand(BasicPrivateLabel privLabel,
                                      User user,
                                      java.lang.String commandName)
Returns True if the specified user has access to the named command


addCommand

public void addCommand(java.lang.String cmdName,
                       java.lang.String cmdDesc,
                       boolean cmdEnable,
                       java.lang.String[] cmdTypes,
                       java.lang.String cmdAclName,
                       AclEntry.AccessLevel cmdAclDft,
                       java.lang.String cmdString,
                       boolean hasArgs,
                       java.util.Collection<DCServerConfig.CommandArg> cmdArgList,
                       java.lang.String cmdProto,
                       long maxRteAge,
                       boolean allowQueue,
                       boolean expectAck,
                       int expAckCode,
                       long stateMask,
                       boolean stateVal,
                       int cmdSCode)

getCommandList

public java.lang.String[] getCommandList()
Gets a list of command names

Returns:
The list of command names

getCommandMap

public java.util.Map<java.lang.String,DCServerConfig.Command> getCommandMap(BasicPrivateLabel privLabel,
                                                                            User user,
                                                                            java.lang.String type)
Gets the command's (name,description) map

Parameters:
type - The description type
Returns:
The command's (name,description) map

getCommandDescriptionMap

public java.util.Map<java.lang.String,java.lang.String> getCommandDescriptionMap(BasicPrivateLabel privLabel,
                                                                                 User user,
                                                                                 java.lang.String type)
Gets the command's (name,description) map

Parameters:
privLabel - The context PrivateLabel instance
user - The context login User
type - The description type
Returns:
The command's (name,description) map

ParseCommandMap_JSON

public static OrderedMap<java.lang.String,DCServerConfig.Command> ParseCommandMap_JSON(JSON._Object commands)
Sets the commands, based on the specified JSON object

Parameters:
commands - The JSON command object

getCommands_JSON

public JSON._Object getCommands_JSON(BasicPrivateLabel privLabel,
                                     User user,
                                     java.lang.String type)
Gets the commands as a JSON object

Parameters:
privLabel - The context PrivateLabel instance
user - The context login User
type - The description type
Returns:
The JSON object containing this DCS commands

getCommand

public DCServerConfig.Command getCommand(java.lang.String name)
Returns the named command

Parameters:
name - The name of the command to return
Returns:
The Command instance (or null if not found)

getCommandDescription

public java.lang.String getCommandDescription(java.lang.String cmdName,
                                              java.lang.String dft)
Gets the "Command Description" for the specified command

Parameters:
dft - The default "Command Description"
Returns:
The "Command Description" for the specified command

getCommandString

public java.lang.String getCommandString(java.lang.String cmdName,
                                         java.lang.String dft)
Gets the "Command String" for the specified command

Parameters:
dft - The default "Command String"
Returns:
The "Command String" for the specified command

getCommandAuditStatusCode

public int getCommandAuditStatusCode(java.lang.String cmdName,
                                     int code)
Gets the status-code for the specified command. An event with this status code will be inserted into the EventData table when this command is sent to the device.

Parameters:
code - The default status-code
Returns:
The status-code for the specified command

addRecommendedConfigPropertyKey

public void addRecommendedConfigPropertyKey(java.lang.String key)
Adds a recommended runtime configiuration property key to this DCS

Parameters:
key - The recommended configuration property key

getRecommendedConfigPropertyKeys

public java.util.Set<java.lang.String> getRecommendedConfigPropertyKeys()
Returns the recommended runtime configuration property key set

Returns:
The recommended runtime configuration property key set

getDefaultProperties

public RTProperties getDefaultProperties()
Returns the default RTProperties instance

Returns:
The default RTProperties instance

getPropertyGroupNames

public java.util.Set<java.lang.String> getPropertyGroupNames()
Returns a set of RTProperties group names

Returns:
A set of RTProperties group names

getPropertiesID

public java.lang.String getPropertiesID(Device device)
Gets the DCS properties ID for the specific device.


getPropertiesID

public java.lang.String getPropertiesID(Device device,
                                        java.lang.String dftID)
Gets the DCS properties ID for the specific device.


getProperties

public RTProperties getProperties(java.lang.String grpID)
Gets the RTProperties instance for the specified group name. Returns the default if the specified properties group id is not found.

Parameters:
grpID - The property group name
Returns:
The matching group RTProperties instance (does not return null)

getProperties

public RTProperties getProperties(Device device)
Gets the RTProperties instance for the specified group name. Returns the default if the specified properties group id is not found.

Parameters:
device - The device from which the property group name is obtained
Returns:
The matching group RTProperties instance (does not return null)

getProperties

public RTProperties getProperties(java.lang.String grpID,
                                  RTProperties dftRTP)
Gets the RTProperties instance for the specified group name. Returns the specified default if the specified properties group id is not found.

Parameters:
grpID - The property group name
dftRTP - The default RTProperties to return if group not found (may be null)
Returns:
The matching group RTProperties instance

getProperties

public RTProperties getProperties(Device device,
                                  RTProperties dftRTP)
Gets the RTProperties instance for the specified group name. Returns the specified default if the specified properties group id is not found.

Parameters:
device - The device from which the property group name is obtained
dftRTP - The default RTProperties to return if group not found (may be null)
Returns:
The matching group RTProperties instance

getPropertiesForKey

public RTProperties getPropertiesForKey(Device device,
                                        java.lang.String key)
Gets the RTProperties instance that contains the specified key. Returns the default RTProperties instance if not other instance contains the specified key


getPropertiesForKey

public RTProperties getPropertiesForKey(Device device,
                                        java.lang.String[] key)
Gets the RTProperties instance that contains the specified key. Returns the default RTProperties instance if not other instance contains the specified key


getProperties

public RTProperties getProperties(java.lang.String grpID,
                                  boolean createNewGroup)
Gets the RTProperties instance for the specified group name. Returns the default if the specified properties group id is blank or "default".

Parameters:
grpID - The property group name
createNewGroup - True to create this group if not already present.
Returns:
The matching group RTProperties instance

getPropertiesForKey

public RTProperties getPropertiesForKey(java.lang.String grpID,
                                        java.lang.String key)
Gets the RTProperties instance that contains the specified key. Returns the default RTProperties instance if no other instance contains the specified key


getPropertiesForKey

public RTProperties getPropertiesForKey(java.lang.String grpID,
                                        java.lang.String[] key)
Gets the RTProperties instance that contains the specified key. Returns the default RTProperties instance if no other instance contains the specified key


normalizeKey

public java.lang.String normalizeKey(java.lang.String key)
Prepend DCS name to key


normalizeKeys

public java.lang.String[] normalizeKeys(java.lang.String[] key)
Prepend DCS name to keys


getPropertyKeys

public java.util.Set<java.lang.String> getPropertyKeys(java.lang.String prefix)
Returns a set of all property keys that match the specified prefix.

Parameters:
prefix - The property key prefix
Returns:
The set of matching property keys.

hasProperty

public boolean hasProperty(java.lang.String[] key,
                           boolean inclDft)
Returns true is the property key has been defined.

Parameters:
key - An array of property keys (true if any one of these keys are defined).
inclDft - True to also test default property key definitions.
Returns:
True if the property key has been defined.

hasProperty

public boolean hasProperty(Device dev,
                           java.lang.String[] key,
                           boolean inclDft)
Returns true is the property key has been defined.

Parameters:
dev - The specific Device instance
key - An array of property keys (true if any one of these keys are defined).
inclDft - True to also test default property key definitions.
Returns:
True if the property key has been defined.

getStringArrayProperty

public java.lang.String[] getStringArrayProperty(java.lang.String key,
                                                 java.lang.String[] dft)
Gets the String-array value for the specified property key

Parameters:
key - The property key
dft - The default value if the property key is not defined
Returns:
The String-array value of the property

getStringArrayProperty

public java.lang.String[] getStringArrayProperty(Device dev,
                                                 java.lang.String key,
                                                 java.lang.String[] dft)
Gets the String-array value for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default value if the property key is not defined
Returns:
The String-array value of the property

getStringArrayProperty

public java.lang.String[] getStringArrayProperty(java.lang.String[] key,
                                                 java.lang.String[] dft)
Gets the String-array value for the specified property key

Parameters:
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The String-array value of the property

getStringArrayProperty

public java.lang.String[] getStringArrayProperty(Device dev,
                                                 java.lang.String[] key,
                                                 java.lang.String[] dft)
Gets the String-array value for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The String-array value of the property

getStringProperty

public java.lang.String getStringProperty(java.lang.String key,
                                          java.lang.String dft)
Gets the String value for the specified property key

Parameters:
key - The property key
dft - The default value if the property key is not defined
Returns:
The String value of the property

getStringProperty

public java.lang.String getStringProperty(Device dev,
                                          java.lang.String key,
                                          java.lang.String dft)
Gets the String value for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default value if the property key is not defined
Returns:
The String value of the property

getStringProperty

public java.lang.String getStringProperty(java.lang.String[] key,
                                          java.lang.String dft)
Gets the String value for the specified property key

Parameters:
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The String value of the property

getStringProperty

public java.lang.String getStringProperty(Device dev,
                                          java.lang.String[] key,
                                          java.lang.String dft)
Gets the String value for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The String value of the property

getClassProperty

public java.lang.Class<?> getClassProperty(java.lang.String key,
                                           java.lang.Class<?> dft)
Gets the Class for the specified property key

Parameters:
key - The property key
dft - The default class if the property key is not defined
Returns:
The Class of the property

getClassProperty

public java.lang.Class<?> getClassProperty(Device dev,
                                           java.lang.String key,
                                           java.lang.Class<?> dft)
Gets the Class for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default class if the property key is not defined
Returns:
The Class of the property

getClassProperty

public java.lang.Class<?> getClassProperty(java.lang.String[] key,
                                           java.lang.Class<?> dft)
Gets the Class for the specified property key

Parameters:
key - An array of property keys
dft - The default Class if the property key is not defined
Returns:
The Class of the property

getClassProperty

public java.lang.Class<?> getClassProperty(Device dev,
                                           java.lang.String[] key,
                                           java.lang.Class<?> dft)
Gets the Class for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default Class if the property key is not defined
Returns:
The Class of the property

getCustomParserInstance

public CustomParser getCustomParserInstance(java.lang.String key,
                                            CustomParser dft)
Returns the CustomParser instance specified by the property key

Parameters:
key - The property key
dft - The default CustomParser instance if the property key is not defined
Returns:
The CustomParser instance

getCustomParserInstance

public CustomParser getCustomParserInstance(Device dev,
                                            java.lang.String key,
                                            CustomParser dft)
Returns the CustomParser instance specified by the property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default CustomParser instance if the property key is not defined
Returns:
The CustomParser instance

getCustomParserInstance

public CustomParser getCustomParserInstance(java.lang.String[] key,
                                            CustomParser dft)
Returns the CustomParser instance specified by the property key

Parameters:
key - An array of property keys
dft - The default CustomParser instance if the property key is not defined
Returns:
The CustomParser instance

getCustomParserInstance

public CustomParser getCustomParserInstance(Device dev,
                                            java.lang.String[] key,
                                            CustomParser dft)
Returns the CustomParser instance specified by the property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default CustomParser instance if the property key is not defined
Returns:
The CustomParser instance

getIntProperty

public int getIntProperty(java.lang.String key,
                          int dft)
Gets the Integer value for the specified property key

Parameters:
key - The property key
dft - The default value if the property key is not defined
Returns:
The Integer value of the property

getIntProperty

public int getIntProperty(Device dev,
                          java.lang.String key,
                          int dft)
Gets the Integer value for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default value if the property key is not defined
Returns:
The Integer value of the property

getIntProperty

public int getIntProperty(java.lang.String[] key,
                          int dft)
Gets the Integer value for the specified property key

Parameters:
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Integer value of the property

getIntProperty

public int getIntProperty(Device dev,
                          java.lang.String[] key,
                          int dft)
Gets the Integer value for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Integer value of the property

getIntArrayProperty

public int[] getIntArrayProperty(java.lang.String key,
                                 int[] dft)
Gets the Integer array for the specified property key

Parameters:
key - The property key
dft - The default array if the property key is not defined
Returns:
The Integer array of the property

getIntArrayProperty

public int[] getIntArrayProperty(Device dev,
                                 java.lang.String key,
                                 int[] dft)
Gets the Integer array for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default array if the property key is not defined
Returns:
The Integer array of the property

getIntArrayProperty

public int[] getIntArrayProperty(java.lang.String[] key,
                                 int[] dft)
Gets the Integer array for the specified property key

Parameters:
key - An array of property keys
dft - The default array if the property key is not defined
Returns:
The Integer array of the property

getIntArrayProperty

public int[] getIntArrayProperty(Device dev,
                                 java.lang.String[] key,
                                 int[] dft)
Gets the Integer array for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default array if the property key is not defined
Returns:
The Integer array of the property

getLongProperty

public long getLongProperty(java.lang.String key,
                            long dft)
Gets the Long value for the specified property key

Parameters:
key - The property key
dft - The default value if the property key is not defined
Returns:
The Long value of the property

getLongProperty

public long getLongProperty(Device dev,
                            java.lang.String key,
                            long dft)
Gets the Long value for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default value if the property key is not defined
Returns:
The Long value of the property

getLongProperty

public long getLongProperty(java.lang.String[] key,
                            long dft)
Gets the Long value for the specified property key

Parameters:
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Long value of the property

getLongProperty

public long getLongProperty(Device dev,
                            java.lang.String[] key,
                            long dft)
Gets the Long value for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Long value of the property

getDoubleProperty

public double getDoubleProperty(java.lang.String key,
                                double dft)
Gets the Double value for the specified property key

Parameters:
key - The property key
dft - The default value if the property key is not defined
Returns:
The Double value of the property

getDoubleProperty

public double getDoubleProperty(Device dev,
                                java.lang.String key,
                                double dft)
Gets the Double value for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default value if the property key is not defined
Returns:
The Double value of the property

getDoubleProperty

public double getDoubleProperty(java.lang.String[] key,
                                double dft)
Gets the Double value for the specified property key

Parameters:
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Double value of the property

getDoubleProperty

public double getDoubleProperty(Device dev,
                                java.lang.String[] key,
                                double dft)
Gets the Double value for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Double value of the property

getBooleanProperty

public boolean getBooleanProperty(java.lang.String key,
                                  boolean dft)
Gets the Boolean value for the specified property key

Parameters:
key - The property key
dft - The default value if the property key is not defined
Returns:
The Boolean value of the property

getBooleanProperty

public boolean getBooleanProperty(Device dev,
                                  java.lang.String key,
                                  boolean dft)
Gets the Boolean value for the specified property key

Parameters:
dev - The specific Device instance
key - The property key
dft - The default value if the property key is not defined
Returns:
The Boolean value of the property

getBooleanProperty

public boolean getBooleanProperty(java.lang.String[] key,
                                  boolean dft)
Gets the Boolean value for the specified property key

Parameters:
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Boolean value of the property

getBooleanProperty

public boolean getBooleanProperty(Device dev,
                                  java.lang.String[] key,
                                  boolean dft)
Gets the Boolean value for the specified property key

Parameters:
dev - The specific Device instance
key - An array of property keys
dft - The default value if the property key is not defined
Returns:
The Boolean value of the property

getDigitalInputState

public boolean getDigitalInputState(long mask,
                                    int bit)
Returns the state of the indicated input bit within the mask for this device type.

Parameters:
mask - The input mask from the device
bit - The bit to test

getDigitalOutputState

public boolean getDigitalOutputState(long mask,
                                     int bit)
Returns the state of the indicated output bit within the mask for this device type.

Parameters:
mask - The output mask from the device
bit - The bit to test

equals

public boolean equals(java.lang.Object other)
Returns true if the 'other' DCServerCOnfig is equal to this DCServerConfig based on the name.

Overrides:
equals in class java.lang.Object
Parameters:
other - The other DCServerConfig instance.
Returns:
True if the other DCServerConfig as the same name as this DCServerConfig

compareTo

public int compareTo(java.lang.Object other)
Compares another DCServerConfig instance to this instance.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - The other DCServerConfig instance.
Returns:
'compareTo' operator on DCServerConfig names.

hashCode

public int hashCode()
Return hashCode based on the DCServerConfig name

Overrides:
hashCode in class java.lang.Object
Returns:
this.getNmae().hashCoe()

toString

public java.lang.String toString()
Returns a String representation of this instance

Overrides:
toString in class java.lang.Object
Returns:
A String representation

toString

public java.lang.String toString(boolean inclName)
Returns a String representation of this instance

Parameters:
inclName - True to include the name in the returnsed String representation
Returns:
A String representation

getPortsString

public java.lang.StringBuffer getPortsString(java.lang.StringBuffer sb)
Returns a StringBuffer representation of the ports utilized.

Parameters:
sb - The StringBuffer to populate
Returns:
The input StringBuffer

getPortsString

public java.lang.String getPortsString()
Returns a String representation of the ports utilized.

Returns:
The String representation

getRunningJarPath

public java.io.File[] getRunningJarPath()
Return running jar file path