Examples of Rule


Examples of org.apache.pig.impl.plan.optimizer.Rule

        nodes = new ArrayList<String>(1);
        nodes.add(LOSTREAM_CLASSNAME);
        edges = new HashMap<Integer, Integer>();
        required = new ArrayList<Boolean>(1);
        required.add(true);
        mRules.add(new Rule(nodes, edges, required, new TypeCastInserter(plan,
                LOSTREAM_CLASSNAME)));

    }
View Full Code Here

Examples of org.apache.pig.newplan.optimizer.Rule

       protected List<Set<Rule>> buildRuleSets() {           
            List<Set<Rule>> ls = new ArrayList<Set<Rule>>();
           
            Set<Rule> s = new HashSet<Rule>();
            // add split filter rule
            Rule r = new LoadTypeCastInserter( "TypeCastInserter" );
            s.add(r);
            ls.add(s);
            
            s = new HashSet<Rule>();
            r = new FilterAboveForeach( "FilterAboveForeach" );
View Full Code Here

Examples of org.apache.portals.applications.webcontent.rewriter.rules.Rule

            String name = attribute.getId();
            String value = attributes.getValue(name);
            if (value != null) // && name.equalsIgnoreCase(attribute.getId()))
            {
                Rule rule = attribute.getRule();
                if (null == rule)
                {
                    continue;
                }
               
                if (!rule.shouldRewrite(value))
                {
                    continue;
                }                                       
               
                String rewritten = rewriteUrl(value, tag.getId(), name, attributes);
                if (null != rewritten) // return null indicates "don't rewrite"
                {
                    if (rule.getSuffix() != null)
                    {
                        rewritten = rewritten.concat(rule.getSuffix());
                    }
                   
                    attributes.addAttribute(name, rewritten);
                                       
                    if (rule.getPopup())
                    {
                        attributes.addAttribute("TARGET", "_BLANK");                       
                    }
                }
            }           
View Full Code Here

Examples of org.apache.provisionr.api.network.Rule

    @Test
    public void testConvertTcpIpPermissionToRuleAndBack() {
        IpPermission expected = new IpPermission().withFromPort(1).withToPort(1024)
            .withIpProtocol("tcp").withIpRanges("0.0.0.0/0");

        Rule rule = ConvertIpPermissionToRule.FUNCTION.apply(expected);
        assertNotNull(rule);

        assertThat(rule.getCidr()).isEqualTo("0.0.0.0/0");
        assertThat(rule.getProtocol()).isEqualTo(Protocol.TCP);

        assertThat(rule.getPorts().lowerEndpoint()).isEqualTo(1);
        assertThat(rule.getPorts().upperEndpoint()).isEqualTo(1024);

        IpPermission actual = ConvertRuleToIpPermission.FUNCTION.apply(rule);
        assertThat(actual).isEqualTo(expected);
    }
View Full Code Here

Examples of org.apache.qpid.server.security.access.config.Rule

        final RuleSet rs = config.getConfiguration();
        assertEquals(1, rs.getRuleCount());

        final Map<Integer, Rule> rules = rs.getAllRules();
        assertEquals(1, rules.size());
        final Rule rule = rules.get(0);
        assertEquals("Rule has unexpected identity", "user1", rule.getIdentity());
        assertEquals("Rule has unexpected operation", Operation.ACCESS, rule.getAction().getOperation());
        assertEquals("Rule has unexpected operation", ObjectType.VIRTUALHOST, rule.getAction().getObjectType());
        assertEquals("Rule has unexpected object properties", ObjectProperties.EMPTY, rule.getAction().getProperties());
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.Rule

                UriRef ruleID = (UriRef) solutionMapping.get("rule");
                Literal description = (Literal) solutionMapping.get("description");

                try {
                    Recipe recipe = getRecipe(recipeID);
                    Rule rule = new RecipeRule(recipe, getRule(recipe, ruleID));
                    if (description != null) {
                        rule.setDescription(description.getLexicalForm());
                    }

                    matchingRules.add(rule);
                } catch (NoSuchRecipeException e) {
                    // in this case go on in the iteration by fetching other matching recipes
View Full Code Here

Examples of org.apache.tomcat.util.digester.Rule

        digester.addCallMethod(PREFIX + "/tlibversion", "setTlibVersion", 0);
        digester.addCallMethod(PREFIX + "/tlib-version", "setTlibVersion", 0);
        digester.addCallMethod(PREFIX + "/jspversion", "setJspVersion", 0);
        digester.addCallMethod(PREFIX + "/jsp-version", "setJspVersion", 0);
        digester.addRule(PREFIX, new Rule() {
            // for TLD 2.0 and later, jsp-version is set by version attribute
            @Override
            public void begin(String namespace, String name, Attributes attributes) {
                TaglibXml taglibXml = (TaglibXml) digester.peek();
                taglibXml.setJspVersion(attributes.getValue("version"));
View Full Code Here

Examples of org.apache.turbine.services.intake.xmlmodel.Rule

                        + "InitableByConstraintMap");
            }
        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule) field.getRuleMap().get("required");
        if (reqRule != null)
        {
            alwaysRequired = Boolean.valueOf(reqRule.getValue()).booleanValue();
            ifRequiredMessage = reqRule.getMessage();
        }

        Rule maxLengthRule = (Rule) field.getRuleMap().get("maxLength");
        if (maxLengthRule != null)
        {
            maxSize = maxLengthRule.getValue();
        }

        // map the getter and setter methods
        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
View Full Code Here

Examples of org.apache.uima.annotator.regex.Rule

            }

            // create new rule and add all rule settings
            // additionally add a reference to the regex variables object
            // to resolve regex variables
            Rule rule = new Rule_impl(regex, matchStrategy, matchType, id,
                  confidence, featurePath, variables);

            // ********************************
            // get match type filter features
            // ********************************
            if (ruleList[r].getMatchTypeFilter() != null) {
               // iterate over all filter features and add them to the rule
               FeatureDocument.Feature[] filterFeatures = ruleList[r]
                     .getMatchTypeFilter().getFeatureArray();
               for (int x = 0; x < filterFeatures.length; x++) {
                  String featureName = filterFeatures[x].getFeaturePath();
                  String featureValue = filterFeatures[x].getStringValue();

                  // create new filter feature and add them to the rule
                  FilterFeature filterFeature = new FilterFeature_impl(
                        featureName, featureValue);
                  rule.addFilterFeature(filterFeature);
               }
            }
            // ***********************************************
            // get all update match type annotation features
            // ***********************************************
            if (ruleList[r].getUpdateMatchTypeAnnotation() != null) {
               // iterate over all match type annotation update features and add
               // them to the rule
               SetFeatureDocument.SetFeature[] updateFeatures = ruleList[r]
                     .getUpdateMatchTypeAnnotation().getSetFeatureArray();
               for (int x = 0; x < updateFeatures.length; x++) {
                  String featureName = updateFeatures[x].getName();
                  String featureValue = updateFeatures[x].getStringValue();
                  int featureType = updateFeatures[x].getType().intValue();
                  int normalization = 0;
                  if (updateFeatures[x].getNormalization() != null) {
                     normalization = updateFeatures[x].getNormalization()
                           .intValue();
                  }
                  String implClass = updateFeatures[x].getClass1();
                  // create new feature and add them to the rule
                  Feature updateFeature = new Feature_impl(featureType,
                        featureName, featureValue, normalization, implClass);
                  rule.addUpdateFeature(updateFeature);
               }
            }

            // **********************************
            // get all exceptions for this rule
            // **********************************
            if (ruleList[r].getRuleExceptions() != null) {
               // iterate over all match type annotation update features and add
               // them to the rule
               ExceptionDocument.Exception[] exceptions = ruleList[r]
                     .getRuleExceptions().getExceptionArray();
               for (int x = 0; x < exceptions.length; x++) {
                  String exceptionMatchType = exceptions[x].getMatchType();
                  String regexPattern = exceptions[x].getStringValue();

                  // create new Exception object and add them to the rule
                  org.apache.uima.annotator.regex.RuleException exception = new RuleException_impl(
                        exceptionMatchType, regexPattern);
                  rule.addException(exception);
               }
            }

            // add rule to the concept
            concept.addRule(rule);
View Full Code Here

Examples of org.apache.whirr.service.FirewallManager.Rule

    Map<String, List<String>> firewallRules = clusterSpec.getFirewallRules();
    for (String role: firewallRules.keySet()) {
      if (!roleIsInTarget(role)) {
        continue;   // skip execution for this role
      }
      Rule rule = Rule.create();
     
      if (role == null) {
        rule.destination(event.getCluster().getInstances());
      } else {
        rule.destination(RolePredicates.role(role));
      }
     
      List<String> ports = firewallRules.get(role);
      rule.ports(Ints.toArray(Collections2.transform(ports, new Function<String,Integer>() {
        @Override
        public Integer apply(String input) {
          return Integer.valueOf(input);
        }
      })));
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.