Example #1
0
        public void StopCachesOnNode(ArrayList cacheName)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.StopCachesOnNode);

            command.Parameters.AddParameter(cacheName);
            ExecuteCommandOnCacehServer(command);
        }
Example #2
0
 public void GarbageCollect(bool block, bool isCompactLOH)
 {
     ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GarbageCollect);
     command.Parameters.AddParameter(block);
     command.Parameters.AddParameter(isCompactLOH);
     ExecuteCommandOnCacehServer(command);
 }
        public List <Address> GetConfClusterServers(string cluster)
        {
            ManagementCommand command = GetManagementCommand(ConfigurationCommandUtil.MethodName.GetConfClusterServers);

            command.Parameters.AddParameter(cluster);
            return(ExecuteCommandOnMgtServer(command, true) as List <Address>);
        }
Example #4
0
        public void ClearCacheContent(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.ClearCacheContent);
            command.Parameters.AddParameter(cacheId);

            ExecuteCommandOnCacehServer(command);
        }
Example #5
0
        public void BalanceDataloadOnCache(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.BalanceDataloadOnCache);
            command.Parameters.AddParameter(cacheId);

            ExecuteCommandOnCacehServer(command);
        }
Example #6
0
        public ClientNodeStatusWrapper GetClientNodeStatus(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetClientNodeStatus);
            command.Parameters.AddParameter(cacheId);

            return (ClientNodeStatusWrapper)ExecuteCommandOnCacehServer(command);
        }
Example #7
0
        /// <summary>
        /// Checks if the current cache is a Cluster cache or not, used in NCache UnReg cache tool as now UnReg is only applicable to cluster caches only
        /// </summary>
        /// <returns>true if Cluster Cache</returns>
        public CacheStatusOnServerContainer IsClusteredCache(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.IsClusteredCache);
            command.Parameters.AddParameter(cacheId);

            return (CacheStatusOnServerContainer)ExecuteCommandOnCacehServer(command);
        }
Example #8
0
        public string GetCacheName(int port)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheName);

            command.Parameters.AddParameter(port);
            return(((string)ExecuteCommandOnCacehServer(command)).ToLower());
        }
Example #9
0
        public ConfigurationVersion GetConfigurationVersion(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetConfigurationVersion, 1);

            command.Parameters.AddParameter(cacheId);
            return((ConfigurationVersion)ExecuteCommandOnCacehServer(command));
        }
Example #10
0
        public List <ClientProcessStats> GetClientProcessStats(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetClientProcessStats);

            command.Parameters.AddParameter(cacheId);
            return(ExecuteCommandOnCacehServer(command) as List <ClientProcessStats>);
        }
Example #11
0
        public Caching.Cache GetCache(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCache);

            command.Parameters.AddParameter(cacheId);
            return((Caching.Cache)ExecuteCommandOnCacehServer(command));
        }
Example #12
0
        public List <Common.Monitoring.ClientNode> GetCacheClients(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheClients);

            command.Parameters.AddParameter(cacheId);
            return(ExecuteCommandOnCacehServer(command) as List <Common.Monitoring.ClientNode>);
        }
Example #13
0
        public Alachisoft.NCache.Caching.Statistics.CacheStatistics GetCacheStatistics2(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheStatistics2);

            command.Parameters.AddParameter(cacheId);
            return((Alachisoft.NCache.Caching.Statistics.CacheStatistics)ExecuteCommandOnCacehServer(command));
        }
Example #14
0
        public CacheNodeStatistics[] GetCacheStatistics(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheStatistics);

            command.Parameters.AddParameter(cacheId);
            return((CacheNodeStatistics[])ExecuteCommandOnCacehServer(command));
        }
Example #15
0
 public void RemoveCacheFromClientConfig(string cacheId)
 {
     ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.RemoveCacheFromClientConfig);
     command.Parameters.AddParameter(cacheId);
    
     ExecuteCommandOnCacehServer(command);
 }
Example #16
0
        public Dictionary <string, TopicStats> GetTopicStats(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetTopicStats);

            command.Parameters.AddParameter(cacheId);
            return(ExecuteCommandOnCacehServer(command) as Dictionary <string, TopicStats>);
        }
