Revision: 71
http://gnu-hylafax.svn.sourceforge.net/gnu-hylafax/?rev=71&view=rev
Author: sjardine
Date: 2008-02-20 08:03:15 -0800 (Wed, 20 Feb 2008)
Log Message:
-----------
Added event code for notifier class to the util module.
Added Paths:
-----------
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicReceiveNotifier.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicSendNotifier.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/Event.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveEvent.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveListener.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveNotifier.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendAndReceiveNotifier.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendEvent.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendListener.java
branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendNotifier.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicReceiveNotifier.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicReceiveNotifier.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicReceiveNotifier.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,92 @@
+// BasicReceiveNotifier.java - a HylaFAX Job representation
+// $Id: BasicReceiveNotifier.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003, Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+
+/**
+ * This interface defines what a class should implement in order to notify others of job related events.
+ * @author $Author: sjardine $
+ * @version $Id: BasicReceiveNotifier.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.ReceiveListener
+ * @see gnu.hylafax.job.ReceiveEvent
+ **/
+public class BasicReceiveNotifier implements ReceiveNotifier
+{
+ private List listeners= null;
+
+ public BasicReceiveNotifier()
+ {
+ listeners= new ArrayList();
+ }
+
+ /**
+ * This method is called when Job state changes.
+ */
+ public void notifyReceiveListeners(ReceiveEvent details)
+ {
+ if(details == null){
+ return;
+ }
+ synchronized(listeners){
+ Iterator i= listeners.iterator();
+ while(i.hasNext()){
+ ReceiveListener l= (ReceiveListener)i.next();
+ l.onReceiveEvent(details);
+ }
+ }
+ }// notifyListeners
+
+ /**
+ * This method is called to register a Job Listener.
+ */
+ public void addReceiveListener(ReceiveListener l)
+ {
+ if(l == null){
+ return;
+ }
+ synchronized(listeners){
+ listeners.add(l);
+ }
+ }
+
+ /**
+ * This method is used to deregister a Job Listener.
+ */
+ public void removeReceiveListener(ReceiveListener l)
+ {
+ if(l == null){
+ return;
+ }
+ synchronized(listeners){
+ listeners.remove(l);
+ }
+ }
+
+}// BasicReceiveNotifier class
+// BasicReceiveNotifier.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicSendNotifier.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicSendNotifier.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/BasicSendNotifier.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,87 @@
+// BasicSendNotifier.java - a HylaFAX Job representation
+// $Id: BasicSendNotifier.java,v 1.3 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003, Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * This interface defines what a class should implement in order to notify
+ * others of job related events.
+ *
+ * @author $Author: sjardine $
+ * @version $Id: BasicSendNotifier.java,v 1.3 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.SendListener
+ * @see gnu.hylafax.job.SendEvent
+ */
+public class BasicSendNotifier implements SendNotifier {
+ private List listeners = null;
+
+ public BasicSendNotifier() {
+ listeners = new ArrayList();
+ }
+
+ /**
+ * This method is called when Job state changes.
+ */
+ public void notifySendListeners(SendEvent details) {
+ if (details == null) {
+ return;
+ }
+ synchronized (listeners) {
+ Iterator i = listeners.iterator();
+ while (i.hasNext()) {
+ SendListener l = (SendListener) i.next();
+ l.onSendEvent(details);
+ }
+ }
+ }// notifyListeners
+
+ /**
+ * This method is called to register a Job Listener.
+ */
+ public void addSendListener(SendListener l) {
+ if (l == null) {
+ return;
+ }
+ synchronized (listeners) {
+ listeners.add(l);
+ }
+ }
+
+ /**
+ * This method is used to deregister a Job Listener.
+ */
+ public void removeSendListener(SendListener l) {
+ if (l == null) {
+ return;
+ }
+ synchronized (listeners) {
+ listeners.remove(l);
+ }
+ }
+
+}// BasicSendNotifier class
+// BasicSendNotifier.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/Event.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/Event.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/Event.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,47 @@
+// Event.java - a HylaFAX Job representation
+// $Id: Event.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+/**
+ * This class contains the information available on a basic job notification.
+ * @author $Author: sjardine $
+ * @version $Id: Event.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ **/
+public class Event
+{
+
+ private String queueFile;
+
+ public String getFilename()
+ {
+ return queueFile;
+ }
+
+ public void setFilename(String fn)
+ {
+ queueFile= fn;
+ }
+
+}// Event class
+// Event.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveEvent.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveEvent.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveEvent.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,88 @@
+// ReceiveEvent.java - a HylaFAX Job representation
+// $Id: ReceiveEvent.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+/**
+ * This class contains the information available on a receive job notification.
+ * @author $Author: sjardine $
+ * @version $Id: ReceiveEvent.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ **/
+public class ReceiveEvent extends Event
+{
+
+ private String modem;
+ private String message;
+ private String cidNumber;
+ private String cidName;
+ private String commid;
+
+
+ public String getModem()
+ {
+ return modem;
+ }
+
+ public void setModem(String m)
+ {
+ modem= m;
+ }
+
+ public void setMessage(String msg)
+ {
+ message= msg;
+ }
+
+ public String getMessage(){
+ return message;
+ }
+
+ public void setCidNumber(String cid)
+ {
+ cidNumber= cid;
+ }
+
+ public String getCidNumber(){
+ return cidNumber;
+ }
+
+ public void setCidName(String cid)
+ {
+ cidName= cid;
+ }
+
+ public String getCidName(){
+ return cidName;
+ }
+
+ public void setCommunicationIdentifier(String cid)
+ {
+ commid= cid;
+ }
+
+ public String getCommunicationIdentifier(){
+ return commid;
+ }
+
+}// ReceiveEvent class
+// ReceiveEvent.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveListener.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveListener.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveListener.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,44 @@
+// ReceiveListener.java - a HylaFAX Job representation
+// $Id: ReceiveListener.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+/**
+ * This interface defines what a class interested in receiving
+ * receive events should implement. A Listener should
+ * register for events from a Notifier.
+ * @author $Author: sjardine $
+ * @version $Id: ReceiveListener.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.ReceiveNotifier
+ * @see gnu.hylafax.job.ReceiveEvent
+ **/
+public interface ReceiveListener
+{
+
+ /**
+ * This method is called when send Job state changes.
+ */
+ public void onReceiveEvent(ReceiveEvent details);
+
+}// ReceiveListener class
+// ReceiveListener.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveNotifier.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveNotifier.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/ReceiveNotifier.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,52 @@
+// ReceiveNotifier.java - a HylaFAX Job representation
+// $Id: ReceiveNotifier.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+/**
+ * This interface defines what a class should implement in order to notify others of job related events.
+ * @author $Author: sjardine $
+ * @version $Id: ReceiveNotifier.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.ReceiveListener
+ * @see gnu.hylafax.job.ReceiveEvent
+ **/
+public interface ReceiveNotifier
+{
+
+ /**
+ * This method is called when Job state changes.
+ */
+ public void notifyReceiveListeners(ReceiveEvent details);
+
+ /**
+ * This method is called to register a Job ReceiveListener.
+ */
+ public void addReceiveListener(ReceiveListener l);
+
+ /**
+ * This method is used to deregister a Job ReceiveListener.
+ */
+ public void removeReceiveListener(ReceiveListener l);
+
+}// ReceiveNotifier class
+// ReceiveNotifier.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendAndReceiveNotifier.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendAndReceiveNotifier.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendAndReceiveNotifier.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,76 @@
+// SendAndReceiveNotifier.java - a HylaFAX Job representation
+// $Id: SendAndReceiveNotifier.java,v 1.3 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003, Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+
+
+
+
+/**
+ * This class is a convenience class implementing both a SendNotifier and ReceiveNotifier.
+ * @author $Author: sjardine $
+ * @version $Id: SendAndReceiveNotifier.java,v 1.3 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.SendListener
+ * @see gnu.hylafax.job.ReceiveListener
+ * @see gnu.hylafax.job.SendEvent
+ * @see gnu.hylafax.job.ReceiveEvent
+ **/
+public class SendAndReceiveNotifier
+ extends BasicSendNotifier
+ implements ReceiveNotifier
+{
+ private BasicReceiveNotifier rn;
+
+ public SendAndReceiveNotifier()
+ {
+ super();
+ rn= new BasicReceiveNotifier();
+ }
+
+ /**
+ * This method is called when Job state changes.
+ */
+ public void notifyReceiveListeners(ReceiveEvent details)
+ {
+ rn.notifyReceiveListeners(details); // delegate
+ }// notifyReceiveListeners
+
+ /**
+ * This method is called to register a Job Listener.
+ */
+ public void addReceiveListener(ReceiveListener l)
+ {
+ rn.addReceiveListener(l); // delegate
+ }
+
+ /**
+ * This method is used to deregister a Job Listener.
+ */
+ public void removeReceiveListener(ReceiveListener l)
+ {
+ rn.removeReceiveListener(l); // delegate
+ }
+
+}// SendAndReceiveNotifier class
+// SendAndReceiveNotifier.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendEvent.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendEvent.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendEvent.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,130 @@
+// SendEvent.java - a HylaFAX Job representation
+// $Id: SendEvent.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+
+import java.util.StringTokenizer;
+
+/**
+ * This class contains the information available on a job notification.
+ * @author $Author: sjardine $
+ * @version $Id: SendEvent.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ */
+public class SendEvent extends Event {
+
+ /** The job was completed successfully */
+ public final static String REASON_DONE = "done";
+
+ /** The job was not completed */
+ public final static String REASON_FAILED = "failed";
+
+ /** The job was rejected */
+ public final static String REASON_REJECTED = "rejected";
+
+ /** The job is blocked by other concurrent jobs */
+ public final static String REASON_BLOCKED = "blocked";
+
+ /** The job is being requeued for another attempt */
+ public final static String REASON_REQUEUED = "requeued";
+
+ /** The job was removed from the queue */
+ public final static String REASON_REMOVED = "removed";
+
+ /** The job was removed from the queue */
+ public final static String REASON_KILLED = "killed";
+
+ /** The job could not be sent before kill timer expired */
+ public final static String REASON_TIMEDOUT = "timedout";
+
+ /** The job document conversion failed */
+ public final static String REASON_FORMATFAILED = "format_failed";
+
+ /** The document conversion program could not be found */
+ public final static String REASON_NOFORMATTER = "no_formatter";
+
+ /** The remote side rejected a document poll */
+ public final static String REASON_POLLREJECTED = "poll_rejected";
+
+ /** There was no document available for polling */
+ public final static String REASON_POLLNODOCUMENT = "poll_no_document";
+
+ /** The document poll failed */
+ public final static String REASON_POLLFAILED = "poll_failed";
+
+ private String reason;
+
+ private long jobTime = -1;
+
+ private String nextAttempt = null;
+
+ private long jobid = -1;
+
+ public void setJobId(long jid) {
+ jobid = jid;
+ }
+
+ public long getJobId() {
+ return jobid;
+ }
+
+ public String getReason() {
+ return reason;
+ }
+
+ public void setReason(String r) {
+ reason = r;
+ }
+
+ public long getElapsedTime() {
+ return jobTime;
+ }
+
+ public void setElapsedTime(long time) {
+ jobTime = time;
+ }
+
+ /**
+ * set the job elapsed time.
+ * @param time the elapsed time value in "mm:ss" format
+ */
+ public void setElapsedTime(String time) {
+ jobTime = -1;
+ if (time != null && !time.trim().equals("")) {
+ StringTokenizer st = new StringTokenizer(time.trim(), ":");
+ short minutes = Short.parseShort(st.nextToken());
+ short seconds = Short.parseShort(st.nextToken());
+ jobTime = (minutes * 60) + seconds;
+ }
+ }
+
+ public void setNextAttempt(String seconds) {
+ nextAttempt = seconds;
+ }
+
+ public String getNextAttempt() {
+ return nextAttempt;
+ }
+
+}// SendEvent class
+// SendEvent.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendListener.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendListener.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendListener.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,41 @@
+// SendListener.java - a HylaFAX Job representation
+// $Id: SendListener.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+/**
+ * This interface defines what a class interested in receiving send Job related events should implement. A
+ * Listener should register for events from a Notifier.
+ * @author $Author: sjardine $
+ * @version $Id: SendListener.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.Event
+ */
+public interface SendListener {
+
+ /**
+ * This method is called when send Job state changes.
+ */
+ public void onSendEvent(SendEvent details);
+
+}// SendListener class
+// SendListener.java
Added: branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendNotifier.java
===================================================================
--- branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendNotifier.java (rev 0)
+++ branches/1.1.0-Site-Triggers/modules/utils/src/main/java/gnu/hylafax/job/SendNotifier.java 2008-02-20 16:03:15 UTC (rev 71)
@@ -0,0 +1,52 @@
+// SendNotifier.java - a HylaFAX Job representation
+// $Id: SendNotifier.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+//
+// Copyright 2003 Innovation Software Group, LLC - http://www.innovationsw.com
+// Joe Phillips <joe.phillips@...>
+//
+// for information on the HylaFAX FAX server see
+// http://www.hylafax.org/
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free
+// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+//
+package gnu.hylafax.job;
+
+/**
+ * This interface defines what a class should implement in order to notify others of job related events.
+ * @author $Author: sjardine $
+ * @version $Id: SendNotifier.java,v 1.2 2006/02/20 04:52:10 sjardine Exp $
+ * @see gnu.hylafax.job.SendListener
+ * @see gnu.hylafax.job.SendEvent
+ **/
+public interface SendNotifier
+{
+
+ /**
+ * This method is called when Job state changes.
+ */
+ public void notifySendListeners(SendEvent details);
+
+ /**
+ * This method is called to register a Job SendListener.
+ */
+ public void addSendListener(SendListener l);
+
+ /**
+ * This method is used to deregister a Job SendListener.
+ */
+ public void removeSendListener(SendListener l);
+
+}// SendNotifier class
+// SendNotifier.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|