File size: 2,402 Bytes
eb67da4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
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;
/**
*
* CmsVersion
*
*/
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();
/**
* @return version
*/
public static final String getVersion() {
return "V4.0.202204";
}
/**
* @return revision
*/
public static final String getRevision() {
return "b";
}
/**
* @return whether the authorization edition
*/
public static boolean isAuthorizationEdition() {
return copyright.verify(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME);
}
/**
* @param domain
* @return whether the domain authorized
*/
public static boolean verifyDomain(String domain) {
return copyright.verify(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME, domain);
}
/**
* @return license
*/
public static License getLicense() {
return copyright.getLicense(CommonConstants.CMS_FILEPATH + CommonConstants.LICENSE_FILENAME);
}
/**
* @return cluster id
*/
public static final String getClusterId() {
return clusterId;
}
/**
* @return whether the master node
*/
public static boolean isMaster() {
return master;
}
/**
* @param master
*/
public static void setMaster(boolean master) {
CmsVersion.master = master;
}
/**
* @return whether initialized
*/
public static boolean isInitialized() {
return initialized;
}
/**
* @param initialized
*/
public static void setInitialized(boolean initialized) {
CmsVersion.initialized = initialized;
}
/**
* @return the scheduled
*/
public static boolean isScheduled() {
return scheduled && initialized;
}
/**
* @param scheduled the scheduled to set
*/
public static void setScheduled(boolean scheduled) {
CmsVersion.scheduled = scheduled;
}
} |