Examples of FabricException


Examples of io.fabric8.api.FabricException

     */
    @Override
    public void setResolver(String resolver) {
        List<String> validResolverList = Arrays.asList(ZkDefs.VALID_RESOLVERS);
        if (!validResolverList.contains(resolver)) {
            throw new FabricException("Resolver " + resolver + " is not valid.");
        }
        setAttribute(DataStore.ContainerAttribute.Resolver, resolver);
    }
View Full Code Here

Examples of io.fabric8.api.FabricException

        if (allMetadata != null && allMetadata.length > 0) {
            for (CreateContainerMetadata metadata : allMetadata) {
                Container container = metadata.getContainer();
                containers.add(container);
                if (!metadata.isSuccess()) {
                    throw new FabricException("Failed to create container." , metadata.getFailure());
                }
            }
        }

        return containers;
View Full Code Here

Examples of io.fabric8.api.FabricException

        for (Container aux : containers) {
            String cntId = aux.getId();
            try {
                fabricService.destroyContainer(cntId, true);
            } catch (Exception ex) {
                new FabricException("Cannot destroy container: " + cntId, ex).printStackTrace(System.err);
            }
        }
    }
View Full Code Here

Examples of io.fabric8.api.FabricException

        for (Container aux : containers) {
            String cntId = aux.getId();
            try {
                fabricService.stopContainer(cntId, true);
            } catch (Exception ex) {
                new FabricException("Cannot stop container: " + cntId, ex).printStackTrace(System.err);
            }
        }
    }
View Full Code Here

Examples of io.fabric8.api.FabricException

                String containers = getStringData(curator.get(), ZkPath.CONFIG_ENSEMBLE.getPath(clusterId));
                Collections.addAll(list, containers.split(","));
            }
            return list;
        } catch (Exception e) {
            throw new FabricException("Unable to load zookeeper quorum containers", e);
        }
    }
View Full Code Here

Examples of io.fabric8.api.FabricException

                }

                Profile defaultProfile = profileRegistry.get().getRequiredProfile(versionId, "default");
                Map<String, String> zkConfig = defaultProfile.getConfiguration(Constants.ZOOKEEPER_CLIENT_PID);
                if (zkConfig == null) {
                    throw new FabricException("Failed to find old zookeeper configuration in default profile");
                }
                String zkUrl = getSubstitutedData(curator.get(), zkConfig.get("zookeeper.url"));
                for (String data : zkUrl.split(",")) {
                    addUsedPorts(usedPorts, data);
                }
View Full Code Here

Examples of io.fabric8.api.FabricException

        if (container != null) {
                    if (verbose) {
                        System.out.println(String.format("Waiting: Container %s is %s", container.getId(), container.getProvisionStatus()));
                    }
                    if (container.getProvisionStatus() != null && container.getProvisionStatus().startsWith(Container.PROVISION_ERROR)) {
                        throw new FabricException("Error provisioning container " + container.getId() + " : " + container.getProvisionStatus());
                    }
                }
        return false;
      }
    }
View Full Code Here

Examples of io.fabric8.api.FabricException

    @Override
    public List<String> getFields(String className) {
        try {
            return BeanUtils.getFields(Class.forName(className));
        } catch (ClassNotFoundException e) {
            throw new FabricException("Failed to load class " + className, e);
        }
    }
View Full Code Here

Examples of io.fabric8.api.FabricException

            }
        }

        if (patchFiles.isEmpty()) {
            LOG.warn("No valid patches to apply");
            throw new FabricException("No valid patches to apply");
        }

        if (targetId == null || targetId.equals("")) {
            Version latestVersion = getLatestVersion();
            VersionSequence sequence = new VersionSequence(latestVersion.getId());
            targetId = sequence.next().getName();
        }
       
        Version targetVersion = profileService.createVersionFrom(sourceId, targetId, null);

        File currentPatchFile = null;
        try {
            for (File file : patchFiles) {
                currentPatchFile = file;
                if (!file.isFile()) {
                    LOG.info("File is a directory, skipping: {}", file);
                    continue;
                }
                LOG.info("Applying patch file {}", file);
                fabricService.getPatchService().applyPatch(targetVersion, file.toURI().toURL(), proxyUser, proxyPassword);
                LOG.info("Successfully applied {}", file);
            }
        } catch (Throwable t) {
            LOG.warn("Failed to apply patch file {}", currentPatchFile, t);
            profileService.deleteVersion(targetId);
            throw new FabricException("Failed to apply patch file " + currentPatchFile, t);
        }

        for (File file : patchFiles) {
            try {
                LOG.info("Deleting patch file {}", file);
View Full Code Here

Examples of io.fabric8.api.FabricException

    public synchronized void close() {
        if (connector != null) {
            try {
                connector.close();
            } catch (IOException e) {
                throw new FabricException("Failed to close connection: " + connector + " on " + this + ". " + e, e);
            } finally {
                connector = null;
            }
        }
    }
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.