Sun Java System Portal Server 7 Developer's Guide

The RegistrationValidator Interface

RegistrationValidator is the Java interface for the registration validation service provider interface. Where non-standard logic is required for validating registration data from consumers, implement this Java interface to validate the data with arbitrary logic.

Each producer instance can be configured with a unique registration validator. The producer uses the configured registration validator when:

The RegistrationValidator interface will be passed the registration data and service description. It uses a subset of the information contained in those obejcts to determine the return value of the validate() method. The return value is a code indicating success or failure. Any non-negative value indicates that the validation was successful. Any negative value indicates a validation failure.

The integer code return value can be interpreted by the producer to provide meaningful error messages to users. That is, for each RegistrationValidator implementation, resource messages must be inserted into the producer’s resource bundle. When an attempt to add a registration via the administration console takes place, the administration console gets the RegistrationValidator and calls the validate() method. A return value greater or equal to zero indicates success (validation succeeded). A negative return value indicates that validation failed.

The administration console displays the localized human-readable message regarding the validation. Typically, this is used for error messages; but it can also be used to provide warning messages or differing success messages. Registration validation messages should be formatted as such:

<RV class name><code>=<mesage>

where:

For example, to provide a message for RegistrationValidator class com.sun.portal.foo.FooValidator and for validator code -23:

com.sun.portal.foo.bar.FooValidator-23=Unknown company name

Note –

Javadocs for RegistrationValidator class is available online at http://hostname:port/portal/javadocs.