Table of Contents

Class BannedIPAddressService

Namespace
Dynamicweb.SystemTools.Security
Assembly
Dynamicweb.dll
public abstract class BannedIPAddressService : ICacheStorage<string, BannedIPAddress>, ICacheStorage<string>, ICacheStorage
Inheritance
BannedIPAddressService
Implements
Inherited Members

Properties

Info

Represents the Cache information

public abstract CacheInformation Info { get; }

Property Value

CacheInformation

Methods

BanIP(string, DateTime)

Bans the specified IP for till the specified expiration time.

public abstract void BanIP(string ipAddress, DateTime banExpiration)

Parameters

ipAddress string

The IP address to ban. Use Context.Current.Request.GetClientIPAddress() to get IP address of current user

banExpiration DateTime

The ban expiration datetime.

BanIP(string, DateTime, string)

Bans the specified IP for till the specified expiration time.

public abstract void BanIP(string ipAddress, DateTime banExpiration, string cause)

Parameters

ipAddress string

The IP address to ban. Use Context.Current.Request.GetClientIPAddress() to get IP address of current user

banExpiration DateTime

The ban expiration datetime.

cause string

Reason why the IP address was banned

BanIP(string, string)

Bans the specified IP.

public abstract void BanIP(string ipAddress, string cause)

Parameters

ipAddress string

The IP address to ban. Use Context.Current.Request.GetClientIPAddress() to get IP address of current user

cause string

Reason why the IP address was banned

ClearCache()

Clears Cache

public abstract void ClearCache()

ClearCache(IEnumerable<string>)

Clears Cache by IP addresses collection

public abstract void ClearCache(IEnumerable<string> keys)

Parameters

keys IEnumerable<string>

The collection of IP addresses

ClearCache(string)

Clears Cache by IP address

public abstract void ClearCache(string key)

Parameters

key string

The IP address

GetBannedIPAddressData(string)

Gets the banned IP address information

public abstract BannedIPAddress? GetBannedIPAddressData(string ipAddress)

Parameters

ipAddress string

The IP address.

Returns

BannedIPAddress

IsIPBanned(string)

Determines whether the specified IP is banned.

public abstract bool IsIPBanned(string ipAddress)

Parameters

ipAddress string

The IP address.

Returns

bool

IsPrivateIPAddress(string)

Shows whether the specified IP address is private IP address.

public abstract bool IsPrivateIPAddress(string ipAddress)

Parameters

ipAddress string

The IP address

Returns

bool

IsWhitelistIPAddress(string)

Shows whether the specified IP address is on the whitelist.

public abstract bool IsWhitelistIPAddress(string ipAddress)

Parameters

ipAddress string

The IP address

Returns

bool

SetCacheType<TObjectCache>()

Sets the Cache type

public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, BannedIPAddress>

Type Parameters

TObjectCache
To top