ConnectionFilterImpl Class ConnectionEvent Class

Using Network Connection Filters 7-3

7.2.2.1 ConnectionFilterImpl Class

This class is the WebLogic connection filter implementation of the ConnectionFilter and ConnectionFilterRulesListener interfaces. Once configured using the Administration Console, this connection filter accepts all incoming connections by default, and also provides static factory methods that allow the server to obtain the current connection filter. To use this connection to deny access, simply enter connection filter rules using the Administration Console. This class is provided as part of the WebLogic Server product. To configure this class for use, see Section 7.4, Configuring the WebLogic Connection Filter .

7.2.2.2 ConnectionEvent Class

This is the class from which all event state objects are derived. All events are constructed with a reference to the object, that is, the source that is logically deemed to be the object upon which a specific event initially occurred. To create a new ConnectionEvent instance, applications use the methods provided by this class: getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, and hashcode.

7.3 Guidelines for Writing Connection Filter Rules

This section describes how connection filter rules are written and evaluated. If no connection rules are specified, all connections are accepted. Depending on how you implement connection filtering, connection filter rules can be written in a flat file or input directly on the Administration Console. The following sections provide information and guidelines for writing connection filter rules: ■ Section 7.3.1, Connection Filter Rules Syntax ■ Section 7.3.2, Types of Connection Filter Rules ■ Section 7.3.3, How Connection Filter Rules are Evaluated

7.3.1 Connection Filter Rules Syntax

The syntax of connection filter rules is as follows: ■ Each rule must be written on a single line. ■ Tokens in a rule are separated by white space. ■ A pound sign is the comment character. Everything after a pound sign on a line is ignored. ■ Whitespace before or after a rule is ignored. ■ Lines consisting only of whitespace or comments are skipped. The format of filter rules differ depending on whether you are using a filter file to enter the filter rules or you enter the filter rules on the Administration Console. ■ When entering the filter rules on the Administration Console, enter them in the following format: targetAddress localAddress localPort action protocols ■ When specifying rules in the filter file, enter them in the following format: targetAddress action protocols