Examples of PolicyEngineData


Examples of org.apache.sandesha2.policy.PolicyEngineData

    }

    processor.processPolicy(policy);

    RMProcessorContext ctx = processor.getContext();
    PolicyEngineData data = ctx.readCurrentPolicyEngineData();

   
    if (data.isAcknowledgementIntervalSet())
      propertyBean.setAcknowledgementInterval(data.getAcknowledgementInterval());
    else
      propertyBean.setAcknowledgementInterval(parentPropertyBean.getAcknowledgementInaterval());
   
    if (data.isExponentialBackoffSet())
      propertyBean.setExponentialBackoff(data.isExponentialBackoff());
    else
      propertyBean.setExponentialBackoff(parentPropertyBean.isExponentialBackoff());
   
    //Inactivity timeout given in the policy will affect only if it gives both the measure and the value.
    //Otherwise value will be taken from the parent.
    if (data.isInactivityTimeoutSet() && data.isInactivityTimeoutMeassureSet() )
      propertyBean.setInactiveTimeoutInterval(data.getInactivityTimeout(),data.getInactivityTimeoutMeassure());
    else
      propertyBean.setInactiveTimeoutInterval(parentPropertyBean.getInactiveTimeoutInterval());
   
    if (data.isInvokeInOrderSet())
      propertyBean.setInOrder(data.isInvokeInOrder());
    else
      propertyBean.setInOrder(parentPropertyBean.isInOrder());
   
    if (data.isMaximumRetransmissionCountSet())
      propertyBean.setMaximumRetransmissionCount(data.getMaximumRetransmissionCount());
    else
      propertyBean.setMaximumRetransmissionCount(parentPropertyBean.getMaximumRetransmissionCount());
   
    if (data.isRetransmissionIntervalSet())
      propertyBean.setRetransmissionInterval(data.getRetransmissionInterval());
    else
      propertyBean.setRetransmissionInterval(parentPropertyBean.getRetransmissionInterval());
     
    if (data.isStorageManagerSet())
      propertyBean.setStorageManagerClass(data.getStorageManager());
    else
      propertyBean.setStorageManagerClass(data.getStorageManager());
   
    if (data.isMessageTypesToDropSet())
      loadMessageTypesToDrop(data.getMessageTypesToDrop(),propertyBean);
    else
      propertyBean.setMsgTypesToDrop(parentPropertyBean.getMsgTypesToDrop());
   
    return propertyBean;
  }
View Full Code Here

Examples of org.apache.sandesha2.policy.PolicyEngineData

    }

    processor.processPolicy(policy);

    RMProcessorContext ctx = processor.getContext();
    PolicyEngineData data = ctx.readCurrentPolicyEngineData();

    if (data.isAcknowledgementIntervalSet())
      propertyBean.setAcknowledgementInterval(data.getAcknowledgementInterval());
    else
      propertyBean.setAcknowledgementInterval(parentPropertyBean.getAcknowledgementInaterval());
   
    if (data.isExponentialBackoffSet())
      propertyBean.setExponentialBackoff(data.isExponentialBackoff());
    else
      propertyBean.setExponentialBackoff(parentPropertyBean.isExponentialBackoff());
   
    //Inactivity timeout given in the policy will affect only if it gives both the measure and the value.
    //Otherwise value will be taken from the parent.
    if (data.isInactivityTimeoutSet() && data.isInactivityTimeoutMeassureSet() )
      propertyBean.setInactiveTimeoutInterval(data.getInactivityTimeout(),data.getInactivityTimeoutMeassure());
    else
      propertyBean.setInactiveTimeoutInterval(parentPropertyBean.getInactiveTimeoutInterval());
   
    if (data.isInvokeInOrderSet())
      propertyBean.setInOrder(data.isInvokeInOrder());
    else
      propertyBean.setInOrder(parentPropertyBean.isInOrder());
   
    if (data.isMaximumRetransmissionCountSet())
      propertyBean.setMaximumRetransmissionCount(data.getMaximumRetransmissionCount());
    else
      propertyBean.setMaximumRetransmissionCount(parentPropertyBean.getMaximumRetransmissionCount());
   
    if (data.isRetransmissionIntervalSet())
      propertyBean.setRetransmissionInterval(data.getRetransmissionInterval());
    else
      propertyBean.setRetransmissionInterval(parentPropertyBean.getRetransmissionInterval());
     
    if (data.isStorageManagerSet())
      propertyBean.setStorageManagerClass(data.getStorageManager());
    else
      propertyBean.setStorageManagerClass(data.getStorageManager());
   
    if (data.isMessageTypesToDropSet())
      loadMessageTypesToDrop(data.getMessageTypesToDrop(),propertyBean);
    else
      propertyBean.setMsgTypesToDrop(parentPropertyBean.getMsgTypesToDrop());
   
    return propertyBean;
  }
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

   

    public PolicyEngineData commitPolicyEngineData() {
        if (pedStackPointer > 2) {
            pedStackPointer--;
            PolicyEngineData ped = (PolicyEngineData) pedStack.get(pedStackPointer);
            return ped;
        } else if(pedStackPointer == 2) {
            RootPolicyEngineData rootData = (RootPolicyEngineData)this.pedStack.get(0);
            rootData.addTopLevelPED(readCurrentPolicyEngineData());
            pedStackPointer--;
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

       
        /*
         * Now get the initial PolicyEngineData, initialize it and put it onto
         * the PED stack.
         */
        PolicyEngineData ped = new RootPolicyEngineData();
        ped.initializeWithDefaults();
       
        /*
         * Now get a context and push the top level token onto the token stack.
         * The top level token is a special token that acts as anchor to start
         * parsing.
 
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

   
    public static void build(ArrayList topLevelPeds) throws WSSPolicyException {
        Iterator topLevelPEDIterator = topLevelPeds.iterator();
        WSS4JConfig config = new WSS4JConfig();
        while (topLevelPEDIterator.hasNext()) {
            PolicyEngineData ped = (PolicyEngineData) topLevelPEDIterator.next();
            if(ped instanceof Binding) {
                if(ped instanceof SymmetricBinding) {
                    processSymmetricPolicyBinding((SymmetricBinding)ped, config);
                } else {
                    processAsymmetricPolicyBinding((AsymmetricBinding)ped, config);
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

            assertEquals("Incrrect number of PolicyEngineData", 4, peds.size());
           
            Iterator pedIter = peds.iterator();
            boolean asymmBindingfound = false, wss11found = false, signedPartsFound = false, encryptedPartsFound = false;
            while (pedIter.hasNext()) {
                PolicyEngineData ped = (PolicyEngineData) pedIter.next();
                if(ped instanceof AsymmetricBinding) {
                    asymmBindingfound = true;
                    AsymmetricBinding symmetricBinding = (AsymmetricBinding)ped;
                    assertEquals("Incorrect layout",Constants.LAYOUT_STRICT ,symmetricBinding.getLayout().getValue());
                } else if(ped instanceof Wss11) {
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

            assertEquals("Incrrect number of PolicyEngineData", 4, peds.size());
           
            Iterator pedIter = peds.iterator();
            boolean symmBindingfound = false, wss11found = false, signedPartsFound = false, encryptedPartsFound = false;
            while (pedIter.hasNext()) {
                PolicyEngineData ped = (PolicyEngineData) pedIter.next();
                if(ped instanceof SymmetricBinding) {
                    symmBindingfound = true;
                    SymmetricBinding symmetricBinding = (SymmetricBinding)ped;
                    assertEquals("Incorrect layout",Constants.LAYOUT_STRICT ,symmetricBinding.getLayout().getValue());
                } else if(ped instanceof Wss11) {
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

       
        /*
         * Now get the initial PolicyEngineData, initialize it and put it onto
         * the PED stack.
         */
        PolicyEngineData ped = new RootPolicyEngineData();
        ped.initializeWithDefaults();
       
        /*
         * Now get a context and push the top level token onto the token stack.
         * The top level token is a special token that acts as anchor to start
         * parsing.
 
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

    public static WSS4JPolicyData build(ArrayList topLevelPeds)
            throws WSSPolicyException {
        Iterator topLevelPEDIterator = topLevelPeds.iterator();
        WSS4JPolicyData wpd = new WSS4JPolicyData();
        while (topLevelPEDIterator.hasNext()) {
            PolicyEngineData ped = (PolicyEngineData) topLevelPEDIterator
                    .next();
            if (ped instanceof Binding) {
                if (ped instanceof SymmetricBinding) {
                    processSymmetricPolicyBinding((SymmetricBinding) ped, wpd);
                } else {
                    processAsymmetricPolicyBinding((AsymmetricBinding) ped, wpd);
                }
                /*
                 * Don't change the order of Wss11 / Wss10 instance checks
                 * because Wss11 extends Wss10 - thus first check Wss11.
                 */
            } else if (ped instanceof Wss11) {
                processWSS11((Wss11) ped, wpd);
            } else if (ped instanceof Wss10) {
                processWSS10((Wss10) ped, wpd);
            } else if (ped instanceof SignedEncryptedElements) {
                processSignedEncryptedElements((SignedEncryptedElements) ped,
                        wpd);
            } else if (ped instanceof SignedEncryptedParts) {
                processSignedEncryptedParts((SignedEncryptedParts) ped, wpd);
            } else if (ped instanceof SupportingToken) {
                processSupportingToken((SupportingToken) ped, wpd);
            } else {
                System.out.println("Unknown top level PED found: "
                        + ped.getClass().getName());
            }
        }
        return wpd;
    }
View Full Code Here

Examples of org.apache.ws.security.policy.model.PolicyEngineData

     * @param wpd
     *            The WSS4J data to initialize
     */
    private static void symmetricBinding(SymmetricBinding binding,
            WSS4JPolicyData wpd) throws WSSPolicyException {
        PolicyEngineData ped = binding.getProtectionToken();
        AlgorithmSuite suite = binding.getAlgorithmSuite();
        if (ped != null) {
            wpd.setProtectionToken(
                    ((ProtectionToken) ped).getProtectionToken(), suite);
        } else {
            ped = binding.getEncryptionToken();
            PolicyEngineData ped1 = binding.getSignatureToken();
            if (ped == null && ped1 == null) {
                // this is an error - throw something
            }
            wpd.setEncryptionToken(
                    ((EncryptionToken) ped).getEncryptionToken(), suite);
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.