Examples of XmppID


Examples of com.anzsoft.client.XMPP.XmppID

  public void getDiscoItems()
  {
    XmppQuery query = session.getFactory().createQuery();
    query.setType(XmppQuery.TYPE_GET);
    query.setID("disco_item_1");
    XmppID jid = XmppID.parseId(session.getUser().getID());
    query.setTo(jid.getDomain());
    query.setQuery("http://jabber.org/protocol/disco#items");
    session.send(query);
  }
View Full Code Here

Examples of com.anzsoft.client.XMPP.XmppID

    iq.getNode().appendChild(vcardEl);
    JabberApp.instance().getSession().send(iq, new XmppPacketListener()
    {
      public void onPacketReceived(XmppPacket packet)
      {
        XmppID id = packet.getFromID();
        XmppVCard vcard = new XmppVCard();
        if(vcard.formXml(packet.toXML()))
        {
          vcards.put(id.toStringNoResource(), vcard);
          if(listener != null)
            listener.onVCard(id,vcard);
          fireOnVCard(id,vcard);
        }
      }
View Full Code Here

Examples of com.anzsoft.client.XMPP.XmppID

 
  protected boolean iqVerify(final Element x,final XmppID to,final String id,final String xmlns)
  {
    if(!x.getTagName().equals("iq"))
      return false;
    XmppID from = XmppID.parseId(x.getAttribute("from"));
    XmppID local = XmppID.parseId(session.getUser().getID());
    XmppID server = XmppID.parseId(XmppID.parseId(session.getUser().getID()).getDomain());
   
    if(from == null)
    {
      if(to != null&&!to.equals(server))
      {
View Full Code Here

Examples of com.anzsoft.client.XMPP.XmppID

  private XmppContactStatus status;
  private Subscription subscription;
 
  public static XmppContact fromXml(Element e)
  {
    XmppID jid = XmppID.parseId(e.getAttribute("jid"));
    String subscription = e.getAttribute("subscription");
    String name = e.getAttribute("name");
    ArrayList<String> groups = XMLHelper.getSubTagsConents(e, "group");
    return new XmppContact(jid,Subscription.valueOf(subscription),name,groups);
   
View Full Code Here

Examples of com.anzsoft.client.XMPP.XmppID

    {
      public void onPresenceReceived(XmppPresence presence)
      {
        try
        {
          XmppID id = presence.getFromID();
          String jid = id.toStringNoResource();
          String type = presence.getType();
          if(type != null&&(type.equals("subscribe")||type.equals("subscribed")||type.equals("unsubscribe")||type.equals("unsubscribed")))
          {
            onSubscription(id,type,presence.getNick());
            return;
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPID

      adapter = (IRemoteServiceContainerAdapter) container
          .getAdapter(IRemoteServiceContainerAdapter.class);
      assertNotNull(adapter);

      clientID = new XMPPID(container.getConnectNamespace(), username);
      assertNotNull(clientID);

      connectContext = ConnectContextFactory
          .createUsernamePasswordConnectContext(username, password);
      assertNotNull(connectContext);
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPID

  }

  protected ID createUserIDFromName(String name) {
    ID result = null;
    try {
      result = new XMPPID(connectNamespace, name);
      return result;
    } catch (final Exception e) {
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPID

      // XMPP server returns the same length for both
      while (jids.hasNext() && names.hasNext()) {
        try {
          jid = (String) jids.next();
          name = (String) names.next();
          IUser user = new User(new XMPPID(connectNamespace, jid),
              name);
          result.add(new XMPPResultItem(user));
        } catch (URISyntaxException e) {
          throw new RuntimeException(
              "cannot create connect id for client " + jid //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPID

    }
    return password;
  }

  private XMPPID getXMPPID(ID remote) throws ECFException {
    XMPPID jabberID = null;
    try {
      jabberID = (XMPPID) remote;
    } catch (final ClassCastException e) {
      throw new ECFException(e);
    }
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPID

      throw new ECFException("already connected");
    if (timeout > 0)
      SmackConfiguration.setPacketReplyTimeout(timeout);
    Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual);

    final XMPPID jabberURI = getXMPPID(remote);

    String username = jabberURI.getNodename();
    String hostname = jabberURI.getHostname();
    String hostnameOverride = null;

    // Check for the URI form of "joe@bloggs.org;talk.google.com", which
    // would at this point would have
    // - username = "joe"
    // - hostname = "blogs.org;talk.google.com"
    // - hostnameOverride = null
    //
    // We need to turn this into:
    // - username = "joe"
    // - hostname = "bloggs.org"
    // - hostnameOverride = "talk.google.com"

    int semiColonIdx = hostname.lastIndexOf(';');
    if (semiColonIdx != -1) {
      hostnameOverride = hostname.substring(semiColonIdx + 1);
      hostname = hostname.substring(0, semiColonIdx);
    }

    if (google && hostnameOverride == null) {
      hostnameOverride = GOOGLE_TALK_HOST;
    }
    final String serviceName = hostname;

    serverPort = jabberURI.getPort();
    serverResource = jabberURI.getResourceName();
    if (serverResource == null
        || serverResource.equals(XMPPID.PATH_DELIMITER)) {
      serverResource = getClientIdentifier();
      jabberURI.setResourceName(serverResource);
    }
    try {
      ConnectionConfiguration config;
      if (hostnameOverride != null) {
        config = new ConnectionConfiguration(hostnameOverride,
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.