public class WattDepotAdminClient extends WattDepotClient implements WattDepotAdminInterface
Constructor and Description |
---|
WattDepotAdminClient(String serverUri,
String username,
String orgId,
String password)
Creates a new WattDepotAdminClient.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteOrganization(String id)
Deletes the given Organization.
|
void |
deleteUser(String id,
String orgId)
Deletes the given User.
|
Organization |
getOrganization(String id) |
OrganizationList |
getOrganizations() |
UserInfo |
getUser(String id,
String orgId) |
UserPassword |
getUserPassword(String id,
String orgId) |
UserInfoList |
getUsers(String orgId) |
boolean |
isDefinedOrganization(String id)
Checks to see if the given id is a defined Organization's id.
|
boolean |
isDefinedUserInfo(String id,
String orgId)
Checks to see if the given id and orgId is a defined UserInfo id.
|
void |
putOrganization(Organization org)
Stores the given Organization in the WattDepot Server.
|
void |
putUser(UserInfo user)
Stores the given user in the WattDepot Server.
|
void |
updateOrganization(Organization org)
Updates the Organization in the WattDepot Server.
|
void |
updateUser(UserInfo user)
Updates the UserInfo in the WattDepot Server.
|
void |
updateUserPassword(UserPassword password)
Updates the Userpassword in the WattDepot Server.
|
deleteCollectorProcessDefinition, deleteDepository, deleteMeasurement, deleteMeasurementPruningDefinition, deleteMeasurementType, deleteSensor, deleteSensorGroup, deleteSensorModel, getAverageValues, getAverageValues, getCollectorProcessDefinition, getCollectorProcessDefinitions, getDailyValues, getDailyValues, getDepositories, getDepository, getDepositorySensors, getDescriptiveStats, getDescriptiveStats, getEarliestValue, getEarliestValue, getHistoricalValues, getHistoricalValues, getHourlyValues, getHourlyValues, getLatestValue, getLatestValue, getMaximumValues, getMaximumValues, getMeasurementPruningDefinition, getMeasurementPruningDefinitions, getMeasurements, getMeasurements, getMeasurementType, getMeasurementTypes, getMinimumValues, getMinimumValues, getOrganizationId, getSensor, getSensorGroup, getSensorGroups, getSensorModel, getSensorModels, getSensors, getSensorStatus, getSensorStatuses, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, getWattDepotUri, isDefinedCollectorProcessDefinition, isDefinedDepository, isDefinedMeasurementPruningDefinition, isDefinedMeasurementType, isDefinedSensor, isDefinedSensorGroup, isDefinedSensorModel, isHealthy, makeClient, putCollectorProcessDefinition, putDepository, putMeasurement, putMeasurementPruningDefinition, putMeasurements, putMeasurementType, putSensor, putSensorGroup, putSensorModel, updateCollectorProcessDefinition, updateDepository, updateMeasurementPruningDefinition, updateMeasurementType, updateSensor, updateSensorGroup, updateSensorModel
public WattDepotAdminClient(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 id of 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 deleteOrganization(String id) throws IdNotFoundException
WattDepotAdminInterface
deleteOrganization
in interface WattDepotAdminInterface
id
- the unique id of the Organization.IdNotFoundException
- if the Organization's id is not found.public void deleteUser(String id, String orgId) throws IdNotFoundException
WattDepotAdminInterface
deleteUser
in interface WattDepotAdminInterface
id
- the unique id of the User.orgId
- the id of the user's organization.IdNotFoundException
- if the User's id is not found.public void putOrganization(Organization org)
WattDepotAdminInterface
putOrganization
in interface WattDepotAdminInterface
org
- the Organization to store.public void putUser(UserInfo user)
WattDepotAdminInterface
putUser
in interface WattDepotAdminInterface
user
- The UserInfo to store.public void updateOrganization(Organization org)
WattDepotAdminInterface
updateOrganization
in interface WattDepotAdminInterface
org
- the Organization to update.public void updateUser(UserInfo user)
WattDepotAdminInterface
updateUser
in interface WattDepotAdminInterface
user
- the UserInfo to update.public Organization getOrganization(String id) throws IdNotFoundException
getOrganization
in interface WattDepotAdminInterface
id
- The unique id of the Organization.IdNotFoundException
- if the id does not exist.public OrganizationList getOrganizations()
getOrganizations
in interface WattDepotAdminInterface
public UserInfo getUser(String id, String orgId) throws IdNotFoundException
getUser
in interface WattDepotAdminInterface
id
- The unique id of the UserInfo.orgId
- the id of the user's organization.IdNotFoundException
- if the id does not exist.public UserInfoList getUsers(String orgId)
getUsers
in interface WattDepotAdminInterface
orgId
- the id of the users' organization.public UserPassword getUserPassword(String id, String orgId) throws IdNotFoundException
getUserPassword
in interface WattDepotAdminInterface
id
- The unique id of the UserPassword.orgId
- the organization id.IdNotFoundException
- if the id does not exist.public void updateUserPassword(UserPassword password) throws IdNotFoundException
WattDepotAdminInterface
updateUserPassword
in interface WattDepotAdminInterface
password
- the UserPassword to update.IdNotFoundException
- if the user id or organization ids are not
defined.public boolean isDefinedOrganization(String id)
WattDepotAdminInterface
isDefinedOrganization
in interface WattDepotAdminInterface
id
- the id to check.public boolean isDefinedUserInfo(String id, String orgId)
WattDepotAdminInterface
isDefinedUserInfo
in interface WattDepotAdminInterface
id
- the id to check.orgId
- the organization id.Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.