Package org.eclipse.ecf.presence

Examples of org.eclipse.ecf.presence.IPresence$Mode


    IRosterEntry entry;
      try {
        userID = IDFactory.getDefault().createID(targetID.getNamespace(), userName);

        IUser child = new org.eclipse.ecf.core.user.User(userID,userName);
        IPresence presence = new Presence(IPresence.Type.AVAILABLE);
        entry = new RosterEntry(parent, child,presence);
        /*IPresence presence = presenceContainer.createPresence(userID.getName());
        entry.setPresenceState(presence);*/
        return entry;
      } catch (IDCreateException e) {
View Full Code Here


   *
   * @param entry the IRosterEntry to check.  Must not be <code>null</code>.
   * @return <code>true</code> if the given IRosterEntry should be added, <code>false</code> otherwise.
   */
  protected boolean addEntry(IRosterEntry entry) {
    IPresence presence = entry.getPresence();
    if (presence == null)
      return false;
    return (presence.getType().equals(IPresence.Type.AVAILABLE) && presence.getMode().equals(IPresence.Mode.AVAILABLE));
  }
View Full Code Here

    }
    return NO_CONTRIBUTIONS;
  }

  protected ImageDescriptor getRosterEntryImageDescriptor(IRosterEntry entry) {
    IPresence p = entry.getPresence();
    if (p != null) {
      IPresence.Type pType = p.getType();
      IPresence.Mode pMode = p.getMode();
      // If type is unavailable then we're unavailable
      if (pType.equals(IPresence.Type.AVAILABLE)) {
        // if type and mode are both 'available' then we're actually
        // available
        if (pMode.equals(IPresence.Mode.AVAILABLE))
View Full Code Here

  protected String getRosterEntryLabel(IRosterEntry entry) {
    return entry.getName();
  }

  protected ImageDescriptor getRosterEntryImageDescriptor(IRosterEntry entry) {
    IPresence p = entry.getPresence();
    if (p != null) {
      IPresence.Type pType = p.getType();
      IPresence.Mode pMode = p.getMode();
      // If type is unavailable then we're unavailable
      if (pType.equals(IPresence.Type.AVAILABLE)) {
        // if type and mode are both 'available' then we're actually
        // available
        if (pMode.equals(IPresence.Mode.AVAILABLE))
View Full Code Here

   *         otherwise.
   */
  protected boolean isAvailable(IRosterEntry entry) {
    if (entry == null)
      return false;
    IPresence presence = entry.getPresence();
    boolean type = (presence == null) ? false : presence.getType().equals(IPresence.Type.AVAILABLE);
    boolean mode = (presence == null) ? false : presence.getMode().equals(IPresence.Mode.AVAILABLE);
    return (type && mode);
  }
View Full Code Here

    if (containsChannelParticipant(createIDFromString(name)) != null)
      firePresenceListeners(false, new String[] { name });
  }

  private IPresence createPresence(final boolean available) {
    return new IPresence() {

      private static final long serialVersionUID = -7514227760059471898L;
      Map properties = new HashMap();

      public Mode getMode() {
View Full Code Here

  }

  protected void handlePresenceEvent(PresenceEvent evt) {
    final Presence xmppPresence = evt.getPresence();
    final String from = xmppPresence.getFrom();
    final IPresence newPresence = createIPresence(xmppPresence);
    final XMPPID fromID = createIDFromName(from);
    if (newPresence.getType().equals(IPresence.Type.SUBSCRIBE)
        || newPresence.getType().equals(IPresence.Type.UNSUBSCRIBE)
        || newPresence.getType().equals(IPresence.Type.SUBSCRIBED)
        || newPresence.getType().equals(IPresence.Type.UNSUBSCRIBED)) {
      rosterManager.notifySubscriptionListener(fromID, newPresence);
    } else {
      updatePresence(fromID, newPresence);
      firePresenceListeners(fromID, newPresence);
    }
View Full Code Here

    return IPresence.Mode.AVAILABLE;
  }

  protected IPresence createIPresence(Presence xmppPresence) {
    final String status = xmppPresence.getStatus();
    final IPresence newPresence = new org.eclipse.ecf.presence.Presence(
        createIPresenceType(xmppPresence), status,
        createIPresenceMode(xmppPresence));
    return newPresence;
  }
View Full Code Here

  }

  protected void handlePresenceEvent(PresenceEvent evt) {
    final Presence xmppPresence = evt.getPresence();
    final String from = canonicalizeRoomFrom(xmppPresence.getFrom());
    final IPresence newPresence = createIPresence(xmppPresence);
    final ID fromID = createUserIDFromName(from);
    if (newPresence.getType().equals(IPresence.Type.AVAILABLE)) {
      if (!chatRoomContainerParticipants.contains(fromID))
        chatRoomContainerParticipants.add(fromID);
    } else
      chatRoomContainerParticipants.remove(fromID);
    fireParticipant(fromID, newPresence);
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.presence.IPresence$Mode

Copyright © 2018 www.massapicom. 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.