Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-11-01 11:23:00 +0000
committerEike Stepper2008-11-01 11:23:00 +0000
commit1bd480f81f09442906779ec673d77ef27d883a95 (patch)
tree1fa4775624fb65b31e44633b1b0372e0f975eca4 /plugins/org.eclipse.net4j.buddies.common
parentf24d82af2542d10c9eab5ace82b7177fed1917c2 (diff)
downloadcdo-1bd480f81f09442906779ec673d77ef27d883a95.tar.gz
cdo-1bd480f81f09442906779ec673d77ef27d883a95.tar.xz
cdo-1bd480f81f09442906779ec673d77ef27d883a95.zip
[253054] [POLISH] Pass protocol and signalID in Signal constructor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=253054
Diffstat (limited to 'plugins/org.eclipse.net4j.buddies.common')
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java10
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java8
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java11
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java8
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java10
-rw-r--r--plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java8
6 files changed, 13 insertions, 42 deletions
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java
index 30cf3eaf8f..440f45a38b 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateIndication.java
@@ -12,6 +12,7 @@ package org.eclipse.net4j.buddies.internal.common.protocol;
import org.eclipse.net4j.buddies.common.IBuddy.State;
import org.eclipse.net4j.signal.Indication;
+import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import java.io.IOException;
@@ -21,14 +22,9 @@ import java.io.IOException;
*/
public abstract class BuddyStateIndication extends Indication
{
- public BuddyStateIndication()
+ public BuddyStateIndication(SignalProtocol<?> protocol)
{
- }
-
- @Override
- protected short getSignalID()
- {
- return ProtocolConstants.SIGNAL_BUDDY_STATE;
+ super(protocol, ProtocolConstants.SIGNAL_BUDDY_STATE);
}
@Override
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java
index 7bb4b6bf9c..97c454e9cb 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/BuddyStateNotification.java
@@ -28,18 +28,12 @@ public class BuddyStateNotification extends Request
public BuddyStateNotification(SignalProtocol<?> protocol, String userID, State state)
{
- super(protocol);
+ super(protocol, ProtocolConstants.SIGNAL_BUDDY_STATE);
this.userID = userID;
this.state = state;
}
@Override
- protected short getSignalID()
- {
- return ProtocolConstants.SIGNAL_BUDDY_STATE;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeString(userID);
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java
index 36c22d707b..406fb4b5e2 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftIndication.java
@@ -15,6 +15,7 @@ import org.eclipse.net4j.buddies.common.ICollaborationProvider;
import org.eclipse.net4j.buddies.internal.common.Buddy;
import org.eclipse.net4j.buddies.internal.common.Collaboration;
import org.eclipse.net4j.signal.Indication;
+import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import java.io.IOException;
@@ -28,19 +29,15 @@ public class CollaborationLeftIndication extends Indication
private ICollaborationProvider collaborationProvider;
- public CollaborationLeftIndication(IBuddyProvider buddyProvider, ICollaborationProvider collaborationProvider)
+ public CollaborationLeftIndication(SignalProtocol<?> protocol, IBuddyProvider buddyProvider,
+ ICollaborationProvider collaborationProvider)
{
+ super(protocol, ProtocolConstants.SIGNAL_COLLABORATION_LEFT);
this.buddyProvider = buddyProvider;
this.collaborationProvider = collaborationProvider;
}
@Override
- protected short getSignalID()
- {
- return ProtocolConstants.SIGNAL_COLLABORATION_LEFT;
- }
-
- @Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
long collaborationID = in.readLong();
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java
index 067e94494e..7fd1835278 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/CollaborationLeftNotification.java
@@ -27,18 +27,12 @@ public class CollaborationLeftNotification extends Request
public CollaborationLeftNotification(SignalProtocol<?> protocol, long collaborationID, String userID)
{
- super(protocol);
+ super(protocol, ProtocolConstants.SIGNAL_COLLABORATION_LEFT);
this.collaborationID = collaborationID;
this.userID = userID;
}
@Override
- protected short getSignalID()
- {
- return ProtocolConstants.SIGNAL_COLLABORATION_LEFT;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeLong(collaborationID);
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java
index 70cbb13ba1..f1d812b1f7 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageIndication.java
@@ -15,6 +15,7 @@ import org.eclipse.net4j.buddies.common.ICollaborationProvider;
import org.eclipse.net4j.buddies.common.IMessage;
import org.eclipse.net4j.buddies.spi.common.Facility;
import org.eclipse.net4j.signal.Indication;
+import org.eclipse.net4j.signal.SignalProtocol;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import java.io.IOException;
@@ -26,18 +27,13 @@ public class MessageIndication extends Indication
{
private ICollaborationProvider collaborationProvider;
- public MessageIndication(ICollaborationProvider collaborationProvider)
+ public MessageIndication(SignalProtocol<?> protocol, ICollaborationProvider collaborationProvider)
{
+ super(protocol, ProtocolConstants.SIGNAL_MESSAGE);
this.collaborationProvider = collaborationProvider;
}
@Override
- protected short getSignalID()
- {
- return ProtocolConstants.SIGNAL_MESSAGE;
- }
-
- @Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
long collaborationID = in.readLong();
diff --git a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java
index 894697f155..726c70f4a3 100644
--- a/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java
+++ b/plugins/org.eclipse.net4j.buddies.common/src/org/eclipse/net4j/buddies/internal/common/protocol/MessageNotification.java
@@ -30,19 +30,13 @@ public class MessageNotification extends Request
public MessageNotification(SignalProtocol<?> protocol, long collaborationID, String facilityType, IMessage message)
{
- super(protocol);
+ super(protocol, ProtocolConstants.SIGNAL_MESSAGE);
this.collaborationID = collaborationID;
this.facilityType = facilityType;
this.message = message;
}
@Override
- protected short getSignalID()
- {
- return ProtocolConstants.SIGNAL_MESSAGE;
- }
-
- @Override
protected void requesting(ExtendedDataOutputStream out) throws IOException
{
out.writeLong(collaborationID);

Back to the top