org.opengts.extra.service
Class GTSServiceRequest

java.lang.Object
  extended by org.opengts.util.ServiceRequest
      extended by org.opengts.extra.service.GTSServiceRequest
All Implemented Interfaces:
ServiceXML

public class GTSServiceRequest
extends ServiceRequest
implements ServiceXML


Nested Class Summary
 
Nested classes/interfaces inherited from class org.opengts.util.ServiceRequest
ServiceRequest.Authorization, ServiceRequest.RequestBody
 
Field Summary
 
Fields inherited from class org.opengts.util.ServiceRequest
AUTH_ENCODING_PREFIX, METHOD_handleRequest, SRATTR_account, SRATTR_auth, SRATTR_code, SRATTR_command, SRATTR_password, SRATTR_result, SRATTR_user, SRTAG_Authorization, SRTAG_GTSRequest, SRTAG_GTSResponse, SRTAG_Message
 
Fields inherited from interface org.opengts.extra.service.ServiceXML
ATTR_account, ATTR_arg, ATTR_arg0, ATTR_arg1, ATTR_arg2, ATTR_arg3, ATTR_arg4, ATTR_arg5, ATTR_arg6, ATTR_arg7, ATTR_args_, ATTR_auth, ATTR_code, ATTR_command, ATTR_eval, ATTR_format, ATTR_index, ATTR_key, ATTR_locale, ATTR_name, ATTR_offset, ATTR_option, ATTR_parameter, ATTR_partial, ATTR_password, ATTR_reportGroupTag, ATTR_reportJobID, ATTR_result, ATTR_shadowSize, ATTR_shadowUrl, ATTR_size, ATTR_table, ATTR_timezone, ATTR_type, ATTR_url, ATTR_urlOnly, ATTR_user, CMD_commands, CMD_custom, CMD_dbcreate, CMD_dbdel, CMD_dbget, CMD_dbput, CMD_dbschema, CMD_devcmd, CMD_eventdata, CMD_mapdata, CMD_messages, CMD_propget, CMD_pushpins, CMD_report, CMD_reportlist, CMD_statuscodes, CMD_version, JMXServiceObjectName, TAG_Ascending, TAG_Authorization, TAG_AutoIndex, TAG_Column, TAG_Columns, TAG_Command, TAG_Commands, TAG_Comment, TAG_CreationFromMS, TAG_CreationToMS, TAG_CustomCommand, TAG_Device, TAG_DeviceCommand, TAG_DeviceGroup, TAG_EmailAddress, TAG_EventData, TAG_Field, TAG_GPSRequired, TAG_GTSRequest, TAG_GTSResponse, TAG_Limit, TAG_MapData, TAG_MenuDescription, TAG_Message, TAG_Messages, TAG_Property, TAG_Pushpin, TAG_Pushpins, TAG_Record, TAG_RecordKey, TAG_Report, TAG_ReportItem, TAG_ReportJob, TAG_ReportList, TAG_StatusCode, TAG_Subtitle, TAG_TableSchema, TAG_TimeFrom, TAG_TimeTo, TAG_Title, TAG_Version, TAG_Where
 
Constructor Summary
GTSServiceRequest(java.lang.String url)
          Constructor
 
Method Summary
protected  java.lang.StringBuffer formatTime(java.lang.StringBuffer sb, java.lang.String pfx, DateTime dt, boolean isTimeTo)
          Appends a formatted "TimeFrom"/"TimeTo" tag element to the specified StringBuffer
 Account getAccount(java.lang.String acctID)
          Get a specific virtual Account
 java.lang.String[] getAccountIDs()
          Gets a list of Accounts
 org.w3c.dom.Document getCommandOnly_Document(java.lang.String command)
          Returns a Document response for requrest that only require a command name
 Device getDevice(java.lang.String acctID, java.lang.String devID)
           
