Package io.fabric8.patch

Examples of io.fabric8.patch.Result


                }
                if (!simulate) {
                    new Offline(new File(System.getProperty("karaf.base")))
                            .applyConfigChanges(((PatchImpl) patch).getPatch());
                }
                Result result = new ResultImpl(patch, simulate, System.currentTimeMillis(), updates, startup, overrides);
                results.put(patch.getId(), result);
            }
            // Apply results
            System.out.println("Bundles to update:");
            for (Map.Entry<Bundle, String> e : toUpdate.entrySet()) {
                System.out.println("    " + e.getKey().getSymbolicName() + "/" + e.getKey().getVersion().toString() + " with " + e.getValue());
            }
            if (simulate) {
                System.out.println("Running simulation only - no bundles are being updated at this time");
            } else {
                System.out.println("Installation will begin.  The connection may be lost or the console restarted.");
            }
            System.out.flush();
            if (!simulate) {
                Thread thread = new Thread() {
                    public void run() {
                        try {
                            applyChanges(toUpdate);
                            for (Patch patch : patches) {
                                Result result = results.get(patch.getId());
                                ((PatchImpl) patch).setResult(result);
                                saveResult(result);
                            }
                        } catch (Exception e) {
                            e.printStackTrace(System.err);
View Full Code Here


        private Map<String, Map<String, String>> bundleVersions = new HashMap<String, Map<String, String>>();

        public BundleVersionHistory(Map<String, Patch> patches) {
            super();
            for (Map.Entry<String, Patch> patch : patches.entrySet()) {
                Result result = patch.getValue().getResult();
                if (result != null) {
                    for (BundleUpdate update : result.getUpdates()) {
                        String symbolicName = stripSymbolicName(update.getSymbolicName());
                        Map<String, String> versions = bundleVersions.get(symbolicName);
                        if (versions == null) {
                            versions = new HashMap<String, String>();
                            bundleVersions.put(symbolicName, versions);
View Full Code Here

            throw new PatchException("Patch '" + patchId + "' not found");
        }
        if (patch.isInstalled()) {
            throw new PatchException("Patch '" + patchId + "' is already installed");
        }
        Result result = patch.install(force, synchronous);
        display(result);
    }
View Full Code Here

            throw new PatchException("Patch '" + patchId + "' not found");
        }
        if (patch.isInstalled()) {
            throw new PatchException("Patch '" + patchId + "' is already installed");
        }
        Result result = patch.simulate();
        display(result);
    }
View Full Code Here

          try {
            // TODO replace with better JmxTemplate reusing the
            // Connection!!!
            JMXConnector connector = null; // TODO: find out how to improve -->  connectionWrapper.getConnector();
            if (connector == null) {
              connector = new LocalJMXConnector(connection);
            }
            Object answer = callback.doWithJmxConnector(connector);
            answerHolder[0] = answer;
          } catch (Exception e) {
            Activator.getLogger().warning("Failed to connect to JMX: " + e, e);
View Full Code Here

          try {
            // TODO replace with better JmxTemplate reusing the
            // Connection!!!
            JMXConnector connector = null; //TODO: find out how to improve -->  connectionWrapper.getConnector();
            if (connector == null) {
              connector = new LocalJMXConnector(connection);
            }
            Object answer = callback.doWithJmxConnector(connector);
            answerHolder[0] = answer;
          } catch (Exception e) {
            throw new RuntimeException(e);
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);
            }
          });

          // on failure we don't add the cloud image to the navigator
          Throwable failure = metadata.getFailure();
          if (failure != null) {
            return new Status(Status.ERROR, FabricPlugin.PLUGIN_ID, "Failed to create Fabric: " + fabricName, failure);
          }

          // now extract the public IP from the meta data
          final StringBuilder urisBuilder = new StringBuilder();
          for(String address:metadata.getPublicAddresses()) {
            urisBuilder.append(address).append(",");
          }

          final CreateJCloudsContainerOptions.Builder arguments = args;
          Viewers.async(new Runnable() {
View Full Code Here

          args = args.computeService(computeClient);

          FabricPlugin.getLogger().debug("Creating Jclouds provider type: " + providerName);

            // we need to set the fabric user , pw and role in that way, otherwise the user is not created
          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) {
View Full Code Here

            NovaFirewallSupport novafw = new NovaFirewallSupport();
            novafw.activateComponent();
            firewallManagerFactory.bindFirewallSupport(novafw);
           
          // create and activate provider
          JcloudsContainerProvider provider = new JcloudsContainerProvider();
          provider.activateComponent();
            provider.bindFirewallManagerFactory(firewallManagerFactory);

            // get and set the provider name
          String providerName = args.getProviderName();
          args = args.contextName(providerName);

          // create and set the compute service
          ComputeService computeClient = CloudDetails.createComputeService(getSelectedCloud());
          args = args.computeService(computeClient);

          FabricPlugin.getLogger().debug("Creating Jclouds provider type: " + providerName);

            // we need to set the fabric user , pw and role in that way, otherwise the user is not created
          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

          FabricPlugin.getLogger().debug("Create cloud fabric: " + fabricName + " container: " + agentName);

          // create and activate firewall manager
          FirewallManagerFactoryImpl firewallManagerFactory = new FirewallManagerFactoryImpl();
          firewallManagerFactory.activateComponent();
          Ec2FirewallSupport ec2fw = new Ec2FirewallSupport();
          ec2fw.activateComponent();
            firewallManagerFactory.bindFirewallSupport(ec2fw);
            NovaFirewallSupport novafw = new NovaFirewallSupport();
            novafw.activateComponent();
            firewallManagerFactory.bindFirewallSupport(novafw);
           
View Full Code Here

TOP

Related Classes of io.fabric8.patch.Result

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.