Package org.apache.airavata.registry.api.exception.worker

Examples of org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException


            response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).accept(
                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
            status = response.getStatus();
            if (status == ClientConstant.HTTP_BAD_REQUEST){
                logger.debug("Workflow already exists...");
                throw new UserWorkflowAlreadyExistsException(workflowName + " already exists !!!");
            }
            else if (status != ClientConstant.HTTP_OK) {
                logger.error(response.getEntity(String.class));
                throw new RuntimeException("Failed : HTTP error code : "
                        + status);
            } 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 UserWorkflowAlreadyExistsException(workflowName + " already exists !!!");
        } else {
            logger.error(response.getEntity(String.class));
            throw new RuntimeException("Failed : HTTP error code : "
                    + status);
        }
View Full Code Here


  }
 
    public void addWorkflow(String workflowName, String workflowGraphXml) throws RegistryException {
      WorkerResource worker = jpa.getWorker();
    if (isWorkflowExists(workflowName)){
          throw new UserWorkflowAlreadyExistsException(workflowName);
        }
    UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
    workflowResource.setContent(workflowGraphXml);
    workflowResource.save();
    }
View Full Code Here

        if (userWorkflowRegistry != null){
            userWorkflowRegistry.addWorkflow(workflowName, workflowGraphXml);
        }else {
            WorkerResource worker = jpa.getWorker();
            if (isWorkflowExists(workflowName)){
                throw new UserWorkflowAlreadyExistsException(workflowName);
            }
            UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
            workflowResource.setContent(workflowGraphXml);
            workflowResource.save();
        }
View Full Code Here

        if (userWorkflowRegistry != null){
            userWorkflowRegistry.addWorkflow(workflowName, workflowGraphXml);
        }else {
            WorkerResource worker = jpa.getWorker();
            if (isWorkflowExists(workflowName)){
                throw new UserWorkflowAlreadyExistsException(workflowName);
            }
            UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
            workflowResource.setContent(workflowGraphXml);
            workflowResource.save();
        }
View Full Code Here

        if (userWorkflowRegistry != null){
            userWorkflowRegistry.addWorkflow(workflowName, workflowGraphXml);
        }else {
            WorkerResource worker = jpa.getWorker();
            if (isWorkflowExists(workflowName)){
                throw new UserWorkflowAlreadyExistsException(workflowName);
            }
            UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
            workflowResource.setContent(workflowGraphXml);
            workflowResource.save();
        }
View Full Code Here

        if (userWorkflowRegistry != null){
            userWorkflowRegistry.addWorkflow(workflowName, workflowGraphXml);
        }else {
            WorkerResource worker = jpa.getWorker();
            if (isWorkflowExists(workflowName)){
                throw new UserWorkflowAlreadyExistsException(workflowName);
            }
            UserWorkflowResource workflowResource = worker.createWorkflowTemplate(workflowName);
            workflowResource.setContent(workflowGraphXml);
            workflowResource.save();
        }
View Full Code Here

            response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).accept(
                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
            status = response.getStatus();
            if (status == ClientConstant.HTTP_BAD_REQUEST){
                logger.debug("Workflow already exists...");
                throw new UserWorkflowAlreadyExistsException(workflowName);
            }
            else if (status != ClientConstant.HTTP_OK) {
                logger.error(response.getEntity(String.class));
                throw new RuntimeException("Failed : HTTP error code : "
                        + status);
            } 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 UserWorkflowAlreadyExistsException(workflowName);
        } else {
            logger.error(response.getEntity(String.class));
            throw new RuntimeException("Failed : HTTP error code : "
                    + status);
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException

Copyright © 2018 www.massapicom. 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.