@Component(value="CaRGOResourceClientV2") public class ResourceClientImpl extends APIBaseClient implements ResourceClient
apiBaseUrl, AUTH_BEARER_PREFIX, AUTHORIZATION_HEADER, restTemplateAPI_V1, API_V2, COMMAND, COMMAND_BY_UUID, CONVERSION, CONVERSION_BY_QUERY, CONVERSION_BY_UUID, COPY, COUNT, DEPTH, DEPTH_PATH, GATEWAY, GATEWAY_BY_QUERY, GATEWAY_BY_UUID, GATEWAY_COUNT, GATEWAY_RESOURCE, GROUP, GROUP_BY_UUID, GROUP_COUNT, GROUP_GATEWAY, GROUP_MAIN, GROUP_MOVE, GROUP_RESOURCES, GROUP_SUBGROUPS, GROUP_TREE, INTERNAL_PATH, MOVE, MOVE_RESOURCE_BY_UUID, PATH_LEVEL, PHENOMENON, PHENOMENON_BY_QUERY, PHENOMENON_BY_UUID, QUERY, RESOURCE, RESOURCE_BY_ID, RESOURCE_BY_QUERY, RESOURCE_BY_UUID, RESOURCE_COUNT, RESOURCE_DATA_PUBLISH, RESOURCE_ID, RESOURCE_LATEST, RESOURCE_LATEST_BY_UUID, RESOURCE_LATEST_UOM, RESOURCE_QUERY_LATEST, RESOURCE_QUERY_SUMMARY, RESOURCE_QUERY_TIMERANGE, RESOURCE_SUMMARY, RESOURCE_SUMMARY_BY_UUID, RESOURCE_SUMMARY_UOM, SOURCE, SOURCE_UUID, SUBGROUP, TARGET, TARGET_UOM, TARGET_UUID, UNIT, UNIT_BY_QUERY, UNIT_BY_UUID, UUID, UUID_PATH| Constructor and Description |
|---|
ResourceClientImpl(org.springframework.web.client.RestOperations restTemplate,
CargoClientConfig sparkworksCargoClientConfig,
CargoInternalCommunicationConfiguration cargoInternalCommunicationConfiguration) |
ResourceClientImpl(String apibaseUrl,
String accessToken) |
ResourceClientImpl(String apiBaseUrl,
String clientId,
String clientSecret,
String username,
String password,
String oauth2TokenUrl,
String oauth2GrantType,
String oauth2Scope) |
| Modifier and Type | Method and Description |
|---|---|
Long |
count()
Retrieve the number of the Resources the user has access to.
|
net.sparkworks.cargo.common.dto.ResourceDTO |
create(String systemName,
String userFriendlyName,
net.sparkworks.cargo.common.enumerator.ResourceType type,
String phenomenon,
String unit,
String controls,
UUID groupUUID)
Create a new Resource.
|
void |
delete(UUID uuid)
Delete a Resource by its UUID.
|
net.sparkworks.cargo.common.dto.ResourceDTO |
getBySystemName(String systemName)
Retrieve a Resource by its name
|
net.sparkworks.cargo.common.dto.ResourceDTO |
getByUUID(UUID uuid)
Retrieve a Resource by its UUID
|
Collection<net.sparkworks.cargo.common.dto.ResourceDTO> |
listAll()
Retrieve all the Resources the user has access to.
|
net.sparkworks.cargo.common.dto.ResourceDTO |
move(UUID resourceUuid,
UUID targetGroupUuid)
Move a Resource to a Group
|
net.sparkworks.cargo.common.dto.ResourceDTO |
update(UUID uuid,
String userFriendlyName,
net.sparkworks.cargo.common.enumerator.ResourceType type,
String controls,
UUID phenomenonUuid,
UUID unitUuid) |
prepareHeaders@Autowired
public ResourceClientImpl(@Qualifier(value="cargoRestTemplate")
org.springframework.web.client.RestOperations restTemplate,
CargoClientConfig sparkworksCargoClientConfig,
CargoInternalCommunicationConfiguration cargoInternalCommunicationConfiguration)
public ResourceClientImpl(String apiBaseUrl, String clientId, String clientSecret, String username, String password, String oauth2TokenUrl, String oauth2GrantType, String oauth2Scope)
public Collection<net.sparkworks.cargo.common.dto.ResourceDTO> listAll()
ResourceClientlistAll in interface ResourceClientCollection containing all the ResourceDTO the user has access to.public net.sparkworks.cargo.common.dto.ResourceDTO create(String systemName, String userFriendlyName, net.sparkworks.cargo.common.enumerator.ResourceType type, String phenomenon, String unit, String controls, UUID groupUUID)
ResourceClientcreate in interface ResourceClientsystemName - the uri of the new ResourceuserFriendlyName - the user friendly name of the Resourcetype - Sensor/Actuatorphenomenon - the phenomenon name of the Resource observesunit - the unit of measurement the Resourcecontrols - // TODO: 3/12/2018 add description to controlsgroupUUID - the UUID of the Group the new Resource will belong toResourceDTOpublic net.sparkworks.cargo.common.dto.ResourceDTO getByUUID(UUID uuid)
ResourceClientgetByUUID in interface ResourceClientuuid - the UUID of the Resource to retrieveResourceDTO foundpublic net.sparkworks.cargo.common.dto.ResourceDTO getBySystemName(String systemName)
ResourceClientgetBySystemName in interface ResourceClientsystemName - the system name of the Resource to retrieveResourceDTO foundpublic Long count()
ResourceClientcount in interface ResourceClientpublic void delete(UUID uuid)
ResourceClientdelete in interface ResourceClientuuid - the UUID of the Resource to deletepublic net.sparkworks.cargo.common.dto.ResourceDTO move(UUID resourceUuid, UUID targetGroupUuid)
ResourceClientmove in interface ResourceClientresourceUuid - the Resource UUIDtargetGroupUuid - the Group UUIDResourceDTOCopyright © 2018. All rights reserved.