static java.lang.String getGTSReportsResult(org.w3c.dom.Document gtsRespDoc)
          Returns the "result" tag value for the specified GTSResponse
static java.lang.String getGTSResponse_Message_code(org.w3c.dom.Document gtsRespDoc)
           
 org.w3c.dom.Document getMapDataDevice_Document(java.lang.String deviceID, DateTime frDT, DateTime toDT)
           
 org.w3c.dom.Document getMapDataGroup_Document(java.lang.String groupID, DateTime frDT, DateTime toDT)
           
 org.w3c.dom.Document getProperty_Document(java.lang.String propKey)
           
 java.lang.String getProperty(java.lang.String propKey)
           
 org.w3c.dom.Document getReportDevice_Document(java.lang.String reportName, java.lang.String deviceID, DateTime frDT, DateTime toDT)
           
 org.w3c.dom.Document getReportGroup_Document(java.lang.String reportName, java.lang.String groupID, DateTime frDT, DateTime toDT)
           
 org.w3c.dom.Document getReportJob_Document(java.lang.String reportGroupTag)
           
protected  org.w3c.dom.NodeList getResponseNodeList(org.w3c.dom.Document respDoc, java.lang.String tag)
          Reads the Document response and returns a list of the specified subnodes
 org.w3c.dom.Document getTableSchema_Document(java.lang.String tableName)
           
 java.lang.String getTagRequest()
           
 java.lang.String getTagResponse()
           
 User getUser(java.lang.String acctID, java.lang.String userID)
           
 org.w3c.dom.Document getVersion_Document()
           
 java.lang.String getVersion()
           
static boolean isGTSResponse(org.w3c.dom.Document gtsRespDoc)
          Returns true if the specified Document is a "GTSResponse"
static boolean isGTSResponseError(org.w3c.dom.Document gtsRespDoc)
          Returns the "result" tag value for the if the specified GTSResponse result attribute is "error"
protected  void printDBRecordInfo(DBRecord dbr)
           
 ServiceRequest setAuthorization(java.lang.String acctID, java.lang.String userID, java.lang.String passwd)
           
 
Methods inherited from class org.opengts.util.ServiceRequest
_sendRequest_HTTP, _sendRequest_JMX, _sendRequest, appendRequestBody, getAttrAccount, getAttrAuth, getAttrCommand, getAttrPassword, getAttrResult, getAttrUser, getCommand, getJMXObjectName, getJMXServiceURL, getTagAuthorization, getURL, isJMX, sendRequest, sendRequest, setAuthorization, setAuthorization, setCommand, setJMXObjectName, setRequestBody, setURL, setURL, setURL, toString, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GTSServiceRequest

public GTSServiceRequest(java.lang.String url)
                  throws java.net.MalformedURLException
Constructor

Parameters:
url - The service URL
Throws:
java.net.MalformedURLException
Method Detail

isGTSResponse

public static boolean isGTSResponse(org.w3c.dom.Document gtsRespDoc)
Returns true if the specified Document is a "GTSResponse"


getGTSReportsResult

public static java.lang.String getGTSReportsResult(org.w3c.dom.Document gtsRespDoc)
Returns the "result" tag value for the specified GTSResponse

Parameters:
gtsRespDoc - The GTSResponse tag document
Returns:
The "result" tag value for the specified GTSResponse

isGTSResponseError

public static boolean isGTSResponseError(org.w3c.dom.Document gtsRespDoc)
Returns the "result" tag value for the if the specified GTSResponse result attribute is "error"

Parameters:
gtsRespDoc - The GTSResponse tag document
Returns:
True if the specified GTSResponse result attribute is "error"

getGTSResponse_Message_code

public static java.lang.String getGTSResponse_Message_code(org.w3c.dom.Document gtsRespDoc)

setAuthorization

public ServiceRequest setAuthorization(java.lang.String acctID,
                                       java.lang.String userID,
                                       java.lang.String passwd)

getCommandOnly_Document

