From d100493139446a9fc27e40932b1bb9dabd1e0a8f Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Fri, 17 Aug 2012 08:43:13 +0000 Subject: Adds get/set data to SourceContacts. Moves custom buttons to ExternalContactSource. Adds listener to refresh contact sources. --- .../contactsource/GenericSourceContact.java | 2 ++ .../service/contactsource/SourceContact.java | 32 ++++++++++++++++++++++ .../contactsource/contactsource.manifest.mf | 1 + 3 files changed, 35 insertions(+) (limited to 'src/net/java/sip/communicator/service') diff --git a/src/net/java/sip/communicator/service/contactsource/GenericSourceContact.java b/src/net/java/sip/communicator/service/contactsource/GenericSourceContact.java index cf84e06..ab382ee 100644 --- a/src/net/java/sip/communicator/service/contactsource/GenericSourceContact.java +++ b/src/net/java/sip/communicator/service/contactsource/GenericSourceContact.java @@ -9,6 +9,7 @@ package net.java.sip.communicator.service.contactsource; import java.util.*; import net.java.sip.communicator.service.protocol.*; +import net.java.sip.communicator.util.*; /** * Implements a generic SourceContact for the purposes of the support @@ -17,6 +18,7 @@ import net.java.sip.communicator.service.protocol.*; * @author Lyubomir Marinov */ public class GenericSourceContact + extends DataObject implements SourceContact { /** diff --git a/src/net/java/sip/communicator/service/contactsource/SourceContact.java b/src/net/java/sip/communicator/service/contactsource/SourceContact.java index 9d4536e..d013d7f 100644 --- a/src/net/java/sip/communicator/service/contactsource/SourceContact.java +++ b/src/net/java/sip/communicator/service/contactsource/SourceContact.java @@ -91,4 +91,36 @@ public interface SourceContact * @return the byte array of the image or null if no image is available */ public byte[] getImage(); + + /** + * Gets the user data associated with this instance and a specific key. + * + * @param key the key of the user data associated with this instance to be + * retrieved + * @return an Object which represents the value associated with + * this instance and the specified key; null if no + * association with the specified key exists in this instance + */ + public Object getData(Object key); + + /** + * Sets a user-specific association in this instance in the form of a + * key-value pair. If the specified key is already associated in + * this instance with a value, the existing value is overwritten with the + * specified value. + *

+ * The user-defined association created by this method and stored in this + * instance is not serialized by this instance and is thus only meant for + * runtime use. + *

+ *

+ * The storage of the user data is implementation-specific and is thus not + * guaranteed to be optimized for execution time and memory use. + *

+ * + * @param key the key to associate in this instance with the specified value + * @param value the value to be associated in this instance with the + * specified key + */ + public void setData(Object key, Object value); } diff --git a/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf b/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf index 7b06df7..4ae0097 100644 --- a/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf +++ b/src/net/java/sip/communicator/service/contactsource/contactsource.manifest.mf @@ -4,5 +4,6 @@ Bundle-Vendor: jitsi.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, + net.java.sip.communicator.util, net.java.sip.communicator.service.protocol Export-Package: net.java.sip.communicator.service.contactsource -- cgit v1.1