|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.sdsc.inca.Component edu.sdsc.inca.Client edu.sdsc.inca.DepotClient
This class allows access to the services provided by an Inca Depot. Along with defining an API that understands the Depot protocol, it defines a main method that allows access to an Depot via a telnet-style interface.
Field Summary | |
static java.lang.String |
CRLF
|
static java.lang.String |
DEPOT_CLIENT_OPTS
|
protected static org.apache.log4j.Logger |
logger
|
Fields inherited from class edu.sdsc.inca.Client |
CLIENT_OPTS, host, port, reader, socket, writer |
Fields inherited from class edu.sdsc.inca.Component |
authenticate, cert, certPath, COMPONENT_OPTS, key, keyPath, logFile, password, trusted, trustedPath |
Constructor Summary | |
DepotClient()
|
Method Summary | |
void |
insertReport(java.lang.String resource,
java.lang.String reportXml,
java.lang.String sysusage,
java.lang.String stderr,
java.lang.String context)
Asks the Depot to insert a new report into the database. |
static void |
main(java.lang.String[] args)
A simple main method for exercising the DepotClient. |
protected java.lang.String[] |
queryDialog(java.lang.String command,
java.lang.String data)
An internal method that handles the functionality common to several query methods. |
java.lang.String[] |
queryGuids()
Asks the Depot for all the suite guids in its database. |
java.lang.String[] |
queryHql(java.lang.String select)
Asks the Depot to run an HQL query; returns the result. |
edu.sdsc.inca.queryResult.ReportDetailsDocument |
queryInstance(long instanceId,
long configId)
Asks the Depot for the ReportDetailsDocument for a specified instance. |
edu.sdsc.inca.queryResult.ReportDetailsDocument[] |
querySeries(long configId)
Asks the Depot for a ReportDetailsDocuments for each instances of a specified series. |
java.lang.String[] |
querySuite(java.lang.String suiteGuid)
Asks the Depot for XML for the latest instance of each series from a specified suite. |
void |
setConfiguration(java.util.Properties config)
A convenience function for setting multiple configuration properties at once. |
java.lang.String |
updateSuite(java.lang.String suiteXml)
Asks the Depot to add XML for a suite to its database, replacing any existing XML for the same suite. |
Methods inherited from class edu.sdsc.inca.Client |
close, commandGetLog, commandLogConfig, commandPing, connect, dialog, getHost, getPort, getUri, isConnected, read, setHost, setPort, setServer, telnetDialog, write |
Methods inherited from class edu.sdsc.inca.Component |
addTrustedCert, configComponent, createSocket, getAuthenticate, getCertificate, getCertificatePath, getKey, getKeyPath, getLogFile, getPassword, getTrustedCertificates, getTrustedPath, openResourceStream, readCredentials, readVersion, setAuthenticate, setCertificatePath, setKeyPath, setLogFile, setPassword, setTrustedPath |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CRLF
public static final java.lang.String DEPOT_CLIENT_OPTS
protected static final org.apache.log4j.Logger logger
Constructor Detail |
public DepotClient()
Method Detail |
public void setConfiguration(java.util.Properties config) throws ConfigurationException
setConfiguration
in class Client
config
- contains client configuration values
ConfigurationException
- on a faulty configuration property valuepublic void insertReport(java.lang.String resource, java.lang.String reportXml, java.lang.String sysusage, java.lang.String stderr, java.lang.String context) throws java.io.IOException, ProtocolException
resource
- the name of the resource that generated the reportreportXml
- the XML for the report itself (see report schema)sysusage
- system usage informationstderr
- optional stderr output from the reportercontext
- execution context for the reporter
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic edu.sdsc.inca.queryResult.ReportDetailsDocument queryInstance(long instanceId, long configId) throws java.io.IOException, ProtocolException, org.apache.xmlbeans.XmlException
instanceId
- the id of the instance to retrieveconfigId
- the id of the related series config to retrieve
java.io.IOException
- on read/write error
ProtocolException
- on an invalid message
org.apache.xmlbeans.XmlException
- if the Depot response cannot be parsedpublic edu.sdsc.inca.queryResult.ReportDetailsDocument[] querySeries(long configId) throws java.io.IOException, ProtocolException, org.apache.xmlbeans.XmlException
configId
- the id of the desired series config
java.io.IOException
- on read/write error
ProtocolException
- on an invalid message
org.apache.xmlbeans.XmlException
- if the Depot response cannot be parsedpublic java.lang.String[] queryGuids() throws java.io.IOException, ProtocolException
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.lang.String[] queryHql(java.lang.String select) throws java.io.IOException, ProtocolException
select
- the HQL select query
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.lang.String[] querySuite(java.lang.String suiteGuid) throws java.io.IOException, ProtocolException
suiteGuid
- the guid from the suite XML
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic java.lang.String updateSuite(java.lang.String suiteXml) throws java.io.IOException, ProtocolException
suiteXml
- XML representing the suite to be saved
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messageprotected java.lang.String[] queryDialog(java.lang.String command, java.lang.String data) throws java.io.IOException, ProtocolException
command
- the command to send the Depotdata
- the data to accompany the command
java.io.IOException
- on read/write error
ProtocolException
- on an invalid messagepublic static void main(java.lang.String[] args)
usage:java inca.DepotClient
-a|--auth boolean Authenticated (secure) connection? -c|--cert path Path to the authentication certificate -D|--depot str Depot specification; host:port -h|--help null Print help/usage -i|--init path Path to properties file -k|--key path Path to the authentication key -P|--password str Specify how to obtain encryption password -t|--trusted path Path to authentication trusted certificate dir -V|--version null Display program version
args
- command line arguments, as above.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |