Examples of Rule


Examples of org.jboss.security.xacml.sunxacml.Rule

    public Result combine(EvaluationCtx context, List parameters,
                          List ruleElements) {
        Iterator it = ruleElements.iterator();
       
        while (it.hasNext()) {
            Rule rule = ((RuleCombinerElement)(it.next())).getRule();
            Result result = rule.evaluate(context);
            int value = result.getDecision();
           
            // in the case of PERMIT, DENY, or INDETERMINATE, we always
            // just return that result, so only on a rule that doesn't
            // apply do we keep going...
View Full Code Here

Examples of org.jets3t.service.model.LifecycleConfig.Rule

        }

        // Rule section

        public void startRule() {
            latestRule = config.new Rule();
        }
View Full Code Here

Examples of org.jivesoftware.openfire.plugin.rules.Rule

        if (processed) {
            return;
        }
       
        Rule rule = pf.findMatch(packet);

        if (rule != null) {
            rule.doAction(packet);
        }
    }
View Full Code Here

Examples of org.kie.api.definition.rule.Rule

        KnowledgeBase kbase = loadKnowledgeBase( "kb1",
                                                 drl,
                                                 conf );

        Rule rule = kbase.getRule( "org.drools.compiler.integrationtests",
                                   "X" );

        Assert.assertEquals( "John Doe",
                             rule.getMetaData().get( "author" ) );
        Assert.assertEquals( "Hello World!",
                             rule.getMetaData().get( "output" ) );
        Assert.assertEquals( 20,
                             ((Number)rule.getMetaData().get( "value" )).intValue() );
        Assert.assertEquals( "Hello World!",
                             rule.getMetaData().get( "alt" ) );

    }
View Full Code Here

Examples of org.kie.workbench.common.services.refactoring.model.index.Rule

                                                     new ValueTypeIndexTerm( fieldFullyQualifiedClassName ),
                                                     new ValueTypeIndexTerm( fullyQualifiedClassName ) ) );
            }
        } else if ( fixture instanceof VerifyRuleFired ) {
            final VerifyRuleFired verifyRuleFired = (VerifyRuleFired) fixture;
            builder.addGenerator( new Rule( new ValueRuleIndexTerm( verifyRuleFired.getRuleName() ) ) );
        }
    }
View Full Code Here

Examples of org.kuali.rice.kew.api.rule.Rule

  private org.kuali.rice.kew.api.rule.RuleService getRuleSvc() {
    return KewApiServiceLocator.getRuleService();
  }
  @Test
  public void testDefaultApprovalRule() {
    Rule rule = getRuleSvc().getRuleByName("org.martinlaw.rules.default.approval");
    assertEquals("default routing rule for maintenance docs", rule.getDescription());
    assertEquals("org.martinlaw.defaultApprovalTemplate",rule.getRuleTemplate().getName());
  }
View Full Code Here

Examples of org.languagetool.rules.Rule

      try {
        final java.sql.Date dumpSqlDate = new java.sql.Date(dumpDate.getTime());
        final java.sql.Date nowDate = new java.sql.Date(new Date().getTime());
        for (RuleMatch match : ruleMatches) {
          prepSt.setString(1, language.getShortName());
          final Rule rule = match.getRule();
          prepSt.setString(2, rule.getId());
          if (rule instanceof PatternRule) {
            final PatternRule patternRule = (PatternRule) rule;
            prepSt.setString(3, patternRule.getSubId());
          } else {
            prepSt.setNull(3, Types.VARCHAR);
          }
          prepSt.setString(4, rule.getDescription());
          prepSt.setString(5, StringUtils.abbreviate(match.getMessage(), 255));
          final String context = contextTools.getContext(match.getFromPos(), match.getToPos(), text);
          if (context.length() > 255) {
            // let's skip these strange cases, as shortening the text might leave us behind with invalid markup etc
            continue;
View Full Code Here

Examples of org.midonet.client.resource.Rule

                    String[] ruleStrings = fwRule.toStringArray();

                    if (rule.getState() == FirewallRule.State.Revoke) {
                        // Lookup in existingRules, delete if present
                        for(String revokeRuleString : ruleStrings){
                            Rule foundRule = existingRules.get(revokeRuleString);
                            if(foundRule != null){
                                foundRule.delete();
                            }
                        }
                    } else if (rule.getState() == FirewallRule.State.Add) {
                        // Lookup in existingRules, add if not present
                        for(int i = 0; i < ruleStrings.length; i++){
                            String ruleString = ruleStrings[i];
                            Rule foundRule = existingRules.get(ruleString);
                            if(foundRule == null){
                                // Get the cidr for the related entry in the Source Cidrs list
                                String relatedCidr = fwRule.sourceCidrs.get(i);
                                Pair<String,Integer> cidrParts = NetUtils.getCidr(relatedCidr);

                                // Create rule with correct proto, cidr, ACCEPT, dst IP
                                Rule toApply = preFilter.addRule()
                                        .type(DtoRule.Jump)
                                        .jumpChainId(preNat.getId())
                                        .position(1)
                                        .nwSrcAddress(cidrParts.first())
                                        .nwSrcLength(cidrParts.second())
                                        .nwDstAddress(ruleTO.getSrcIp())
                                        .nwDstLength(32)
                                        .nwProto(SimpleFirewallRule.stringToProtocolNumber(rule.getProtocol()));

                                if(rule.getProtocol().equals("icmp")){
                                    // ICMP rules - reuse port fields
                                    // (-1, -1) means "allow all ICMP", so we don't set tpSrc / tpDst
                                    if(fwRule.icmpType != -1 | fwRule.icmpCode != -1){
                                        toApply.tpSrc(new DtoRange(fwRule.icmpType, fwRule.icmpType))
                                            .tpDst(new DtoRange(fwRule.icmpCode, fwRule.icmpCode));
                                    }
                                } else {
                                    toApply.tpDst(new DtoRange(fwRule.dstPortStart, fwRule.dstPortEnd));
                                }

                                toApply.create();
                            }
                        }
                    }
                }
            }
View Full Code Here

Examples of org.objectstyle.wolips.ruleeditor.model.Rule

    final Button duplicateButton = new Button(buttongroup, SWT.PUSH);
    duplicateButton.setText("Duplicate");
    duplicateButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(final SelectionEvent event) {
        Rule ruleToCopy = (Rule) tableViewer.getElementAt(table.getSelectionIndex());

        model.copyRule(ruleToCopy);

        updateRules();
        updateBottomDisplay();
View Full Code Here

Examples of org.ocpsoft.rewrite.config.Rule

   @Override
   public RuleBuilder getRuleBuilder()
   {
      if (configurationRuleBuilder == null) {
         configurationRuleBuilder = config.addRule(new Rule() {
            @Override
            public void perform(Rewrite event, EvaluationContext context)
            {}

            @Override
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.