protected override void ProcessRecord()
        {
            if (isInitialized())
            {
                try
                {
                    iControl.LocalLBRAMCacheInformationRAMCacheKey[] keys = new iControl.LocalLBRAMCacheInformationRAMCacheKey[1];
                    keys[0]                   = new iControl.LocalLBRAMCacheInformationRAMCacheKey();
                    keys[0].host_name         = (null != _host_name) ? _host_name : "";
                    keys[0].profile_name      = (null != _profile_name) ? _profile_name : "";
                    keys[0].uri               = (null != _uri) ? _uri : "";
                    keys[0].maximum_responses = 0;

                    GetiControl().LocalLBRAMCacheInformation.evict_ramcache_entry(keys);
                }
                catch (Exception ex)
                {
                    handleException(ex);
                }
            }
            else
            {
                handleNotInitialized();
            }
        }
Exemple #2
0
        protected override void ProcessRecord()
        {
            if (isInitialized())
            {
                try
                {
                    iControl.LocalLBRAMCacheInformationRAMCacheKey[] keys = new iControl.LocalLBRAMCacheInformationRAMCacheKey[1];
                    keys[0]                   = new iControl.LocalLBRAMCacheInformationRAMCacheKey();
                    keys[0].host_name         = (null != _host_name) ? _host_name : "";
                    keys[0].profile_name      = (null != _profile_name) ? _profile_name : "";
                    keys[0].uri               = (null != _uri) ? _uri : "";
                    keys[0].maximum_responses = _max_responses;
                    iControl.LocalLBRAMCacheInformationRAMCacheEntry [][] cache_entries =
                        GetiControl().LocalLBRAMCacheInformation.get_ramcache_entry(keys);
                    for (int i = 0; i < cache_entries[0].Length; i++)
                    {
                        LTMRAMCacheEntry rce = new LTMRAMCacheEntry();
                        rce.ProfileName = cache_entries[0][i].profile_name;
                        rce.Hostname    = cache_entries[0][i].host_name;
                        rce.Uri         = cache_entries[0][i].uri;
                        switch (cache_entries[0][i].vary_type)
                        {
                        case iControl.LocalLBRAMCacheInformationRAMCacheVaryType.RAM_CACHE_VARY_ACCEPT_ENCODING:
                            rce.VaryType = "ACCEPT_ENCODING";
                            break;

                        case iControl.LocalLBRAMCacheInformationRAMCacheVaryType.RAM_CACHE_VARY_BOTH:
                            rce.VaryType = "BOTH";
                            break;

                        case iControl.LocalLBRAMCacheInformationRAMCacheVaryType.RAM_CACHE_VARY_NONE:
                            rce.VaryType = "NONE";
                            break;

                        case iControl.LocalLBRAMCacheInformationRAMCacheVaryType.RAM_CACHE_VARY_USERAGENT:
                            rce.VaryType = "USERAGENT";
                            break;
                        }
                        rce.VaryCount  = cache_entries[0][i].vary_count;
                        rce.Hits       = cache_entries[0][i].hits;
                        rce.Received   = cache_entries[0][i].received;
                        rce.LastSent   = cache_entries[0][i].last_sent;
                        rce.Expiration = cache_entries[0][i].expiration;
                        rce.Size       = cache_entries[0][i].size;

                        WriteObject(rce);
                    }
                }
                catch (Exception ex)
                {
                    handleException(ex);
                }
            }
            else
            {
                handleNotInitialized();
            }
        }