@RequestHandler(RequestCmd.OBJECT_INFO) public Pack getAgentInfo(Pack param) { MapPack p = new MapPack(); p.put("objHash", conf.getObjHash()); p.put("objName", conf.getObjName()); p.put("java.version", System.getProperty("java.version")); p.put("os.name", System.getProperty("os.name")); p.put("user.home", System.getProperty("user.home")); p.put("work.dir", new File(".").getAbsolutePath()); return p; }
public ListValue newList(String name) { ListValue list = new ListValue(); this.put(name, list); return list; }
public ListValue newList(String name) { ListValue list = new ListValue(); this.put(name, list); return list; }
public boolean setTTL(final String keySpace, final String key, final long ttl, final Server server) { Value returnValue = null; MapPack mapPack = new MapPack(); mapPack.put(ParamConstant.KEY_SPACE, keySpace); mapPack.put(ParamConstant.KEY, key); mapPack.put(ParamConstant.TTL, ttl); try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) { returnValue = tcpProxy.getSingleValue(RequestCmd.SET_CUSTOM_TTL, mapPack); } return returnValue != null ? (Boolean) returnValue.toJavaObject() : false; }
public String get(final String keySpace, final String key, final Server server) { MapPack mapPack = new MapPack(); mapPack.put(ParamConstant.KEY_SPACE, keySpace); mapPack.put(ParamConstant.KEY, key); Value value = null; try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) { value = tcpProxy.getSingleValue(RequestCmd.GET_CUSTOM_KV, mapPack); } return value != null ? value.toString() : null; }
public long retrieveVisitorByObj(int objHash, String date, final Server server) { MapPack param = new MapPack(); param.put(ParamConstant.OBJ_HASH, objHash); param.put(ParamConstant.DATE, date); Value value; try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) { value = tcpProxy.getSingleValue(RequestCmd.VISITOR_LOADDATE, param); } return ((DecimalValue) value).value; }
public long retrieveVisitorTotalByObj(String objType, String date, final Server server) { MapPack param = new MapPack(); param.put(ParamConstant.OBJ_TYPE, objType); param.put(ParamConstant.DATE, date); Value value; try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) { value = tcpProxy.getSingleValue(RequestCmd.VISITOR_LOADDATE_TOTAL, param); } return ((DecimalValue) value).value; }
@RequestHandler(RequestCmd.LIST_CONFIGURE_WAS) public Pack listConfigure(Pack param) { MapValue m = Configure.getInstance().getKeyValueInfo(); MapPack pack = new MapPack(); pack.put("key", m.getList("key")); pack.put("value", m.getList("value")); pack.put("default", m.getList("default")); return pack; }
@RequestHandler(RequestCmd.LIST_CONFIGURE_WAS) public Pack listConfigure(Pack param) { MapValue m = Configure.getInstance().getKeyValueInfo(); MapPack pack = new MapPack(); pack.put("key", m.getList("key")); pack.put("value", m.getList("value")); pack.put("default", m.getList("default")); return pack; }
public MapPack toMapPack() { MapPack pack = new MapPack(); for(String key : data.keySet()) { pack.put(key, data.get(key)); } return pack; } }
public Pack read(DataInputX din) throws IOException { int count = (int) din.readDecimal(); for (int t = 0; t < count; t++) { String key = din.readText(); Value value = din.readValue(); this.put(key, value); } return this; }
public long retrieveVisitorRealTimeByObjType(String objType, final Server server) { MapPack param = new MapPack(); param.put(ParamConstant.OBJ_TYPE, objType); Value value; try (TcpProxy tcpProxy = TcpProxy.getTcpProxy(server)) { value = tcpProxy.getSingleValue(RequestCmd.VISITOR_REALTIME_TOTAL, param); } return ((DecimalValue) value).value; }
public MapPack toMapPack() { MapPack pack = new MapPack(); for(String key : data.keySet()) { pack.put(key, data.get(key)); } return pack; } }
/** * set current active service list by obj hashes * * @param objHash * @param server */ public List<SActiveService> retrieveActiveServiceListByObjHash(final int objHash, final Server server) { MapPack paramPack = new MapPack(); paramPack.put(ParamConstant.OBJ_HASH, objHash); List<Pack> packList = retrieveActiveService(paramPack, server); return SActiveService.ofPackList(packList); }
@RequestHandler(RequestCmd.GET_CONFIGURE_WAS) public Pack getAgentConfigure(Pack param) { MapPack p = new MapPack(); p.put("configKey", Configure.getInstance().getKeyValueInfo().getList("key")); String config = Configure.getInstance().loadText(); if (config == null) { //config = getEmptyConfiguration(); config = ""; } p.put("agentConfig", config); return p; }
@RequestHandler(RequestCmd.CONFIGURE_DESC) public Pack getConfigureDesc(Pack param) { StringKeyLinkedMap<String> descMap = Configure.getInstance().getConfigureDesc(); MapPack pack = new MapPack(); Enumeration<StringKeyLinkedEntry<String>> entries = descMap.entries(); while (entries.hasMoreElements()) { StringKeyLinkedEntry<String> entry = entries.nextElement(); pack.put(entry.getKey(), entry.getValue()); } return pack; }
@RequestHandler(RequestCmd.CONFIGURE_DESC) public Pack getConfigureDesc(Pack param) { StringKeyLinkedMap<String> descMap = Configure.getInstance().getConfigureDesc(); MapPack pack = new MapPack(); Enumeration<StringKeyLinkedEntry<String>> entries = descMap.entries(); while (entries.hasMoreElements()) { StringKeyLinkedEntry<String> entry = entries.nextElement(); pack.put(entry.getKey(), entry.getValue()); } return pack; }
@RequestHandler(RequestCmd.CONFIGURE_VALUE_TYPE) public Pack getConfigureValueType(Pack param) { StringKeyLinkedMap<ValueType> valueTypeMap = Configure.getInstance().getConfigureValueType(); MapPack pack = new MapPack(); Enumeration<StringKeyLinkedEntry<ValueType>> entries = valueTypeMap.entries(); while (entries.hasMoreElements()) { StringKeyLinkedEntry<ValueType> entry = entries.nextElement(); pack.put(entry.getKey(), entry.getValue().getType()); } return pack; } }