protected String addSecurityToken(String base, String connector, String nodeId, String securityToken) { StringBuilder sb = new StringBuilder(addNodeId(base, nodeId, "?")); sb.append(connector); sb.append(WebConstants.SECURITY_TOKEN); sb.append("="); sb.append(securityToken); append(sb, WebConstants.HOST_NAME, AppUtils.getHostName()); append(sb, WebConstants.IP_ADDRESS, AppUtils.getIpAddress()); return sb.toString(); }
public void refresh() { this.hostName = AppUtils.getHostName(); setIpAddress(AppUtils.getIpAddress()); this.osUser = System.getProperty("user.name"); this.osName = System.getProperty("os.name"); this.osArch = System.getProperty("os.arch"); this.osVersion = System.getProperty("os.version"); this.availableProcessors = Runtime.getRuntime().availableProcessors(); this.freeMemoryBytes = Runtime.getRuntime().freeMemory(); this.totalMemoryBytes = Runtime.getRuntime().totalMemory(); this.maxMemoryBytes = Runtime.getRuntime().maxMemory(); this.javaVersion = System.getProperty("java.version"); this.javaVendor = System.getProperty("java.vendor"); this.symmetricVersion = Version.version(); this.timezoneOffset = AppUtils.getTimezoneOffset(); Calendar cal = Calendar.getInstance(); cal.set(Calendar.MILLISECOND, 0); this.heartbeatTime = cal.getTime(); }
protected String substituteVariables(String paramKey) { String value = getString(paramKey); if (!StringUtils.isBlank(value)) { if (value.contains("hostName")) { value = FormatUtils.replace("hostName", AppUtils.getHostName(), value); } if (value.contains("ipAddress")) { value = FormatUtils.replace("ipAddress", AppUtils.getIpAddress(), value); } if (value.contains("engineName")) { value = FormatUtils.replace("engineName", getEngineName(), value); } } return value; }
public static String buildRegistrationUrl(String baseUrl, Node node) throws IOException { if (baseUrl == null) { baseUrl = ""; } StringBuilder builder = new StringBuilder(baseUrl); builder.append("/registration?"); append(builder, WebConstants.NODE_GROUP_ID, node.getNodeGroupId()); append(builder, WebConstants.EXTERNAL_ID, node.getExternalId()); append(builder, WebConstants.SYNC_URL, node.getSyncUrl()); append(builder, WebConstants.SCHEMA_VERSION, node.getSchemaVersion()); append(builder, WebConstants.DATABASE_TYPE, node.getDatabaseType()); append(builder, WebConstants.DATABASE_VERSION, node.getDatabaseVersion()); append(builder, WebConstants.SYMMETRIC_VERSION, node.getSymmetricVersion()); append(builder, WebConstants.HOST_NAME, AppUtils.getHostName()); append(builder, WebConstants.IP_ADDRESS, AppUtils.getIpAddress()); return builder.toString(); }