public abstract class MultiThreadedCollector extends TimerTask
Modifier and Type | Field and Description |
---|---|
protected WattDepotClient |
client
The client used to communicate with the WattDepot server.
|
protected boolean |
debug
Flag for debugging messages.
|
protected CollectorProcessDefinition |
definition
The definition about the collector.
|
protected Depository |
depository
The Depository for storing measurements.
|
Constructor and Description |
---|
MultiThreadedCollector(String serverUri,
String username,
String orgId,
String password,
String collectorId,
boolean debug)
Initializes the MultiThreadedCollector.
|
MultiThreadedCollector(String serverUri,
String username,
String orgId,
String password,
String sensorId,
Long pollingInterval,
Depository depository,
boolean debug) |
protected boolean debug
protected CollectorProcessDefinition definition
protected WattDepotClient client
protected Depository depository
public MultiThreadedCollector(String serverUri, String username, String orgId, String password, String collectorId, boolean debug) throws BadCredentialException, IdNotFoundException, BadSensorUriException
serverUri
- The URI for the WattDepot server.username
- The name of a user defined in the WattDepot server.orgId
- the id of the organization the user is in.password
- The password for the user.collectorId
- The CollectorProcessDefinitionId used to initialize this
collector.debug
- flag for debugging messages.BadCredentialException
- if the user or password don't match the
credentials in WattDepot.IdNotFoundException
- if the processId is not defined.BadSensorUriException
- if the Sensor's URI isn't valid.public MultiThreadedCollector(String serverUri, String username, String orgId, String password, String sensorId, Long pollingInterval, Depository depository, boolean debug) throws BadCredentialException, BadSensorUriException, IdNotFoundException
serverUri
- The URI for the WattDepot server.username
- The name of a user defined in the WattDepot server.orgId
- the id of the user's organization.password
- The password for the user.sensorId
- The id of the Sensor to poll.pollingInterval
- The polling interval in seconds.depository
- The Depository to store the measurements.debug
- flag for debugging messages.BadCredentialException
- if the user or password don't match the
credentials in WattDepot.BadSensorUriException
- if the Sensor's URI isn't valid.IdNotFoundException
- if there is a problem with the sensorId.public boolean isValid()
public static boolean start(String serverUri, String username, String orgId, String password, String collectorId, boolean debug) throws InterruptedException, BadCredentialException
serverUri
- The URI for the WattDepot server.username
- The name of a user defined in the WattDepot server.orgId
- the user's organization id.password
- The password for the user.collectorId
- The CollectorProcessDefinitionId used to initialize this
collector.debug
- flag for debugging messages.InterruptedException
- If sleep is interrupted for some reason.BadCredentialException
- if the username and password are invalid.Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.