public class WattDepotClient extends Object implements WattDepotInterface
| Constructor and Description |
|---|
WattDepotClient(String serverUri,
String username,
String orgId,
String password)
Creates a new WattDepotClient.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteCollectorProcessDefinition(CollectorProcessDefinition process)
Deletes the given CollectorProcessDefinitionData.
|
void |
deleteDepository(Depository depository)
Deletes the given Depository.
|
void |
deleteMeasurement(Depository depository,
Measurement measurement)
Deletes the given measurement from the given depository.
|
void |
deleteMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
Deletes the given MeasurementPruningDefinition from the WattDepotServer.
|
void |
deleteMeasurementType(MeasurementType type)
Deletes the given MeasurementType.
|
void |
deleteSensor(Sensor sensor)
Deletes the given Sensor.
|
void |
deleteSensorGroup(SensorGroup group)
Deletes the given SensorGroup.
|
void |
deleteSensorModel(SensorModel model)
Deletes the given SensorModel.
|
InterpolatedValueList |
getAverageValues(Depository depository,
Sensor sensor,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
InterpolatedValueList |
getAverageValues(Depository depository,
SensorGroup group,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
CollectorProcessDefinition |
getCollectorProcessDefinition(String id)
Retrieves the CollectorProcessDefinitionData with the given id from the
WattDepot Server.
|
CollectorProcessDefinitionList |
getCollectorProcessDefinitions() |
InterpolatedValueList |
getDailyValues(Depository depository,
Sensor sensor,
Date start,
Date end,
Boolean usePointValues) |
InterpolatedValueList |
getDailyValues(Depository depository,
SensorGroup group,
Date start,
Date end,
Boolean usePointValues) |
DepositoryList |
getDepositories() |
Depository |
getDepository(String id)
Retrieves the Depository with the given id from the WattDepot Server.
|
SensorList |
getDepositorySensors(String id) |
DescriptiveStats |
getDescriptiveStats(Depository depository,
Sensor sensor,
Date timestamp,
Boolean daily,
Integer samples,
Boolean pointValues) |
DescriptiveStats |
getDescriptiveStats(Depository depository,
SensorGroup group,
Date timestamp,
Boolean daily,
Integer samples,
Boolean pointValues) |
InterpolatedValue |
getEarliestValue(Depository depository,
Sensor sensor) |
InterpolatedValue |
getEarliestValue(Depository depository,
SensorGroup group) |
InterpolatedValueList |
getHistoricalValues(Depository depository,
Sensor sensor,
Date timestamp,
Boolean daily,
Integer samples,
Boolean pointValues) |
InterpolatedValueList |
getHistoricalValues(Depository depository,
SensorGroup group,
Date timestamp,
Boolean daily,
Integer samples,
Boolean pointValues) |
InterpolatedValueList |
getHourlyValues(Depository depository,
Sensor sensor,
Date start,
Date end,
Boolean usePointValues) |
InterpolatedValueList |
getHourlyValues(Depository depository,
SensorGroup group,
Date start,
Date end,
Boolean usePointValues) |
InterpolatedValue |
getLatestValue(Depository depository,
Sensor sensor) |
InterpolatedValue |
getLatestValue(Depository depository,
SensorGroup group) |
InterpolatedValueList |
getMaximumValues(Depository depository,
Sensor sensor,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
InterpolatedValueList |
getMaximumValues(Depository depository,
SensorGroup group,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
MeasurementPruningDefinition |
getMeasurementPruningDefinition(String id) |
MeasurementPruningDefinitionList |
getMeasurementPruningDefinitions() |
MeasurementList |
getMeasurements(Depository depository,
Sensor sensor,
Date start,
Date end) |
MeasurementList |
getMeasurements(Depository depository,
SensorGroup group,
Date start,
Date end) |
MeasurementType |
getMeasurementType(String id) |
MeasurementTypeList |
getMeasurementTypes() |
InterpolatedValueList |
getMinimumValues(Depository depository,
Sensor sensor,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
InterpolatedValueList |
getMinimumValues(Depository depository,
SensorGroup group,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
String |
getOrganizationId() |
Sensor |
getSensor(String id)
Retrieves the Sensor with the given id from the WattDepot Server.
|
SensorGroup |
getSensorGroup(String id)
Retrieves the SensorGroup with the given id from the WattDepot Server.
|
SensorGroupList |
getSensorGroups() |
SensorModel |
getSensorModel(String id)
Retrieves the SensorModel with the given id from the WattDepot Server.
|
SensorModelList |
getSensorModels() |
SensorList |
getSensors() |
SensorStatus |
getSensorStatus(Depository depository,
Sensor sensor) |
SensorStatusList |
getSensorStatuses(Depository depository,
SensorGroup group) |
Double |
getValue(Depository depository,
Sensor sensor,
Date timestamp) |
Double |
getValue(Depository depository,
Sensor sensor,
Date start,
Date end) |
Double |
getValue(Depository depository,
Sensor sensor,
Date start,
Date end,
Long gapSeconds) |
Double |
getValue(Depository depository,
Sensor sensor,
Date timestamp,
Long gapSeconds) |
Double |
getValue(Depository depository,
SensorGroup group,
Date timestamp) |
Double |
getValue(Depository depository,
SensorGroup group,
Date start,
Date end) |
Double |
getValue(Depository depository,
SensorGroup group,
Date start,
Date end,
Long gapSeconds) |
Double |
getValue(Depository depository,
SensorGroup group,
Date timestamp,
Long gapSeconds) |
InterpolatedValueList |
getValues(Depository depository,
Sensor sensor,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
InterpolatedValueList |
getValues(Depository depository,
SensorGroup group,
Date start,
Date end,
Integer interval,
Boolean usePointValues) |
String |
getWattDepotUri() |
boolean |
isDefinedCollectorProcessDefinition(String id)
Checks to see if the given id is a defined CollectorProcessDefinition id.
|
boolean |
isDefinedDepository(String id)
Checks to see if the given id is a defined Depository id.
|
boolean |
isDefinedMeasurementPruningDefinition(String id)
Checks to see if the given id is a defined MeasurementPruningDefinition id.
|
boolean |
isDefinedMeasurementType(String id)
Checks to see if the given id is a defined MeasurementType id.
|
boolean |
isDefinedSensor(String id)
Checks to see if the given id is a defined Sensor id.
|
boolean |
isDefinedSensorGroup(String id)
Checks to see if the given id is a defined SensorGroup id.
|
boolean |
isDefinedSensorModel(String id)
Checks to see if the given id is a defined SensorModel id.
|
boolean |
isHealthy()
Determines the health of the WattDepot server the client is communicating
with.
|
org.restlet.resource.ClientResource |
makeClient(String requestString)
Creates a ClientResource for the given request.
|
void |
putCollectorProcessDefinition(CollectorProcessDefinition process)
Stores the given CollectorProcessDefinitionData in the WattDepot Server.
|
void |
putDepository(Depository depository)
Stores the given Depository in the WattDepot Server.
|
void |
putMeasurement(Depository depository,
Measurement measurement) |
void |
putMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
Stores the given MeasurementPruningDefinition in the WattDepot Server.
|
void |
putMeasurements(Depository depository,
MeasurementList measurementList) |
void |
putMeasurementType(MeasurementType type)
Stores the given MeasurementType in the WattDepot Server.
|
void |
putSensor(Sensor sensor)
Stores the given Sensor in the WattDepot Server.
|
void |
putSensorGroup(SensorGroup group)
Stores the given SensorGroup in the WattDepot Server.
|
void |
putSensorModel(SensorModel model)
Stores the given SensorModel in the WattDepot Server.
|
void |
updateCollectorProcessDefinition(CollectorProcessDefinition process)
Updates the given CollectorProcessDefinitionData in the WattDepot Server.
|
void |
updateDepository(Depository depository)
Updates the given Depository in the WattDepot Server.
|
void |
updateMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
Updates the given MeasurementPruningDefinition in the WattDepot Server.
|
void |
updateMeasurementType(MeasurementType type)
Updates the given MeasurementType in the WattDepot Server.
|
void |
updateSensor(Sensor sensor)
Updates the given Sensor in the WattDepot Server.
|
void |
updateSensorGroup(SensorGroup group)
Updates the given SensorGroup in the WattDepot Server.
|
void |
updateSensorModel(SensorModel model)
Updates the given SensorModel in the WattDepot Server.
|
public WattDepotClient(String serverUri, String username, String orgId, String password) throws BadCredentialException
serverUri - The URI of the WattDepot server (e.g.
"http://server.wattdepot.org/")username - The name of the user. The user must be defined in the
WattDepot server.orgId - the organization the user is in.password - The password for the user.BadCredentialException - If the user or password don't match the
credentials on the WattDepot server.public void deleteCollectorProcessDefinition(CollectorProcessDefinition process) throws IdNotFoundException
WattDepotInterfacedeleteCollectorProcessDefinition in interface WattDepotInterfaceprocess - the CollectorProcessDefinitionData to delete.IdNotFoundException - if the CollectorProcessDefinitionData is not
found in the server.public void deleteDepository(Depository depository) throws IdNotFoundException
WattDepotInterfacedeleteDepository in interface WattDepotInterfacedepository - the Depository to delete.IdNotFoundException - if the Depository is not found in the server.public void deleteMeasurement(Depository depository, Measurement measurement) throws IdNotFoundException
WattDepotInterfacedeleteMeasurement in interface WattDepotInterfacedepository - the Depository that stores the measurement.measurement - the Measurement to delete.IdNotFoundException - if the Measurement is not found in the
Depository.public void deleteMeasurementPruningDefinition(MeasurementPruningDefinition gcd) throws IdNotFoundException
WattDepotInterfacedeleteMeasurementPruningDefinition in interface WattDepotInterfacegcd - The MeasurementPruningDefinition to delete.IdNotFoundException - if the MPD is not
found.public void deleteMeasurementType(MeasurementType type) throws IdNotFoundException
WattDepotInterfacedeleteMeasurementType in interface WattDepotInterfacetype - the measurement type to delete.IdNotFoundException - if the MeasurementType is not found in the
Depository.public void deleteSensor(Sensor sensor) throws IdNotFoundException
WattDepotInterfacedeleteSensor in interface WattDepotInterfacesensor - the Sensor to delete.IdNotFoundException - if the Sensor is not found in the server.public void deleteSensorGroup(SensorGroup group) throws IdNotFoundException
WattDepotInterfacedeleteSensorGroup in interface WattDepotInterfacegroup - the SensorGroup to delete.IdNotFoundException - if the SensorGroup is not found in the server.public void deleteSensorModel(SensorModel model) throws IdNotFoundException
WattDepotInterfacedeleteSensorModel in interface WattDepotInterfacemodel - the SensorModel to delete.IdNotFoundException - if the SensorModel is not found in the server.public InterpolatedValueList getAverageValues(Depository depository, Sensor sensor, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getAverageValues in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public InterpolatedValueList getAverageValues(Depository depository, SensorGroup group, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getAverageValues in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The sensor group making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public CollectorProcessDefinition getCollectorProcessDefinition(String id) throws IdNotFoundException
WattDepotInterfacegetCollectorProcessDefinition in interface WattDepotInterfaceid - The CollectorProcessDefinitionData's id.IdNotFoundException - if the given id is not a
CollectorProcessDefinitionData's id.public CollectorProcessDefinitionList getCollectorProcessDefinitions()
getCollectorProcessDefinitions in interface WattDepotInterfacepublic InterpolatedValueList getDailyValues(Depository depository, Sensor sensor, Date start, Date end, Boolean usePointValues)
getDailyValues in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.public InterpolatedValueList getDailyValues(Depository depository, SensorGroup group, Date start, Date end, Boolean usePointValues)
getDailyValues in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The sensor group making the measurements.start - The start of the period.end - The end of the period.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.public DepositoryList getDepositories()
getDepositories in interface WattDepotInterfacepublic Depository getDepository(String id) throws IdNotFoundException
WattDepotInterfacegetDepository in interface WattDepotInterfaceid - The Depository's id.IdNotFoundException - if the given id is not a Depository's id.public SensorList getDepositorySensors(String id) throws IdNotFoundException
getDepositorySensors in interface WattDepotInterfaceid - The depository id.IdNotFoundException - if the id is not defined.public DescriptiveStats getDescriptiveStats(Depository depository, Sensor sensor, Date timestamp, Boolean daily, Integer samples, Boolean pointValues)
getDescriptiveStats in interface WattDepotInterfacedepository - The Depository storing the Measurements.sensor - The Sensor making the Measurements.timestamp - The time to base the historical values calculation on.daily - if true, use daily grouping of values, if false use hourly grouping.samples - How many samples to use to calculate the values. Corresponds to weeks.pointValues - if true use point value, use difference values otherwise.public DescriptiveStats getDescriptiveStats(Depository depository, SensorGroup group, Date timestamp, Boolean daily, Integer samples, Boolean pointValues)
getDescriptiveStats in interface WattDepotInterfacedepository - The Depository storing the Measurements.group - The SensorGroup whose sensors are making the Measurements.timestamp - The time to base the historical values calculation on.daily - if true, use daily grouping of values, if false use hourly grouping.samples - How many samples to use to calculate the values. Corresponds to weeks.pointValues - if true use point value, use difference values otherwise.public InterpolatedValue getEarliestValue(Depository depository, Sensor sensor)
getEarliestValue in interface WattDepotInterfacedepository - The Depository storing the Measurements.sensor - The Sensor making the Measurements.public InterpolatedValue getEarliestValue(Depository depository, SensorGroup group)
getEarliestValue in interface WattDepotInterfacedepository - The Depository storing the Measurements.group - The SensorGroup whose sensors are making the Measurements.public InterpolatedValueList getHistoricalValues(Depository depository, Sensor sensor, Date timestamp, Boolean daily, Integer samples, Boolean pointValues)
getHistoricalValues in interface WattDepotInterfacedepository - The Depository storing the Measurements.sensor - The Sensor making the Measurements.timestamp - The time to base the historical values calculation on.daily - if true, use daily grouping of values, if false use hourly grouping.samples - How many samples to use to calculate the values. Corresponds to weeks.pointValues - if true use point value, use difference values otherwise.public InterpolatedValueList getHistoricalValues(Depository depository, SensorGroup group, Date timestamp, Boolean daily, Integer samples, Boolean pointValues)
getHistoricalValues in interface WattDepotInterfacedepository - The Depository storing the Measurements.group - The SensorGroup whose sensors are making the Measurements.timestamp - The time to base the historical values calculation on.daily - if true, use daily grouping of values, if false use hourly grouping.samples - How many samples to use to calculate the values. Corresponds to weeks.pointValues - if true use point value, use difference values otherwise.public InterpolatedValueList getHourlyValues(Depository depository, Sensor sensor, Date start, Date end, Boolean usePointValues)
getHourlyValues in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.public InterpolatedValueList getHourlyValues(Depository depository, SensorGroup group, Date start, Date end, Boolean usePointValues)
getHourlyValues in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The sensor group making the measurements.start - The start of the period.end - The end of the period.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.public InterpolatedValue getLatestValue(Depository depository, Sensor sensor)
getLatestValue in interface WattDepotInterfacedepository - The Depository storing the Measurements.sensor - The Sensor making the Measurements.public InterpolatedValue getLatestValue(Depository depository, SensorGroup group)
getLatestValue in interface WattDepotInterfacedepository - The Depository storing the Measurements.group - The SensorGroup whose sensors are making the Measurements.public InterpolatedValueList getMaximumValues(Depository depository, SensorGroup group, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getMaximumValues in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The sensor group making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public InterpolatedValueList getMaximumValues(Depository depository, Sensor sensor, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getMaximumValues in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public MeasurementPruningDefinition getMeasurementPruningDefinition(String id) throws IdNotFoundException
getMeasurementPruningDefinition in interface WattDepotInterfaceid - The MeasurementPruningDefinition id.IdNotFoundException - if id is not defined.public MeasurementPruningDefinitionList getMeasurementPruningDefinitions()
getMeasurementPruningDefinitions in interface WattDepotInterfacepublic MeasurementType getMeasurementType(String id) throws IdNotFoundException
getMeasurementType in interface WattDepotInterfaceid - the unique id for the MeasurementType.IdNotFoundException - if the given id is not a MeasurementType's
id.public MeasurementTypeList getMeasurementTypes()
getMeasurementTypes in interface WattDepotInterfacepublic MeasurementList getMeasurements(Depository depository, Sensor sensor, Date start, Date end)
getMeasurements in interface WattDepotInterfacedepository - The Depository storing the Measurements.sensor - The Sensor that made the measurements.start - The start time.end - The end time.public MeasurementList getMeasurements(Depository depository, SensorGroup group, Date start, Date end)
getMeasurements in interface WattDepotInterfacedepository - The Depository storing the Measurements.group - The SensorGroup whose sensors made the measurements.start - The start time.end - The end time.public InterpolatedValueList getMinimumValues(Depository depository, Sensor sensor, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getMinimumValues in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public InterpolatedValueList getMinimumValues(Depository depository, SensorGroup group, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getMinimumValues in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The sensor group making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public String getOrganizationId()
public Sensor getSensor(String id) throws IdNotFoundException
WattDepotInterfacegetSensor in interface WattDepotInterfaceid - The Sensor's id.IdNotFoundException - if the given id is not a Sensor's id.public SensorGroup getSensorGroup(String id) throws IdNotFoundException
WattDepotInterfacegetSensorGroup in interface WattDepotInterfaceid - The SensorGroup's id.IdNotFoundException - if the given id is not a SensorGroup's id.public SensorGroupList getSensorGroups()
getSensorGroups in interface WattDepotInterfacepublic SensorModel getSensorModel(String id) throws IdNotFoundException
WattDepotInterfacegetSensorModel in interface WattDepotInterfaceid - The SensorModel's id.IdNotFoundException - if the given id is not a SensorModel's id.public SensorModelList getSensorModels()
getSensorModels in interface WattDepotInterfacepublic SensorStatus getSensorStatus(Depository depository, Sensor sensor)
getSensorStatus in interface WattDepotInterfacedepository - The depository to check.sensor - The Sensor.public SensorStatusList getSensorStatuses(Depository depository, SensorGroup group)
getSensorStatuses in interface WattDepotInterfacedepository - The depository to check.group - The SensorGroup.public SensorList getSensors()
getSensors in interface WattDepotInterfacepublic Double getValue(Depository depository, Sensor sensor, Date timestamp) throws NoMeasurementException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.timestamp - The time for the measured value.NoMeasurementException - if there aren't any measurements around the
timestamp.public Double getValue(Depository depository, Sensor sensor, Date start, Date end) throws NoMeasurementException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.NoMeasurementException - if there are no measurements around the
start or end time.public Double getValue(Depository depository, Sensor sensor, Date start, Date end, Long gapSeconds) throws NoMeasurementException, MeasurementGapException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The Sensor making the measurements.start - The start of the interval.end - The end of the intervalgapSeconds - The maximum number of seconds that measurements need to
be within the start and end.NoMeasurementException - if there are no measurements around the
start or end time.MeasurementGapException - if the measurements around start or end are
too far apart.public Double getValue(Depository depository, Sensor sensor, Date timestamp, Long gapSeconds) throws NoMeasurementException, MeasurementGapException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The Sensor making the measurements.timestamp - The time of the value.gapSeconds - The maximum number of seconds that measurements need to
be within the start and end.NoMeasurementException - If there aren't any measurements around the
time.MeasurementGapException - if the measurements around timestamp are
too far apart.public Double getValue(Depository depository, SensorGroup group, Date timestamp) throws NoMeasurementException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The SensorGroup whose sensors are making the measurements.timestamp - The time for the measured value.NoMeasurementException - if there aren't any measurements around the
timestamp.public Double getValue(Depository depository, SensorGroup group, Date start, Date end) throws NoMeasurementException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The SensorGroup whose Sensors are making the measurements.start - The start of the period.end - The end of the period.NoMeasurementException - if there are no measurements around the
start or end time.public Double getValue(Depository depository, SensorGroup group, Date start, Date end, Long gapSeconds) throws NoMeasurementException, MeasurementGapException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The SensorGroup whose Sensors are making the measurements.start - The start of the interval.end - The end of the intervalgapSeconds - The maximum number of seconds that measurements need to
be within the start and end.NoMeasurementException - if there are no measurements around the
start or end time.MeasurementGapException - if the measurements around start or end are
too far apart.public Double getValue(Depository depository, SensorGroup group, Date timestamp, Long gapSeconds) throws NoMeasurementException, MeasurementGapException
getValue in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The SensorGroup whose Sensors are making the measurements.timestamp - The time of the value.gapSeconds - The maximum number of seconds that measurements need to
be within the start and end.NoMeasurementException - If there aren't any measurements around the
time.MeasurementGapException - if the measurements around timestamp are
too far apart.public InterpolatedValueList getValues(Depository depository, Sensor sensor, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getValues in interface WattDepotInterfacedepository - The Depository storing the measurements.sensor - The sensor making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public InterpolatedValueList getValues(Depository depository, SensorGroup group, Date start, Date end, Integer interval, Boolean usePointValues) throws NoMeasurementException
getValues in interface WattDepotInterfacedepository - The Depository storing the measurements.group - The sensor group making the measurements.start - The start of the period.end - The end of the period.interval - The sample interval in minutes.usePointValues - Use point values or difference values, if true point values are used, otherwise difference values.NoMeasurementException - if there are no measurements around the
start or end time.public String getWattDepotUri()
public boolean isDefinedCollectorProcessDefinition(String id)
WattDepotInterfaceisDefinedCollectorProcessDefinition in interface WattDepotInterfaceid - the id to check.public boolean isDefinedDepository(String id)
WattDepotInterfaceisDefinedDepository in interface WattDepotInterfaceid - the id to check.public boolean isDefinedMeasurementPruningDefinition(String id)
WattDepotInterfaceisDefinedMeasurementPruningDefinition in interface WattDepotInterfaceid - the id to check.public boolean isDefinedMeasurementType(String id)
WattDepotInterfaceisDefinedMeasurementType in interface WattDepotInterfaceid - the id to check.public boolean isDefinedSensor(String id)
WattDepotInterfaceisDefinedSensor in interface WattDepotInterfaceid - the id to check.public boolean isDefinedSensorGroup(String id)
WattDepotInterfaceisDefinedSensorGroup in interface WattDepotInterfaceid - the id to check.public boolean isDefinedSensorModel(String id)
WattDepotInterfaceisDefinedSensorModel in interface WattDepotInterfaceid - the id to check.public boolean isHealthy()
WattDepotInterfaceisHealthy in interface WattDepotInterfacepublic org.restlet.resource.ClientResource makeClient(String requestString)
requestString - A String, the request portion of the WattDepot HTTP
API, such as "public void putCollectorProcessDefinition(CollectorProcessDefinition process)
WattDepotInterfaceputCollectorProcessDefinition in interface WattDepotInterfaceprocess - the CollectorProcessDefinitionData.public void putDepository(Depository depository)
WattDepotInterfaceputDepository in interface WattDepotInterfacedepository - the Depository.public void putMeasurement(Depository depository, Measurement measurement) throws MeasurementTypeException
putMeasurement in interface WattDepotInterfacedepository - The Depository to store the Measurement.measurement - The Measurement to store.MeasurementTypeException - if the type of the measurement doesn't
match the type of the depository.public void putMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
WattDepotInterfaceputMeasurementPruningDefinition in interface WattDepotInterfacegcd - the MeasurementPruningDefinition.public void putMeasurementType(MeasurementType type)
WattDepotInterfaceputMeasurementType in interface WattDepotInterfacetype - the MeasurementType.public void putMeasurements(Depository depository, MeasurementList measurementList) throws MeasurementTypeException, MeasurementListSizeExceededException
putMeasurements in interface WattDepotInterfacedepository - The Depository to store the Measurement.measurementList - The MeasurementList to be stored.MeasurementTypeException - if the type of a measurement doesn't
match the type of the depository.MeasurementListSizeExceededException - if list size requirement is
exceeded.public void putSensor(Sensor sensor)
WattDepotInterfaceputSensor in interface WattDepotInterfacesensor - the Sensor.public void putSensorGroup(SensorGroup group)
WattDepotInterfaceputSensorGroup in interface WattDepotInterfacegroup - the SensorGroup.public void putSensorModel(SensorModel model)
WattDepotInterfaceputSensorModel in interface WattDepotInterfacemodel - the SensorModel.public void updateCollectorProcessDefinition(CollectorProcessDefinition process)
WattDepotInterfaceupdateCollectorProcessDefinition in interface WattDepotInterfaceprocess - The CollectorProcessDefinitionData to update.public void updateDepository(Depository depository)
WattDepotInterfaceupdateDepository in interface WattDepotInterfacedepository - The Depository to update.public void updateMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
WattDepotInterfaceupdateMeasurementPruningDefinition in interface WattDepotInterfacegcd - The MeasurementPruningDefinition to update.public void updateMeasurementType(MeasurementType type)
WattDepotInterfaceupdateMeasurementType in interface WattDepotInterfacetype - the MeasurementType to update.public void updateSensor(Sensor sensor)
WattDepotInterfaceupdateSensor in interface WattDepotInterfacesensor - The Sensor to update.public void updateSensorGroup(SensorGroup group)
WattDepotInterfaceupdateSensorGroup in interface WattDepotInterfacegroup - The SensorGroup to update.public void updateSensorModel(SensorModel model)
WattDepotInterfaceupdateSensorModel in interface WattDepotInterfacemodel - the SensorModel to update.Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.