GatewayResource gateway = jpa.getGateway();
WorkerResource workerResource = jpa.getWorker();
String applicationName = descriptor.getType().getApplicationName().getStringValue();
applicationName = createAppName(serviceName, hostName, applicationName);
if (isApplicationDescriptorExists(serviceName,hostName,descriptor.getType().getApplicationName().getStringValue())){
throw new DescriptorAlreadyExistsException(applicationName);
}
ApplicationDescriptorResource applicationDescriptorResource = gateway.createApplicationDescriptorResource(applicationName);
applicationDescriptorResource.setUpdatedUser(workerResource.getUser());
applicationDescriptorResource.setServiceDescName(serviceName);
applicationDescriptorResource.setHostDescName(hostName);