Package org.apache.sandesha2.policy

Examples of org.apache.sandesha2.policy.SandeshaPolicyBean


  }

  public static boolean hasSequenceTimedOut(RMSBean rmsBean, String internalSequenceId, StorageManager storageManager)
      throws SandeshaException {

    SandeshaPolicyBean propertyBean =
      SandeshaUtil.getPropertyBean(storageManager.getContext().getAxisConfiguration());

    if (propertyBean.getInactivityTimeoutInterval() <= 0)
      return false;

    boolean sequenceTimedOut = false;
   
    long lastActivatedTime = rmsBean.getLastActivatedTime();
    long timeNow = System.currentTimeMillis();
    if (lastActivatedTime > 0 && (lastActivatedTime + propertyBean.getInactivityTimeoutInterval() < timeNow))
      sequenceTimedOut = true;

    return sequenceTimedOut;
  }
View Full Code Here


    Parameter parameter = axisConfiguration.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
    if (parameter==null)
      throw new SandeshaException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.defaultPropertyBeanNotSet));
   
    SandeshaPolicyBean sandeshaPropertyBean = (SandeshaPolicyBean) parameter.getValue();
    return sandeshaPropertyBean;
  }
View Full Code Here

    Parameter parameter = axisDescription.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
    if (parameter==null)
      throw new SandeshaException (SandeshaMessageHelper.getMessage(
          SandeshaMessageKeys.propertyBeanNotSet));
   
    SandeshaPolicyBean propertyBean = (SandeshaPolicyBean) parameter.getValue();
    if (propertyBean==null) {
      String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.policyBeanNotFound);
      throw new SandeshaException (message);
    }
View Full Code Here

  throws SandeshaException
  {
    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
      log.debug("Enter: SandeshaUtil::rewriteEPR " + epr);

    SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(configContext.getAxisConfiguration());
    if(!policy.isEnableRMAnonURI()) {
      if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled())
        log.debug("Exit: SandeshaUtil::rewriteEPR, anon uri is disabled");
      return epr;
    }
View Full Code Here

  }

  public static boolean isInOrder(MessageContext context) throws SandeshaException {
    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Enter: SandeshaUtil::isInOrder");
   
    SandeshaPolicyBean policy = getPropertyBean(context.getConfigurationContext().getAxisConfiguration());
    boolean result = policy.isInOrder();
   
    if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Enter: SandeshaUtil::isInOrder, " + result);
    return result;
  }
View Full Code Here

      } catch (AxisFault e1) {
        throw new SandeshaException(e1.getMessage());
      }

    } else {
      SandeshaPolicyBean propertyBean = SandeshaUtil.getPropertyBean(msgContext.getAxisOperation());

      long ackInterval = propertyBean.getAcknowledgementInterval();

      // Ack will be sent as stand alone, only after the acknowledgement interval
      long timeToSend = System.currentTimeMillis() + ackInterval;

      AcknowledgementManager.addAckBeanEntry(ackRMMsgCtx, sequenceId, timeToSend, storageManager);
View Full Code Here

    }

    // We also do some checking at this point to see if MakeConection is required to
    // enable WS-RM 1.1, and write a warning to the log if it has been disabled.
    if(Sandesha2Constants.SPEC_2007_02.NS_URI.equals(rmNamespaceValue)) {
      SandeshaPolicyBean policy = SandeshaUtil.getPropertyBean(context.getAxisConfiguration());
      if(twoWayService && !policy.isEnableMakeConnection()) {
        String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.makeConnectionWarning);
        log.warn(message);
      }
    }
