Examples of CreateSequence


Examples of org.apache.sandesha2.wsrm.CreateSequence

      MessageContext messageContext) throws SandeshaException {

    RMMsgContext rmMsgCtx = MsgInitializer
        .initializeMessage(messageContext);

    CreateSequence createSequence = (CreateSequence) rmMsgCtx
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequence == null)
      throw new SandeshaException(
          "CreateSequence message does not have a CreateSequence part");

    ConfigurationContext context = messageContext.getConfigurationContext();
    StorageManager storageManager = (StorageManager) SandeshaUtil
        .getSandeshaStorageManager(context);
    if (storageManager == null)
      throw new SandeshaException("Storage Manager is null");

    boolean refuseSequence = false;
    String reason = "";

    SequenceOffer offer = createSequence.getSequenceOffer();
    if (offer != null) {
      String offeredSequenceId = offer.getIdentifer().getIdentifier();
      if (offeredSequenceId == null || "".equals(offeredSequenceId)) {
        refuseSequence = true;
        reason = "Offered sequenceId is invalid";
View Full Code Here

Examples of org.apache.sandesha2.wsrm.CreateSequence

      faultMsgContext.setAxisOperation(operation);
      faultMsgContext.setOperationContext(operationContext);

      String acksToStr = null;
      if (referenceRMMsgContext.getMessageType() == Sandesha2Constants.MessageTypes.CREATE_SEQ) {
        CreateSequence createSequence = (CreateSequence) referenceRMMsgContext
            .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
        acksToStr = createSequence.getAcksTo().getAddress().getEpr()
            .getAddress();
      } else {
        SequencePropertyBeanMgr seqPropMgr = storageManager
            .getSequencePropretyBeanMgr();
        String sequenceId = data.getSequenceId();
View Full Code Here

Examples of org.apache.sandesha2.wsrm.CreateSequence

    EndpointReference replyTo = createSequenceMsg.getReplyTo();
    if (replyTo == null)
      throw new AxisFault("ReplyTo is null");

    CreateSequence createSequence = (CreateSequence) createSequenceMsg
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequence == null)
      throw new AxisFault("Create Sequence Part is null");

    EndpointReference acksTo = createSequence.getAcksTo().getAddress()
        .getEpr();

    if (acksTo == null)
      throw new AxisFault("AcksTo is null");
View Full Code Here

Examples of org.apache.sandesha2.wsrm.CreateSequence

    MessageContext applicationMsg = applicationRMMsg.getMessageContext();
    if (applicationMsg == null)
      throw new SandeshaException("Message context is null");
    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(
        applicationRMMsg, internalSequenceId, acksTo);
    CreateSequence createSequencePart = (CreateSequence) createSeqRMMessage
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequencePart == null)
      throw new SandeshaException(
          "Create Sequence part is null for a CreateSequence message");

    SequenceOffer offer = createSequencePart.getSequenceOffer();
    if (offer != null) {
      //Offer processing
      String offeredSequenceId = offer.getIdentifer().getIdentifier();
      SequencePropertyBean msgsBean = new SequencePropertyBean();
      msgsBean.setSequenceId(offeredSequenceId);
View Full Code Here

Examples of org.apache.sandesha2.wsrm.CreateSequence

    // generating a new create sequeuce message.
    RMMsgContext createSeqRMMessage = RMMsgCreator.createCreateSeqMsg(referenceRMMsg, sequencePropertyKey, acksTo,
        storageManager);

    createSeqRMMessage.setFlow(MessageContext.OUT_FLOW);
    CreateSequence createSequencePart = (CreateSequence) createSeqRMMessage
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);

    SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
    RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
    SenderBeanMgr senderBeanMgr = storageManager.getSenderBeanMgr();

    SequenceOffer offer = createSequencePart.getSequenceOffer();
    if (offer != null) {
      String offeredSequenceId = offer.getIdentifer().getIdentifier();

      SequencePropertyBean offeredSequenceBean = new SequencePropertyBean();
      offeredSequenceBean.setName(Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE);
      offeredSequenceBean.setSequencePropertyKey(sequencePropertyKey);
      offeredSequenceBean.setValue(offeredSequenceId);

      seqPropMgr.insert(offeredSequenceBean);
    }

    MessageContext createSeqMsg = createSeqRMMessage.getMessageContext();
    createSeqMsg.setRelationships(null); // create seq msg does not
                        // relateTo anything

    String createSequenceMessageStoreKey = SandeshaUtil.getUUID(); // the key taht will be used to store
                                     //the create sequence message.
   
    RMSBean rmsBean = new RMSBean();
    rmsBean.setInternalSequenceID(internalSequenceId);
    rmsBean.setCreateSeqMsgID(createSeqMsg.getMessageID());
    rmsBean.setCreateSequenceMsgStoreKey(createSequenceMessageStoreKey);
   
    //cloning the message and storing it as a reference.
    MessageContext clonedMessage = SandeshaUtil.cloneMessageContext(createSeqMsg);
    String clonedMsgStoreKey = SandeshaUtil.getUUID();
    storageManager.storeMessageContext(clonedMsgStoreKey, clonedMessage);
    rmsBean.setReferenceMessageStoreKey(clonedMsgStoreKey);
   
   
    //TODO set the replyTo of CreateSeq (and others) to Anymomous if Application Msgs hv it as Anonymous.
   
//    //checking weather the sequence is in polling mode.
//    boolean pollingMode = false;
//    EndpointReference replyTo = applicationRMMsg.getReplyTo();
//    if (replyTo!=null && SandeshaUtil.isWSRMAnonymousReplyTo(replyTo.getAddress()))
//      pollingMode = true;
//    else if (replyTo!=null && offer!=null &&
//        (AddressingConstants.Final.WSA_ANONYMOUS_URL.equals(replyTo.getAddress()) ||
//            AddressingConstants.Submission.WSA_ANONYMOUS_URL.equals(replyTo.getAddress())))
//      pollingMode = true;
//   
//    createSeqBean.setPollingMode(pollingMode);
   
//    //if PollingMode is true, starting the pollingmanager.
//    if (pollingMode)
//      SandeshaUtil.startPollingManager(configCtx);
   
    SecurityToken token = (SecurityToken) createSeqRMMessage.getProperty(Sandesha2Constants.SequenceProperties.SECURITY_TOKEN);
    if(token != null) {
      SecurityManager secManager = SandeshaUtil.getSecurityManager(configCtx);
      rmsBean.setSecurityTokenData(secManager.getTokenRecoveryData(token));
     
      // If we are using token based security, and the 1.1 spec level, then we
      // should introduce a UsesSequenceSTR header into the message.
      if(createSequencePart.getNamespaceValue().equals(Sandesha2Constants.SPEC_2006_08.NS_URI)) {
        UsesSequenceSTR header = new UsesSequenceSTR(null, Sandesha2Constants.SPEC_2006_08.NS_URI);
        header.toSOAPEnvelope(createSeqMsg.getEnvelope());
      }
    }
   
View Full Code Here

Examples of org.apache.sandesha2.wsrm.CreateSequence

    if (log.isDebugEnabled())
      log.debug("Enter: FaultManager::checkForCreateSequenceRefused");

    RMMsgContext createSequenceRMMsg = MsgInitializer.initializeMessage(createSequenceMessage);

    CreateSequence createSequence = (CreateSequence) createSequenceRMMsg
        .getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
    if (createSequence == null)
      throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noCreateSeqParts));

    ConfigurationContext context = createSequenceMessage.getConfigurationContext();
