Examples of MakeConnection


Examples of gui.action.MakeConnection

    loginLabel = new JLabel(this.propertiesMgr.getValue("loginLabel"),
                            JLabel.RIGHT);
    passwordLabel = new JLabel(this.propertiesMgr.getValue("passwordLabel"),
                               JLabel.RIGHT);
    connectButton = new JButton(this.propertiesMgr.getValue("connectButton"));
    connectButton.addActionListener(new MakeConnection(this, this.propertiesMgr));

    //Init the list of protocol available
    //ConnectionInfos. = ProtocolManager.getAvailableProtocols();
    Traces.printTraces("List of availables protocols : ");
    for (int i=0; i<ConnectionInfos.protocols.length; i++) {
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

        Sandesha2Constants.MessageParts.ACK_REQUEST);
    CloseSequence closeSequence = (CloseSequence) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
    CloseSequenceResponse closeSequenceResponse = (CloseSequenceResponse) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.CLOSE_SEQUENCE_RESPONSE);
    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.MAKE_CONNECTION);

    // Setting message type.
    if (createSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    } else if (createSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
      sequenceID = createSequenceResponse.getIdentifier().getIdentifier();
    } else if (terminateSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
      sequenceID = terminateSequence.getIdentifier().getIdentifier();
    } else if (terminateSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
      sequenceID = terminateSequenceResponse.getIdentifier().getIdentifier();
    } else if (rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE) != null) {
     
      Sequence seq = (Sequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      LastMessage lastMessage = seq.getLastMessage();
      SOAPEnvelope envelope = rmMsgCtx.getSOAPEnvelope();
     
      if (lastMessage!=null && envelope.getBody().getFirstOMChild()==null) {
        //the message is an empty body last message
        rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.LAST_MESSAGE);
      }else
        rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
     
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (sequenceAcknowledgementsIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
     
      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!sequenceAcknowledgementsIter.hasNext())
        sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequestedIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!ackRequestedIter.hasNext())
        sequenceID = ackRequest.getIdentifier().getIdentifier();
    } else if (closeSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
      sequenceID = closeSequenceResponse.getIdentifier().getIdentifier();
    } else if (makeConnection != null){
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
      if (makeConnection.getIdentifier()!=null) {
        sequenceID = makeConnection.getIdentifier().getIdentifier();
      } else if (makeConnection.getAddress()!=null){
        //TODO get sequenceId based on the anonymous address.
      } else {
        throw new SandeshaException (
            "Invalid MakeConnection message. Either Address or Identifier must be present");
      }
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

   * This is processed using a SenderWorker.
   */
  public boolean processInMessage(RMMsgContext rmMsgCtx, Transaction transaction) throws AxisFault {
    if(log.isDebugEnabled()) log.debug("Enter: MakeConnectionProcessor::processInMessage " + rmMsgCtx.getSOAPEnvelope().getBody());

    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.MAKE_CONNECTION);
    Address address = makeConnection.getAddress();
    Identifier identifier = makeConnection.getIdentifier();
   
    ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
   
    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();
   
    //selecting the set of SenderBeans that suit the given criteria.
    SenderBean findSenderBean = new SenderBean ();
    findSenderBean.setSend(true);
    findSenderBean.setTransportAvailable(false);
   
    if (address!=null)
      findSenderBean.setToAddress(address.getAddress());
   
    if (identifier!=null)
      findSenderBean.setSequenceID(identifier.getIdentifier());
   
    // Set the time to send field to be now
    findSenderBean.setTimeToSend(System.currentTimeMillis());
   
    //finding the beans that go with the criteria of the passed SenderBean
    //The reSend flag is ignored for this selection, so there is no need to
    //set it.
    Collection collection = senderBeanMgr.find(findSenderBean);
   
    //removing beans that does not pass the resend test
    for (Iterator it=collection.iterator();it.hasNext();) {
      SenderBean bean = (SenderBean) it.next();
      if (!bean.isReSend() && bean.getSentCount()>0)
        it.remove();
    }
   
    //selecting a bean to send RANDOMLY. TODO- Should use a better mechanism.
    int size = collection.size();
    int itemToPick=-1;
   
    boolean pending = false;
    if (size>0) {
      Random random = new Random ();
      itemToPick = random.nextInt(size);
    }

    if (size>1)
      pending = true//there are more than one message to be delivered using the makeConnection.
               //So the MessagePending header should have value true;
   
    Iterator it = collection.iterator();
   
    SenderBean senderBean = null;
    for (int item=0;item<size;item++) {
        senderBean = (SenderBean) it.next();
      if (item==itemToPick)
        break;
    }

    if (senderBean==null) {
      if(log.isDebugEnabled()) log.debug("Exit: MakeConnectionProcessor::processInMessage, no matching message found");
      return false;
    }
   
    replyToPoll(rmMsgCtx, senderBean, storageManager, pending, makeConnection.getNamespaceValue(), transaction);
   
    if(log.isDebugEnabled()) log.debug("Exit: MakeConnectionProcessor::processInMessage");
    return false;
  }
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

        Sandesha2Constants.MessageParts.ACK_REQUEST);
    CloseSequence closeSequence = (CloseSequence) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
    CloseSequenceResponse closeSequenceResponse = (CloseSequenceResponse) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.CLOSE_SEQUENCE_RESPONSE);
    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.MAKE_CONNECTION);

    // Setting message type.
    if (createSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    } else if (createSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
      sequenceID = createSequenceResponse.getIdentifier().getIdentifier();
    } else if (terminateSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
      sequenceID = terminateSequence.getIdentifier().getIdentifier();
    } else if (terminateSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
      sequenceID = terminateSequenceResponse.getIdentifier().getIdentifier();
    } else if (rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE) != null) {
     
      Sequence seq = (Sequence) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
      LastMessage lastMessage = seq.getLastMessage();
      SOAPEnvelope envelope = rmMsgCtx.getSOAPEnvelope();
     
      if (lastMessage!=null && envelope.getBody().getFirstOMChild()==null) {
        //the message is an empty body last message
        rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.LAST_MESSAGE);
      }else
        rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
     
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (sequenceAcknowledgementsIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
     
      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!sequenceAcknowledgementsIter.hasNext())
        sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequestedIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!ackRequestedIter.hasNext())
        sequenceID = ackRequest.getIdentifier().getIdentifier();
    } else if (closeSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
      sequenceID = closeSequenceResponse.getIdentifier().getIdentifier();
    } else if (makeConnection != null){
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
      if (makeConnection.getIdentifier()!=null) {
        sequenceID = makeConnection.getIdentifier().getIdentifier();
      } else if (makeConnection.getAddress()!=null){
        //TODO get sequenceId based on the anonymous address.
      } else {
        throw new SandeshaException (
            "Invalid MakeConnection message. Either Address or Identifier must be present");
      }
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

        referenceMessage.getAxisService());

    MessageContext makeConnectionMessageCtx = SandeshaUtil.createNewRelatedMessageContext(referenceRMMessage,makeConnectionOperation);
    RMMsgContext makeConnectionRMMessageCtx = MsgInitializer.initializeMessage(makeConnectionMessageCtx);
   
    MakeConnection makeConnection = new MakeConnection (Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
    if (makeConnectionSeqId!=null) {
      Identifier identifier = new Identifier (rmNamespaceValue);
      identifier.setIndentifer(makeConnectionSeqId);
      makeConnection.setIdentifier(identifier);
    }
   
    if (makeConnectionAnonURI!=null) {
      Address address = new Address (Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
      address.setAddress (makeConnectionAnonURI);
      makeConnection.setAddress(address);
    }
   
    // Setting the addressing properties. As this is a poll we must send it to an non-anon
    // EPR, so we check both To and ReplyTo from the reference message
    EndpointReference epr = referenceMessage.getTo();
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

   * This is processed using a SenderWorker.
   */
  public boolean processInMessage(RMMsgContext rmMsgCtx, Transaction transaction) throws AxisFault {
    if(log.isDebugEnabled()) log.debug("Enter: MakeConnectionProcessor::processInMessage " + rmMsgCtx.getSOAPEnvelope().getBody());

    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.MAKE_CONNECTION);
    Address address = makeConnection.getAddress();
    Identifier identifier = makeConnection.getIdentifier();
   
    ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
   
    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();
   
    //selecting the set of SenderBeans that suit the given criteria.
    SenderBean findSenderBean = new SenderBean ();
    findSenderBean.setSend(true);
    findSenderBean.setTransportAvailable(false);
   
    if (address!=null)
      findSenderBean.setToAddress(address.getAddress());
   
    if (identifier!=null)
      findSenderBean.setSequenceID(identifier.getIdentifier());
   
    // Set the time to send field to be now
    findSenderBean.setTimeToSend(System.currentTimeMillis());
   
    //finding the beans that go with the criteria of the passed SenderBean
    //The reSend flag is ignored for this selection, so there is no need to
    //set it.
    Collection collection = senderBeanMgr.find(findSenderBean);
   
    //removing beans that does not pass the resend test
    for (Iterator it=collection.iterator();it.hasNext();) {
      SenderBean bean = (SenderBean) it.next();
      if (!bean.isReSend() && bean.getSentCount()>0)
        it.remove();
    }
   
    //selecting a bean to send RANDOMLY. TODO- Should use a better mechanism.
    int size = collection.size();
    int itemToPick=-1;
   
    boolean pending = false;
    if (size>0) {
      Random random = new Random ();
      itemToPick = random.nextInt(size);
    }

    if (size>1)
      pending = true//there are more than one message to be delivered using the makeConnection.
               //So the MessagePending header should have value true;
   
    Iterator it = collection.iterator();
   
    SenderBean senderBean = null;
    for (int item=0;item<size;item++) {
        senderBean = (SenderBean) it.next();
      if (item==itemToPick)
        break;
    }

    if (senderBean==null) {
      if(log.isDebugEnabled()) log.debug("Exit: MakeConnectionProcessor::processInMessage, no matching message found");
      return false;
    }
   
    replyToPoll(rmMsgCtx, senderBean, storageManager, pending, makeConnection.getNamespaceValue(), transaction);
   
    if(log.isDebugEnabled()) log.debug("Exit: MakeConnectionProcessor::processInMessage");
    return false;
  }
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

        WSDL20_2004Constants.MEP_CONSTANT_OUT_IN);
   
    MessageContext makeConnectionMessageCtx = SandeshaUtil.createNewRelatedMessageContext(referenceRMMessage,makeConnectionOperation);
    RMMsgContext makeConnectionRMMessageCtx = MsgInitializer.initializeMessage(makeConnectionMessageCtx);
   
    MakeConnection makeConnection = new MakeConnection (rmNamespaceValue);
    if (makeConnectionSeqId!=null) {
      Identifier identifier = new Identifier (rmNamespaceValue);
      identifier.setIndentifer(makeConnectionSeqId);
      makeConnection.setIdentifier(identifier);
    }
   
    if (makeConnectionAnonURI!=null) {
      Address address = new Address (rmNamespaceValue);
      address.setAddress (makeConnectionAnonURI);
      makeConnection.setAddress(address);
    }
   
    //setting the addressing properties
    makeConnectionMessageCtx.setTo(new EndpointReference (referenceMessage.getTo().getAddress()));
    makeConnectionMessageCtx.setWSAAction(SpecSpecificConstants.getMakeConnectionAction(rmVersion));
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

   * A message is selected by the set of SenderBeans that are waiting to be sent.
   * This is processed using a SenderWorker.
   */
  public boolean processInMessage(RMMsgContext rmMsgCtx) throws AxisFault {
   
    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.MAKE_CONNECTION);
    Address address = makeConnection.getAddress();
    Identifier identifier = makeConnection.getIdentifier();
   
    ConfigurationContext configurationContext = rmMsgCtx.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
   
    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

        Sandesha2Constants.MessageParts.ACK_REQUEST);
    CloseSequence closeSequence = (CloseSequence) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.CLOSE_SEQUENCE);
    CloseSequenceResponse closeSequenceResponse = (CloseSequenceResponse) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.CLOSE_SEQUENCE_RESPONSE);
    MakeConnection makeConnection = (MakeConnection) rmMsgCtx.getMessagePart(
        Sandesha2Constants.MessageParts.MAKE_CONNECTION);

    // Setting message type.
    if (createSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ);
    } else if (createSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE);
      sequenceID = createSequenceResponse.getIdentifier().getIdentifier();
    } else if (terminateSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ);
      sequenceID = terminateSequence.getIdentifier().getIdentifier();
    } else if (terminateSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.TERMINATE_SEQ_RESPONSE);
      sequenceID = terminateSequenceResponse.getIdentifier().getIdentifier();
    } else if (rmMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE) != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.APPLICATION);
      sequenceID = sequence.getIdentifier().getIdentifier();
    } else if (sequenceAcknowledgementsIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK);
      SequenceAcknowledgement sequenceAcknowledgement = (SequenceAcknowledgement) sequenceAcknowledgementsIter.next();
     
      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!sequenceAcknowledgementsIter.hasNext())
        sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
    } else if (ackRequestedIter.hasNext()) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
      AckRequested ackRequest = (AckRequested) ackRequestedIter.next();

      //if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
      if (!ackRequestedIter.hasNext())
        sequenceID = ackRequest.getIdentifier().getIdentifier();
    } else if (closeSequence != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
      sequenceID = closeSequence.getIdentifier().getIdentifier();
    } else if (closeSequenceResponse != null) {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);
      sequenceID = closeSequenceResponse.getIdentifier().getIdentifier();
    } else if (makeConnection != null){ {
      rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.MAKE_CONNECTION_MSG);
      if (makeConnection.getIdentifier()!=null) {
        sequenceID = makeConnection.getIdentifier().getIdentifier();
      } else if (makeConnection.getAddress()!=null){
        //TODO get sequenceId based on the anonymous address.
      } else {
        throw new SandeshaException (
            "Invalid MakeConnection message. Either Address or Identifier must be present");
      }
View Full Code Here

Examples of org.apache.sandesha2.wsrm.MakeConnection

        referenceMessage.getAxisService());

    MessageContext makeConnectionMessageCtx = SandeshaUtil.createNewRelatedMessageContext(referenceRMMessage,makeConnectionOperation);
    RMMsgContext makeConnectionRMMessageCtx = MsgInitializer.initializeMessage(makeConnectionMessageCtx);
   
    MakeConnection makeConnection = new MakeConnection (Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
    if (makeConnectionSeqId!=null) {
      Identifier identifier = new Identifier (rmNamespaceValue);
      identifier.setIndentifer(makeConnectionSeqId);
      makeConnection.setIdentifier(identifier);
    }
   
    if (makeConnectionAnonURI!=null) {
      Address address = new Address (Sandesha2Constants.SPEC_2007_02.MC_NS_URI);
      address.setAddress (makeConnectionAnonURI);
      makeConnection.setAddress(address);
    }
   
    // Setting the addressing properties. As this is a poll we must send it to an non-anon
    // EPR, so we check both To and ReplyTo from the reference message
    EndpointReference epr = referenceMessage.getTo();
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.