@Component(value="CaRGOGroupClientImplV2") public class GroupClientImpl extends APIBaseClient implements GroupClient
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 |
|---|
GroupClientImpl(org.springframework.web.client.RestOperations restTemplate,
CargoClientConfig sparkworksCargoClientConfig,
CargoInternalCommunicationConfiguration cargoInternalCommunicationConfiguration) |
GroupClientImpl(String apibaseUrl,
String accessToken) |
GroupClientImpl(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 Groups the user has access to.
|
net.sparkworks.cargo.common.dto.GroupDTO |
create(String name,
String path)
Create a new Group.
|
void |
delete(UUID uuid)
Delete a Group by its UUID.
|
net.sparkworks.cargo.common.dto.GroupDTO |
getByUUID(UUID uuid)
Retrieve a Group by its UUID if the user has access to it.
|
Collection<net.sparkworks.cargo.common.dto.GatewayDTO> |
getGroupGateways(UUID uuid)
Retrieve the Gateways that belong to a specific Group
|
Collection<net.sparkworks.cargo.common.dto.ResourceDTO> |
getGroupResources(UUID uuid)
Retrieve the Resources of a Group with specific UUID.
|
net.sparkworks.cargo.common.dto.GroupNodeDTO |
getGroupsTree()
Retrieve the Tree structure of the Groups starting from the Root
|
Collection<net.sparkworks.cargo.common.dto.GroupDTO> |
getRootGroups()
Retrieve the Main Groups of the current User
|
Collection<net.sparkworks.cargo.common.dto.GroupDTO> |
getSubGroups(UUID uuid,
int depth)
Retrieve the SubGroups of a specific Group in certain depth.
|
Collection<net.sparkworks.cargo.common.dto.GroupDTO> |
listAll()
Retrieve a list of all the Groups the user has access to.
|
void |
move(UUID sourceUUID,
UUID targetUUID)
Move a Group under another Group.
|
net.sparkworks.cargo.common.dto.GroupDTO |
update(UUID uuid,
String name)
Update a Group by its UUID
|
prepareHeaders@Autowired
public GroupClientImpl(@Qualifier(value="cargoRestTemplate")
org.springframework.web.client.RestOperations restTemplate,
CargoClientConfig sparkworksCargoClientConfig,
CargoInternalCommunicationConfiguration cargoInternalCommunicationConfiguration)
public GroupClientImpl(String apiBaseUrl, String clientId, String clientSecret, String username, String password, String oauth2TokenUrl, String oauth2GrantType, String oauth2Scope)
public Collection<net.sparkworks.cargo.common.dto.GroupDTO> listAll()
GroupClientlistAll in interface GroupClientCollection containing all the GroupDTO the user has access to.public net.sparkworks.cargo.common.dto.GroupDTO create(String name, String path)
GroupClientcreate in interface GroupClientname - the name of the new Grouppath - the path of the Parent GroupGroupDTOpublic net.sparkworks.cargo.common.dto.GroupDTO getByUUID(UUID uuid)
GroupClientgetByUUID in interface GroupClientuuid - the UUID of the Group to retrieveGroupDTO found by the UUIDpublic Long count()
GroupClientcount in interface GroupClientpublic void delete(UUID uuid)
GroupClientdelete in interface GroupClientuuid - the UUID of the Group to deletepublic void move(UUID sourceUUID, UUID targetUUID)
GroupClientmove in interface GroupClientsourceUUID - the UUID of the Group to be movedtargetUUID - the UUID of the target Grouppublic Collection<net.sparkworks.cargo.common.dto.ResourceDTO> getGroupResources(UUID uuid)
GroupClientgetGroupResources in interface GroupClientuuid - the the UUID of the Group to get the Resources fromCollection of ResourceDTOs that belong to the Grouppublic Collection<net.sparkworks.cargo.common.dto.GroupDTO> getSubGroups(UUID uuid, int depth)
GroupClientgetSubGroups in interface GroupClientuuid - the UUID of the Group to get the SubGroups fromdepth - the depth of the SubGroupsCollection of GroupDTO containing the SubGroups of the Grouppublic Collection<net.sparkworks.cargo.common.dto.GatewayDTO> getGroupGateways(UUID uuid)
GroupClientgetGroupGateways in interface GroupClientuuid - the UUID of the GroupCollection of GatewayDTO that belong to the Grouppublic Collection<net.sparkworks.cargo.common.dto.GroupDTO> getRootGroups()
GroupClientgetRootGroups in interface GroupClientCollection of GroupDTO that contains the main Groups of the userpublic net.sparkworks.cargo.common.dto.GroupDTO update(UUID uuid, String name)
GroupClientupdate in interface GroupClientuuid - the UUID of the Groupname - the new name of the GroupGroupDTOpublic net.sparkworks.cargo.common.dto.GroupNodeDTO getGroupsTree()
GroupClientgetGroupsTree in interface GroupClientGroupNodeDTO that contains all the TreeCopyright © 2018. All rights reserved.