@Component(value="CaRGOUnitConversionClientImplV2") public class UnitConversionClientImpl extends APIBaseClient implements UnitConversionClient
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 |
|---|
UnitConversionClientImpl(org.springframework.web.client.RestOperations restTemplate,
CargoClientConfig sparkworksCargoClientConfig,
CargoInternalCommunicationConfiguration cargoInternalCommunicationConfiguration) |
UnitConversionClientImpl(String apibaseUrl,
String accessToken) |
UnitConversionClientImpl(String apiBaseUrl,
String clientId,
String clientSecret,
String username,
String password,
String oauth2TokenUrl,
String oauth2GrantType,
String oauth2Scope) |
| Modifier and Type | Method and Description |
|---|---|
net.sparkworks.cargo.common.dto.UnitConversionDTO |
create(UUID sourceUuid,
UUID targetUuid,
String method)
Create a UnitConversion
|
void |
delete(UUID uuid)
Delete a UnitConversion by its UUID
|
net.sparkworks.cargo.common.dto.UnitConversionDTO |
getByUUID(UUID uuid)
Get a UnitConversion by its UUID
|
Collection<net.sparkworks.cargo.common.dto.UnitConversionDTO> |
listAll()
Retrieve all the UnitConversions
|
Collection<net.sparkworks.cargo.common.dto.UnitConversionDTO> |
query(UUID sourceUuid,
UUID targetUuid,
UUID uuid)
Retrieve a Collection of UnitConversion by source Unit UUID, target Unit UUID and UnitConversion UUID
The query will try to find conversions with the following priority:
1) find UnitConversion that has source with sourceUuid and target with targetUuid
2) find UnitConversions that has source with sourceUuid
3) find UnitConversions that has target with targetUuid
4) find UnitConversion with uuid
If no conversion is found then UnitConversionNotFoundException is thrown
|
prepareHeaders@Autowired
public UnitConversionClientImpl(@Qualifier(value="cargoRestTemplate")
org.springframework.web.client.RestOperations restTemplate,
CargoClientConfig sparkworksCargoClientConfig,
CargoInternalCommunicationConfiguration cargoInternalCommunicationConfiguration)
public UnitConversionClientImpl(String apiBaseUrl, String clientId, String clientSecret, String username, String password, String oauth2TokenUrl, String oauth2GrantType, String oauth2Scope)
public Collection<net.sparkworks.cargo.common.dto.UnitConversionDTO> listAll()
UnitConversionClientlistAll in interface UnitConversionClientCollection containing all the UnitConversionDTO.public net.sparkworks.cargo.common.dto.UnitConversionDTO getByUUID(UUID uuid)
UnitConversionClientgetByUUID in interface UnitConversionClientuuid - the UUID of the UnitConversion to retrieveUnitConversionDTO foundpublic net.sparkworks.cargo.common.dto.UnitConversionDTO create(UUID sourceUuid, UUID targetUuid, String method)
UnitConversionClientcreate in interface UnitConversionClientsourceUuid - the UUID of the source UnittargetUuid - the UUID of the target Unitmethod - the method applied for the conversionUnitConversionDTOpublic Collection<net.sparkworks.cargo.common.dto.UnitConversionDTO> query(UUID sourceUuid, UUID targetUuid, UUID uuid)
UnitConversionClientquery in interface UnitConversionClientsourceUuid - the UUID of the source UnittargetUuid - the UUID of the target Unituuid - the UUID of the UnitConversion to retrieveCollection of UnitConversionDTO that contains all the Unit Conversions foundpublic void delete(UUID uuid)
UnitConversionClientdelete in interface UnitConversionClientuuid - the UUID of the UnitConversion to deleteCopyright © 2018. All rights reserved.