Package io.fabric8.api

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


        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

    @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

            }
        }

        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

    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

        String username = (String) options.remove("username");
        String password = (String) options.remove("password");
        String role = (String) options.remove("role");

        if (username == null || password == null || role == null) {
            throw new FabricException("Must specify an administrator username, password and administrative role when creating a fabric");
        }

        Object profileObject = options.remove("profiles");

        ObjectMapper mapper = new ObjectMapper();
View Full Code Here

                        registerPort(container, pid, key, port);
                        return port;
                    }
                }
            } else {
                throw new FabricException("Could not acquire port lock");
            }
            throw new FabricException("Could not find port within range [" + fromPort + "," + toPort + "]");
        } catch (Exception ex) {
            throw FabricException.launderThrowable(ex);
        } finally {
            releaseLock();
        }
View Full Code Here

                String existingPorts = getStringData(curator.get(), ipPortsPath);
                if (!existingPorts.contains(portAsString)) {
                    setData(curator.get(), ipPortsPath, existingPorts + " " + portAsString);
                }
            } else {
                throw new FabricException("Could not acquire port lock");
            }
        } catch (Exception ex) {
            throw FabricException.launderThrowable(ex);
        } finally {
            releaseLock();
View Full Code Here

                        }
                    }
                    setData(curator.get(), ipPortsPath, sb.toString());
                }
            } else {
                throw new FabricException("Could not acquire port lock");
            }
        } catch (Exception ex) {
            throw FabricException.launderThrowable(ex);
        } finally {
            releaseLock();
View Full Code Here

                        unregisterPort(container, pid, key);
                    }
                    deleteSafe(curator.get(), containerPortsPidPath);
                }
            } else {
                throw new FabricException("Could not acquire port lock");
            }
        } catch (Exception ex) {
            throw FabricException.launderThrowable(ex);
        } finally {
            releaseLock();
View Full Code Here

TOP

Related Classes of io.fabric8.api.FabricException

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.