Examples of DescriptorAlreadyExistsException


Examples of org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException

    public void addServiceDescription(ServiceDescription serviceDescription) throws DescriptorAlreadyExistsException,
        AiravataAPIInvocationException{
        try {
            getClient().getRegistryClient().addServiceDescriptor(serviceDescription);
        } catch (org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException e) {
            throw new DescriptorAlreadyExistsException("Service descriptor "
                    + serviceDescription.getType().getName()
                    + " already exists.", e);
        } catch (RegException e) {
            throw new AiravataAPIInvocationException("An internal error occurred while trying to add service descriptor"
                    + serviceDescription.getType().getName(),
View Full Code Here

Examples of org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException

        try {
            getClient().getRegistryClient().addApplicationDescriptor(serviceDescription.getType().getName(),
                    hostDescription.getType().getHostName(), applicationDeploymentDescription);
        } catch (org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException e) {
            throw new DescriptorAlreadyExistsException("Application descriptor " +
                    applicationDeploymentDescription.getType().getApplicationName().getStringValue()
                    + " already associated to host " + hostDescription.getType().getHostName()
                    + " and service " + serviceDescription.getType().getName(), e);
        } catch (RegException e) {
View Full Code Here

Examples of org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException

        AiravataAPIInvocationException{

        try {
            getClient().getRegistryClient().addHostDescriptor(host);
        } catch (org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException e) {
            throw new DescriptorAlreadyExistsException("Host descriptor " + host.getType().getHostName()
                    + " already exists.", e);
        } catch (RegException e) {
            throw new AiravataAPIInvocationException("An internal error occurred while trying to add host descriptor"
                    + host.getType().getHostName(),
                    e);
View Full Code Here

Examples of org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException

    public void addServiceDescription(ServiceDescription serviceDescription) throws DescriptorAlreadyExistsException,
        AiravataAPIInvocationException{
        try {
            getClient().getRegistryClient().addServiceDescriptor(serviceDescription);
        } catch (org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException e) {
            throw new DescriptorAlreadyExistsException("Service descriptor "
                    + serviceDescription.getType().getName()
                    + " already exists.", e);
        } catch (RegistryException e) {
            throw new AiravataAPIInvocationException("An internal error occurred while trying to add service descriptor"
                    + serviceDescription.getType().getName(),
View Full Code Here

Examples of org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException

        try {
            getClient().getRegistryClient().addApplicationDescriptor(serviceDescription.getType().getName(),
                    hostDescription.getType().getHostName(), applicationDeploymentDescription);
        } catch (org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException e) {
            throw new DescriptorAlreadyExistsException("Application descriptor " +
                    applicationDeploymentDescription.getType().getApplicationName().getStringValue()
                    + " already associated to host " + hostDescription.getType().getHostName()
                    + " and service " + serviceDescription.getType().getName(), e);
        } catch (RegistryException e) {
View Full Code Here

Examples of org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException

        AiravataAPIInvocationException{

        try {
            getClient().getRegistryClient().addHostDescriptor(host);
        } catch (org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException e) {
            throw new DescriptorAlreadyExistsException("Host descriptor " + host.getType().getHostName()
                    + " already exists.", e);
        } catch (RegistryException e) {
            throw new AiravataAPIInvocationException("An internal error occurred while trying to add host descriptor"
                    + host.getType().getHostName(),
                    e);
View Full Code Here

Examples of org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException

        } else {
            GatewayResource gateway = jpa.getGateway();
            WorkerResource workerResource = jpa.getWorker();
            String hostName = descriptor.getType().getHostName();
            if (isHostDescriptorExists(hostName)){
                throw new DescriptorAlreadyExistsException(hostName);
            }
            HostDescriptorResource hostDescriptorResource = gateway.createHostDescriptorResource(hostName);
            hostDescriptorResource.setUserName(workerResource.getUser());
            hostDescriptorResource.setContent(descriptor.toXML());
            hostDescriptorResource.save();
View Full Code Here

Examples of org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException

        }else {
            GatewayResource gateway = jpa.getGateway();
            WorkerResource workerResource = jpa.getWorker();
            String serviceName = descriptor.getType().getName();
            if (isServiceDescriptorExists(serviceName)){
                throw new DescriptorAlreadyExistsException(serviceName);
            }
            ServiceDescriptorResource serviceDescriptorResource = gateway.createServiceDescriptorResource(serviceName);
            serviceDescriptorResource.setUserName(workerResource.getUser());
            serviceDescriptorResource.setContent(descriptor.toXML());
            serviceDescriptorResource.save();
View Full Code Here

Examples of org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException

            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);
View Full Code Here

Examples of org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException

                logger.error(response.getEntity(String.class));
                throw new RuntimeException("Failed : HTTP error code : "
                        + status);
            }else if (status == ClientConstant.HTTP_BAD_REQUEST){
                logger.debug("Descriptor already exists...");
                throw new DescriptorAlreadyExistsException(hostDescription.getType().getHostName() + " already exists !!!");
            } else {
                if (response.getCookies().size() > 0) {
                    cookie = response.getCookies().get(0).toCookie();
                    CookieManager.setCookie(cookie);
                }
            }
        }else if (status == ClientConstant.HTTP_BAD_REQUEST){
            logger.debug("Descriptor already exists...");
            throw new DescriptorAlreadyExistsException(hostDescription.getType().getHostName() + " already exists !!!");
        }
        else {
            logger.error(response.getEntity(String.class));
            throw new RuntimeException("Failed : HTTP error code : "
                    + status);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.