Package com.volantis.mcs.migrate.api.framework

Examples of com.volantis.mcs.migrate.api.framework.Version


        final String inputData = "the old input";
        final String outputData = "the new output";

        FrameworkFactory factory = FrameworkFactory.getDefaultInstance();

        Version version1 = factory.createVersion("version 1");
        Version version2 = factory.createVersion("version 2");

        SimpleCLINotificationReporter notificationReporter =
                new SimpleCLINotificationReporter();

        ResourceMigratorBuilder builder =
View Full Code Here


        // Note: We will need a VersionRegistry to handle creating versions on
        // the fly from an XML file, but for now just create them normally.

        FrameworkFactory factory = FrameworkFactory.getDefaultInstance();

        Version v30 = factory.createVersion("3.0");
        Version v35 = factory.createVersion("3.4");

        SimpleCLINotificationReporter notificationReporter =
                new SimpleCLINotificationReporter();

        ResourceMigratorBuilder builder =
View Full Code Here

        // target version.
        List path = new ArrayList();

        // Loop around over the steps until no more steps can be added or the
        // path from the specified version to the target version is complete.
        Version inputVersion = version;
        Step addedStep;
        do {
            Version nextVersion = null;
            addedStep = null;
            for (Iterator i = steps.iterator(); i.hasNext();) {
                Step step = (Step) i.next();
                if (step.getInput() == inputVersion) {
                    if (addedStep != null) {
View Full Code Here

            // todo: add a debug log here? does this use notification?
        }

        if (recognisedPath || !applyPathRecognition) {

            Version identifiedVersion = null;
            Iterator contentRecognisersIterator = contentIdentifiers.iterator();
            while (contentRecognisersIterator.hasNext()) {
                input.restart();
                ContentIdentifier contentRecogniser =
                        (ContentIdentifier) contentRecognisersIterator.next();

                // todo: later: potentially a recognition exception should not
                // always be fatal. It may be that there are multiple
                // recognisers for a path and that one of the ones that throws
                // an exception is not the one that actually recognises the
                // content. In this case we could log the error, continue on,
                // and only fail if there is no match in the end.
                boolean identifiedContent;
                try {
                    identifiedContent = contentRecogniser.identifyContent(input);
                } catch (Exception e) {
                    throw new ResourceMigrationException("Error identifying " +
                            "content for type " + getName() + " version " +
                            contentRecogniser.getVersion().getName(), e);
                }

                if (identifiedContent) {
                    if (identifiedVersion == null) {
                        identifiedVersion = contentRecogniser.getVersion();
                    } else {
                        throw new IllegalStateException("Duplicate version " +
                                "match: " + contentRecogniser.getVersion().
                                getName() + " and " + identifiedVersion +
                                " both match the content");
                    }
                }
            }

            if (identifiedVersion != null &&
                    !identifiedVersion.equals(graph.getTargetVersion())) {
                // Extract the sequence of steps that starts with the
                // identified version. This might generate an exception if
                // we didn't do much validation at build time and the
                // identified version does not have a matching step.
                Iterator sequence = graph.getSequence(identifiedVersion);

                match = factory.createMatch(getName(),
                        identifiedVersion.getName(), sequence);
            }
        }

        return match;
    }
View Full Code Here

    public ResourceMigrator createDefaultResourceMigrator(
            NotificationReporter reporter, boolean strictMode) throws ResourceMigrationException {
        FrameworkFactory factory = FrameworkFactory.getDefaultInstance();

        Version rpdm27to30 = factory.createVersion("rpdm 2.7-3.0");
        Version lpdm30 = factory.createVersion("lpdm 3.0");

        Version repository200509 = factory.createVersion("repository 2005/09");
        Version repository200512 = factory.createVersion("repository 2005/12");
        Version repository200602 = factory.createVersion("repository 2006/02");

        ResourceMigratorBuilder builder =
                factory.createResourceMigratorBuilder(reporter);

        // ====================================================================
View Full Code Here

TOP

Related Classes of com.volantis.mcs.migrate.api.framework.Version

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.