public org.w3c.dom.Document getCommandOnly_Document(java.lang.String command)
                                             throws java.io.IOException
Returns a Document response for requrest that only require a command name

Parameters:
command - The command name
Returns:
The XML Document response
Throws:
java.io.IOException

formatTime

protected java.lang.StringBuffer formatTime(java.lang.StringBuffer sb,
                                            java.lang.String pfx,
                                            DateTime dt,
                                            boolean isTimeTo)
Appends a formatted "TimeFrom"/"TimeTo" tag element to the specified StringBuffer

Parameters:
sb - The StringBuffer
pfx - The prefixing spaces to prepend to the formatted tag elemeent
dt - The date/time to format
isTimeTo - True to create tag "TimeTo", false for "TimeFrom"
Returns:
The StringBuffer

getResponseNodeList

protected org.w3c.dom.NodeList getResponseNodeList(org.w3c.dom.Document respDoc,
                                                   java.lang.String tag)
Reads the Document response and returns a list of the specified subnodes

Parameters:
respDoc - The response XML Document
tag - The tag for which a NodeList is returned
Returns:
The NodeList, or null if an error occurred

getVersion_Document

public org.w3c.dom.Document getVersion_Document()
                                         throws java.io.IOException
Throws:
java.io.IOException

getVersion

public java.lang.String getVersion()
                            throws java.io.IOException
Throws:
java.io.IOException

getProperty_Document

public org.w3c.dom.Document getProperty_Document(java.lang.String propKey)
                                          throws java.io.IOException
Throws:
java.io.IOException

getProperty

public java.lang.String getProperty(java.lang.String propKey)
                             throws java.io.IOException
Throws:
java.io.IOException

getTableSchema_Document

public org.w3c.dom.Document getTableSchema_Document(java.lang.String tableName)
                                             throws java.io.IOException
Throws:
java.io.IOException

getMapDataDevice_Document

public org.w3c.dom.Document getMapDataDevice_Document(java.lang.String deviceID,
                                                      DateTime frDT,
                                                      DateTime toDT)
                                               throws java.io.IOException
Throws:
java.io.IOException

getMapDataGroup_Document

public org.w3c.dom.Document getMapDataGroup_Document(java.lang.String groupID,
                                                     DateTime frDT,
                                                     DateTime toDT)
                                              throws java.io.IOException
Throws:
java.io.IOException

getReportDevice_Document

public org.w3c.dom.Document getReportDevice_Document(java.lang.String reportName,
                                                     java.lang.String deviceID,
                                                     DateTime frDT,
                                                     DateTime toDT)
                                              throws java.io.IOException
Throws:
java.io.IOException

getReportGroup_Document

public org.w3c.dom.Document getReportGroup_Document(java.lang.String reportName,
                                                    java.lang.String groupID,
                                                    DateTime frDT,
                                                    DateTime toDT)
                                             throws java.io.IOException
Throws:
java.io.IOException

getReportJob_Document

public org.w3c.dom.Document getReportJob_Document(java.lang.String reportGroupTag)
                                           throws java.io.IOException
Throws:
java.io.IOException

printDBRecordInfo

protected void printDBRecordInfo(DBRecord dbr)

getAccount

public Account getAccount(java.lang.String acctID)
                   throws DBException
Get a specific virtual Account

Throws:
DBException

getAccountIDs

public java.lang.String[] getAccountIDs()
                                 throws DBException
Gets a list of Accounts

Throws:
DBException

getUser

public User getUser(java.lang.String acctID,
                    java.lang.String userID)
             throws DBException
Throws:
DBException

getDevice

public Device getDevice(java.lang.String acctID,
                        java.lang.String devID)
                 throws DBException
Throws:
DBException

getTagResponse

public java.lang.String getTagResponse()
Overrides:
getTagResponse in class ServiceRequest

getTagRequest

public java.lang.String getTagRequest()
Overrides:
getTagRequest in class ServiceRequest