01: /*
02: * MessageService: The message service daemon
03: * Copyright (C) 2007 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * MessageManager.java
20: */
21:
22: // package path
23: package com.rift.coad.daemon.messageservice;
24:
25: // java imports
26: import java.util.Date;
27: import javax.transaction.xa.XAResource;
28:
29: /**
30: * This interface defines the methods responsible for managing a message within
31: * the the message service.
32: *
33: * @author Brett Chaldecott
34: */
35: public interface MessageManager extends Comparable, XAResource {
36: /**
37: * This method returns the id of this messsage.
38: *
39: * @return The id of the message this object is managing.
40: */
41: public String getID();
42:
43: /**
44: * This method returns the message object.
45: *
46: * @return The message object.
47: * @exception MessageServiceException
48: */
49: public Message getMessage() throws MessageServiceException;
50:
51: /**
52: * This method updates the message object.
53: *
54: * @param updatedMessage The updated message object.
55: * @exception MessageServiceException
56: */
57: public void updateMessage(Message updatedMessage)
58: throws MessageServiceException;
59:
60: /**
61: * This method returns the next process time for this message.
62: *
63: * @return The date message.
64: * @exception MessageServiceException
65: */
66: public Date nextProcessTime();
67:
68: /**
69: * This method returns the name of the messaqe queue to which this message
70: * is assigned.
71: *
72: * @return The name of the message queue that this message is assigned to.
73: */
74: public String getMessageQueueName();
75:
76: /**
77: * This method is responsible from removing this message from the db.
78: *
79: * @exception MessageServiceException
80: */
81: public void remove() throws MessageServiceException;
82:
83: }
|