Codota Logo
GatewayVersion
Code IndexAdd Codota to your IDE (free)

How to use
GatewayVersion
in
org.kaazing.gateway.service.update.check

Best Java code snippets using org.kaazing.gateway.service.update.check.GatewayVersion (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: kaazing/gateway

@Override
public boolean equals(Object obj) {
  boolean result;
  if (!(obj instanceof GatewayVersion)) {
    result = false;
  } else if (obj == this) {
    result = true;
  } else {
    result = this.compareTo((GatewayVersion) obj) == 0;
  }
  return result;
}
origin: kaazing/gateway

@Override
public String getAvailableUpdateVersion() {
  return (this.latestVersion != null) ? this.latestVersion.toString() : "";
}
origin: kaazing/gateway

JSONObject root = new JSONObject(tokener);
String version = root.getString("version");
latestVersion = parseGatewayVersion(version);
origin: kaazing/gateway

/**
 * Parses a GatewayVersion from a String
 * @param version
 * @return
 * @throws Exception
 */
public static GatewayVersion parseGatewayVersion(String version) throws Exception {
  if ("develop-SNAPSHOT".equals(version)) {
    return new GatewayVersion(0, 0, 0);
  } else {
    String regex = "(?<major>[0-9]+)\\.(?<minor>[0-9]+)\\.(?<patch>[0-9]+)-?(?<rc>[RC0-9{3}]*)";
    Pattern pattern = Pattern.compile(regex);
    Matcher matcher = pattern.matcher(version);
    if (matcher.matches()) {
      int major = Integer.parseInt(matcher.group("major"));
      int minor = Integer.parseInt(matcher.group("minor"));
      int patch = Integer.parseInt(matcher.group("patch"));
      String rc = matcher.group("rc");
      return new GatewayVersion(major, minor, patch, rc);
    } else {
      throw new IllegalArgumentException(String.format("version String is not of form %s", regex));
    }
  }
}
origin: kaazing/gateway

public UpdateCheckService() {
  ProductInfo productInfo = getProductInfoInstance();
  productName = productInfo.getTitle().replaceAll("\\s+", "");
  try {
    String version = productInfo.getMajor() +"."+ productInfo.getMinor() +"."+ productInfo.getPatch();
    currentVersion = parseGatewayVersion(version);
  } catch (Exception e) {
    throw new RuntimeException("Could not locate a product version associated with the jars on the classpath",
        e);
  }
  final String productEdition = productInfo.getEdition().replaceAll("\\s+", "");
  versionServiceUrl = (productEdition.toLowerCase().contains("enterprise")) ? "https://version.kaazing.com"
      : "https://version.kaazing.org";
}
origin: kaazing/gateway

@Override
public void newVersionAvailable(GatewayVersion currentVersion, GatewayVersion latestGatewayVersion) {
  if (latestVersion == null || latestVersion.compareTo(latestGatewayVersion) < 0) {
    this.latestVersion = latestGatewayVersion;
  }
}
origin: kaazing/gateway

protected void setLatestGatewayVersion(GatewayVersion newlatestVersion) {
  if (this.latestVersion == null || this.latestVersion.compareTo(newlatestVersion) < 0) {
    synchronized (this) {
      this.latestVersion = newlatestVersion;
    }
    if (newlatestVersion.compareTo(currentVersion) > 0) {
      notifyListeners();
    }
  }
}
origin: kaazing/gateway

  /**
   * Adds a @UpdateCheckListener who will be notified when the version changes,
   * @param newListener
   */
  public void addListener(UpdateCheckListener newListener) {
    GatewayVersion latestGatewayVersion = this.getLatestGatewayVersion();
    if (latestGatewayVersion != null && latestGatewayVersion.compareTo(currentVersion) > 0) {
      newListener.newVersionAvailable(currentVersion, latestGatewayVersion);
    }
    newListener.setUpdateCheckService(this);
    listeners.add(newListener);
  }
}
org.kaazing.gateway.service.update.checkGatewayVersion

Javadoc

Represent GatewayVersion with 3 digits of form major.minor.patch

Most used methods

  • compareTo
  • <init>
  • parseGatewayVersion
    Parses a GatewayVersion from a String
  • toString

Popular in Java

  • Making http requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • JOptionPane (javax.swing)
  • JPanel (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now