Package org.apache.airavata.schemas.wec

Examples of org.apache.airavata.schemas.wec.ContextHeaderDocument


            return null;
        }
    }

    private WorkflowContextHeaderBuilder parseContextHeader(OMElement workflowContext, Map<String, String> configuration) throws XMLStreamException {
        ContextHeaderDocument parse = null;
        try {
            parse = ContextHeaderDocument.Factory.parse(workflowContext.toStringWithConsume());
            String msgBox = parse.getContextHeader().getWorkflowMonitoringContext().getMsgBoxEpr();
            if(msgBox == null || "".equals(msgBox)){
                msgBox = getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString();
            }
            String msgBroker = parse.getContextHeader().getWorkflowMonitoringContext().getEventPublishEpr();
            if(msgBroker == null || "".equals(msgBroker)){
                msgBroker = getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString();
            }
            String gfac =  parse.getContextHeader().getSoaServiceEprs().getGfacUrl();
//            if(gfac == null || "".equals(gfac)){
//                gfac = getAiravataAPI().getAiravataManager().getGFaCURLs().get(0).toString();
//            }
            configuration.put(BROKER, msgBroker);
            configuration.put(GFAC, gfac);
            configuration.put(MSGBOX, msgBox);
        } catch (XmlException e) {
            log.error(e.getMessage());
        } catch (AiravataAPIInvocationException e) {
            log.error(e.getMessage());
        }
        return new WorkflowContextHeaderBuilder(parse.getContextHeader());
    }
View Full Code Here


    public EC2Provider(InvocationContext invocationContext) throws ProviderException {
        ExecutionContext execContext = invocationContext.getExecutionContext();
        OMElement omSecurityContextHeader = execContext.getSecurityContextHeader();

        ContextHeaderDocument document = null;
        try {
            document = ContextHeaderDocument.Factory.parse(omSecurityContextHeader.toStringWithConsume());
        } catch (XMLStreamException e) {
            e.printStackTrace();
        } catch (XmlException e) {
            e.printStackTrace();
        }
        SecurityContextDocument.SecurityContext.AmazonWebservices amazonWebservices =
                document.getContextHeader().getSecurityContext().getAmazonWebservices();
        String access_key = amazonWebservices.getAccessKeyId();

        String secret_key = amazonWebservices.getSecretAccessKey();
        String ami_id = amazonWebservices.getAmiId();
        String ins_id = amazonWebservices.getInstanceId();
View Full Code Here

        context.getExecutionDescription().setService(serviceDesc);
        context.getExecutionDescription().setApp(app);

        OMElement omSecurityContextHeader = context.getExecutionContext().getSecurityContextHeader();

        ContextHeaderDocument document = null;
        try {
            if (omSecurityContextHeader != null) {
                document = ContextHeaderDocument.Factory.parse(omSecurityContextHeader.toStringWithConsume());
            }
        } catch (XMLStreamException e) {
            e.printStackTrace();
        } catch (XmlException e) {
            e.printStackTrace();
        }

        SecurityContextDocument.SecurityContext.AmazonWebservices amazonWebservices = null;
        if (document != null) {
            amazonWebservices = document.getContextHeader().getSecurityContext().getAmazonWebservices();
        }

        /*
         * Determine provider
         */
 
View Full Code Here

            return null;
        }
    }

    private WorkflowContextHeaderBuilder parseContextHeader(OMElement workflowContext, Map<String, String> configuration) throws XMLStreamException {
        ContextHeaderDocument parse = null;
        try {
            parse = ContextHeaderDocument.Factory.parse(workflowContext.toStringWithConsume());
            String msgBox = parse.getContextHeader().getWorkflowMonitoringContext().getMsgBoxEpr();
            if(msgBox == null || "".equals(msgBox)){
                msgBox = getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString();
            }
            String msgBroker = parse.getContextHeader().getWorkflowMonitoringContext().getEventPublishEpr();
            if(msgBroker == null || "".equals(msgBroker)){
                msgBroker = getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString();
            }
            String gfac =  parse.getContextHeader().getSoaServiceEprs().getGfacUrl();
            if(gfac == null || "".equals(gfac)){
                gfac = getAiravataAPI().getAiravataManager().getGFaCURLs().get(0).toString();
            }
            configuration.put(BROKER, msgBroker);
            configuration.put(GFAC, gfac);
            configuration.put(MSGBOX, msgBox);
        } catch (XmlException e) {
            log.error(e.getMessage());
        } catch (AiravataAPIInvocationException e) {
            log.error(e.getMessage());
        }
        return new WorkflowContextHeaderBuilder(parse.getContextHeader());
    }
