Package org.fusesource.ide.camel.model

Examples of org.fusesource.ide.camel.model.Endpoint


     * Helper method which provides all images for the figures in the palette
     *
     * @param imageProvider the image provider to use
     */
    public static void addFigureIcons(ImageProvider imageProvider) {
        imageProvider.addIconsForClass(new Endpoint());
        imageProvider.addIconsForClass(new Aggregate());
        imageProvider.addIconsForClass(new AOP());
        imageProvider.addIconsForClass(new Bean());
        imageProvider.addIconsForClass(new Catch());
        imageProvider.addIconsForClass(new Choice());
View Full Code Here


  protected void showDocumentationPage() {
    if (node != null) {
      boolean loadedPage = false;
      // lets see if we can find the docs for an endpoints URI...
      if (node instanceof Endpoint) {
        Endpoint endpoint = (Endpoint) node;
        String uri = endpoint.getUri();
        if (uri != null) {
          int idx = uri.indexOf(':');
          if (idx > 0) {
            String scheme = uri.substring(0, idx);
            String contextId = "org.fusesource.ide.camel.editor."
View Full Code Here

  @Test
  public void testLoadAndSaveOfFilter() throws Exception {
    RouteSupport route = assertModelRoundTrip("filterSample.xml", 1);
    List<AbstractNode> routeChildren = route.getChildren();

    Endpoint endpoint = assertChildIsInstance(route.getRootNodes(), 0, Endpoint.class);
    assertEquals("endpoint uri", "seda:someWhere", endpoint.getUri());

    Filter filter = assertChildIsInstance(endpoint.getOutputs(), 0, Filter.class);
    assertEquals("filter expression", "/foo/bar", filter.getExpression().getExpression());
    assertEquals("filter language", "xpath", filter.getExpression().getLanguage());
   
    Endpoint endpoint2 = assertChildIsInstance(filter.getOutputs(), 0, Endpoint.class);
    assertEquals("endpoint2 uri", "seda:anotherPlace2", endpoint2.getUri());
   
    assertContains(routeChildren, endpoint, filter, endpoint2);
  }
View Full Code Here

  @Test
  public void testLoadAndSaveOfFilterWithBlueprint() throws Exception {
    RouteSupport route = assertModelRoundTrip("filterSampleBlueprint.xml", 1);
    List<AbstractNode> routeChildren = route.getChildren();

    Endpoint endpoint = assertChildIsInstance(route.getRootNodes(), 0, Endpoint.class);
    assertEquals("endpoint uri", "seda:someWhere", endpoint.getUri());

    Filter filter = assertChildIsInstance(endpoint.getOutputs(), 0, Filter.class);
    assertEquals("filter expression", "/foo/bar", filter.getExpression().getExpression());
    assertEquals("filter language", "xpath", filter.getExpression().getLanguage());
   
    Endpoint endpoint2 = assertChildIsInstance(filter.getOutputs(), 0, Endpoint.class);
    assertEquals("endpoint2 uri", "seda:anotherPlace2", endpoint2.getUri());
   
    assertContains(routeChildren, endpoint, filter, endpoint2);
  }
View Full Code Here

  @Test
  public void testLoadAndSaveOfContentBasedRouter() throws Exception {
    RouteSupport route = assertModelRoundTrip("cbrSample.xml", 1);
    List<AbstractNode> routeChildren = route.getChildren();

    Endpoint endpoint = assertChildIsInstance(route.getRootNodes(), 0, Endpoint.class);
    assertEquals("endpoint uri", "seda:choiceInput", endpoint.getUri());

    System.out.println("Endpoint outputs: " + endpoint.getOutputs());
    Choice choice = assertChildIsInstance(endpoint.getOutputs(), 0, Choice.class);

    System.out.println("Choice outputs: " + choice.getOutputs());
    When filter = assertChildIsInstance(choice.getOutputs(), 0, When.class);
    Otherwise otherwise = assertChildIsInstance(choice.getOutputs(), 1, Otherwise.class);
   
    assertEquals("when expression", "/foo/bar", filter.getExpression().getExpression());
    assertEquals("when language", "xpath", filter.getExpression().getLanguage());
   
    Endpoint endpoint2 = assertChildIsInstance(filter.getOutputs(), 0, Endpoint.class);
    assertEquals("endpoint2 uri", "seda:choiceWhen", endpoint2.getUri());

    Endpoint endpoint3 = assertChildIsInstance(otherwise.getOutputs(), 0, Endpoint.class);
    assertEquals("endpoint3 uri", "seda:choiceOtherwise", endpoint3.getUri());

    assertContains(routeChildren, endpoint, filter, endpoint2);
  }
View Full Code Here

    setExemplar(endpoint);
  }

  @Override
  protected AbstractNode createNode() {
    return new Endpoint(endpoint);
  }
View Full Code Here

      addMenuItem(menu, title, description, Endpoint.class, context, fp, new CreateNodeConnectionFeature(fp, Endpoint.class) {

        @Override
        protected AbstractNode createNode() throws Exception {
          return new Endpoint(endpoint);
        }
      });
    }
  }
View Full Code Here

    // set the new name for the EClass
    PictogramElement pe = context.getPictogramElement();
    //EClass eClass = (EClass) getBusinessObjectForPictogramElement(pe);
    Object bo = getBusinessObjectForPictogramElement(pe);
    if (bo instanceof Endpoint) {
      Endpoint ep = (Endpoint)getBusinessObjectForPictogramElement(pe);
      ep.setUri(value);
    } else if (bo instanceof Bean) {
      Bean bean = (Bean)getBusinessObjectForPictogramElement(pe);
      bean.setRef(value);
    }
   
View Full Code Here

    @Override
    public ValidationResult validate(AbstractNode node) {
        ValidationResult res = new ValidationResult();
       
        if (node instanceof Endpoint) {
            Endpoint ep = (Endpoint)node;
            try {
                new URI(ep.getUri());
            } catch (URISyntaxException ex) {
                res.addError(ex.getMessage());
            }
        }
       
View Full Code Here

        if (parent != null) {
          Set<Endpoint> set = parent.getEndpoints();
          String[] endpointUris = parent.getEndpointUris();
          for (String uri : endpointUris) {
            if (!containsUri(set, uri)) {
              Endpoint endpoint = new Endpoint();
              endpoint.setUri(uri);
              endpoints.add(endpoint);
            }
          }
          endpoints.addAll(set);
        }
View Full Code Here

TOP

Related Classes of org.fusesource.ide.camel.model.Endpoint

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.