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

Examples of eu.planets_project.ifr.core.services.migration.genericwrapper2.GenericMigrationWrapper


        // 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

            Map<String, String> identifierMap,
            Map<String, File> tempFileMappings) throws MigrationException {

        for (String tempFileLabel : tempFileMappings.keySet()) {
            if (identifierMap.containsKey(tempFileLabel)) {
                throw new MigrationException(String.format(
                        "The identifier map already contains an element with "
                                + "the key '%s'. Cannot add the temporay file "
                                + "mapping '%s = %s'.", tempFileLabel,
                        tempFileLabel, tempFileMappings.get(tempFileLabel)));
            }

            try {
                identifierMap.put(tempFileLabel, tempFileMappings.get(
                        tempFileLabel).getCanonicalPath());
            } catch (SecurityException se) {
                throw new MigrationException(
                        String.format(
                                "Failed accessing the canonical file path of the "
                                        + "temporary file labeled '%s'",
                                tempFileLabel), se);
            } catch (IOException ioe) {
                throw new MigrationException(
                        String.format(
                                "Failed accessing the canonical file path of the "
                                        + "temporary file labeled '%s'",
                                tempFileLabel), ioe);
            }
View Full Code Here

    temporaryFileMappings = createTemporaryFile(
      temporaryFileMappings, tempFileLabel, desiredFileName);
      }
  } catch (IOException ioe) {
      throw new MigrationException("Failed creating temporary files.",
        ioe);
  }
  return temporaryFileMappings;
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.ifr.core.services.migration.genericwrapper2.GenericMigrationWrapper

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.