Example #17
0
        public ClientConfiguration.Dom.ClientConfiguration GetClientConfiguration(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetClientConfiguration);
            command.Parameters.AddParameter(cacheId);

            return ExecuteCommandOnCacehServer(command) as ClientConfiguration.Dom.ClientConfiguration;
        }
Example #18
0
        public int GetCacheProcessID(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheProcessID, 1);

            command.Parameters.AddParameter(cacheId);
            return((int)ExecuteCommandOnCacehServer(command));
        }
Example #19
0
 public void BindToIP(BindedIpMap bindIPMap)
 {
     ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.BindToIP);
     command.Parameters.AddParameter(bindIPMap);
     
     ExecuteCommandOnCacehServer(command);
 }
Example #20
0
        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 if (Source.ToLower() == "monitor")
                {
                    command.source = ManagementCommand.SourceType.MONITOR;
                }
                else
                {
                    command.source = ManagementCommand.SourceType.TOOL;
                }
            }
            else
            {
                command.source = ManagementCommand.SourceType.TOOL;
            }

            return(command);
        }
Example #21
0
        /// <summary>
        /// Checks whether the specified port is available (non-conflicting) or not
        /// </summary>
        /// <param name="port">Cluster port</param>
        /// <returns>'true' if the port is available, otherwise 'flase'</returns>
        public bool PortIsAvailable(int port)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.PortIsAvailable);
            command.Parameters.AddParameter(port);

            return (bool)ExecuteCommandOnCacehServer(command);
        }
Example #22
0
 public void Deserialize(Common.Serialization.IO.CompactReader reader)
 {
     Type          = (ReplicationType)reader.ReadInt32();
     Configuration = reader.ReadObject() as ClusterConfiguration;
     Metadata      = reader.ReadObject() as ClusterInfo;
     Command       = reader.ReadObject() as ManagementCommand;
 }
Example #23
0
        public void SetLocalCacheIP(string ip)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.SetLocalCacheIP);
            command.Parameters.AddParameter(ip);

            ExecuteCommandOnCacehServer(command);
        }
Example #24
0
        public IDictionary GetCacheProps()

        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheProps);

            return ExecuteCommandOnCacehServer(command) as IDictionary;
        }
Example #25
0
        public bool IsCacheRegistered(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.IsCacheRegistered);
            command.Parameters.AddParameter(cacheId);

            return (bool)ExecuteCommandOnCacehServer(command);
        }
Example #26
0
        public CacheInfo GetCacheInfo(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.GetCacheInfo);
            command.Parameters.AddParameter(cacheId);

            return ExecuteCommandOnCacehServer(command) as CacheInfo;
        }
Example #27
0
 public void Run()
 {
     inventoryCmd  = new InventoryCommand();
     managementCmd = new ManagementCommand();
     PrintWelcome();
     RequestCommand();
 }
Example #28
0
 public string CanApplyHotConfiguration(string cacheId, CacheServerConfig config)
 {
     ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.CanApplyHotConfig);
     command.Parameters.AddParameter(cacheId);
     command.Parameters.AddParameter(config);
     return ExecuteCommandOnCacehServer(command) as string;
 }
Example #29
0
 public object OnRequest(IRequest request)
 {
     if (request.Message is ManagementCommand)
     {
         ManagementCommand command = request.Message as ManagementCommand;
         if (command == null)
         {
             return(null);
         }
         ManagementResponse response = new ManagementResponse();
         response.MethodName = command.MethodName;
         response.Version    = command.CommandVersion;
         response.RequestId  = command.RequestId;
         byte[] arguments = CompactBinaryFormatter.ToByteBuffer(command.Parameters, null);
         try
         {
             response.ResponseMessage = _rpcService.InvokeMethodOnTarget(command.MethodName,
                                                                         command.Overload, GetTargetMethodParameters(arguments));
         }
         catch (System.Exception ex)
         {
             response.Exception = ex;
         }
         return(response);
     }
     else
     {
         return(null);
     }
 }
Example #30
0
        public void StopCacheOnCacheHost(string cacheId)
        {
            ManagementCommand command = GetManagementCommand(ManagementUtil.MethodName.StopCacheOnHost, 1);

            command.Parameters.AddParameter(cacheId);
            ExecuteCommandOnCacehServer(command);
        }