Example #1
0
        public static DataCacheSecurity SetCacheSecurity(string mode, string level)
        {
            DataCacheSecurityMode    _mode  = DataCacheSecurityMode.Transport;
            DataCacheProtectionLevel _level = DataCacheProtectionLevel.EncryptAndSign;

            switch (mode)
            {
            case "none":
                _mode = DataCacheSecurityMode.None;
                break;
            }
            switch (level)
            {
            case "none":
                _level = DataCacheProtectionLevel.None;
                break;

            case "sign":
                _level = DataCacheProtectionLevel.Sign;
                break;
            }

            return(new DataCacheSecurity(_mode, _level));
        }
 public DataCacheSecurity(DataCacheSecurityMode securityMode, DataCacheProtectionLevel protectionLevel)
 {
     ProtectionLevel = protectionLevel;
     SecurityMode    = securityMode;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="hostName">Host name</param>
 /// <param name="cachePort">Cache port</param>
 /// <param name="cacheName">Cache name</param>
 /// <param name="localCache">Whether to use local cache or not</param>
 /// <param name="securityMode">Security mode</param>
 /// <param name="protectionLevel">Protection level</param>
 public AppFabricCacheManager(string hostName, int cachePort, string cacheName, bool localCache, DataCacheSecurityMode securityMode, DataCacheProtectionLevel protectionLevel)
 {
     this.HostName        = hostName;
     this.CachePort       = cachePort;
     this.CacheName       = cacheName;
     this.LocalCache      = localCache;
     this.SecurityMode    = securityMode;
     this.ProtectionLevel = protectionLevel;
     this.Initialize();
 }