View Full Code Here

Examples of org.h2.command.ddl.CreateSequence

    }

    private CreateSequence parseCreateSequence() {
        boolean ifNotExists = readIfNoExists();
        String sequenceName = readIdentifierWithSchema();
        CreateSequence command = new CreateSequence(session, getSchema());
        command.setIfNotExists(ifNotExists);
        command.setSequenceName(sequenceName);
        while (true) {
            if (readIf("START")) {
                readIf("WITH");
                command.setStartWith(readExpression());
            } else if (readIf("INCREMENT")) {
                readIf("BY");
                command.setIncrement(readExpression());
            } else if (readIf("CACHE")) {
                command.setCacheSize(readExpression());
            } else if (readIf("BELONGS_TO_TABLE")) {
                command.setBelongsToTable(true);
            } else {
                break;
            }
        }
        return command;
View Full Code Here

Examples of org.h2.command.ddl.CreateSequence

    }

    private CreateSequence parseCreateSequence() {
        boolean ifNotExists = readIfNoExists();
        String sequenceName = readIdentifierWithSchema();
        CreateSequence command = new CreateSequence(session, getSchema());
        command.setIfNotExists(ifNotExists);
        command.setSequenceName(sequenceName);
        while (true) {
            if (readIf("START")) {
                readIf("WITH");
                command.setStartWith(readExpression());
            } else if (readIf("INCREMENT")) {
                readIf("BY");
                command.setIncrement(readExpression());
            } else if (readIf("CACHE")) {
                command.setCacheSize(readExpression());
            } else if (readIf("BELONGS_TO_TABLE")) {
                command.setBelongsToTable(true);
            } else {
                break;
            }
        }
        return command;
View Full Code Here

Examples of org.h2.command.ddl.CreateSequence

    }

    private CreateSequence parseCreateSequence() {
        boolean ifNotExists = readIfNoExists();
        String sequenceName = readIdentifierWithSchema();
        CreateSequence command = new CreateSequence(session, getSchema());
        command.setIfNotExists(ifNotExists);
        command.setSequenceName(sequenceName);
        while (true) {
            if (readIf("START")) {
                readIf("WITH");
                command.setStartWith(readExpression());
            } else if (readIf("INCREMENT")) {
                readIf("BY");
                command.setIncrement(readExpression());
            } else if (readIf("CACHE")) {
                command.setCacheSize(readExpression());
            } else if (readIf("BELONGS_TO_TABLE")) {
                command.setBelongsToTable(true);
            } else {
                break;
            }
        }
        return command;
View Full Code Here

Examples of org.h2.command.ddl.CreateSequence

    }

    private CreateSequence parseCreateSequence() {
        boolean ifNotExists = readIfNoExists();
        String sequenceName = readIdentifierWithSchema();
        CreateSequence command = new CreateSequence(session, getSchema());
        command.setIfNotExists(ifNotExists);
        command.setSequenceName(sequenceName);
        while (true) {
            if (readIf("START")) {
                readIf("WITH");
                command.setStartWith(readExpression());
            } else if (readIf("INCREMENT")) {
                readIf("BY");
                command.setIncrement(readExpression());
            } else if (readIf("CACHE")) {
                command.setCacheSize(readExpression());
            } else if (readIf("BELONGS_TO_TABLE")) {
                command.setBelongsToTable(true);
            } else {
                break;
            }
        }
        return command;
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.