View Full Code Here

        updateParameter(moduleResourcePath, "db.driver", parameters.getDriverName(), sandeshaModule);
        updateParameter(moduleResourcePath, "db.user", parameters.getUserName(), sandeshaModule);
        updateParameter(moduleResourcePath, "db.password", parameters.getPassword() , sandeshaModule);

        // getting the policy bean to update
        SandeshaPolicyBean sandeshaPolicyBean
                = (SandeshaPolicyBean) axisConfiguration.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN).getValue();

        sandeshaPolicyBean.setInactiveTimeoutInterval(
                parameters.getInactivityTimeoutInterval(), parameters.getInactivityTimeoutMeasure());

        sandeshaPolicyBean.setSequenceRemovalTimeoutInterval(
                parameters.getSequenceRemovalTimeoutInterval(), parameters.getSequenceRemovalTimeoutMeasure());
        sandeshaPolicyBean.setSequenceRemovalTimeoutMeasure(parameters.getSequenceRemovalTimeoutMeasure());

        sandeshaPolicyBean.setAcknowledgementInterval(parameters.getAcknowledgementInterval());
        sandeshaPolicyBean.setRetransmissionInterval(parameters.getRetransmissionInterval());
        sandeshaPolicyBean.setExponentialBackoff(parameters.isExponentialBackoff());
        sandeshaPolicyBean.setMaximumRetransmissionCount(parameters.getMaximumRetransmissionCount());

        // if it has set the storage as permenent the we need to initiate storage and put to the
        // configuration context.
        if ((parameters.getStorageManager() != null)
                && (parameters.getStorageManager().equals(Sandesha2Constants.PERMANENT_STORAGE_MANAGER))){
            sandeshaPolicyBean.setPermanentStorageManagerClass(PersistentStorageManager.class.getName());
            // creating the persistace storage.
            PersistentStorageManager persistentStorageManager = new PersistentStorageManager(configurationContext);
            persistentStorageManager.initStorage(sandeshaModule);

            Parameter permenentStorage = axisConfiguration.getParameter(Sandesha2Constants.PERMANENT_STORAGE_MANAGER);
View Full Code Here

        rmParameterBean.setPassword(getParameterValue("db.password", sandeshaModule));
        rmParameterBean.setUserName(getParameterValue("db.user", sandeshaModule));

        Parameter sandeshaPolicyBeanParameter = axisConfiguration.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN);
        if (sandeshaPolicyBeanParameter != null) {
            SandeshaPolicyBean sandeshaPolicyBean = (SandeshaPolicyBean) sandeshaPolicyBeanParameter.getValue();

            // sandesha policy bean stored them in miliseconds so we make them seconds to display users.
            rmParameterBean.setInactivityTimeoutInterval(
                    sandeshaPolicyBean.getInactivityTimeoutInterval() / 1000);
            rmParameterBean.setInactivityTimeoutMeasure("seconds");

            rmParameterBean.setSequenceRemovalTimeoutInterval(
                    sandeshaPolicyBean.getSequenceRemovalTimeoutInterval() / 1000);
            rmParameterBean.setSequenceRemovalTimeoutMeasure("seconds");

            rmParameterBean.setAcknowledgementInterval(sandeshaPolicyBean.getAcknowledgementInterval());
            rmParameterBean.setRetransmissionInterval(sandeshaPolicyBean.getRetransmissionInterval());
            rmParameterBean.setExponentialBackoff(sandeshaPolicyBean.isExponentialBackoff());
            rmParameterBean.setMaximumRetransmissionCount(sandeshaPolicyBean.getMaximumRetransmissionCount());
        }

        if (axisConfiguration.getParameter(Sandesha2Constants.STORAGE_MANAGER_PARAMETER) != null){
            rmParameterBean.setStorageManager(
                    (String) axisConfiguration.getParameter(Sandesha2Constants.STORAGE_MANAGER_PARAMETER).getValue());
View Full Code Here

            if (wsRMPolicyKey != null) {
                Object property = synapseOutMessageContext.getEntry(wsRMPolicyKey);
                if (property instanceof OMElement) {
                    OMElement policyOMElement = (OMElement) property;
                    RMAssertionBuilder builder = new RMAssertionBuilder();
                    SandeshaPolicyBean sandeshaPolicyBean = (SandeshaPolicyBean) builder.build(policyOMElement, null);
                    Parameter policyParam = new Parameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN, sandeshaPolicyBean);
                    anoymousService.addParameter(policyParam);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.sandesha2.policy.SandeshaPolicyBean

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.