Class BrowsingDatabaseManagerBuilder
Database Manager Builder.
Inheritance
Inherited Members
Namespace: Gee.External.Browsing.Services
Assembly: Gee.External.Browsing.dll
Syntax
public sealed class BrowsingDatabaseManagerBuilder
Methods
Build()
Build a Database Manager.
Declaration
public BrowsingDatabaseManager Build()
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManager |
RestrictUpdatesTo(ThreatListDescriptor)
Restrict Updates.
Declaration
public BrowsingDatabaseManagerBuilder RestrictUpdatesTo(ThreatListDescriptor threatListDescriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreatListDescriptor | threatListDescriptor | A ThreatListDescriptor identifying a ThreatList to restrict updates to. |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database synchronizer builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
RestrictUpdatesTo(ThreatListDescriptor, ThreatListUpdateConstraints)
Restrict Updates.
Declaration
public BrowsingDatabaseManagerBuilder RestrictUpdatesTo(ThreatListDescriptor threatListDescriptor, ThreatListUpdateConstraints updateConstraints)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreatListDescriptor | threatListDescriptor | A ThreatListDescriptor identifying a ThreatList to restrict updates to. |
| ThreatListUpdateConstraints | updateConstraints | The ThreatListUpdateConstraints to apply when the ThreatList identified
by |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
RestrictUpdatesTo(ThreatListDescriptor, Func<ThreatListUpdateConstraintsBuilder, ThreatListUpdateConstraints>)
Restrict Updates.
Declaration
public BrowsingDatabaseManagerBuilder RestrictUpdatesTo(ThreatListDescriptor threatListDescriptor, Func<ThreatListUpdateConstraintsBuilder, ThreatListUpdateConstraints> updateConstraintsAction)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreatListDescriptor | threatListDescriptor | A ThreatListDescriptor identifying a ThreatList to restrict updates to. |
| System.Func<ThreatListUpdateConstraintsBuilder, ThreatListUpdateConstraints> | updateConstraintsAction | An action to create the ThreatListUpdateConstraints to apply when the
ThreatList identified by |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
RestrictUpdatesTo(ThreatType, PlatformType, ThreatEntryType)
Restrict Updates.
Declaration
public BrowsingDatabaseManagerBuilder RestrictUpdatesTo(ThreatType threatType, PlatformType platformType, ThreatEntryType threatEntryType)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreatType | threatType | A ThreatType identifying a ThreatList to restrict updates to. |
| PlatformType | platformType | A PlatformType identifying a ThreatList to restrict updates to. |
| ThreatEntryType | threatEntryType | A ThreatEntryType identifying a ThreatList to restrict updates to. |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
RestrictUpdatesTo(ThreatType, PlatformType, ThreatEntryType, ThreatListUpdateConstraints)
Restrict Updates.
Declaration
public BrowsingDatabaseManagerBuilder RestrictUpdatesTo(ThreatType threatType, PlatformType platformType, ThreatEntryType threatEntryType, ThreatListUpdateConstraints updateConstraints)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreatType | threatType | A ThreatType identifying a ThreatList to restrict updates to. |
| PlatformType | platformType | A PlatformType identifying a ThreatList to restrict updates to. |
| ThreatEntryType | threatEntryType | A ThreatEntryType identifying a ThreatList to restrict updates to. |
| ThreatListUpdateConstraints | updateConstraints | The ThreatListUpdateConstraints to apply when the ThreatList identified
by |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
RestrictUpdatesTo(ThreatType, PlatformType, ThreatEntryType, Func<ThreatListUpdateConstraintsBuilder, ThreatListUpdateConstraints>)
Restrict Updates.
Declaration
public BrowsingDatabaseManagerBuilder RestrictUpdatesTo(ThreatType threatType, PlatformType platformType, ThreatEntryType threatEntryType, Func<ThreatListUpdateConstraintsBuilder, ThreatListUpdateConstraints> updateConstraintsAction)
Parameters
| Type | Name | Description |
|---|---|---|
| ThreatType | threatType | A ThreatType identifying a ThreatList to restrict updates to. |
| PlatformType | platformType | A PlatformType identifying a ThreatList to restrict updates to. |
| ThreatEntryType | threatEntryType | A ThreatEntryType identifying a ThreatList to restrict updates to. |
| System.Func<ThreatListUpdateConstraintsBuilder, ThreatListUpdateConstraints> | updateConstraintsAction | An action to create the ThreatListUpdateConstraints to apply when the
ThreatList identified by |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
SetClient(IBrowsingClient, Boolean)
Set Client.
Declaration
public BrowsingDatabaseManagerBuilder SetClient(IBrowsingClient value, bool ownClient)
Parameters
| Type | Name | Description |
|---|---|---|
| IBrowsingClient | value | |
| System.Boolean | ownClient | A boolean flag indicating whether or not the BrowsingDatabaseManager takes ownership of the client and disposes it when the database manager itself is disposed. If the database manager takes ownership of the client and you reference or dispose the client after you create the database manager, the behavior of the database manager and the client is undefined. |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
SetDatabase(IManagedBrowsingDatabase, Boolean)
Set Database.
Declaration
public BrowsingDatabaseManagerBuilder SetDatabase(IManagedBrowsingDatabase value, bool ownDatabase)
Parameters
| Type | Name | Description |
|---|---|---|
| IManagedBrowsingDatabase | value | |
| System.Boolean | ownDatabase | A boolean flag indicating whether or not the BrowsingDatabaseManager takes ownership of the database and disposes it when the database manager itself is disposed. If the database manager takes ownership of the database and you reference or dispose the database after you create the database manager, the behavior of the database manager and the database is undefined. |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
SetUpdateConstraints(IDictionary<ThreatListDescriptor, ThreatListUpdateConstraints>)
Set Update Constraints.
Declaration
public BrowsingDatabaseManagerBuilder SetUpdateConstraints(IDictionary<ThreatListDescriptor, ThreatListUpdateConstraints> value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<ThreatListDescriptor, ThreatListUpdateConstraints> | value |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
UseHttpClient(String)
Use an HTTP Client.
Declaration
public BrowsingDatabaseManagerBuilder UseHttpClient(string apiKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | apiKey | A Google Safe Browsing API key to authenticate to the Google Safe Browsing API with. |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Remarks
Use an HttpBrowsingClient to communicate with the Google Safe Browsing API. The BrowsingDatabaseManager takes ownership of the HTTP client and will dispose it when the database manager itself is disposed.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |
UseJsonDatabase(String)
Use a JSON Database.
Declaration
public BrowsingDatabaseManagerBuilder UseJsonDatabase(string databaseFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | databaseFilePath | An absolute file path to the database file. If the file does not exist, it will be created. |
Returns
| Type | Description |
|---|---|
| BrowsingDatabaseManagerBuilder | This database manager builder. |
Remarks
Use a ManagedJsonBrowsingDatabase to store threat list updates retrieved from the Google Safe Browsing API. The BrowsingDatabaseManager takes ownership of the JSON database and will dispose it when the database manager itself is disposed.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown if |