01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/courier/tags/sakai_2-4-1/courier-api/api/src/java/org/sakaiproject/courier/api/ObservingCourier.java $
03: * $Id: ObservingCourier.java 7044 2006-03-27 04:14:59Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.courier.api;
21:
22: import java.util.Observer;
23:
24: /**
25: * <p>
26: * ObservingCourier is an observer which uses the courier service to notify when things change.
27: * </p>
28: */
29: public interface ObservingCourier extends Observer {
30: /**
31: * Check to see if we want to process or ignore this update.
32: *
33: * @param arg
34: * The arg from the update.
35: * @return true to continue, false to quit.
36: */
37: boolean check(Object arg);
38:
39: /**
40: * Disable.
41: */
42: void disable();
43:
44: /**
45: * Enable.
46: */
47: void enable();
48:
49: /**
50: * @return the delivery id.
51: */
52: String getDeliveryId();
53:
54: /**
55: * @return The element id.
56: */
57: String getElementId();
58:
59: /**
60: * @return the enabled status.
61: */
62: boolean getEnabled();
63:
64: /**
65: * @return the location this observer is observing.
66: */
67: String getLocation();
68:
69: /**
70: * Accept notification that the element has just been delivered. If there are pending requests to deliver, they can be cleared.
71: */
72: void justDelivered();
73:
74: /**
75: * Set the delivery id.
76: *
77: * @param id
78: * The delivery id.
79: */
80: void setDeliveryId(String id);
81:
82: /**
83: * Set the element id.
84: *
85: * @param id
86: * the element id.
87: */
88: void setElementId(String id);
89: }
|