use of com.sequenceiq.cloudbreak.common.dal.ResourceBasicView in project cloudbreak by hortonworks.
the class DatalakeService method addSharedServiceResponse.
public void addSharedServiceResponse(ClusterApiView cluster, ClusterViewV4Response clusterResponse) {
SharedServiceV4Response sharedServiceResponse = new SharedServiceV4Response();
if (cluster.getStack().getDatalakeCrn() != null) {
LOGGER.debug("Add shared service response by datalakeCrn");
Optional<ResourceBasicView> datalakeStack = stackService.getResourceBasicViewByResourceCrn(cluster.getStack().getDatalakeCrn());
datalakeStack.ifPresent(s -> {
sharedServiceResponse.setSharedClusterId(s.getId());
sharedServiceResponse.setSharedClusterName(s.getName());
});
}
clusterResponse.setSharedServiceResponse(sharedServiceResponse);
}
use of com.sequenceiq.cloudbreak.common.dal.ResourceBasicView in project cloudbreak by hortonworks.
the class DatalakeService method prepareDatalakeRequest.
public void prepareDatalakeRequest(Stack source, StackV4Request stackRequest) {
if (!Strings.isNullOrEmpty(source.getDatalakeCrn())) {
LOGGER.debug("Prepare datalake request by datalakecrn");
SharedServiceV4Request sharedServiceRequest = new SharedServiceV4Request();
Optional<ResourceBasicView> datalakeStack = stackService.getResourceBasicViewByResourceCrn(source.getDatalakeCrn());
datalakeStack.ifPresent(s -> {
sharedServiceRequest.setDatalakeName(s.getName());
});
stackRequest.setSharedService(sharedServiceRequest);
}
}
Aggregations