01: /*
02: * <copyright>
03: *
04: * Copyright 1997-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26:
27: package org.cougaar.core.service.wp;
28:
29: import java.io.Serializable;
30:
31: import org.cougaar.core.component.Service;
32:
33: /**
34: * This service is used by the white pages client and server to
35: * protect and verify requests.
36: * <p>
37: * The component that advertises this service is optional. If
38: * it is not loaded in the node then wrapping is disabled.
39: * <p>
40: * The node's white pages lease manager will wrap each agent's
41: * request. Multiple requests may be batched into a message
42: * sent by the node to the white pages server. The server
43: * receives the message and unwraps the batched requests.
44: */
45: public interface WhitePagesProtectionService extends Service {
46:
47: /**
48: * Client method to wrap a request.
49: * <p>
50: * For example, this may sign the request and wrap it with the
51: * certificate chain used for signing.
52: *
53: * @param agent - The agent making the request
54: * @param request - the request object
55: * @return the wrapped request object
56: * @throws Exception if the request can't be wrapped and the
57: * client must fail the request
58: */
59: Wrapper wrap(String agent, Object request) throws Exception;
60:
61: /**
62: * Server method to unwrap a client's wrapper.
63: * <p>
64: * For example, this may install and verify the signing
65: * certificate.
66: *
67: * @param agent - The agent making the request
68: * @param w - the wrapped request object
69: * @return the request object
70: * @throws Exception if the request can't be wrapped and the
71: * server must ignore the request
72: */
73: Object unwrap(String agent, Wrapper w) throws Exception;
74:
75: /**
76: * Marker interface for a wrapper.
77: */
78: interface Wrapper extends Serializable {
79: }
80: }
|