Package org.apache.axis2.addressing

Examples of org.apache.axis2.addressing.EndpointReference


        log.debug("Exit: AckRequestedProcessor::processAckRequestedHeader, Sequence terminated");
      return false;
    }

    // Setting the ack depending on AcksTo.
    EndpointReference acksTo = new EndpointReference(rmdBean.getAcksToEPR());
    String acksToStr = acksTo.getAddress();

    if (acksToStr == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));

    //Getting the operation for ack messages.
    AxisOperation ackOperation = SpecSpecificConstants.getWSRMOperation(
        Sandesha2Constants.MessageTypes.ACK,
        rmdBean.getRMVersion(),
        msgContext.getAxisService());
   
    MessageContext ackMsgCtx = SandeshaUtil.createNewRelatedMessageContext(rmMsgCtx, ackOperation);
   
    //setting up the RMMsgContext
    RMMsgContext ackRMMsgCtx = MsgInitializer.initializeMessage(ackMsgCtx);
    ackRMMsgCtx.setRMNamespaceValue(rmMsgCtx.getRMNamespaceValue());
       
    ackMsgCtx.setTo(acksTo);
       
    ackRMMsgCtx.setRMNamespaceValue(rmMsgCtx.getRMNamespaceValue());
   
    if (ackMsgCtx.getMessageID()==null)
      ackMsgCtx.setMessageID(SandeshaUtil.getUUID());
   
    //adding the SOAP Envelope
    SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil.getSOAPVersion(msgContext.getEnvelope()));
    SOAPEnvelope envelope = factory.getDefaultEnvelope();
    try {
      ackMsgCtx.setEnvelope(envelope);
    } catch (AxisFault e3) {
      throw new SandeshaException(e3.getMessage());
    }

    ackMsgCtx.setReplyTo(msgContext.getTo());
    RMMsgCreator.addAckMessage(ackRMMsgCtx, sequenceId, rmdBean);
   
    //this is not a client generated message. So set serverSide to true.
    ackMsgCtx.setServerSide(true);

    if (acksTo.hasAnonymousAddress()) {
      //If acksTo is anonymous we will be sending the ack here it self. Transport will use what ever mechanism to send the
      //message. (for e.g. HTTP will use the back channel)

      // setting "response written" since acksto is anonymous
     
      //adding an OperationContext if one is not available. (for e.g. If we are in the SandeshaGlobalInHandler)
      if (rmMsgCtx.getMessageContext().getOperationContext() == null) {
        // operation context will be null when doing in a GLOBAL
        // handler.
       
        ServiceContext serviceCtx = msgContext.getServiceContext();
        OperationContext opCtx =  OperationContextFactory.createOperationContext(ackOperation.getAxisSpecificMEPConstant(), ackOperation, serviceCtx);

        rmMsgCtx.getMessageContext().setOperationContext(opCtx);
      }
     
      try {
        AxisEngine.send(ackMsgCtx);
        TransportUtils.setResponseWritten(ackMsgCtx, true);
      } catch (AxisFault e1) {
        throw new SandeshaException(e1.getMessage());
      }

    } else {
      //If AcksTo is non-anonymous we will be adding a senderBean entry here. The sender is responsible
      //for sending it out.
     
      SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();

      String key = SandeshaUtil.getUUID();

      // dumping to the storage will be done be Sandesha2 Transport Sender
      // storageManager.storeMessageContext(key,ackMsgCtx);

      SenderBean ackBean = new SenderBean();
      ackBean.setMessageContextRefKey(key);
      ackBean.setMessageID(ackMsgCtx.getMessageID());
     
      //acks are sent only once.
      ackBean.setReSend(false);
     
      ackBean.setSequenceID(sequenceId);
     
      EndpointReference to = ackMsgCtx.getTo();
      if (to!=null)
        ackBean.setToAddress(to.getAddress());

      // this will be set to true in the sender.
      ackBean.setSend(true);

      ackMsgCtx.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);
