001
014
015 package com.liferay.portal.license.util;
016
017 import com.liferay.portal.license.LicenseInfo;
018
019 import java.util.Set;
020
021
024 public class LicenseManagerUtil {
025
026 public static final int STATE_ABSENT = 1;
027
028 public static final int STATE_EXPIRED = 2;
029
030 public static final int STATE_GOOD = 3;
031
032 public static final int STATE_INACTIVE = 4;
033
034 public static final int STATE_INVALID = 5;
035
036 public static final int STATE_OVERLOAD = 6;
037
038 public static void checkLicense(String productId) {
039 getLicenseManager().checkLicense(productId);
040 }
041
042 public static String getHostName() {
043 return getLicenseManager().getHostName();
044 }
045
046 public static Set<String> getIpAddresses() {
047 return getLicenseManager().getIpAddresses();
048 }
049
050 public static LicenseInfo getLicenseInfo(String productId) {
051 return getLicenseManager().getLicenseInfo(productId);
052 }
053
054 public static LicenseManager getLicenseManager() {
055 return _licenseManager;
056 }
057
058 public static int getLicenseState(String productId) {
059 return getLicenseManager().getLicenseState(productId);
060 }
061
062 public static Set<String> getMacAddresses() {
063 return getLicenseManager().getMacAddresses();
064 }
065
066 public void setLicenseManager(LicenseManager licenseManager) {
067 _licenseManager = licenseManager;
068 }
069
070 private static LicenseManager _licenseManager;
071
072 }