public abstract class WattDepotPersistence extends Object
Constructor and Description |
---|
WattDepotPersistence() |
Modifier and Type | Method and Description |
---|---|
abstract CollectorProcessDefinition |
defineCollectorProcessDefinition(String id,
String name,
String sensorId,
Long pollingInterval,
String depositoryId,
Set<Property> properties,
String orgId)
Defines a new CollectorProcessDefinition.
|
abstract Depository |
defineDepository(String id,
String name,
MeasurementType measurementType,
String orgId)
Defines a new WattDepository in WattDepot.
|
abstract MeasurementPruningDefinition |
defineMeasurementPruningDefinition(String id,
String name,
String depositoryId,
String sensorId,
String orgId,
Integer ignore,
Integer collect,
Integer gap)
Defines a new MeasurementPruningDefinition.
|
abstract MeasurementType |
defineMeasurementType(String id,
String name,
String units)
Defines a new MeasurementType in WattDepot.
|
abstract Organization |
defineOrganization(String id,
String name,
Set<String> users) |
abstract Sensor |
defineSensor(String id,
String name,
String uri,
String modelId,
Set<Property> properties,
String orgId) |
abstract SensorGroup |
defineSensorGroup(String id,
String name,
Set<String> sensors,
String orgId) |
abstract SensorModel |
defineSensorModel(String id,
String name,
String protocol,
String type,
String version)
Defines a new SensorModel in WattDepot.
|
abstract UserInfo |
defineUserInfo(String userId,
String firstName,
String lastName,
String email,
String orgId,
Set<Property> properties,
String password)
Defines a new UserInfo with the given information.
|
abstract void |
deleteCollectorProcessDefinition(String id,
String orgId)
Deletes the given CollectorProcessDefinition.
|
abstract void |
deleteDepository(String id,
String orgId)
Deletes the given WattDepository.
|
abstract void |
deleteMeasurement(String depotId,
String orgId,
String measId) |
abstract void |
deleteMeasurementPruningDefinition(String id,
String orgId)
Deletes the given MeasurementPruningDefinition.
|
abstract void |
deleteMeasurementType(String id)
Deletes the given measurement type.
|
abstract void |
deleteOrganization(String id) |
abstract void |
deleteSensor(String id,
String orgId)
Deletes the given Sensor.
|
abstract void |
deleteSensorGroup(String id,
String orgId)
Deletes the given SensorGroup.
|
abstract void |
deleteSensorModel(String id)
Deletes the given SensorModel.
|
abstract void |
deleteUser(String id,
String orgId) |
abstract void |
deleteUserPassword(String userId,
String orgId) |
abstract CollectorProcessDefinition |
getCollectorProcessDefinition(String id,
String orgId,
boolean check) |
abstract List<String> |
getCollectorProcessDefinitionIds(String orgId,
boolean check) |
abstract List<CollectorProcessDefinition> |
getCollectorProcessDefinitions(String orgId,
boolean check) |
abstract List<Depository> |
getDepositories(String orgId,
boolean check) |
abstract Depository |
getDepository(String id,
String orgId,
boolean check) |
abstract List<String> |
getDepositoryIds(String orgId,
boolean check) |
abstract InterpolatedValue |
getEarliestMeasuredValue(String depotId,
String orgId,
String sensorId,
boolean check) |
abstract InterpolatedValue |
getLatestMeasuredValue(String depotId,
String orgId,
String sensorId,
boolean check) |
abstract InterpolatedValue |
getLatestMeasuredValue(String depotId,
String orgId,
String sensorId,
Long window,
boolean check) |
abstract Measurement |
getMeasurement(String depotId,
String orgId,
String measId,
boolean check) |
abstract MeasurementPruningDefinition |
getMeasurementPruningDefinition(String id,
String orgId,
boolean check) |
abstract List<String> |
getMeasurementPruningDefinitionIds(String orgId,
boolean check) |
abstract List<MeasurementPruningDefinition> |
getMeasurementPruningDefinitions(String orgId,
boolean check) |
abstract List<Measurement> |
getMeasurements(String depotId,
String orgId,
String sensorId,
boolean check) |
abstract List<Measurement> |
getMeasurements(String depotId,
String orgId,
String sensorId,
Date start,
Date end,
boolean check) |
abstract Long |
getMeasurementsCount(String orgId,
boolean check) |
abstract Long |
getMeasurementsCount(String depotId,
String orgId,
String sensorId,
boolean check) |
abstract Long |
getMeasurementsCount(String depotId,
String orgId,
String sensorId,
Date start,
Date end,
boolean check) |
abstract MeasurementType |
getMeasurementType(String id,
boolean check) |
abstract List<MeasurementType> |
getMeasurementTypes() |
abstract Organization |
getOrganization(String id,
boolean check) |
abstract List<String> |
getOrganizationIds() |
abstract List<Organization> |
getOrganizations() |
abstract MeasurementRateSummary |
getRateSummary(String depotId,
String orgId,
String sensorId,
boolean check) |
abstract Sensor |
getSensor(String id,
String orgId,
boolean check) |
abstract SensorGroup |
getSensorGroup(String id,
String orgId,
boolean check) |
abstract List<String> |
getSensorGroupIds(String orgId,
boolean check) |
abstract List<SensorGroup> |
getSensorGroups(String orgId,
boolean check) |
abstract List<String> |
getSensorIds(String orgId,
boolean check) |
abstract SensorModel |
getSensorModel(String id,
boolean check) |
abstract List<String> |
getSensorModelIds() |
abstract List<SensorModel> |
getSensorModels() |
abstract List<Sensor> |
getSensors(String orgId,
boolean check) |
ServerProperties |
getServerProperties() |
int |
getSessionClose() |
int |
getSessionOpen() |
abstract SensorMeasurementSummary |
getSummary(String depotId,
String orgId,
String sensorId,
Date start,
Date end,
boolean check) |
abstract UserInfo |
getUser(String id,
String orgId,
boolean check) |
abstract List<String> |
getUserIds(String orgId,
boolean check) |
abstract UserPassword |
getUserPassword(String id,
String orgId,
boolean check) |
abstract List<UserInfo> |
getUsers() |
abstract List<UserInfo> |
getUsers(String orgId,
boolean check) |
abstract Double |
getValue(String depotId,
String orgId,
String sensorId,
Date timestamp,
boolean check) |
abstract Double |
getValue(String depotId,
String orgId,
String sensorId,
Date start,
Date end,
boolean check) |
abstract Double |
getValue(String depotId,
String orgId,
String sensorId,
Date start,
Date end,
Long gapSeconds,
boolean check) |
abstract Double |
getValue(String depotId,
String orgId,
String sensorId,
Date timestamp,
Long gapSeconds,
boolean check) |
void |
initializeMeasurementTypes()
Ensures the base set of MeasurementTypes are defined in WattDepot.
|
void |
initializeSensorModels()
Ensures the base set of SensorModels are defined in WattDepot.
|
abstract List<String> |
listSensors(String depotId,
String orgId,
boolean check) |
abstract void |
putMeasurement(String depotId,
String orgId,
Measurement meas) |
abstract void |
putMeasurementList(String depotId,
String orgId,
MeasurementList measurementList) |
void |
setServerProperties(ServerProperties properties) |
abstract void |
stop()
Cleans up the persistence layer.
|
abstract CollectorProcessDefinition |
updateCollectorProcessDefinition(CollectorProcessDefinition process)
Updates the given CollectorProcessDefinition in the persistent store.
|
abstract MeasurementPruningDefinition |
updateMeasurementPruningDefinition(MeasurementPruningDefinition gcd)
Updates the given MeasurementPruningDefinition in the persistent store.
|
abstract MeasurementType |
updateMeasurementType(MeasurementType type)
Updates the given measurement type in the persistent store.
|
abstract Organization |
updateOrganization(Organization org) |
abstract Sensor |
updateSensor(Sensor sensor)
Updates the given sensor in the persistent store.
|
abstract SensorGroup |
updateSensorGroup(SensorGroup group)
Updates the given sensor group in the persistent store.
|
abstract SensorModel |
updateSensorModel(SensorModel model)
Updates the given sensor model in the persistent store.
|
abstract UserInfo |
updateUserInfo(UserInfo user) |
abstract UserPassword |
updateUserPassword(UserPassword password) |
public abstract CollectorProcessDefinition defineCollectorProcessDefinition(String id, String name, String sensorId, Long pollingInterval, String depositoryId, Set<Property> properties, String orgId) throws UniqueIdException, MisMatchedOwnerException, IdNotFoundException, BadSlugException
id
- The unique id.name
- The unique name.sensorId
- The id of the Sensor to poll.pollingInterval
- The polling interval.depositoryId
- The id of the depository to use.properties
- The properties associated with this
CollectorProcessDefinition.orgId
- the id of the owner of the CollectorProcessDefinitionUniqueIdException
- if the id is already used for another
CollectorProcessDefinintion.MisMatchedOwnerException
- if the given owner doesn't match the
owners of the Sensor or Depository.IdNotFoundException
- if the sensorId or orgId are not defined.BadSlugException
- if the given id isn't valid.public abstract Depository defineDepository(String id, String name, MeasurementType measurementType, String orgId) throws UniqueIdException, IdNotFoundException, BadSlugException
id
- The unique id.name
- The name.measurementType
- the Measurement Type.orgId
- the id of the owner of the WattDepository.UniqueIdException
- if the id is already used for another
WattDepository.IdNotFoundException
- if the orgId is not defined.BadSlugException
- if the id isn't valid.public abstract MeasurementPruningDefinition defineMeasurementPruningDefinition(String id, String name, String depositoryId, String sensorId, String orgId, Integer ignore, Integer collect, Integer gap) throws UniqueIdException, BadSlugException, IdNotFoundException
id
- The id of the garbage collection definition.name
- The name of the garbage collection definition.depositoryId
- The id of the depository.sensorId
- The id of the sensor.orgId
- The organization id.ignore
- The number of days to ignore starting from now.collect
- The number of days to garbage collect in.gap
- The minimum gap between measurements in seconds.UniqueIdException
- if the id derived from name is already defined.BadSlugException
- if the id isn't valid.IdNotFoundException
- If the depository, sensor or organization are
not defined.public abstract MeasurementType defineMeasurementType(String id, String name, String units) throws UniqueIdException, BadSlugException
id
- The unique id.name
- the name of the MeasurementType.units
- the units for the MeasurementType. Must be a
javax.measure.unit.Unit toString() value.UniqueIdException
- if the id derived from name is already defined.BadSlugException
- if the id isn't valid.public abstract Organization defineOrganization(String id, String name, Set<String> users) throws UniqueIdException, BadSlugException, IdNotFoundException
id
- The unique id.name
- The unique name.users
- The members of the group.UniqueIdException
- If the id is already used for another
Organization.BadSlugException
- if the id isn't valid.IdNotFoundException
- if the user's are not defined.public abstract Sensor defineSensor(String id, String name, String uri, String modelId, Set<Property> properties, String orgId) throws UniqueIdException, MisMatchedOwnerException, IdNotFoundException, BadSlugException
id
- The unique id.name
- The name of the sensor.uri
- The URI for the sensor.modelId
- The id of the SensorModel.properties
- the properties associated with this Sensor.orgId
- the id of the owner of the Sensor.UniqueIdException
- if the id is already used for another Sensor.MisMatchedOwnerException
- if the given owner doesn't match the
owners of the SensorModel.IdNotFoundException
- if modelId, or orgId are not actual Ids.BadSlugException
- if the id isn't valid.public abstract SensorGroup defineSensorGroup(String id, String name, Set<String> sensors, String orgId) throws UniqueIdException, MisMatchedOwnerException, IdNotFoundException, BadSlugException
id
- The unique id.name
- The unique name.sensors
- A set of the Sensors that make up the SensorGrouporgId
- the owner of the SensorGroup.UniqueIdException
- if the id is already used for another
SensorGroup.MisMatchedOwnerException
- if the given owner doesn't match the
owners of the Sensors.IdNotFoundException
- if sensorIds, or orgId are not actual Ids.BadSlugException
- id the id isn't valid.public abstract SensorModel defineSensorModel(String id, String name, String protocol, String type, String version) throws UniqueIdException, BadSlugException
id
- The unique id.name
- The unique name.protocol
- The protocol used by a meter.type
- The type of the meter.version
- The version the meter is using.UniqueIdException
- if the id is already used for another
SensorModel.BadSlugException
- if the id isn't valid.public abstract UserInfo defineUserInfo(String userId, String firstName, String lastName, String email, String orgId, Set<Property> properties, String password) throws UniqueIdException, IdNotFoundException
userId
- The unique userId.firstName
- The user's name.lastName
- The user's last name.email
- The user's email address.orgId
- The id of the user's organization.properties
- The additional properties of the user.password
- the password for the user.UniqueIdException
- if the id is already used for another UserInfo.IdNotFoundException
- Organization is not defined.public abstract void deleteCollectorProcessDefinition(String id, String orgId) throws IdNotFoundException, MisMatchedOwnerException
id
- The unique id of the CollectorProcessDefinition.orgId
- the group id of the user making the request.IdNotFoundException
- If the id is not known or defined.MisMatchedOwnerException
- if the orgId doesn't match the owner of
the sensor process.public abstract void deleteDepository(String id, String orgId) throws IdNotFoundException, MisMatchedOwnerException
id
- The unique id of the WattDepository.orgId
- the group id of the user making the request.IdNotFoundException
- If the id is not known or defined.MisMatchedOwnerException
- if the orgId doesn't match the owner of
the sensor process.public abstract void deleteMeasurement(String depotId, String orgId, String measId) throws IdNotFoundException
depotId
- the id of the Depository storing the measurement.orgId
- the id of the Organization.measId
- The id of the measurement to delete.IdNotFoundException
- if there is a problem with the ids.public abstract void deleteMeasurementPruningDefinition(String id, String orgId) throws IdNotFoundException
id
- The id of the MeasurementPruningDefinition to delete.orgId
- The Organization's id.IdNotFoundException
- if the id is not defined.public abstract void deleteMeasurementType(String id) throws IdNotFoundException
id
- The unique id for the MeasurementType to delete.IdNotFoundException
- if the id is not a known MeasurementType.public abstract void deleteOrganization(String id) throws IdNotFoundException
id
- The unique id of the Organization.IdNotFoundException
- If the id is not known or defined.public abstract void deleteSensor(String id, String orgId) throws IdNotFoundException, MisMatchedOwnerException
id
- The unique id of the Sensor.orgId
- the group id of the user making the request.IdNotFoundException
- If the id is not known or defined.MisMatchedOwnerException
- if the orgId doesn't match the owner of
the sensor.public abstract void deleteSensorGroup(String id, String orgId) throws IdNotFoundException, MisMatchedOwnerException
id
- The unique id of the SensorGroup.orgId
- the group id of the user making the request.IdNotFoundException
- If the id is not known or defined.MisMatchedOwnerException
- if the orgId doesn't match the owner of
the sensor group.public abstract void deleteSensorModel(String id) throws IdNotFoundException
id
- The unique id of the SensorModel.IdNotFoundException
- If the id is not known or defined.public abstract void deleteUser(String id, String orgId) throws IdNotFoundException
id
- The unique id of the User.orgId
- the id of the organization the user is a member.IdNotFoundException
- If the id is not known or defined.public abstract void deleteUserPassword(String userId, String orgId) throws IdNotFoundException
userId
- The id of the UserPassword to delete.orgId
- the user's organization id.IdNotFoundException
- If the id is not known or defined.public abstract CollectorProcessDefinition getCollectorProcessDefinition(String id, String orgId, boolean check) throws IdNotFoundException
id
- The unique id for the CollectorProcessDefinition.orgId
- the group id of the user making the request.check
- true if want to check the ids.IdNotFoundException
- if either id is not defined.public abstract List<String> getCollectorProcessDefinitionIds(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the owner Organization.check
- true if want to check the ids.IdNotFoundException
- if the orgId is not defined.public abstract List<CollectorProcessDefinition> getCollectorProcessDefinitions(String orgId, boolean check) throws IdNotFoundException
orgId
- the group id of the user making the request.check
- true if want to check the ids.IdNotFoundException
- if the orgId is not defined.public abstract List<Depository> getDepositories(String orgId, boolean check) throws IdNotFoundException
orgId
- the group id of the user making the request.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public abstract Depository getDepository(String id, String orgId, boolean check) throws IdNotFoundException
id
- The unique id for the Depository to get.orgId
- the id of the owner's Organization.check
- true if want to check the ids.IdNotFoundException
- if either id is not defined.public abstract List<String> getDepositoryIds(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the owner UserGroup.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public abstract InterpolatedValue getEarliestMeasuredValue(String depotId, String orgId, String sensorId, boolean check) throws NoMeasurementException, IdNotFoundException
depotId
- the id of the Depository.orgId
- the Organziation's id.sensorId
- The id of the Sensor making the measurements.check
- true if want to check the ids.NoMeasurementException
- If there aren't any measurements around the
time.IdNotFoundException
- if there is a problem with the ids.public abstract InterpolatedValue getLatestMeasuredValue(String depotId, String orgId, String sensorId, boolean check) throws NoMeasurementException, IdNotFoundException
depotId
- the id of the Depository.orgId
- the Organziation's id.sensorId
- The id of the Sensor making the measurements.check
- true if want to check the ids.NoMeasurementException
- If there aren't any measurements around the
time.IdNotFoundException
- if there is a problem with the ids.public abstract InterpolatedValue getLatestMeasuredValue(String depotId, String orgId, String sensorId, Long window, boolean check) throws NoMeasurementException, IdNotFoundException
depotId
- the id of the Depository.orgId
- the Organziation's id.sensorId
- The id of the Sensor making the measurements.window
- The number of seconds to consider for latest.check
- true if want to check the ids.NoMeasurementException
- If there aren't any measurements around the
time.IdNotFoundException
- if there is a problem with the ids.public abstract Measurement getMeasurement(String depotId, String orgId, String measId, boolean check) throws IdNotFoundException
depotId
- the id of the Depository storing the measurements.orgId
- the Organziation's id.measId
- The measurement id.check
- true if want to check the ids.IdNotFoundException
- if there are problems with the ids.public abstract MeasurementPruningDefinition getMeasurementPruningDefinition(String id, String orgId, boolean check) throws IdNotFoundException
id
- The id of the MeasurementPruningDefinition.orgId
- The Organization's id.check
- true if want to check the ids.IdNotFoundException
- if the id is not defined.public abstract List<String> getMeasurementPruningDefinitionIds(String orgId, boolean check) throws IdNotFoundException
orgId
- The Organization's id.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.public abstract List<MeasurementPruningDefinition> getMeasurementPruningDefinitions(String orgId, boolean check) throws IdNotFoundException
orgId
- The Organization's id.check
- true if want to check the ids.IdNotFoundException
- If there is a problem with the ids.public abstract MeasurementType getMeasurementType(String id, boolean check) throws IdNotFoundException
id
- The unique id for the MeasurementType.check
- true if want to check the ids.IdNotFoundException
- if the id is not defined.public abstract List<MeasurementType> getMeasurementTypes()
public abstract List<Measurement> getMeasurements(String depotId, String orgId, String sensorId, boolean check) throws IdNotFoundException
depotId
- the id of the Depository storing the measurements.orgId
- the Organziation's id.sensorId
- the id of the Sensor.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.public abstract List<Measurement> getMeasurements(String depotId, String orgId, String sensorId, Date start, Date end, boolean check) throws IdNotFoundException
depotId
- the id of the Depository storing the measurements.orgId
- the Organziation's id.sensorId
- The id of the Sensor.start
- The start of the interval.end
- The end of the interval.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.public abstract Long getMeasurementsCount(String orgId, boolean check) throws IdNotFoundException
orgId
- the Organziation's id.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the id.public abstract Long getMeasurementsCount(String depotId, String orgId, String sensorId, boolean check) throws IdNotFoundException
depotId
- the id of the Depository storing the measurements.orgId
- the Organziation's id.sensorId
- the id of the Sensor.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.public abstract Long getMeasurementsCount(String depotId, String orgId, String sensorId, Date start, Date end, boolean check) throws IdNotFoundException
depotId
- the id of the Depository storing the measurements.orgId
- the Organziation's id.sensorId
- The id of the Sensor.start
- The start of the interval.end
- The end of the interval.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.public abstract Organization getOrganization(String id, boolean check) throws IdNotFoundException
id
- the unique id for the Organization.check
- true if want to check the ids.IdNotFoundException
- if the id isn't a defined Organization's id.public abstract List<String> getOrganizationIds()
public abstract List<Organization> getOrganizations()
public abstract MeasurementRateSummary getRateSummary(String depotId, String orgId, String sensorId, boolean check) throws IdNotFoundException, NoMeasurementException
depotId
- The depository id.orgId
- The organization id.sensorId
- The Sensor id.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.NoMeasurementException
- if there aren't any measurements.public abstract Sensor getSensor(String id, String orgId, boolean check) throws MisMatchedOwnerException, IdNotFoundException
id
- The unique id for the Sensor.orgId
- the group id of the user making the request.check
- true if want to check the ids.MisMatchedOwnerException
- if the owners of the pieces don't match.IdNotFoundException
- if the ids are not defined.public abstract SensorGroup getSensorGroup(String id, String orgId, boolean check) throws IdNotFoundException
id
- The unique id for the SensorGroup.orgId
- the group id of the user making the request.check
- true if want to check the ids.IdNotFoundException
- if the ids are not defined.public abstract List<String> getSensorGroupIds(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the owner UserGroup.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public abstract List<SensorGroup> getSensorGroups(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the Organization owning the SensorGroups.check
- true if want to check the ids.IdNotFoundException
- if the orgId is not defined.public abstract List<String> getSensorIds(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the owner UserGroup.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public abstract SensorModel getSensorModel(String id, boolean check) throws IdNotFoundException
id
- The unique id for the SensorModel.check
- true if want to check the ids.IdNotFoundException
- if id isn't a defined SensorModel id.public abstract List<String> getSensorModelIds()
public abstract List<SensorModel> getSensorModels()
public abstract List<Sensor> getSensors(String orgId, boolean check) throws IdNotFoundException
orgId
- the group id of the user making the request.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public ServerProperties getServerProperties()
public void setServerProperties(ServerProperties properties)
properties
- the properties to setpublic int getSessionClose()
public int getSessionOpen()
public abstract SensorMeasurementSummary getSummary(String depotId, String orgId, String sensorId, Date start, Date end, boolean check) throws IdNotFoundException
depotId
- The depository id.orgId
- The organization id.sensorId
- The Sensor id.start
- The start of the period.end
- The end of the period.check
- true if want to check the ids.IdNotFoundException
- if there is a problem with the ids.public abstract UserInfo getUser(String id, String orgId, boolean check) throws IdNotFoundException
id
- the unique id for the UserInfo.orgId
- the id of the organization the user is in.check
- true if want to check the ids.IdNotFoundException
- if the combination of id and orgId isn't a
defined UserInfo.public abstract List<String> getUserIds(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the organization the user is in.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public abstract UserPassword getUserPassword(String id, String orgId, boolean check) throws IdNotFoundException
id
- The user's id.orgId
- the id of the organization the user is in.check
- true if want to check the ids.IdNotFoundException
- if id and orgId aren't a defined UserPassword.public abstract List<UserInfo> getUsers(String orgId, boolean check) throws IdNotFoundException
orgId
- the id of the organization the user is in.check
- true if want to check the ids.IdNotFoundException
- if orgId is not defined.public abstract Double getValue(String depotId, String orgId, String sensorId, Date timestamp, boolean check) throws NoMeasurementException, IdNotFoundException
depotId
- the id of the depository.orgId
- the Organziation's id.sensorId
- The id of the Sensor making the measurements.timestamp
- The time of the value.check
- true if want to check the ids.NoMeasurementException
- If there aren't any measurements around the
time.IdNotFoundException
- if there is a problem with the ids.public abstract Double getValue(String depotId, String orgId, String sensorId, Date start, Date end, boolean check) throws NoMeasurementException, IdNotFoundException
depotId
- the id of the depository.orgId
- the Organziation's id.sensorId
- The id of the Sensor making the measurements.start
- The start of the period.end
- The end of the period.check
- true if want to check the ids.NoMeasurementException
- if there are no measurements around the
start or end time.IdNotFoundException
- if there is a problem with the ids.public abstract Double getValue(String depotId, String orgId, String sensorId, Date start, Date end, Long gapSeconds, boolean check) throws NoMeasurementException, MeasurementGapException, IdNotFoundException
depotId
- the id of the depository.orgId
- the Organziation's id.sensorId
- The id of 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.check
- true if want to check the ids.NoMeasurementException
- if there are no measurements around the
start or end time.MeasurementGapException
- if the measurements around start or end are
too far apart.IdNotFoundException
- if there is a problem with the ids.public abstract Double getValue(String depotId, String orgId, String sensorId, Date timestamp, Long gapSeconds, boolean check) throws NoMeasurementException, MeasurementGapException, IdNotFoundException
depotId
- the id of the depository.orgId
- the Organziation's id.sensorId
- The id of 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.check
- true if want to check the ids.NoMeasurementException
- If there aren't any measurements around the
time.MeasurementGapException
- if the measurements around timestamp are
too far apart.IdNotFoundException
- if there is a problem with the ids.public void initializeMeasurementTypes()
public void initializeSensorModels()
public abstract List<String> listSensors(String depotId, String orgId, boolean check) throws IdNotFoundException
depotId
- the id of the depository.orgId
- the id of the organization.check
- if true checks the ids.IdNotFoundException
- if there is a problem with the ids.public abstract void putMeasurement(String depotId, String orgId, Measurement meas) throws MeasurementTypeException, IdNotFoundException
depotId
- the id of the Depository.orgId
- the Organization's id.meas
- The measurement to store.MeasurementTypeException
- if the type of the measurement doesn't
match the Depository measurement type.IdNotFoundException
- if there is a problem with the ids.public abstract void putMeasurementList(String depotId, String orgId, MeasurementList measurementList) throws MeasurementTypeException, IdNotFoundException
depotId
- the id of the Depository.orgId
- the Organization's id.measurementList
- The list of measurements to store.MeasurementTypeException
- if the type of one of the measurements doesn't
match the Depository measurement type.IdNotFoundException
- if there is a problem with the ids.public abstract void stop()
public abstract CollectorProcessDefinition updateCollectorProcessDefinition(CollectorProcessDefinition process) throws IdNotFoundException
process
- The updated CollectorProcessDefinition.IdNotFoundException
- if there is a problem with the ids in the
CollectorProcessDefinition.public abstract MeasurementPruningDefinition updateMeasurementPruningDefinition(MeasurementPruningDefinition gcd) throws IdNotFoundException
gcd
- The updated MeasurementPruningDefinition.IdNotFoundException
- If there is a problem with the ids.public abstract MeasurementType updateMeasurementType(MeasurementType type)
type
- The updated MeasurementType.public abstract Organization updateOrganization(Organization org) throws IdNotFoundException
org
- The updated Organization.IdNotFoundException
- if the given Organization is not defined.public abstract Sensor updateSensor(Sensor sensor) throws IdNotFoundException
sensor
- The updated Sensor.IdNotFoundException
- if there are problems with the ids.public abstract SensorGroup updateSensorGroup(SensorGroup group) throws IdNotFoundException
group
- The updated SensorGroup.IdNotFoundException
- if there is a problem with the ids.public abstract SensorModel updateSensorModel(SensorModel model) throws IdNotFoundException
model
- The updated SensorModel.IdNotFoundException
- if the SensorModel isn't in persistence.public abstract UserInfo updateUserInfo(UserInfo user) throws IdNotFoundException
user
- The updated UserInfo.IdNotFoundException
- if the user isn't in the persistence.public abstract UserPassword updateUserPassword(UserPassword password) throws IdNotFoundException
password
- The UserPassword to update.IdNotFoundException
- if the password is not in persistence.Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.