|
package com.publiccms.common.constants; |
|
|
|
import java.util.UUID; |
|
|
|
import com.publiccms.common.copyright.CmsCopyright; |
|
import com.publiccms.common.copyright.Copyright; |
|
import com.publiccms.common.copyright.License; |
|
|
|
|
|
|
|
|
|
|
|
|
|
public class CmsVersion { |
|
private static final String clusterId = UUID.randomUUID().toString(); |
|
private static boolean master = false; |
|
private static boolean initialized = false; |
|
private static boolean scheduled = true; |
|
private static Copyright copyright = new CmsCopyright(); |
|
|
|
|
|
|
|
|
|
public static final String getVersion() { |
|
return "V4.0.202204"; |
|
} |
|
|
|
|
|
|
|
public static final String getRevision() { |
|
return "b"; |
|
} |
|
|
|
|
|
|
|
|
|
public static boolean isAuthorizationEdition() { |
|
return copyright.verify(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME); |
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static boolean verifyDomain(String domain) { |
|
return copyright.verify(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME, domain); |
|
} |
|
|
|
|
|
|
|
|
|
public static License getLicense() { |
|
return copyright.getLicense(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME); |
|
} |
|
|
|
|
|
|
|
|
|
public static final String getClusterId() { |
|
return clusterId; |
|
} |
|
|
|
|
|
|
|
|
|
public static boolean isMaster() { |
|
return master; |
|
} |
|
|
|
|
|
|
|
|
|
public static void setMaster(boolean master) { |
|
CmsVersion.master = master; |
|
} |
|
|
|
|
|
|
|
|
|
public static boolean isInitialized() { |
|
return initialized; |
|
} |
|
|
|
|
|
|
|
|
|
public static void setInitialized(boolean initialized) { |
|
CmsVersion.initialized = initialized; |
|
} |
|
|
|
|
|
|
|
public static boolean isScheduled() { |
|
return scheduled && initialized; |
|
} |
|
|
|
|
|
|
|
public static void setScheduled(boolean scheduled) { |
|
CmsVersion.scheduled = scheduled; |
|
} |
|
} |