Package com.socrata.datasync.deltaimporter2

Examples of com.socrata.datasync.deltaimporter2.Version


    public static final String WGAPUBLISHER_PRODUCT_NAME = "OpenWGA Server";
    public static final String WGAPUBLISHER_PLATFORM_NAME = "Dragon";
   
    public static Version toCsConfigVersion() {
       
        Version version =
            new Version(WGAPUBLISHER_MAJOR_VERSION,
                    WGAPUBLISHER_MINOR_VERSION,
                    WGAPUBLISHER_MAINTENANCE_VERSION,
                    WGAPUBLISHER_PATCH_VERSION,
                    WGAPUBLISHER_BUILD_VERSION);
        return version;
View Full Code Here


                catch (InvalidPluginException e) {
                    plugin.addInstallationFault(plugin.new InitialisationFault(e.getMessage()));
                }
               
                // WGA Version
                Version wgaVersion = WGAVersion.toCsConfigVersion();
                int comp = wgaVersion.compareTo(plugin.getCsConfig().getPluginConfig().getMinimumWGAVersion());
                if (comp < 0) {
                    plugin.addInstallationFault(plugin.new InstallationFault(WGAPlugin.InstallationFault.ERROR_WRONG_WGA_VERSION));
                }
               
                // Java Version
                Version javaVersion = Version.getJavaVersion();
                comp = javaVersion.compareTo(plugin.getCsConfig().getPluginConfig().getMinimumJavaVersion());
                if (comp < 0) {
                    plugin.addInstallationFault(plugin.new InstallationFault(WGAPlugin.InstallationFault.ERROR_WRONG_JAVA_VERSION));
                }
               
                // Dependencies
View Full Code Here

            String dbKey = plugin.buildDatabaseKey();
            WGDatabase db = contentdbs.get(dbKey);
            if (db != null) {
                try {
                    Long pluginFileTime = (Long) db.getAttribute(DBATTRIB_PLUGIN_FILETIME);
                    Version pluginVersion = (Version) db.getAttribute(DBATTRIB_PLUGIN_VERSION);
                    if (pluginVersion.equals(plugin.getPluginID().getVersion()) &&
                        (pluginFileTime != null && pluginFileTime.equals(new Long(plugin.getFileLastModified())))) {
                        if (!db.isSessionOpen()) {
                            db.openSession();
                        }
                        return db;
View Full Code Here

    public void createPluginConfig() {
        PluginConfig config =  PluginConfig.instantiatePluginConfigForCompliance(_csConfig.getVersionCompliance());
        config.getId().getVersion().setBuildVersion(1);
        if (getVersionCompliance() != null) {
            Version minWGAVersion = VERSIONCOMPLIANCE_TO_WGA_VERSION.get(getVersionCompliance().getKey());
            if (minWGAVersion != null) {
                config.setMinimumWGAVersion(minWGAVersion);
            }
           
            // OpenWGA 5.0 requires java 1.5
            if (minWGAVersion.isAtLeast(5, 0)) {
                config.setMinimumJavaVersion(new Version("1.5.0"));
            }
        }
       
        config.setPersonalisationMode(Constants.PERSMODE_AUTO);
       
View Full Code Here

    public List<ValidationError> validate() {
        List<ValidationError> errors = new ArrayList<ValidationError>();

        if (hasPluginConfig()) {
            try {
                Version newV = new Version(_pluginVersion);
                newV.setBuildVersion(_pluginBuild);
                _csConfig.getPluginConfig().getId().setVersion(newV);
            }
            catch (RuntimeException e) {
                // unparsable version
                errors.add(new ValidationError("Invalid version format.", new String[] { "pluginVersion" }));
            }

            try {
                Version newV = new Version(_pluginWGAVersion);
                _csConfig.getPluginConfig().setMinimumWGAVersion(newV);
            }
            catch (RuntimeException e) {
                // unparsable version
                errors.add(new ValidationError("Invalid version format.", new String[] { "pluginWGAVersion" }));
            }

            try {
                Version newV = new Version(_pluginJavaVersion);
                _csConfig.getPluginConfig().setMinimumJavaVersion(newV);
            }
            catch (RuntimeException e) {
                // unparsable version
                errors.add(new ValidationError("Invalid version format.", new String[] { "pluginJavaVersion" }));
View Full Code Here

  }
 
  public static Version toWGAVersion(VersionCompliance versionCompliance) {
    if (versionCompliance != null) {
      if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA3)) {
        return new Version(3, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA4)) {
        return new Version(4, 0, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA41)) {
        return new Version(4, 1, 0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA50)) {
        return new Version(5, 0 ,0);
      } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA51)) {
                return new Version(5, 1 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA52)) {
                return new Version(5, 2 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA53)) {
                return new Version(5, 3 ,0);
            } else if (versionCompliance.getKey().equals(VERSIONCOMPLIANCE_WGA54)) {
                return new Version(5, 4 ,0);
            }
    }
    return null;
  }
View Full Code Here

        bean.setUniqueName(sValue)
        update(bean);
        break;
      case 1:
        try {       
          bean.setVersion(new Version((String)value));
          update(bean);
        } catch (RuntimeException e) {
          // unparsable version
            throw new IllegalArgumentException("Unparseable plugin version");
        }
View Full Code Here

TOP

Related Classes of com.socrata.datasync.deltaimporter2.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.