01: package com.sun.portal.wsrp.producer.registration.validator;
02:
03: import com.sun.portal.wsrp.common.stubs.MissingParametersFault;
04: import com.sun.portal.wsrp.common.stubs.RegistrationData;
05: import com.sun.portal.wsrp.common.stubs.ServiceDescription;
06: import com.sun.portal.wsrp.common.stubs.OperationFailedFault;
07:
08: /**
09: * RegistrationValidator is the SPI for registration validation
10: * in the WSRP producer.
11: * <p>
12: * This interface provides a method for accepting or denying
13: * a registration request based on the incoming registration data.
14: * The interface
15: * is implemented with whatever logic is appropriate for this
16: * task.
17: * <br><br>
18: * In the WSRP producer, registration is checked for validity
19: * when:
20: * <ul>
21: * <li>a consumer registration is added out of band
22: * in the producer administration module
23: * <li>a consumer registration is added via an inband
24: * registration call to the WSRP register() operation
25: * <li>a registration is modified out of band in the producer
26: * administration module
27: * <li>a registration is modified via an inband call
28: * to the WSRP modifyRegistration() operation
29: * </ul>
30: * The implementation class name is taken from configuration
31: * of the producer instance (there is one RegistrationValidator
32: * implementation per producer instance).
33: *
34: */
35: public interface RegistrationValidator {
36: /**
37: * Validate the registration.
38: * This logic is used to determine if a registration is valid.
39: * The logic varies depending on the implementation of this
40: * interface.
41: * <p>
42: * Clients perform registration validation by passing in
43: * RegistrationData and ServiceDescription objects. Any data or
44: * functionality supplied by these object may be used to determine
45: * registration validity.
46: * <p>
47: * The return value of this method is a code indicating success or
48: * failure. Any non-negative code indicates success, any negative
49: * code indicates failure. The code can be used by clients as
50: * a key to a human-readable error message that matches
51: * the return code. Implementations of this interface should
52: * publicize the codes that may possibly be returned from the
53: * implementation of this method, and the semantics of the codes.
54: *
55: * @param registrationData a <code>RegistrationData</code> object that describes the
56: * registration to be validated
57: * @param serviceDescription a <code>ServiceDescription</code> object for the WSRP
58: * producer that is being registered into
59: * @return an <code>int</code>, the validation code. Any non-negative value
60: * indicates to clients that validation was successful. Any negative value
61: * indicates that validation failed.
62: * @see com.sun.portal.wsrp.common.stubs.RegistrationData
63: * @see com.sun.portal.wsrp.common.stubs.ServiceDescription
64: */
65: public int validate(RegistrationData registrationData,
66: ServiceDescription serviceDescription);
67: }
|