Package org.apache.sandesha2.storage.beans

Examples of org.apache.sandesha2.storage.beans.SequencePropertyBean


            .getSequencePropretyBeanMgr();

        Transaction preInvocationTransaction = storageManager.getTransaction();
       
        //Getting the incomingSequenceIdList
        SequencePropertyBean allSequencesBean = (SequencePropertyBean) sequencePropMgr
            .retrieve(
                Sandesha2Constants.SequenceProperties.ALL_SEQUENCES,
                Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
        if (allSequencesBean == null)
          continue;

        ArrayList allSequencesList = SandeshaUtil.getArrayListFromString (allSequencesBean
            .getValue());
       
        preInvocationTransaction.commit();
       
        Iterator allSequencesItr = allSequencesList.iterator();

        currentIteration: while (allSequencesItr.hasNext()) {

          String sequenceId = (String) allSequencesItr.next();
         
          Transaction invocationTransaction = storageManager.getTransaction();   //Transaction based invocation
         
          NextMsgBean nextMsgBean = nextMsgMgr.retrieve(sequenceId);
          if (nextMsgBean == null) {

            String message = "Next message not set correctly. Removing invalid entry.";
            log.debug(message);
            allSequencesItr.remove();
           
            //cleaning the invalid data of the all sequences.
            allSequencesBean.setValue(allSequencesList.toString());
            sequencePropMgr.update(allSequencesBean)
           
            throw new SandeshaException (message);
          }
View Full Code Here


    ConfigurationContext context = terminateSeqMsg.getConfigurationContext();
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context);
    SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();

    Transaction terminateReceivedTransaction = storageManager.getTransaction();
    SequencePropertyBean terminateReceivedBean = new SequencePropertyBean ();
    terminateReceivedBean.setSequenceID(sequenceId);
    terminateReceivedBean.setName(Sandesha2Constants.SequenceProperties.TERMINATE_RECEIVED);
    terminateReceivedBean.setValue("true");
   
    sequencePropertyBeanMgr.insert(terminateReceivedBean);
   
    //add the terminate sequence response if required.
    if (SpecSpecificConstants.isTerminateSequenceResponseRequired (terminateSeqRMMsg.getRMSpecVersion()))
      addTerminateSequenceResponse (terminateSeqRMMsg,sequenceId);
   
    setUpHighestMsgNumbers(context,storageManager,sequenceId,terminateSeqRMMsg);
   
    terminateReceivedTransaction.commit();
   
    Transaction terminateTransaction = storageManager.getTransaction();
    TerminateManager.cleanReceivingSideOnTerminateMessage(context,sequenceId);
   
   
    SequencePropertyBean terminatedBean = new SequencePropertyBean (
             sequenceId,Sandesha2Constants.SequenceProperties.SEQUENCE_TERMINATED,Sandesha2Constants.VALUE_TRUE);
   
    sequencePropertyBeanMgr.insert(terminatedBean);
   
   
View Full Code Here

      if (highestInMsgNo==0) {
        addResponseSideTerminate=false;
      } else {
       
        //setting the last in message property
        SequencePropertyBean lastInMsgBean = new SequencePropertyBean (
            sequenceID,Sandesha2Constants.SequenceProperties.LAST_IN_MESSAGE_NO,highestImMsgNumberStr);
        seqPropMgr.insert(lastInMsgBean);
       
        MessageContext highestInMsg = storageManager.retrieveMessageContext(highestImMsgKey,configCtx);
        MessageContext highestOutMessage = highestInMsg.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_OUT_VALUE);
       
        if (highestOutMessage!=null) {
          RMMsgContext highestOutRMMsg = MsgInitializer.initializeMessage(highestOutMessage);
          Sequence seqPartOfOutMsg = (Sequence) highestOutRMMsg.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
       
          if (seqPartOfOutMsg!=null) {
           
            //response message of the last in message can be considered as the last out message.
            highestOutMsgNo = seqPartOfOutMsg.getMessageNumber().getMessageNumber();
            SequencePropertyBean highestOutMsgBean = new SequencePropertyBean (
                responseSideInternalSequenceID,
                Sandesha2Constants.SequenceProperties.LAST_OUT_MESSAGE_NO,
                new Long(highestOutMsgNo).toString() );
         
            seqPropMgr.insert(highestOutMsgBean);
View Full Code Here

    SenderBeanMgr retramsmitterMgr = storageManager
        .getRetransmitterBeanMgr();

    retramsmitterMgr.insert(terminateBean);
   
    SequencePropertyBean terminateAdded = new SequencePropertyBean();
    terminateAdded.setName(Sandesha2Constants.SequenceProperties.TERMINATE_ADDED);
    terminateAdded.setSequenceID(outSequenceID);
    terminateAdded.setValue("true");

   
    seqPropMgr.insert(terminateAdded);
   
    //This should be dumped to the storage by the sender
View Full Code Here

       
          //Setting sequence properties for the outgoing sequence.
          //Only will be used by the server side response path. Will be wasted properties for the client side.
       
          //setting the out_sequence_id
          SequencePropertyBean outSequenceBean = new SequencePropertyBean();
          outSequenceBean.setName(Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
          outSequenceBean.setValue(offeredSequenceID);
          outSequenceBean.setSequenceID(outgoingSideInternalSequenceID);
          seqPropMgr.insert(outSequenceBean);

          //setting the internal_sequence_id
          SequencePropertyBean internalSequenceBean = new SequencePropertyBean();
          internalSequenceBean.setName(Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
          internalSequenceBean.setSequenceID(offeredSequenceID);
          internalSequenceBean.setValue(outgoingSideInternalSequenceID);
          seqPropMgr.insert(internalSequenceBean);
        } else {
          //removing the accept part.
          createSeqResPart.setAccept(null);
          createSeqResponse.addSOAPEnvelope();
        }
      }

      EndpointReference acksTo = createSeqPart.getAcksTo().getAddress().getEpr();
      if (acksTo == null || acksTo.getAddress() == null
          || acksTo.getAddress() == "") {
        String message = "Acks to not present in the create sequence message";
        log.debug(message);
        throw new AxisFault(message);
      }

      SequencePropertyBean acksToBean = new SequencePropertyBean(
          newSequenceId, Sandesha2Constants.SequenceProperties.ACKS_TO_EPR,acksTo.getAddress());

      seqPropMgr.insert(acksToBean);
     
      outMessage.setResponseWritten(true);

      //commiting tr. before sending the response msg.
      createSequenceTransaction.commit();
     
      Transaction updateLastActivatedTransaction = storageManager.getTransaction();
      SequenceManager.updateLastActivatedTime(newSequenceId,createSeqRMMsg.getMessageContext().getConfigurationContext());
      updateLastActivatedTransaction.commit();
     
      AxisEngine engine = new AxisEngine(context);
      engine.send(outMessage);
     
      SequencePropertyBean toBean = seqPropMgr.retrieve(newSequenceId,Sandesha2Constants.SequenceProperties.TO_EPR);
      if (toBean==null) {
        String message = "Internal Error: wsa:To value is not set";
        log.debug(message);
        throw new SandeshaException (message);
      }
     
      EndpointReference toEPR = new EndpointReference (toBean.getValue());
     
      String addressingNamespaceURI = SandeshaUtil.getSequenceProperty(newSequenceId,Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE,context);
      String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceURI);
     
      if (anonymousURI.equals(toEPR.getAddress())) {
View Full Code Here

    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx);
   
    Transaction closeSequenceTransaction = storageManager.getTransaction();
   
    SequencePropertyBeanMgr sequencePropMgr = storageManager.getSequencePropretyBeanMgr();
    SequencePropertyBean sequenceClosedBean = new SequencePropertyBean ();
    sequenceClosedBean.setSequenceID(sequenceID);
    sequenceClosedBean.setName(Sandesha2Constants.SequenceProperties.SEQUENCE_CLOSED);
    sequenceClosedBean.setValue(Sandesha2Constants.VALUE_TRUE);
   
    sequencePropMgr.insert(sequenceClosedBean);
   
    RMMsgContext ackRMMsgCtx = AcknowledgementManager.generateAckMessage(rmMsgCtx,sequenceID);
   
View Full Code Here

  }

  private static void removeReceivingSideProperties (ConfigurationContext configContext, String sequenceID) throws SandeshaException {
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext);
    SequencePropertyBeanMgr sequencePropertyBeanMgr = storageManager.getSequencePropretyBeanMgr();
    SequencePropertyBean allSequenceBean = sequencePropertyBeanMgr.retrieve(Sandesha2Constants.SequenceProperties.ALL_SEQUENCES,Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
   
    if (allSequenceBean!=null) {
      log.debug("AllSequence bean is null");
     
      ArrayList allSequenceList = SandeshaUtil.getArrayListFromString(allSequenceBean.getValue());
      allSequenceList.remove(sequenceID);
   
      //updating
      allSequenceBean.setValue(allSequenceList.toString());
      sequencePropertyBeanMgr.update(allSequenceBean);
    }
  }
View Full Code Here

   
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configContext);
   
    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
   
    SequencePropertyBean seqTerminatedBean = new SequencePropertyBean (internalSequenceID,Sandesha2Constants.SequenceProperties.SEQUENCE_TERMINATED,Sandesha2Constants.VALUE_TRUE);
    seqPropMgr.insert(seqTerminatedBean);
   
    cleanSendingSideData(configContext,internalSequenceID,serverSide);
  }
