OracleWebEventProvider Class

The OracleWebEventProvider class allows ASP.NET applications to store Web events in an Oracle database.

Class Inheritance

System.Object

  System.Configuration.Provider.ProviderBase

    System.Web.Management.WebEventProvider

      System.Web.Management.BufferedWebEventProvider

        Oracle.Web.Management.OracleWebEventProvider

Declaration

// C#
public class OracleWebEventProvider: BufferedWebEventProvider

Thread Safety

All public static methods are thread-safe, although instance members are not guaranteed to be thread-safe.

Remarks

This class allows ASP.NET applications to store Web event information in an Oracle database.

Example

The following is a web.config example for an ASP.NET application that uses the OracleWebEventProvider class as the default provider. This configuration uses the connection string and default attribute values specified in the machine.config file.

Applications must provide any required configuration entries for event mapping, buffer modes, and rules in the web.config file, because the machine.config file does not provide these configuration entries. The following web.config file provides an example:

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <system.web>
    <healthmonitoring enabled="true"/>
      <bufferModes>
        <add name="Notification"
             maxBufferSize="1000"
             maxFlushSize="200"
             urgentFlushThreshold="500"
             regularFlushInterval="00:00:6"
             urgentFlushInterval="00:00:03"
             maxBufferThreads="1"/>
      </bufferModes>
      <eventMappings>
        <add name="CustomEvent"
             type="CustomEventSource.CustomEvent, CustomEventSource"/>
      </eventMappings>
      <rules>
        <add name="CustomRule"
             eventName="CustomEvent"
             provider="OracleWebEventProvider"
             minInterval="00:00:00"/>
      </rules>
    </healthMonitoring>
  </system.web>
</configuration>

The following is a web.config example for an ASP.NET application that uses an OracleWebEventProvider class as the default provider, using customized settings for the connection string name and application name, and an application-specific connection string, along with other configurations as described in the previous example:

<?xml version="1.0"?>
<configuration xmlns=
  "http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <connectionStrings>
    <add name="my_webevent_app_con_string" connectionString=
      "User Id=scott;Password=tiger;Data Source=Oracle"/>
  </connectionStrings>
  <system.web>
    <!-- Enable and customize OracleWebEventProvider -->
    <healthMonitoring enabled="true">
      <providers>
        <add name="CustomOracleWebEventProvider"
             type="Oracle.Web.Management.OracleWebEventProvider,
                   Oracle.Web, Version=2.112.2.0, Culture=neutral,
                   PublicKeyToken=89b483f429c47342"
             connectionStringName="my_webevent_app_con_string"
             bufferMode="CustomBufferMode">
      </providers>
      <bufferModes>
        <add name="CustomBufferMode"
             maxBufferSize="1000"
             maxFlushSize="200"
             urgentFlushThreshold="500"
             regularFlushInterval="00:00:06"
             urgentFlushInterval="00:00:03"
             maxBufferThreads="1"/>
      </bufferModes>
      <eventMappings>
        <add name="CustomEvent"
             type="CustomEventSource.CustomEvent, CustomEventSource"/>
      </eventMappings>
      <rules>
        <add name="CustomRule"
             eventName="CustomEvent"
             provider="CustomOracleWebEventProvider"
             minInterval="00:00:00"/>
      </rules>
    </healthMonitoring>
  </system.web>
</configuration>

Note that the applicationName attribute should be set to a unique value for each ASP.NET application.

Requirements

Namespace: Oracle.Web.Management

Assembly: Oracle.Web.dll

Oracle Providers for ASP.NET Version: Oracle Providers for ASP.NET 2.0 and Oracle Providers for ASP.NET 4


OracleWebEventProvider Members

OracleWebEventProvider members are listed in the following tables.

OracleWebEventProvider Constructors

The OracleWebEventProvider constructor is listed in Table 7-1.

Table 7-1 OracleWebEventProvider Constructor

Constructor Description

OracleWebEventProvider Constructors

Instantiates a new instance of the OracleWebEventProvider class


OracleWebEventProvider Static Methods

OracleWebEventProvider static methods are listed in Table 7-2.

Table 7-2 OracleWebEventProvider Static Methods

Static Methods Description

Equals

Inherited from System.Object (Overloaded)

ReferenceEquals

Inherited from System.Object


OracleWebEventProvider Public Properties

OracleWebEventProvider public properties are listed in Table 7-3.

Table 7-3 OracleWebEventProvider Public Properties

Public Properties Description

BufferMode

Inherited from System.Web.Management.BufferedWebEventProvider

CommandTimeout

Gets the number of seconds that the command is allowed to execute before it is terminated with an exception

Description

Inherited from System.Configuration.Provider.ProviderBase

Name

Inherited from System.Configuration.Provider.ProviderBase

UseBuffering

