01: /*
02: * <copyright>
03: *
04: * Copyright 2001-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;
28:
29: import org.cougaar.core.blackboard.TimestampEntry;
30: import org.cougaar.core.component.Service;
31: import org.cougaar.core.util.UID;
32:
33: /**
34: * This service tracks timestamps for the ADD ({@link
35: * BlackboardService#publishAdd}) and the more recent modification
36: * ({@link BlackboardService#publishChange}) of {@link
37: * org.cougaar.core.util.UniqueObject}s.
38: * <p>
39: * These timestamps are not persisted, and upon rehydration the
40: * creation time of the objects will be the agent restart time.
41: *
42: * @property org.cougaar.core.blackboard.timestamp
43: * Enable blackboard timestamps, defaults to false.
44: *
45: * @see org.cougaar.core.blackboard.TimestampSubscription
46: */
47: public interface BlackboardTimestampService extends Service {
48:
49: /**
50: * @see #getTimestampEntry get the creation time
51: */
52: long getCreationTime(UID uid);
53:
54: /**
55: * @see #getTimestampEntry get the modification time
56: */
57: long getModificationTime(UID uid);
58:
59: /**
60: * Get the TimestampEntry for the local blackboard UniqueObject
61: * with the given UID.
62: * <p>
63: * The timestamps are measured in milliseconds, and matches the
64: * transaction close times of the blackboard subscriber that
65: * performed the "publishAdd()" or "publishChange()".
66: * <p>
67: * The underlying (UID, TimestampEntry) map is dynamically
68: * maintained by a separate subscriber. These methods are
69: * thread safe. Clients should be aware that multiple calls
70: * to "getTimestampEntry(..)" may return different responses.
71: * <p>
72: * The service provider of this service may restrict the set
73: * of UniqueObjects covered by this service. UniqueObjects
74: * that are not covered have null TimestampEntry values.
75: *
76: * @return the TimestampEntry for the UniqueObject with the
77: * specified UID, or null if not known.
78: */
79: TimestampEntry getTimestampEntry(UID uid);
80:
81: }
|