diff options
author | Werner Dittmann <wernerd@java.net> | 2009-08-26 11:07:20 +0000 |
---|---|---|
committer | Werner Dittmann <wernerd@java.net> | 2009-08-26 11:07:20 +0000 |
commit | fb88643cc5c1e7e83b79f63b5005a582ed6bea84 (patch) | |
tree | 6f5ae63785eef4c084bdcfe4e25c8ee648486a0c /src/net/java/sip/communicator/service/protocol/OperationSetInstantMessageTransformImpl.java | |
parent | 63cdcff18540d0a2c8184057d2ed3a6f0986ad43 (diff) | |
download | jitsi-fb88643cc5c1e7e83b79f63b5005a582ed6bea84.zip jitsi-fb88643cc5c1e7e83b79f63b5005a582ed6bea84.tar.gz jitsi-fb88643cc5c1e7e83b79f63b5005a582ed6bea84.tar.bz2 |
Integrate the second big patch for OTR. With this patch all the required GSoC functions are available. Third commit.
Diffstat (limited to 'src/net/java/sip/communicator/service/protocol/OperationSetInstantMessageTransformImpl.java')
-rw-r--r-- | src/net/java/sip/communicator/service/protocol/OperationSetInstantMessageTransformImpl.java | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/OperationSetInstantMessageTransformImpl.java b/src/net/java/sip/communicator/service/protocol/OperationSetInstantMessageTransformImpl.java new file mode 100644 index 0000000..4839a5d --- /dev/null +++ b/src/net/java/sip/communicator/service/protocol/OperationSetInstantMessageTransformImpl.java @@ -0,0 +1,47 @@ +package net.java.sip.communicator.service.protocol; + +import java.util.*; + +public class OperationSetInstantMessageTransformImpl implements + OperationSetInstantMessageTransform { + + public final Map<Integer, Vector<TransformLayer>> transformLayers = new Hashtable<Integer, Vector<TransformLayer>>(); + + private static final int defaultPriority = 1; + + public void addTransformLayer(TransformLayer transformLayer) { + this.addTransformLayer(defaultPriority, transformLayer); + } + + public void addTransformLayer(int priority, TransformLayer transformLayer) { + synchronized (transformLayers) { + if (!transformLayers.containsKey(defaultPriority)) + transformLayers.put(defaultPriority, + new Vector<TransformLayer>()); + + transformLayers.get(defaultPriority).add(transformLayer); + } + } + + public boolean containsLayer(TransformLayer layer) { + synchronized (transformLayers) { + for (Map.Entry<Integer, Vector<TransformLayer>> entry : transformLayers + .entrySet()) { + if (entry.getValue().contains(layer)) + return true; + } + + } + return false; + } + + public void removeTransformLayer(TransformLayer transformLayer) { + synchronized (transformLayers) { + for (Map.Entry<Integer, Vector<TransformLayer>> entry : transformLayers + .entrySet()) { + entry.getValue().remove(transformLayer); + } + } + } + +} |