Package io.fabric8.api

Examples of io.fabric8.api.PlaceholderResolver


        }
        ContainersNode containersNode = fabric.getContainersNode();
        if (containersNode != null) {
          List<Container> selectedContainers = getSelectedContainers();
          if (!selectedContainers.isEmpty()) {
            Container container = selectedContainers.get(0);
            ContainerNode containerNode = containersNode
                .getContainerNode(container.getId());
            if (containerNode != null) {
              Selections.setSingleSelection(
                  fabric.getRefreshableUI(), containerNode);
            }
          }
View Full Code Here


    IStructuredSelection selection = getSelection();
    if (selection != null) {
      boolean changed = false;
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        Container container = ContainerNode
            .toContainer(iterator.next());
        if (container != null) {
          containers.add(container);
        }
      }
View Full Code Here

          public boolean apply(Container container) {
            return container != null && container.isRoot();
          }
        }));
    if (rootContainers.size() == 1 && fabric != null) {
      Container rootContainer = rootContainers.get(0);
      ContainersNode containersNode = fabric.getContainersNode();
      if (containersNode != null) {
        return containersNode.getContainerNode(rootContainer.getId());
      }
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  public boolean matches(ProfileNode profile) {
    Container ag = getContainer();
    Profile[] profiles = ag.getProfiles();
    for (Profile prof : profiles) {
      if (Objects.equal(prof.getId(), profile.getId())) {
        if (Objects.equal(ag.getVersionId(), profile.getVersion())) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

          CreateJCloudsContainerOptions opts = args.withUser(args.getUser(), args.getPassword(), "admin").build();

          FabricPlugin.getLogger().debug("Compute Service: " + opts.getComputeService());

          // finally create the image
          final CreateJCloudsContainerMetadata metadata = provider.create(opts, new CreationStateListener() {
            @Override
            public void onStateChange(String message) {
              monitor.subTask(message);
            }
          });
View Full Code Here

          }
        }
      });
      return (T) answerHolder[0];
    } catch (Exception e) {
      throw new FabricException(e);
    }

  }
View Full Code Here

        FabricService fabricService = createMock(FabricService.class);
        expect(fabricService.adapt(CuratorFramework.class)).andReturn(curator).anyTimes();
        replay(fabricService);

        PlaceholderResolver resolver = getEncryptedPropertyResolver();
        assertEquals("encryptedpassword",resolver.resolve(fabricService, null, null, null, "crypt:URdoo9++D3tsoC9ODrTfLNK5WzviknO3Ig6qbI2HuvQ="));
        verify(curator);
        verify(getDataBuilder);
    }
View Full Code Here

        FabricService fabricService = createMock(FabricService.class);
        expect(fabricService.adapt(CuratorFramework.class)).andReturn(curator).anyTimes();
        replay(fabricService);

        PlaceholderResolver resolver = getEncryptedPropertyResolver();
        assertEquals("encryptedpassword",resolver.resolve(fabricService, null, null, null, "crypt:URdoo9++D3tsoC9ODrTfLNK5WzviknO3Ig6qbI2HuvQ="));
        verify(curator);
        verify(getDataBuilder);
    }
View Full Code Here

        expect(fabricService.getContainer(EasyMock.<String > anyObject())).andReturn(new ContainerImpl(null, "root", fabricService));

        replay(fabricService);
        replay(dataStore);

        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals("root",resolver.resolve(fabricService, null, null, null, "container:name"));
        verify(fabricService);
        verify(dataStore);
    }
View Full Code Here

        verify(dataStore);
    }

    @Test
    public void testResolveCurrentAttributes() throws Exception {
        PlaceholderResolver resolver = getContainerPlaceholderResolver();
        assertEquals(ip,resolver.resolve(fabricService, null, null, null, "container:ip"));
        assertEquals(localhostname,resolver.resolve(fabricService, null, null, null, "container:localhostname"));
        assertEquals(bindaddress,resolver.resolve(fabricService, null, null, null, "container:bindaddress"));
        assertEquals(containerResolver,resolver.resolve(fabricService, null, null, null, "container:resolver"));

        verify(fabricService);
        verify(dataStore);
    }
View Full Code Here

TOP

Related Classes of io.fabric8.api.PlaceholderResolver

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.