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
WattDepotInterface
deleteCollectorProcessDefinition
in interface WattDepotInterface
process
- the CollectorProcessDefinitionData to delete.IdNotFoundException
- if the CollectorProcessDefinitionData is not
found in the server.public void deleteDepository(Depository depository) throws IdNotFoundException
WattDepotInterface
deleteDepository
in interface WattDepotInterface
depository
- the Depository to delete.IdNotFoundException
- if the Depository is not found in the server.public void deleteMeasurement(Depository depository, Measurement measurement) throws IdNotFoundException
WattDepotInterface
deleteMeasurement
in interface WattDepotInterface
depository
- 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
WattDepotInterface
deleteMeasurementPruningDefinition
in interface WattDepotInterface
gcd
- The MeasurementPruningDefinition to delete.IdNotFoundException
- if the MPD is not
found.public void deleteMeasurementType(MeasurementType type) throws IdNotFoundException
WattDepotInterface
deleteMeasurementType
in interface WattDepotInterface
type
- the measurement type to delete.IdNotFoundException
- if the MeasurementType is not found in the
Depository.public void deleteSensor(Sensor sensor) throws IdNotFoundException
WattDepotInterface
deleteSensor
in interface WattDepotInterface
sensor
- the Sensor to delete.IdNotFoundException
- if the Sensor is not found in the server.public void deleteSensorGroup(SensorGroup group) throws IdNotFoundException
WattDepotInterface
deleteSensorGroup
in interface WattDepotInterface
group
- the SensorGroup to delete.IdNotFoundException
- if the SensorGroup is not found in the server.public void deleteSensorModel(SensorModel model) throws IdNotFoundException
WattDepotInterface
deleteSensorModel
in interface WattDepotInterface
model
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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
WattDepotInterface
getCollectorProcessDefinition
in interface WattDepotInterface
id
- The CollectorProcessDefinitionData's id.IdNotFoundException
- if the given id is not a
CollectorProcessDefinitionData's id.public CollectorProcessDefinitionList getCollectorProcessDefinitions()
getCollectorProcessDefinitions
in interface WattDepotInterface
public InterpolatedValueList getDailyValues(Depository depository, Sensor sensor, Date start, Date end, Boolean usePointValues)
getDailyValues
in interface WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
public Depository getDepository(String id) throws IdNotFoundException
WattDepotInterface
getDepository
in interface WattDepotInterface
id
- 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 WattDepotInterface
id
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- The Depository storing the Measurements.sensor
- The Sensor making the Measurements.public InterpolatedValue getEarliestValue(Depository depository, SensorGroup group)
getEarliestValue
in interface WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- The Depository storing the Measurements.sensor
- The Sensor making the Measurements.public InterpolatedValue getLatestValue(Depository depository, SensorGroup group)
getLatestValue
in interface WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
id
- The MeasurementPruningDefinition id.IdNotFoundException
- if id is not defined.public MeasurementPruningDefinitionList getMeasurementPruningDefinitions()
getMeasurementPruningDefinitions
in interface WattDepotInterface
public MeasurementType getMeasurementType(String id) throws IdNotFoundException
getMeasurementType
in interface WattDepotInterface
id
- the unique id for the MeasurementType.IdNotFoundException
- if the given id is not a MeasurementType's
id.public MeasurementTypeList getMeasurementTypes()
getMeasurementTypes
in interface WattDepotInterface
public MeasurementList getMeasurements(Depository depository, Sensor sensor, Date start, Date end)
getMeasurements
in interface WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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
WattDepotInterface
getSensor
in interface WattDepotInterface
id
- The Sensor's id.IdNotFoundException
- if the given id is not a Sensor's id.public SensorGroup getSensorGroup(String id) throws IdNotFoundException
WattDepotInterface
getSensorGroup
in interface WattDepotInterface
id
- The SensorGroup's id.IdNotFoundException
- if the given id is not a SensorGroup's id.public SensorGroupList getSensorGroups()
getSensorGroups
in interface WattDepotInterface
public SensorModel getSensorModel(String id) throws IdNotFoundException
WattDepotInterface
getSensorModel
in interface WattDepotInterface
id
- The SensorModel's id.IdNotFoundException
- if the given id is not a SensorModel's id.public SensorModelList getSensorModels()
getSensorModels
in interface WattDepotInterface
public SensorStatus getSensorStatus(Depository depository, Sensor sensor)
getSensorStatus
in interface WattDepotInterface
depository
- The depository to check.sensor
- The Sensor.public SensorStatusList getSensorStatuses(Depository depository, SensorGroup group)
getSensorStatuses
in interface WattDepotInterface
depository
- The depository to check.group
- The SensorGroup.public SensorList getSensors()
getSensors
in interface WattDepotInterface
public Double getValue(Depository depository, Sensor sensor, Date timestamp) throws NoMeasurementException
getValue
in interface WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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 WattDepotInterface
depository
- 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)
WattDepotInterface
isDefinedCollectorProcessDefinition
in interface WattDepotInterface
id
- the id to check.public boolean isDefinedDepository(String id)
WattDepotInterface
isDefinedDepository
in interface WattDepotInterface
id
- the id to check.public boolean isDefinedMeasurementPruningDefinition(String id)
WattDepotInterface
isDefinedMeasurementPruningDefinition
in interface WattDepotInterface
id
- the id to check.public boolean isDefinedMeasurementType(String id)
WattDepotInterface
isDefinedMeasurementType
in interface WattDepotInterface
id
- the id to check.public boolean isDefinedSensor(String id)
WattDepotInterface
isDefinedSensor
in interface WattDepotInterface
id
- the id to check.public boolean isDefinedSensorGroup(String id)
WattDepotInterface
isDefinedSensorGroup
in interface WattDepotInterface
id
- the id to check.public boolean isDefinedSensorModel(String id)
WattDepotInterface
isDefinedSensorModel
in interface WattDepotInterface
id
- the id to check.public boolean isHealthy()
WattDepotInterface
isHealthy
in interface WattDepotInterface
public 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)
WattDepotInterface
putCollectorProcessDefinition
in interface WattDepotInterface
process
- the CollectorProcessDefinitionData.public void putDepository(Depository depository)
WattDepotInterface
putDepository
in interface WattDepotInterface
depository
- the Depository.public void putMeasurement(Depository depository, Measurement measurement) throws MeasurementTypeException
putMeasurement
in interface WattDepotInterface
depository
- 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)
WattDepotInterface
putMeasurementPruningDefinition
in interface WattDepotInterface
gcd
- the MeasurementPruningDefinition.public void putMeasurementType(MeasurementType type)
WattDepotInterface
putMeasurementType
in interface WattDepotInterface
type
- the MeasurementType.public void putMeasurements(Depository depository, MeasurementList measurementList) throws MeasurementTypeException, MeasurementListSizeExceededException
putMeasurements
in interface WattDepotInterface
depository
- 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)
WattDepotInterface
putSensor
in interface WattDepotInterface
sensor
- the Sensor.public void putSensorGroup(SensorGroup group)
WattDepotInterface
putSensorGroup
in interface WattDepotInterface
group
- the SensorGroup.public void putSensorModel(SensorModel model)
WattDepotInterface
putSensorModel
in interface WattDepotInterface
model
- the SensorModel.public void updateCollectorProcessDefinition(CollectorProcessDefinition process)
WattDepotInterface
updateCollectorProcessDefinition
in interface WattDepotInterface
process
- The CollectorProcessDefinitionData to update.public void updateDepository(Depository depository)
WattDepotInterface
updateDepository
in interface WattDepotInterface
depository
- The Depository to update.public void updateMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
WattDepotInterface
updateMeasurementPruningDefinition
in interface WattDepotInterface
gcd
- The MeasurementPruningDefinition to update.public void updateMeasurementType(MeasurementType type)
WattDepotInterface
updateMeasurementType
in interface WattDepotInterface
type
- the MeasurementType to update.public void updateSensor(Sensor sensor)
WattDepotInterface
updateSensor
in interface WattDepotInterface
sensor
- The Sensor to update.public void updateSensorGroup(SensorGroup group)
WattDepotInterface
updateSensorGroup
in interface WattDepotInterface
group
- The SensorGroup to update.public void updateSensorModel(SensorModel model)
WattDepotInterface
updateSensorModel
in interface WattDepotInterface
model
- the SensorModel to update.Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.