use of com.emc.ecs.management.entity.ObjectUsers in project ecs-dashboard by carone1.
the class ManagementClient method getObjectUsersUid.
/**
* Retrieve Object user's uid
* @param objectUsersRequest - object users request
* @return ObjectUsers
*/
public ObjectUsers getObjectUsersUid(ObjectUsersRequest objectUsersRequest) {
String authToken = getAuthToken();
WebResource mgmtResource = this.mgmtClient.resource(uri);
// get keys for user
WebResource objectUsersUidResource = mgmtResource.path(REST_GET_OBJECT_USERS);
// marker parameter
if (objectUsersRequest.getMarker() != null) {
objectUsersUidResource = objectUsersUidResource.queryParam(REST_MARKER_PARAMETER, objectUsersRequest.getMarker());
}
// limit parameter
if (objectUsersRequest.getLimit() != null) {
objectUsersUidResource = objectUsersUidResource.queryParam(REST_LIMIT_PARAMETER, String.valueOf(objectUsersRequest.getLimit()));
}
ObjectUsers objectUsers = objectUsersUidResource.header(X_SDS_AUTH_TOKEN, authToken).get(ObjectUsers.class);
return objectUsers;
}
use of com.emc.ecs.management.entity.ObjectUsers in project ecs-dashboard by carone1.
the class BillingBO method getObjectUserSecretKeys.
// ================================
// Public methods
// ================================
/**
* Retrieve Object uid and secret keys
* @return ObjectUserDetails
*/
public List<ObjectUserDetails> getObjectUserSecretKeys() {
List<ObjectUserDetails> userDetails = new ArrayList<ObjectUserDetails>();
// Collect all uids in order to collect secret keys after
List<ObjectUser> objectUserList = new ArrayList<ObjectUser>();
// first batch
ObjectUsersRequest objectUsersRequest = new ObjectUsersRequest();
ObjectUsers objectUsersResult = client.getObjectUsersUid(objectUsersRequest);
if (objectUsersResult != null) {
if (objectUsersResult.getBlobUser() != null) {
objectUserList.addAll(objectUsersResult.getBlobUser());
}
objectUsersRequest.setMarker(objectUsersResult.getNextMarker());
// Subsequent batches
while (objectUsersResult.getNextMarker() != null) {
objectUsersResult = client.getObjectUsersUid(objectUsersRequest);
if (objectUsersResult != null) {
objectUserList.addAll(objectUsersResult.getBlobUser());
objectUsersRequest.setMarker(objectUsersResult.getNextMarker());
} else {
break;
}
}
}
// Collect secret keys
for (ObjectUser objectUser : objectUserList) {
ObjectUserSecretKeys objectUserSecretKeys = client.getObjectUserSecretKeys(objectUser.getUserId().toString(), objectUser.getNamespace().toString());
if (objectUserSecretKeys != null) {
userDetails.add(new ObjectUserDetails(objectUser, objectUserSecretKeys));
}
}
return userDetails;
}
Aggregations