Examples of OperationContext


Examples of org.apache.axis2.context.OperationContext

       
        SerializedStorageEntry entry = new SerializedStorageEntry();
        entry.data = stream.toByteArray();
        entry.context = msgContext.getConfigurationContext();
       
        OperationContext opCtx = msgContext.getOperationContext();
        if(opCtx != null) {
          MessageContext inMsgCtx = opCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
          if(inMsgCtx != null) {
            entry.inTransportControl = inMsgCtx.getProperty(RequestResponseTransport.TRANSPORT_CONTROL);
            entry.inTransportOut     = inMsgCtx.getProperty(MessageContext.TRANSPORT_OUT);
            entry.inTransportOutInfo = inMsgCtx.getProperty(Constants.OUT_TRANSPORT_INFO);
          }
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

    String createSeqMsgId = null;
    if (relatesTo != null) {
      createSeqMsgId = relatesTo.getValue();
    } else {
      // Work out the related message from the operation context
      OperationContext context = rmMsgCtx.getMessageContext().getOperationContext();
      MessageContext createSeq = context.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      if(createSeq != null) createSeqMsgId = createSeq.getMessageID();
    }
    if(createSeqMsgId == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.relatesToNotAvailable);
      log.error(message);
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

    String createSeqMsgId = null;
    if (relatesTo != null) {
      createSeqMsgId = relatesTo.getValue();
    } else {
      // Work out the related message from the operation context
      OperationContext context = createSeqResponseRMMsgCtx.getMessageContext().getOperationContext();
      MessageContext createSeq = context.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
      if(createSeq != null) createSeqMsgId = createSeq.getMessageID();
    }
    if(createSeqMsgId == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.relatesToNotAvailable);
      log.error(message);
      throw new SandeshaException(message);
    }

    SenderBeanMgr retransmitterMgr = storageManager.getSenderBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();

    RMSBean rmsBean = rmsBeanMgr.retrieve(createSeqMsgId);
    if (rmsBean == null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound);
      log.debug(message);
      throw new SandeshaException(message);
    }

    // Check that the create sequence response message proves possession of the correct token
    String tokenData = rmsBean.getSecurityTokenData();
    if(tokenData != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      MessageContext crtSeqResponseCtx = createSeqResponseRMMsgCtx.getMessageContext();
      OMElement body = crtSeqResponseCtx.getEnvelope().getBody();
      SecurityToken token = secManager.recoverSecurityToken(tokenData);
      secManager.checkProofOfPossession(token, body, crtSeqResponseCtx);
    }

    String internalSequenceId = rmsBean.getInternalSequenceID();
    if (internalSequenceId == null || "".equals(internalSequenceId)) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.tempSeqIdNotSet);
      log.debug(message);
      throw new SandeshaException(message);
    }
    createSeqResponseRMMsgCtx.setProperty(Sandesha2Constants.MessageContextProperties.INTERNAL_SEQUENCE_ID,internalSequenceId);
   
    rmsBean.setSequenceID(newOutSequenceId);

    // We should poll for any reply-to that uses the anonymous URI, when MakeConnection
    // is enabled.
    if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
      SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configCtx.getAxisConfiguration());
      if(policy.isEnableMakeConnection()) {
        String acksTo = rmsBean.getAcksToEPR();
        EndpointReference reference = new EndpointReference(acksTo);
        if(acksTo == null || reference.hasAnonymousAddress()) {
          rmsBean.setPollingMode(true);
        }
      }
    }

    SenderBean createSequenceSenderBean = retransmitterMgr.retrieve(createSeqMsgId);
    if (createSequenceSenderBean == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.createSeqEntryNotFound));

    // deleting the create sequence entry.
    retransmitterMgr.delete(createSeqMsgId);
   
    // Remove the create sequence message
    storageManager.removeMessageContext(rmsBean.getCreateSequenceMsgStoreKey());
       
    // processing for accept (offer has been sent)
    Accept accept = createSeqResponsePart.getAccept();
    if (accept != null) {

      // TODO this should be detected in the Fault manager.
      if (rmsBean.getOfferedSequence() == null) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.accptButNoSequenceOffered);
        log.debug(message);
        throw new SandeshaException(message);
      }

      RMDBean rMDBean = new RMDBean();
     
      EndpointReference acksToEPR = accept.getAcksTo().getEPR();
      rMDBean.setAcksToEPR(acksToEPR.getAddress());
      rMDBean.setSequenceID(rmsBean.getOfferedSequence());
      rMDBean.setNextMsgNoToProcess(1);
      rMDBean.setOutboundInternalSequence(rmsBean.getInternalSequenceID());

      rMDBean.setServiceName(createSeqResponseRMMsgCtx.getMessageContext().getAxisService().getName());
     
      //Storing the referenceMessage of the sending side sequence as the reference message
      //of the receiving side as well.
      //This can be used when creating new outgoing messages.
     
      String referenceMsgStoreKey = rmsBean.getReferenceMessageStoreKey();
      MessageContext referenceMsg = storageManager.retrieveMessageContext(referenceMsgStoreKey, configCtx);
     
      String newMessageStoreKey = SandeshaUtil.getUUID();
      storageManager.storeMessageContext(newMessageStoreKey,referenceMsg);
     
      rMDBean.setReferenceMessageKey(newMessageStoreKey);

      // If this is an offered sequence that needs polling then we need to setup the
      // rmdBean for polling too, so that it still gets serviced after the outbound
      // sequence terminates.
      if (Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(createSeqResponseRMMsgCtx.getRMSpecVersion())) {
        if(rmsBean.isPollingMode()) {
          rMDBean.setPollingMode(true);
        }
      }
     
      String rmSpecVersion = createSeqResponseRMMsgCtx.getRMSpecVersion();
      rMDBean.setRMVersion(rmSpecVersion);
     
      EndpointReference toEPR = createSeqResponseRMMsgCtx.getTo();
      if (toEPR==null) {
        //Most probably this is a sync response message, using the replyTo of the request message
        OperationContext operationContext = createSeqResponseRMMsgCtx.getMessageContext().getOperationContext();
        if (operationContext!=null) {
          MessageContext createSequnceMessage = operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
          if (createSequnceMessage!=null)
            toEPR = createSequnceMessage.getReplyTo();
        }
      }
     
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

        applicationMsgContext.getAxisService());

    MessageContext createSeqmsgContext = SandeshaUtil
        .createNewRelatedMessageContext(applicationRMMsg, createSequenceOperation);
   
    OperationContext createSeqOpCtx = createSeqmsgContext.getOperationContext();
    String createSeqMsgId = SandeshaUtil.getUUID();
    createSeqmsgContext.setMessageID(createSeqMsgId);
    context.registerOperationContext(createSeqMsgId, createSeqOpCtx);

    RMMsgContext createSeqRMMsg = new RMMsgContext(createSeqmsgContext);
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

   
    if (terminateMessage.getMessageID()==null) {
      terminateMessage.setMessageID(SandeshaUtil.getUUID());
    }

    OperationContext operationContext = terminateMessage.getOperationContext();
    // to receive terminate sequence response messages correctly
    configCtx.registerOperationContext(terminateMessage.getMessageID(), operationContext);
   
    String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmsBean.getRMVersion());
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

      if (rmMsgCtx.getMessageContext().getOperationContext() == null) {
        // operation context will be null when doing in a GLOBAL
        // handler.
       
        ServiceContext serviceCtx = msgContext.getServiceContext();
        OperationContext opCtx =  ContextFactory.createOperationContext(ackOperation, serviceCtx);

        rmMsgCtx.getMessageContext().setOperationContext(opCtx);
      }

      rmMsgCtx.getMessageContext().getOperationContext().setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN,
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

        getRMVersion(),
        getMsgContext().getAxisService());
    getMsgContext().setAxisOperation(ackOperation);

    ServiceContext serviceCtx = getMsgContext().getServiceContext();
    OperationContext opcontext = ContextFactory.createOperationContext(ackOperation, serviceCtx);
    opcontext.setParent(getMsgContext().getServiceContext());

    getConfigurationContext().registerOperationContext(ackRequestRMMsg.getMessageId(), opcontext);
    getMsgContext().setOperationContext(opcontext);
   
    Iterator iterator = ackRequestRMMsg.getMessageParts(Sandesha2Constants.MessageParts.ACK_REQUEST);
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

    if (ackRMMsgContext.getMessageContext().getOperationContext() == null) {
      // operation context will be null when doing in a GLOBAL
      // handler.
      AxisOperation op = ackMsgContext.getAxisOperation();

      OperationContext opCtx = ContextFactory.createOperationContext(op, ackRMMsgContext.getMessageContext().getServiceContext());
      ackRMMsgContext.getMessageContext().setOperationContext(opCtx);
    }

    ackRMMsgContext.getMessageContext().getOperationContext().setProperty(
        org.apache.axis2.Constants.RESPONSE_WRITTEN, Constants.VALUE_TRUE);
