Skip to main content
summaryrefslogtreecommitdiffstats
blob: 3385a2e068ff4a9ee7fc4d159b8b98513029175c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*******************************************************************************
 * Copyright (c) 2010 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.framework.messaging;

import java.util.Properties;
import org.eclipse.osee.framework.core.exception.OseeCoreException;

/**
 * @author Roberto E. Escobar
 */
public interface ConnectionNode {

   /**
    * Subscribes listener to updates to message/s with the given id.
    * 
    * @param statusCallback Used to relay the status of the subscribe command ( success, failure, etc). Can not be null.
    */
   void subscribe(MessageID messageId, OseeMessagingListener listener, final OseeMessagingStatusCallback statusCallback);

   /**
    * Subscribes listener to updates to message/s with the given id.
    * 
    * @param selector A string conforming to the SQL 92 syntax used for extra filtering of subscriptions
    * @param statusCallback Used to relay the status of the subscribe command ( success, failure, etc). Can not be null.
    */
   void subscribe(MessageID messageId, OseeMessagingListener listener, String selector, final OseeMessagingStatusCallback statusCallback);

   /**
    * Subscribes listener to updates to message/s with the given id. A default status handler will be used to log
    * failures.
    */
   void subscribe(MessageID messageId, OseeMessagingListener listener);

   /**
    * Unsubscribes listener from updates for message with id equal to messageId.
    * 
    * @param statusCallback Used to relay the status of the unsubscribe ( success, failure, etc). Can not be null.
    */
   void unsubscribe(MessageID messageId, OseeMessagingListener listener, final OseeMessagingStatusCallback statusCallback);

   /**
    * Unsubscribes listener from updates for message with id equal to messageId. A default status handler will be used
    * to log failures.
    */
   void unsubscribe(MessageID messageId, OseeMessagingListener listener);

   boolean subscribeToReply(MessageID messageId, OseeMessagingListener listener);

   boolean unsubscribteToReply(MessageID messageId, OseeMessagingListener listener);

   /**
    * Sends given message.
    * 
    * @param statusCallback Used to relay the status of the sending of the message ( success, failure, etc). Can not be
    * null.
    */
   void send(MessageID messageId, Object message, final OseeMessagingStatusCallback statusCallback) throws OseeCoreException;

   /**
    * Attaches the properties provided to the message before sending.
    * 
    * @param properties Set of properties to be attached to the message.
    * @param statusCallback Used to relay the status of the sending of the message ( success, failure, etc). Can not be
    * null.
    */
   void send(MessageID messageId, Object message, Properties properties, OseeMessagingStatusCallback statusCallback) throws OseeCoreException;

   /**
    * Sends given message. Uses default status handler to log failures in sending given message.
    */
   void send(MessageID messageId, Object message) throws OseeCoreException;

   void addConnectionListener(ConnectionListener connectionListener);

   void removeConnectionListener(ConnectionListener connectionListener);

   void stop();

   String getSummary();

   String getSubscribers();

   String getSenders();

}

Back to the top