Examples of PubSubService


Examples of com.cxy.redisclient.service.PubSubService

import junit.framework.TestCase;

public class PubSub extends TestCase {
  public void testPub(){
    PubSubService service = new PubSubService();
    service.publish(13, "test", "16:16 message");
  }
View Full Code Here

Examples of com.cxy.redisclient.service.PubSubService

  public void testPub(){
    PubSubService service = new PubSubService();
    service.publish(13, "test", "16:16 message");
  }
  public void testSub(){
    PubSubService service = new PubSubService();
    service.subscribe(13, new JedisPubSub() {

      @Override
      public void onMessage(String channel, String message) {
        System.out.println(channel + " received:" + message);
       
View Full Code Here

Examples of com.cxy.redisclient.service.PubSubService

     
    };
   
    final Thread t = new Thread(new Runnable() {
        public void run() {
          PubSubService subscribe = new PubSubService();
          subscribe.subscribe(id, callback, subChannel);
        }
    });
    t.start();
   
    tbtmSubItem.addDisposeListener(new DisposeListener() {
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.PubSubService

     * @param geoLocation The geo location.
     * @throws rocks.xmpp.core.stanza.model.StanzaException If the entity returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     */
    public void publish(GeoLocation geoLocation) throws XmppException {
        PubSubService pepService = xmppSession.getExtensionManager(PubSubManager.class).createPersonalEventingService();
        pepService.getNode(GeoLocation.NAMESPACE).publish(geoLocation);
    }
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.PubSubService

                                                byte[] data = baos.toByteArray();
                                                storeToCache(item.getId(), data);
                                                notifyListeners(message.getFrom().asBareJid(), data);

                                            } else {
                                                PubSubService pubSubService = xmppSession.getExtensionManager(PubSubManager.class).createPubSubService(message.getFrom());

                                                List<Item> items = pubSubService.getNode(AvatarData.NAMESPACE).getItems(item.getId());
                                                if (!items.isEmpty()) {
                                                    Item i = items.get(0);
                                                    if (i.getPayload() instanceof AvatarData) {
                                                        AvatarData avatarData = (AvatarData) i.getPayload();
                                                        storeToCache(item.getId(), avatarData.getData());
View Full Code Here

Examples of rocks.xmpp.extensions.pubsub.PubSubService

     * @param itemId The item id.
     * @param info   The info element.
     * @throws rocks.xmpp.core.XmppException If an XMPP exception occurs.
     */
    private void publishToPersonalEventingService(byte[] avatar, String itemId, AvatarMetadata.Info info) throws XmppException {
        PubSubService personalEventingService = xmppSession.getExtensionManager(PubSubManager.class).createPersonalEventingService();
        if (avatar != null) {
            if (info.getUrl() == null) {
                // Publish image.
                personalEventingService.getNode(AvatarData.NAMESPACE).publish(itemId, new AvatarData(avatar));
            }
            // Publish meta data.
            personalEventingService.getNode(AvatarMetadata.NAMESPACE).publish(itemId, new AvatarMetadata(info));
        } else {
            personalEventingService.getNode(AvatarMetadata.NAMESPACE).publish(itemId, new AvatarMetadata());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.