Inherited from System.Web.Management.BufferedWebEventProvider


OracleWebEventProvider Public Methods

OracleWebEventProvider public methods are listed in Table 7-4.

Table 7-4 OracleWebEventProvider Public Methods

Public Method Description

Initialize

Initializes the OracleWebEventProvider instance with the property values specified in the ASP.NET application configuration file

ProcessEvent

Processes the event passed to it as an argument

ProcessEventFlush

Flushes the information passed to it as an argument

Shutdown

Releases all resources

Flush

Inherited from System.BufferedWebEventProvider

Equals(Overloaded)

Inherited from System.Object

GetHashCode

Inherited from System.Object

GetType

Inherited from System.Object

ToString

Inherited from System.Object



OracleWebEventProvider Constructors

This constructor creates an instance of the OracleWebEventProvider class.

Overload List:

OracleWebEventProvider()

This constructor creates an instance of the OracleWebEventProvider class.

Declaration

// C#
public OracleWebEventProvider();

Remarks

This constructor creates a new instance of the OracleWebEventProvider class.


OracleWebEventProvider Static Methods

The OracleWebEventProvider static methods are listed in Table 7-5.

Table 7-5 OracleWebEventProvider Static Methods

Static Methods Description

Equals

Inherited from System.Object (Overloaded)

ReferenceEquals

Inherited from System.Object



OracleWebEventProvider Public Properties

The OracleWebEventProvider public properties are listed in Table 7-6.

Table 7-6 OracleWebEventProvider Public Properties

Public Properties Description

BufferMode

Inherited from System.Web.Management.BufferedWebEventProvider

CommandTimeout

Gets the number of seconds that the command is allowed to execute before it is terminated with an exception

Description

Inherited from System.Configuration.Provider.ProviderBase

Name

Inherited from System.Configuration.Provider.ProviderBase

UseBuffering

Inherited from System.Web.Management.BufferedWebEventProvider


CommandTimeout

This property gets the number of seconds that the command is allowed to execute before it is terminated with an exception.

Declaration

// C#
public int CommandTimeout {get;}
 

Property Value

An int.

Remarks

To customize a provider, ASP.NET developers can set an integer value for this property through the web.config file using the commandTimeout attribute.

The default value is 30 seconds. The attribute name in the configuration file is case-sensitive.


OracleWebEventProvider Public Methods

The OracleWebEventProvider public methods are listed in Table 7-7.

Table 7-7 OracleWebEventProvider Public Methods

Public Method Description

Initialize

Initializes the OracleWebEventProvider instance with the property values specified in the ASP.NET application configuration file

ProcessEvent

Processes the event passed to it as an argument

ProcessEventFlush

Flushes the information passed to it as an argument

Shutdown

Releases all resources

Flush

Inherited from System.BufferedWebEventProvider

Equals(Overloaded)

Inherited from System.Object

GetHashCode

Inherited from System.Object

GetType

Inherited from System.Object

ToString

Inherited from System.Object


Initialize

This method initializes the OracleWebEventProvider instance with the property values specified in the ASP.NET application configuration file (web.config).

Declaration

// C#
public override void Initialize(string name, NameValueCollection config);

Parameters

  • name

    The name of the OracleWebEventProvider instance to initialize.

  • config

    A Systems.Collections.Specialized.NameValueCollection object that contains the names and values of configuration options for the OracleWebEventProvider.

Exceptions

InvalidOperationException - If the OracleWebEventProvider instance is already initialized.

ProviderException - One of the following conditions exists:

  • The connectionStringName attribute in the configuration file is null or empty.

  • The connection string corresponding to value of the connectionStringName attribute is null or empty.

  • An unrecognized attribute is found in the configuration file.

  • Another error occurs during initialization of the provider.

Remarks

The Initialize method is not intended to be called directly by the application.

ProcessEvent

This method processes the event passed to it as an argument.

Declaration

// C#
public override void ProcessEvent(WebBaseEvent eventRaised);

Parameters

  • eventRaised

    The WebBaseEvent object to be processed.

Remarks

This method is called by ASP.NET applications to start event processing. If buffering is enabled, then the event is added to the buffer of events, otherwise, the event information is directly written into Oracle Database.

ProcessEventFlush

This method flushes the information passed to it as an argument.

Declaration

// C#
public override void ProcessEventFlush(WebEventBufferFlushInfo flushEvent);

Parameters

  • flushEvent

    The WebEventBufferFlushInfo object that contains a collection of buffered Web events.

Remarks

This method is called by ASP.NET applications to flush all events into Oracle Database.

Shutdown

This method releases all resources.

Declaration

// C#
public override void Shutdown();

Remarks

This method is called by ASP.NET applications when the provider is unloaded. All the buffered events are first flushed into Oracle Database before the provider proceeds with shutdown.