001
014
015 package com.liferay.portal.kernel.license.util;
016
017 import com.liferay.portal.kernel.json.JSONObject;
018 import com.liferay.portal.kernel.license.LicenseInfo;
019 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
020
021 import java.util.List;
022 import java.util.Map;
023 import java.util.Set;
024
025
028 public class LicenseManagerUtil {
029
030
033 @Deprecated
034 public static final int STATE_ABSENT = LicenseManager.STATE_ABSENT;
035
036
039 @Deprecated
040 public static final int STATE_EXPIRED = LicenseManager.STATE_EXPIRED;
041
042
045 @Deprecated
046 public static final int STATE_GOOD = LicenseManager.STATE_GOOD;
047
048
052 @Deprecated
053 public static final int STATE_INACTIVE = LicenseManager.STATE_INACTIVE;
054
055
058 @Deprecated
059 public static final int STATE_INVALID = LicenseManager.STATE_INVALID;
060
061
065 @Deprecated
066 public static final int STATE_OVERLOAD = LicenseManager.STATE_OVERLOAD;
067
068 public static void checkLicense(String productId) {
069 getLicenseManager().checkLicense(productId);
070 }
071
072 public static List<Map<String, String>> getClusterLicenseProperties(
073 String clusterNodeId) {
074
075 return getLicenseManager().getClusterLicenseProperties(clusterNodeId);
076 }
077
078 public static String getHostName() {
079 return getLicenseManager().getHostName();
080 }
081
082 public static Set<String> getIpAddresses() {
083 return getLicenseManager().getIpAddresses();
084 }
085
086 public static LicenseInfo getLicenseInfo(String productId) {
087 return getLicenseManager().getLicenseInfo(productId);
088 }
089
090 public static LicenseManager getLicenseManager() {
091 PortalRuntimePermission.checkGetBeanProperty(LicenseManagerUtil.class);
092
093 return _licenseManager;
094 }
095
096 public static List<Map<String, String>> getLicenseProperties() {
097 return getLicenseManager().getLicenseProperties();
098 }
099
100 public static Map<String, String> getLicenseProperties(String productId) {
101 return getLicenseManager().getLicenseProperties(productId);
102 }
103
104 public static int getLicenseState(Map<String, String> licenseProperties) {
105 return getLicenseManager().getLicenseState(licenseProperties);
106 }
107
108 public static int getLicenseState(String productId) {
109 return getLicenseManager().getLicenseState(productId);
110 }
111
112 public static Set<String> getMacAddresses() {
113 return getLicenseManager().getMacAddresses();
114 }
115
116 public static void registerLicense(JSONObject jsonObject) throws Exception {
117 getLicenseManager().registerLicense(jsonObject);
118 }
119
120 public void setLicenseManager(LicenseManager licenseManager) {
121 PortalRuntimePermission.checkSetBeanProperty(getClass());
122
123 _licenseManager = licenseManager;
124 }
125
126 private static LicenseManager _licenseManager;
127
128 }