Alachisoft.NCache.Common.ServiceConfiguration Maven / Gradle / Ivy
package Alachisoft.NCache.Common;
import Alachisoft.NCache.Common.Enum.Time;
import com.alachisoft.ncache.runtime.util.TimeSpan;
import java.net.InetAddress;
import java.net.UnknownHostException;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if !VS2003
public class ServiceConfiguration {
private static String _port = "9800";
private static int _managementPort = 8250;
private static String _sendBufferSize = "131072";
private static String _receiveBufferSize = "131072";
private static String _licenseLogging = "false";
private static String _bindToClusterIP;
private static String _bindToClientServerIP;
private static String _enableDualSocket = "false";
private static String _enableNaggling = "false";
private static String _nagglingSize = "500";
private static String _autoStartCaches;
private static String _cacheUserName;
private static String _cacheUserPassword;
private static String _enableDebuggingCounters = "false";
private static String _expirationBulkRemoveSize = "10";
private static String _expirationBulkRemoveDelay = "0";
private static String _evictionBulkRemoveSize = "10";
private static String _evictionBulkRemoveDelay = "0";
private static String _bulkItemsToReplicated = "300";
private static String _publishCountersToCacheHost = "false";
private static TimeSpan _metricsMonitorPublishingInterval = TimeSpan.FromSeconds(1);
static {
Load();
}
public static void Load() {
try {
try {
_bindToClusterIP= InetAddress.getLocalHost().getHostAddress();
_bindToClientServerIP = InetAddress.getLocalHost().getHostAddress();
} catch (Exception e) {
}
//Mansoor: replace it with properites files in java
/*System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
if (config.AppSettings.Settings["NCacheServer.ExpirationBulkRemoveSize"] != null) {
_expirationBulkRemoveSize = config.AppSettings.Settings["NCacheServer.ExpirationBulkRemoveSize"].Value;
}
if (config.AppSettings.Settings["NCacheServer.ExpirationBulkRemoveDelay"] != null) {
_expirationBulkRemoveDelay = config.AppSettings.Settings["NCacheServer.ExpirationBulkRemoveDelay"].Value;
}
if (config.AppSettings.Settings["NCacheServer.EvictionBulkRemoveSize"] != null) {
_evictionBulkRemoveSize = config.AppSettings.Settings["NCacheServer.EvictionBulkRemoveSize"].Value;
}
if (config.AppSettings.Settings["NCacheServer.EvictionBulkRemoveDelay"] != null) {
_evictionBulkRemoveDelay = config.AppSettings.Settings["NCacheServer.EvictionBulkRemoveDelay"].Value;
}*/
} catch (RuntimeException ex) {
}
}
public static int getManagementPort() {
return _managementPort;
}
public static void setManagementPort(int value) {
_managementPort = value;
}
public static String getPort() {
return _port;
}
public static void setPort(String value) {
_port = value;
}
public static String getSendBufferSize() {
return _sendBufferSize;
}
public static void setSendBufferSize(String value) {
_sendBufferSize = value;
}
public static String getReceiveBufferSize() {
return _receiveBufferSize;
}
public static void setReceiveBufferSize(String value) {
setReceiveBufferSize(value);
}
public static String getLicenseLogging() {
return _licenseLogging;
}
public static void setLicenseLogging(String value) {
_licenseLogging = value;
}
public static String getBindToClusterIP() {
return _bindToClusterIP;
}
public static void setBindToClusterIP(String value) {
_bindToClusterIP = value;
}
public static String getBindToClientServerIP() {
return _bindToClientServerIP;
}
public static void setBindToClientServerIP(String value) {
_bindToClientServerIP = value;
}
public static String getEnableDualSocket() {
return _enableDualSocket;
}
public static void setEnableDualSocket(String value) {
_enableDualSocket = value;
}
public static String getEnableNaggling() {
return _enableNaggling;
}
public static void setEnableNaggling(String value) {
_enableNaggling = value;
}
public static String getNagglingSize() {
return _nagglingSize;
}
public static void setNagglingSize(String value) {
_nagglingSize = value;
}
public static String getAutoStartCaches() {
return _autoStartCaches;
}
public static void setAutoStartCaches(String value) {
_autoStartCaches = value;
}
public static String getCacheUserName() {
return _cacheUserName;
}
public static void setCacheUserName(String value) {
_cacheUserName = value;
}
public static String getCacheUserPassword() {
return _cacheUserPassword;
}
public static void setCacheUserPassword(String value) {
_cacheUserPassword = value;
}
public static String getEnableDebuggingCounters() {
return _enableDebuggingCounters;
}
public static void setEnableDebuggingCounters(String value) {
_enableDebuggingCounters = value;
}
public static String getExpirationBulkRemoveSize() {
return _expirationBulkRemoveSize;
}
public static void setExpirationBulkRemoveSize(String value) {
_expirationBulkRemoveSize = value;
}
public static String getExpirationBulkRemoveDelay() {
return _expirationBulkRemoveDelay;
}
public static void setExpirationBulkRemoveDelay(String value) {
_expirationBulkRemoveDelay = value;
}
public static String getEvictionBulkRemoveSize() {
return _evictionBulkRemoveSize;
}
public static void setEvictionBulkRemoveSize(String value) {
_evictionBulkRemoveSize = value;
}
public static String getEvictionBulkRemoveDelay() {
return _evictionBulkRemoveDelay;
}
public static void setEvictionBulkRemoveDelay(String value) {
_evictionBulkRemoveDelay = value;
}
public static String getBulkItemsToReplicated() {
return _bulkItemsToReplicated;
}
public static void setBulkItemsToReplicated(String value) {
_bulkItemsToReplicated = value;
}
public static String getPublishCountersToCacheHost() {
return _publishCountersToCacheHost;
}
private static void setPublishCountersToCacheHost(String value) {
_publishCountersToCacheHost = value;
}
public static TimeSpan getMetricsMonitorPublishingInterval() {
return _metricsMonitorPublishingInterval;
}
public static void setMetricsMonitorPublishingInterval(TimeSpan value) {
_metricsMonitorPublishingInterval = value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy