Broadcast on Broadcast off
The Documentation for Project Zero has moved. Please update your bookmarks to: http://www.projectzero.org/documentation/
Table of
Contents...
Hide

Project Zero Developer’s Guide

Concepts and components
Basic concepts overview
Event processing
Writing Java handlers
Writing Groovy handlers
Firing events
Global Context
Global Context reference
Application directory layout
Virtualized directories
Assemble
PHP
Features and configuration
Configuration
Debugging
Dependencies
Packaging
Application classpath
Logging and tracing
RESTful resources
RESTful documentation
File serving
Response rendering
Validators and validation
HTTP error handling
Calling a remote resource
Using the Connection API
Sending an email using EmailConnection
Configuring destinations
Configuring protocols
Configuring connection handlers
Creating a connection handler
Creating a custom protocol transport
Simple logging connection handlers
Protocol reference
Client programming with Dojo
Runtime options
Deployment modifications
HTTP configuration
SSL configuration
Proxy configuration
Extending the CLI
Security considerations
Authentication
OpenID authentication
Extending security
Security tokens
CSRF prevention support
Extending token support
Leveraging TAI
User service
File based user service
LDAP user service
Extending user service
Security Utilities
Leveraging XOREncoder
Extensions
Atom support
RSS support
JSON support
XMLEncoder
REST to SOAP extension
URIUtils
Developer Web tools
Database setup tools
Configuring data access
Common query patterns
Advanced query patterns
Update patterns
Local database transactions
Extending data access
Configuration vendor differences
PHP data access
Resource model
Configuring ZRM
Resource model declaration
Programmatic model API
HTTP REST API
A ZRM mini tutorial
Active content filtering support
Default filters
Custom filters
Runtime management
Management commands
Zero socket opener
Other extension modules
Amazon E-commerce service
Flickr service
WeatherZero forecast service
Wikipedia service
Reference
Zero command line interface
JavaDoc - Public API
JavaDoc - Public SPI
JavaDoc - All Classes

 

Configuring connection handlers

A connection handler is a small piece of logic that can be configured for a destination. The connection infrastructure invokes a configured connection handler before sending a request and again when receiving the response.

Connection handlers can examine the contents of the request and response and carry out simple processing. Examples of scenarios where a connection handler may be useful include:

  • Logging requests sent to a destination and the responses received.
  • Manipulating the request or response headers.
  • Performing simple transformations of the request or response body.
  • Dynamically adding protocol configuration (when it cannot be statically determined by a connection configuration).

For more information about destination configuration and an overview of destination processing, see Configuring destinations.

For a description of how to write a connection handler, see Creating a connection handler.

Configuring connection handlers for a destination

Connection handlers can be configured for a destination by specifying a handlers list. Each element in the handlers list must contain a class attribute naming the connection handler implementation class. The element may also contain a config attribute in order to supply any configuration parameter required by the connection handler.

For example, the following configuration registers a single connection handler with the named destination and specifies a configuration parameter, "source", for the connection handler.

/config/connection/destinations += [{
        "name" : "http://www.projectzero.org/*",
        "handlers" : [{
                "class" : "zero.core.connection.handlers.logger.SimpleJavaLoggerHandler",
                "config" : {
                        "source" : "mySourceName"
                }
        }]
}]

r20 - 30 Jan 2008 - 14:57:21 - rushall
Syndicate this site RSS ATOM
Copyright 2007 © IBM Corporation | Privacy | Terms of Use | About this site