Package eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.ConfigurationException


                    logo = currentNode.getTextContent().trim();
                }
            }
        }
        if(title == null){
            throw new ConfigurationException("title not set in configfile");
        }
        if(creator == null){
            throw new ConfigurationException("creator not set in configfile");
        }
        ServiceDescription.Builder builder =
                new ServiceDescription.Builder(title,
                                               "eu.planets_project.ifr.services.migrate.Migrate");
        builder.author(creator);
        builder.classname(canonicalName);
        builder.description(description);
        builder.identifier(identifier);
        builder.instructions(instructions);
        builder.version(version);
        builder.tool(tool);
        builder.serviceProvider(publisher);
        builder.paths(paths.toArray(new eu.planets_project.services.datatypes.MigrationPath[paths.size()]));

        if(furtherinfo != null){
            try {
                builder.furtherInfo(new URI(furtherinfo));
            } catch (URISyntaxException e) {
                throw new ConfigurationException("furtherInfo not set to valid value", e);
            }
        }
        if(logo != null){
            try {
                builder.logo(new URI(logo));
            } catch (URISyntaxException e) {
                throw new ConfigurationException("logo not set to valid value", e);
            }
        }

        return builder.build();
View Full Code Here


        URI identifierURI = null;
        if(homepage != null){
            try {
                homepageURL = new URL(homepage);
            } catch (MalformedURLException e) {
                throw new ConfigurationException("Homepage not set to valid value", e);
            }
        }
        if(identifier != null){
            try {
                identifierURI = new URI(identifier);
            } catch (URISyntaxException e) {
                throw new ConfigurationException("identifier not set to valid value", e);
            }
        }

        Tool t = new Tool(identifierURI, name, version, description, homepageURL);
        return t;
View Full Code Here

        // Verify that all identifiers in commandLineIdentifiers are associated
        // with a value in identifierMap
        if (!identifierMap.keySet().containsAll(commandLineIdentifiers)) {
            commandLineIdentifiers.removeAll(identifierMap.keySet());
            throw new ConfigurationException("Cannot build the command line. "
                    + "Missing values for these identifiers: "
                    + commandLineIdentifiers);
        }

        // Replace the identifiers in the command line fragments with their
View Full Code Here

                        presetCategoryID = parameter.getName();
                        final Preset preset = toolPresets
                                .getPreset(presetCategoryID);
                        presetSetting = preset.getSetting(parameter.getValue());
                        if (presetSetting == null) {
                            throw new ConfigurationException(String.format(
                                    "The preset '%s = %s' has not been defined"
                                            + " in the configuration.",
                                    parameter.getName(), parameter.getValue()));
                        }
                    } else {
                        throw new ConfigurationException(String.format(
                                "More than one preset was specified in the "
                                        + "parameters. Found '%s"
                                        + " = %s' and '%s = %s'.",
                                presetCategoryID, presetSetting.getName(),
                                parameter.getName(), parameter.getValue()));
View Full Code Here

            builder.properties(serviceProperties);

            return builder.build();

        } catch (XPathExpressionException xPathExpressionException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the '%s' element.",
                    ConfigurationFileTagsV1.SERVICE_DESCRIPTION_ELEMENT_XPATH,
                    this.configuration.getNodeName()), xPathExpressionException);
        } catch (NullPointerException nullPointerException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the '%s' element.",
                    ConfigurationFileTagsV1.SERVICE_DESCRIPTION_ELEMENT_XPATH,
                    this.configuration.getNodeName()), nullPointerException);
        }
    }
View Full Code Here

            return elementNode.getTextContent().trim();

        } catch (Exception exception) {
            // This is a mandatory element, thus no exceptions are tolerated.
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the '%s' element.",
                    elementName, nodeWithMandatoryElement.getNodeName()),
                    exception);
        }
    }
View Full Code Here

        } catch (XPathExpressionException xpee) {
            // The URI element is optional, thus ignore exceptions.
        } catch (NullPointerException npe) {
            // The URI element is optional, thus ignore exceptions.
        } catch (URISyntaxException uriSyntalException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element and creating a URI, in "
                            + "the '%s' element.", elementName,
                    nodeWithOptionalURIElement.getNodeName()),
                    uriSyntalException);
        }
View Full Code Here

        } catch (XPathExpressionException xpee) {
            // The URI element is optional, thus ignore exceptions.
        } catch (NullPointerException npe) {
            // The URI element is optional, thus ignore exceptions.
        } catch (MalformedURLException malformedURLException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element and creating a URL, in "
                            + "the '%s' element.", elementName,
                    nodeWithOptionalURLElement.getNodeName()),
                    malformedURLException);
        }
View Full Code Here

                properties.add(propertyBuilder.build());
            }
            return properties.toArray(new Property[properties.size()]);
        } catch (Exception exception) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element of the configuration"
                            + " document.", serviceDescriptionNode
                            .getNodeName()), exception);
        }
    }
View Full Code Here

            final Tool toolDescription = new Tool(identifierURI, name, version,
                    description, homePageURL);

            return toolDescription;
        } catch (XPathExpressionException xPathExpressionException) {
            throw new ConfigurationException(String.format(
                    "Failed parsing the '%s' element in the element: %s",
                    ConfigurationFileTagsV1.TOOL_ELEMENT,
                    nodeWithToolDescription.getNodeName()),
                    xPathExpressionException);
        }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.services.migration.genericwrapper2.exceptions.ConfigurationException

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.