View Full Code Here


   
    SenderBeanMgr retransmitterBeanMgr = storageManager.getSenderBeanMgr();

    // If this message is going to an anonymous address, and the inbound sequence has
    // anonymous acksTo, then we add in an ack for the inbound sequence.
    EndpointReference target = rmMessageContext.getTo();
    if(target == null || target.hasAnonymousAddress()) {
      if(target != null && SandeshaUtil.isWSRMAnonymous(target.getAddress())) {
        // Search for any sequences that have an acksTo that matches this target, and add an ack
        // for each of them.
        RMDBean findBean = new RMDBean();
        findBean.setAcksToEPR(target.getAddress());
        findBean.setTerminated(false);
        Collection rmdBeans = storageManager.getRMDBeanMgr().find(findBean);
        Iterator sequences = rmdBeans.iterator();
        while(sequences.hasNext()) {
          RMDBean sequence = (RMDBean) sequences.next();
          if (sequence.getHighestInMessageNumber() > 0) {
            if(log.isDebugEnabled()) log.debug("Piggybacking ack for sequence: " + sequence.getSequenceID());
            RMMsgCreator.addAckMessage(rmMessageContext, sequence.getSequenceID(), sequence);
          }
        }
       
      } else {
        // We have no good indicator of the identity of the destination, so the only sequence
        // we can ack is the inbound one that caused us to create this response.
        String inboundSequence = (String) rmMessageContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID);
        if(inboundSequence != null) {
          RMDBean inboundBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, inboundSequence);
          if(inboundBean != null && !inboundBean.isTerminated()) {
            String acksTo = inboundBean.getAcksToEPR();
            EndpointReference acksToEPR = new EndpointReference(acksTo);
           
            if(acksTo == null || acksToEPR.hasAnonymousAddress()) {
              if(log.isDebugEnabled()) log.debug("Piggybacking ack for inbound sequence: " + inboundSequence);
              RMMsgCreator.addAckMessage(rmMessageContext, inboundSequence, inboundBean);
            }
          }
        }
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Enter: AcknowledgementManager::generateAckMessage " + rmdBean);

    MessageContext referenceMsg = referenceRMMessage.getMessageContext();

    EndpointReference acksTo = new EndpointReference(rmdBean.getAcksToEPR());

    if (acksTo.getAddress() == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));

    AxisOperation ackOperation = SpecSpecificConstants.getWSRMOperation(
        Sandesha2Constants.MessageTypes.ACK,
        rmdBean.getRMVersion(),
View Full Code Here

    SenderBean ackBean = new SenderBean();
    ackBean.setMessageContextRefKey(key);
    ackBean.setMessageID(ackMsgContext.getMessageID());
    ackBean.setReSend(false);
    ackBean.setSequenceID(sequenceId);
    EndpointReference to = ackMsgContext.getTo();
    if (to!=null)
      ackBean.setToAddress(to.getAddress());

    ackBean.setSend(true);
    ackMsgContext.setProperty(Sandesha2Constants.QUALIFIED_FOR_SENDING, Sandesha2Constants.VALUE_FALSE);

    ackBean.setMessageType(Sandesha2Constants.MessageTypes.ACK);
View Full Code Here

    String axis2_xml = "target" + File.separator + "repos" + File.separator + "client" + File.separator + "client_axis2.xml";
   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);
    Options clientOptions = new Options ();
   
    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(Configuration.TRANSPORT_URL,transportTo);
   
//    String sequenceKey = SandeshaUtil.getUUID();
//    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
View Full Code Here

      Options clientOptions = new Options ();
      clientOptions.setAction(pingAction);
      clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
       clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,
           Sandesha2Constants.SPEC_VERSIONS.v1_1);
      clientOptions.setTo(new EndpointReference (to));
     
      String sequenceKey = "some_sequence_key";
      clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
     
      ServiceClient serviceClient = new ServiceClient (configContext,null);
View Full Code Here

    Options clientOptions = new Options ();
    clientOptions.setAction(pingAction);
    clientOptions.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
     clientOptions.setProperty(SandeshaClientConstants.RM_SPEC_VERSION,
         Sandesha2Constants.SPEC_VERSIONS.v1_1);
    clientOptions.setTo(new EndpointReference (to));
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   
    String acksTo = serviceClient.getMyEPR(Constants.TRANSPORT_HTTP).getAddress();
    clientOptions.setProperty(SandeshaClientConstants.AcksTo,acksTo);
View Full Code Here

   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    Options clientOptions = new Options ();

    clientOptions.setTo(new EndpointReference (to));
    clientOptions.setProperty(Configuration.TRANSPORT_URL,transportTo);
       
    ServiceClient serviceClient = new ServiceClient (configContext,null);
   
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);
View Full Code Here

   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);   
   
    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));

    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
View Full Code Here

   
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repoPath,axis2_xml);

    Options clientOptions = new Options ();
    clientOptions.setAction(echoAction);
    clientOptions.setTo(new EndpointReference (to));
   
    String sequenceKey = SandeshaUtil.getUUID();
    clientOptions.setProperty(SandeshaClientConstants.SEQUENCE_KEY,sequenceKey);
   
    ServiceClient serviceClient = new ServiceClient (configContext,null);
View Full Code Here

TOP

Related Classes of org.apache.axis2.addressing.EndpointReference

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.