01: /*
02: * <copyright>
03: *
04: * Copyright 2002-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.wp.resolver;
28:
29: import java.io.Serializable;
30: import org.cougaar.core.util.UID;
31:
32: /**
33: * An "unknown lease uid" response from the {@link ClientTransport}'s
34: * {@link ModifyService}, indicating to the {@link LeaseManager} that
35: * an attempt to renew a lease failed because the server doesn't know
36: * a lease with the specified UID.
37: * <p>
38: * If a client attempts to renew a Lease by passing the UID, and
39: * the server doesn't know the UID, then this response is
40: * returned to request the full Record of data.
41: * <p>
42: * This is used to cover two cases:<ol>
43: * <li>The server expired the lease due to lack of renewal
44: * (e.g. network partition) and the client must remind
45: * the server of the data</li>
46: * <li>The server has crashed and must be reconciled.</li>
47: * </ol>
48: * <p>
49: * The Record should use the same UID as the Lease. This will
50: * ensure that duplicate or out-of-order messages will not
51: * cause problems.
52: */
53: public final class LeaseNotKnown implements Serializable {
54:
55: private final UID uid;
56:
57: public LeaseNotKnown(UID uid) {
58: this .uid = uid;
59: // validate
60: String s = ((uid == null) ? "null uid" : null);
61: if (s != null) {
62: throw new IllegalArgumentException(s);
63: }
64: }
65:
66: public UID getUID() {
67: return uid;
68: }
69:
70: public String toString() {
71: return "(lease-not-known uid=" + uid + ")";
72: }
73: }
|