View Full Code Here

Examples of org.apache.axis2.context.OperationContext

    setTransportProperties (returnMessage, pollMessage);
   
    // Link the response to the request

    AxisOperation operation = SpecSpecificConstants.getWSRMOperation(Sandesha2Constants.MessageTypes.POLL_RESPONSE_MESSAGE, pollMessage.getRMSpecVersion(), pollMessage.getMessageContext().getAxisService());
    OperationContext context = new OperationContext (operation, pollMessage.getMessageContext().getServiceContext());
   
    if(context == null) {
      AxisOperation oldOperation = returnMessage.getAxisOperation();

      context = ContextFactory.createOperationContext(oldOperation, returnMessage.getServiceContext()); //new OperationContext(oldOperation);

      context.addMessageContext(pollMessage.getMessageContext());
      pollMessage.getMessageContext().setOperationContext(context);
    }
    context.addMessageContext(returnMessage);
    returnMessage.setOperationContext(context);
   
    returnMessage.setProperty(Sandesha2Constants.MAKE_CONNECTION_RESPONSE, Boolean.TRUE);
    returnMessage.setProperty(RequestResponseTransport.TRANSPORT_CONTROL, pollMessage.getProperty(RequestResponseTransport.TRANSPORT_CONTROL));
   
View Full Code Here

Examples of org.apache.chemistry.opencmis.client.api.OperationContext

            throw new IllegalArgumentException("Operation context must be set!");
        }

        final NavigationService navigationService = getBinding().getNavigationService();
        final ObjectFactory objectFactory = getObjectFactory();
        final OperationContext ctxt = new OperationContextImpl(context);

        return new CollectionIterable<Document>(new AbstractPageFetcher<Document>(ctxt.getMaxItemsPerPage()) {

            @Override
            protected AbstractPageFetcher.Page<Document> fetchPage(long skipCount) {

                // get all checked out documents
                ObjectList checkedOutDocs = navigationService.getCheckedOutDocs(getRepositoryId(), null,
                        ctxt.getFilterString(), ctxt.getOrderBy(), ctxt.isIncludeAllowableActions(),
                        ctxt.getIncludeRelationships(), ctxt.getRenditionFilterString(),
                        BigInteger.valueOf(this.maxNumItems), BigInteger.valueOf(skipCount), null);

                // convert objects
                List<Document> page = new ArrayList<Document>();
                if (checkedOutDocs.getObjects() != null) {
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.