View Full Code Here

   
    if (addEntryWithSequenceID && sequenceID!=null) {
      //this value cannot be completely deleted since this data will be needed by SequenceReports
      //so saving it with the sequenceID value being the out sequenceID.
     
      SequencePropertyBean newBean = new SequencePropertyBean ();
      newBean.setSequenceID(sequenceID);
      newBean.setName(propertyBean.getName());
      newBean.setValue(propertyBean.getValue());

      seqPropMgr.insert(newBean);
      //TODO amazingly this property does not seem to get deleted without following - in the hibernate impl
      //(even though the lines efter current methodcall do this).
      seqPropMgr.delete (propertyBean.getSequenceID(),propertyBean.getName());
View Full Code Here

 
  public static void timeOutSendingSideSequence (ConfigurationContext context,String internalSequenceID, boolean serverside) throws SandeshaException {
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context);
   
    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropretyBeanMgr();
    SequencePropertyBean seqTerminatedBean = new SequencePropertyBean (internalSequenceID,Sandesha2Constants.SequenceProperties.SEQUENCE_TIMED_OUT,Sandesha2Constants.VALUE_TRUE);
    seqPropMgr.insert(seqTerminatedBean);
   
    cleanSendingSideData(context,internalSequenceID,serverside);
  }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.storage.beans.SequencePropertyBean

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.