View Full Code Here

            }

            break;
        case INVOKE:
            try {
                ContextHeaderDocument document  = ContextHeaderDocument.Factory.parse(getHeader(axisRequestMsgCtx).toStringWithConsume());
                log = LoggerFactory.getLogger(GFacMessageReciever.class + "." + document.getContextHeader().getWorkflowMonitoringContext().getExperimentId());
                log.debug("invoking Invoke operation");
                processInvokeOperation(axisRequestMsgCtx);
                log.debug(axisRequestMsgCtx.getEnvelope().getBody().getFirstElement().toString());
                log.debug("Invoke operation invoked !!");
            } catch (Exception e) {
View Full Code Here

        ConfigurationContext context = messageContext.getConfigurationContext();
        String brokerURL = getEventBrokerURL(messageContext);
        String topic = getTopic(messageContext);
        OMElement outputElement = null;
        OMElement header = getHeader(messageContext);
        ContextHeaderDocument document = null;
        try {
            document = ContextHeaderDocument.Factory.parse(header.toStringWithConsume());
        } catch (XMLStreamException e) {
            e.printStackTrace();
        } catch (XmlException e) {
            e.printStackTrace();
        }
        //Set the WorkflowContext Header to the ThreadLocal of the Gfac Service, so that this can be accessed easilly
        WorkflowContextHeaderBuilder.setCurrentContextHeader(document.getContextHeader());
        Map<Parameter,ActualParameter> actualParameters = new LinkedHashMap<Parameter,ActualParameter>();
        ServiceDescription serviceDescription = getRegistry(context).getServiceDescriptor(serviceName);
        if(serviceDescription==null){
          throw new RegistryException(new Exception("Service Description not found in registry."));
        }
View Full Code Here

        SOAPHeader header = context.getEnvelope().getHeader();
        OMElement contextHeader = header.getFirstChildWithName(new QName(
                "http://airavata.apache.org/schemas/wec/2012/05", "context-header"));
        String address = null;
        try {
            ContextHeaderDocument document = ContextHeaderDocument.Factory.parse(contextHeader.toStringWithConsume());
            address = document.getContextHeader().getWorkflowMonitoringContext().getEventPublishEpr();
        } catch (XmlException e) {
            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
        } catch (XMLStreamException e) {
            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
        }
View Full Code Here

    private String getTopic(MessageContext context) {
        OMElement contextHeader = getHeader(context);
        String topic = null;
        try {
            ContextHeaderDocument document = ContextHeaderDocument.Factory.parse(contextHeader.toStringWithConsume());
            topic = document.getContextHeader().getWorkflowMonitoringContext().getExperimentId();
        } catch (XmlException e) {
            e.printStackTrace();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        }
View Full Code Here

            }

            break;
        case INVOKE:
            try {
                ContextHeaderDocument document  = ContextHeaderDocument.Factory.parse(getHeader(axisRequestMsgCtx).toStringWithConsume());
                log = LoggerFactory.getLogger(GFacMessageReciever.class + "." + document.getContextHeader().getWorkflowMonitoringContext().getExperimentId());
                log.debug("invoking Invoke operation");
                processInvokeOperation(axisRequestMsgCtx);
                log.info(axisRequestMsgCtx.getEnvelope().getBody().getFirstElement().toString());
                log.info("Invoke operation invoked !!");
            } catch (Exception e) {
View Full Code Here

        ConfigurationContext context = messageContext.getConfigurationContext();
        String brokerURL = getEventBrokerURL(messageContext);
        String topic = getTopic(messageContext);
        OMElement outputElement = null;
        OMElement header = getHeader(messageContext);
        ContextHeaderDocument document = null;
        try {
            document = ContextHeaderDocument.Factory.parse(header.toStringWithConsume());
        } catch (XMLStreamException e) {
            e.printStackTrace();
        } catch (XmlException e) {
            e.printStackTrace();
        }
        //Set the WorkflowContext Header to the ThreadLocal of the Gfac Service, so that this can be accessed easilly
        WorkflowContextHeaderBuilder.setCurrentContextHeader(document.getContextHeader());
        Map<Parameter,ActualParameter> actualParameters = new LinkedHashMap<Parameter,ActualParameter>();
        ServiceDescription serviceDescription = getRegistry(context).getServiceDescriptor(serviceName);
        if(serviceDescription==null){
          throw new RegistryException(new Exception("Service Description not found in registry."));
        }
View Full Code Here

TOP

Related Classes of org.apache.airavata.schemas.wec.ContextHeaderDocument

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.