protected object ExecuteCommandOnCacehServer(Alachisoft.NCache.Common.Protobuf.ManagementCommand command) { ManagementResponse response = null; if (_requestManager != null) { try { response = _requestManager.SendRequest(command) as ManagementResponse; } catch (System.Exception e) { throw new ManagementException(e.Message,e); } if (response != null && response.exception != null) { throw new ManagementException(response.exception.message); } } if (response != null) return response.ReturnValue; return null; }
protected object ExecuteCommandOnCacehServer(Alachisoft.NCache.Common.Protobuf.ManagementCommand command) { ManagementResponse response = null; if (_requestManager != null) { try { response = _requestManager.SendRequest(command) as ManagementResponse; } catch (System.Exception e) { throw new ManagementException(e.Message, e); } if (response != null && response.exception != null) { if (response.exception.type == Alachisoft.NCache.Common.Protobuf.Exception.Type.CONFIGURATON_EXCEPTION) { throw new VersionException(response.exception.message, response.exception.errorCode); } throw new ManagementException(response.exception.message); } } if (response != null) { return(response.ReturnValue); } return(null); }
private ManagementCommand GetManagementCommand(string method, int overload) { ManagementCommand command = new ManagementCommand(); command.methodName = method; command.overload = overload; command.objectName = ManagementUtil.ManagementObjectName.CacheServer; if (!string.IsNullOrEmpty(Source)) { if (Source.ToLower() == "manager") command.source = ManagementCommand.SourceType.MANAGER; else command.source = ManagementCommand.SourceType.TOOL; } else command.source = ManagementCommand.SourceType.TOOL; return command; }