Examples of ComponentConfiguration


Examples of org.apache.camel.ComponentConfiguration

        EndpointConfiguration conf = comp.createConfiguration("ftps:127.0.0.1?username=foo&password=secret");

        assertEquals("foo", conf.getParameter("username"));
        assertEquals("secret", conf.getParameter("password"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"maximumReconnectAttempts\": { \"type\": \"integer\""));
        assertTrue(json.contains("\"dataTimeout\": { \"type\": \"integer\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

        TwitterComponent comp = context.getComponent("twitter", TwitterComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("twitter:search?keywords=camel");

        assertEquals("camel", conf.getParameter("keywords"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"accessToken\": { \"type\": \"string\""));
        assertTrue(json.contains("\"consumerKey\": { \"type\": \"string\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

        QuartzComponent comp = context.getComponent("quartz2", QuartzComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("quartz2://myGroup/myTimerName?durableJob=true&recoverableJob=true&cron=0/2+*+*+*+*+?");

        assertEquals("true", conf.getParameter("durableJob"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"cron\": { \"type\": \"string\""));
        assertTrue(json.contains("\"fireNow\": { \"type\": \"boolean\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

                + "bridgeEndpoint=false&throwExceptionOnFailure=false");

        assertEquals("false", conf.getParameter("bridgeEndpoint"));
        assertEquals("false", conf.getParameter("throwExceptionOnFailure"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"GHTTP_SCHEME\": { \"type\": \"string\""));
        assertTrue(json.contains("\"HTTPS_SCHEME\": { \"type\": \"string\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

        EndpointConfiguration conf = comp.createConfiguration("gauth://authorize?scope=foo&name=fred");

        assertEquals("foo", conf.getParameter("scope"));
        assertEquals("fred", conf.getParameter("name"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"consumerKey\": { \"type\": \"string\""));
        assertTrue(json.contains("\"scope\": { \"type\": \"string\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

        EndpointConfiguration conf = comp.createConfiguration("gmail:test1@example.org?to=test2@example.org&subject=testSubject");

        assertEquals("test2@example.org", conf.getParameter("to"));
        assertEquals("testSubject", conf.getParameter("subject"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"sender\": { \"type\": \"string\""));
        assertTrue(json.contains("\"bcc\": { \"type\": \"string\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

        GTaskComponent comp = context.getComponent("gtask", GTaskComponent.class);
        EndpointConfiguration conf = comp.createConfiguration("gtask:default?workerRoot=camel");

        assertEquals("camel", conf.getParameter("workerRoot"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"workerRoot\": { \"type\": \"string\""));
        assertTrue(json.contains("\"disableStreamCache\": { \"type\": \"boolean\""));
    }
View Full Code Here

Examples of org.apache.camel.ComponentConfiguration

                + "&httpMethodRestrict=POST&traceEnabled=true");

        assertEquals("true", conf.getParameter("traceEnabled"));
        assertEquals("POST", conf.getParameter("httpMethodRestrict"));

        ComponentConfiguration compConf = comp.createComponentConfiguration();
        String json = compConf.createParameterJsonSchema();
        assertNotNull(json);

        assertTrue(json.contains("\"httpMethodRestrict\": { \"type\": \"string\""));
        assertTrue(json.contains("\"traceEnabled\": { \"type\": \"boolean\""));
    }
View Full Code Here

Examples of org.apache.flume.conf.ComponentConfiguration

        agentConf.getChannelConfigMap();
    /*
     * Components which have a ComponentConfiguration object
     */
    for (String chName : channelNames) {
      ComponentConfiguration comp = compMap.get(chName);
      if(comp != null) {
        Channel channel = getOrCreateChannel(channelsNotReused,
            comp.getComponentName(), comp.getType());
        try {
          Configurables.configure(channel, comp);
          channelComponentMap.put(comp.getComponentName(),
              new ChannelComponent(channel));
          LOGGER.info("Created channel " + chName);
        } catch (Exception e) {
          String msg = String.format("Channel %s has been removed due to an " +
              "error during configuration", chName);
View Full Code Here

Examples of org.apache.flume.conf.ComponentConfiguration

        agentConf.getSourceConfigMap();
    /*
     * Components which have a ComponentConfiguration object
     */
    for (String sourceName : sourceNames) {
      ComponentConfiguration comp = compMap.get(sourceName);
      if(comp != null) {
        SourceConfiguration config = (SourceConfiguration) comp;

        Source source = sourceFactory.create(comp.getComponentName(),
            comp.getType());
        try {
          Configurables.configure(source, config);
          Set<String> channelNames = config.getChannels();
          List<Channel> sourceChannels = new ArrayList<Channel>();
          for (String chName : channelNames) {
            ChannelComponent channelComponent = channelComponentMap.get(chName);
            if(channelComponent != null) {
              sourceChannels.add(channelComponent.channel);
            }
          }
          if(sourceChannels.isEmpty()) {
            String msg = String.format("Source %s is not connected to a " +
                "channel",  sourceName);
            throw new IllegalStateException(msg);
          }
          ChannelSelectorConfiguration selectorConfig =
              config.getSelectorConfiguration();

          ChannelSelector selector = ChannelSelectorFactory.create(
              sourceChannels, selectorConfig);

          ChannelProcessor channelProcessor = new ChannelProcessor(selector);
          Configurables.configure(channelProcessor, config);

          source.setChannelProcessor(channelProcessor);
          sourceRunnerMap.put(comp.getComponentName(),
              SourceRunner.forSource(source));
          for(Channel channel : sourceChannels) {
            ChannelComponent channelComponent = Preconditions.
                checkNotNull(channelComponentMap.get(channel.getName()),
                    String.format("Channel %s", channel.getName()));
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.