|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.telemetry.service.client.TelemetryClient
public class TelemetryClient
Provides a client to support access to the DailyProjectData service.
Field Summary | |
---|---|
static java.lang.String |
TELEMETRYCLIENT_TIMEOUT_KEY
The System property key used to retrieve the default timeout value in milliseconds. |
Constructor Summary | |
---|---|
TelemetryClient(java.lang.String host,
java.lang.String email,
java.lang.String password)
Initializes a new TelemetryClient, given the host, userEmail, and password. |
Method Summary | |
---|---|
TelemetryClient |
authenticate()
Authenticates this user and password with this Telemetry service, throwing a TelemetryClientException if the user and password associated with this instance are not valid credentials. |
void |
clearServerCache()
Clears the DailyProjectData cache associated with this user in the Telemetry service associated with this TelemetryClient. |
void |
clearServerCache(java.lang.String owner,
java.lang.String project)
Clears the DailyProjectData cache entries for this user that are associated with the passed project and its owner in the Telemetry service associated with this TelemetryClient. |
TelemetryChartData |
getChart(java.lang.String name,
java.lang.String user,
java.lang.String project,
java.lang.String granularity,
javax.xml.datatype.XMLGregorianCalendar start,
javax.xml.datatype.XMLGregorianCalendar end)
Returns a TelemetryChart instance from this server, or throws a TelemetryClientException if problems occur. |
TelemetryChartData |
getChart(java.lang.String name,
java.lang.String user,
java.lang.String project,
java.lang.String granularity,
javax.xml.datatype.XMLGregorianCalendar start,
javax.xml.datatype.XMLGregorianCalendar end,
java.lang.String params)
Returns a TelemetryChart instance from this server, or throws a TelemetryClientException if problems occur. |
TelemetryChartDefinition |
getChartDefinition(java.lang.String chartName)
Returns a TelemetryChartDefinition instance from this server, or throws a TelemetryClientException if problems occur. |
TelemetryChartIndex |
getChartIndex()
Returns a TelemetryChartIndex instance from this server, or throws a TelemetryClientException if problems occur. |
java.lang.String |
getHostName()
Returns the host associated with this Telemetry client. |
static boolean |
isHost(java.lang.String host)
Returns true if the passed host is a Telemetry host. |
void |
setTimeout(int milliseconds)
Sets the timeout value for this client. |
static java.lang.String |
toString(TelemetryChartData chart)
Returns the passed telemetry chart data in a human-readable string. |
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 TELEMETRYCLIENT_TIMEOUT_KEY
Constructor Detail |
---|
public TelemetryClient(java.lang.String host, java.lang.String email, java.lang.String password)
host
- The host, such as 'http://localhost:9878/telemetry'.email
- The user's email used for authentication.password
- The password used for authentication.Method Detail |
---|
public final void setTimeout(int milliseconds)
milliseconds
- The number of milliseconds to wait before timing out.public TelemetryClient authenticate() throws TelemetryClientException
TelemetryClientException
- If authentication is not successful.public TelemetryChartData getChart(java.lang.String name, java.lang.String user, java.lang.String project, java.lang.String granularity, javax.xml.datatype.XMLGregorianCalendar start, javax.xml.datatype.XMLGregorianCalendar end) throws TelemetryClientException
name
- The chart name.user
- The user email.project
- The project.granularity
- Either Day, Week, or Month.start
- The start day.end
- The end day.
TelemetryClientException
- If the credentials associated with this instance
are not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public TelemetryChartData getChart(java.lang.String name, java.lang.String user, java.lang.String project, java.lang.String granularity, javax.xml.datatype.XMLGregorianCalendar start, javax.xml.datatype.XMLGregorianCalendar end, java.lang.String params) throws TelemetryClientException
name
- The chart name.user
- The user email.project
- The project.granularity
- Either Day, Week, or Month.start
- The start day.end
- The end day.params
- The parameter string, or null if no params are present.
TelemetryClientException
- If the credentials associated with this instance
are not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public void clearServerCache() throws TelemetryClientException
TelemetryClientException
- If problems occur.public void clearServerCache(java.lang.String owner, java.lang.String project) throws TelemetryClientException
project
- The project to be cleared.owner
- The owner of the project.
TelemetryClientException
- If problems occur.public TelemetryChartIndex getChartIndex() throws TelemetryClientException
TelemetryClientException
- If the credentials associated with this instance
are not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public TelemetryChartDefinition getChartDefinition(java.lang.String chartName) throws TelemetryClientException
chartName
- The name of the chart whose definition is to be retrieved.
TelemetryClientException
- If the credentials associated with this instance
are not valid, or if the underlying SensorBase service cannot be reached, or if one or more
of the supplied user, password, or timestamp is not valid.public static boolean isHost(java.lang.String host)
host
- The URL of a Telemetry host, "http://localhost:9875/telemetry".
public java.lang.String getHostName()
public static java.lang.String toString(TelemetryChartData chart)
chart
- The chart data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |