All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.almworks.jira.structure.api2g.license.LicenseData Maven / Gradle / Ivy

There is a newer version: 17.25.3
Show newest version
package com.almworks.jira.structure.api2g.license;

import org.jetbrains.annotations.Nullable;

import java.util.Collection;

public interface LicenseData {
  LicenseData DISABLED = new Disabled();

  String getLicensee();

  StructureLicenseType getLicenseType();

  @Nullable
  String getSerial();

  long getSerialNumber();

  /**
   * @return expiration date, <= 0 if no expiration
   */
  long getExpirationTimestamp();

  /**
   * @return maintenance expiration date, <= 0 if no expiration
   */
  long getMaintenanceExpirationDate();

  /**
   * @return collection of licensed server IDs, or null if not limited
   */
  Collection getLicensedServers();

  boolean isServerLocked();

  int getMaximumNumberOfUsers();

  boolean isUnlimitedNumberOfUsers();

  void extraChecks() throws LicenseException;

  boolean hasExpiration();

  boolean hasMaintenanceExpiration();

  boolean isMarketplaceLicense();

  class Disabled implements LicenseData {
    @Override
    public String getLicensee() {
      return "--";
    }

    @Override
    public StructureLicenseType getLicenseType() {
      return StructureLicenseType.DISABLED;
    }

    @Nullable
    @Override
    public String getSerial() {
      return null;
    }

    @Override
    public long getSerialNumber() {
      return 0;
    }

    @Override
    public long getExpirationTimestamp() {
      return 0;
    }

    @Override
    public long getMaintenanceExpirationDate() {
      return 0;
    }

    @Override
    public Collection getLicensedServers() {
      return null;
    }

    @Override
    public boolean isServerLocked() {
      return false;
    }

    @Override
    public int getMaximumNumberOfUsers() {
      return 0;
    }

    @Override
    public boolean isUnlimitedNumberOfUsers() {
      return false;
    }

    @Override
    public void extraChecks() throws LicenseException {

    }

    @Override
    public boolean hasExpiration() {
      return false;
    }

    @Override
    public boolean hasMaintenanceExpiration() {
      return false;
    }

    @Override
    public boolean isMarketplaceLicense() {
      return false;
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy