Examples of Jid


Examples of jabber.roster.Jid

  boolean default_flag = false;
  RecordStore rs = null;
  try {
    rs = RecordStore.openRecordStore("MyOptions",true);
  }catch (RecordStoreException ex) {
    jid = new Jid("username@localhost/JabberMix");
           password = "password";
     server_name = "localhost";
    
   
    return;
   
  }
 
  //get record in order
  byte b[] = null;
  byte b1[] = null;
  byte b2[] = null;
  byte b3[] = null;
  byte b4[] = null;
  byte b5[] = null;
  byte b6[] = null;
  byte b7[] = null;
 
  try {
    b = rs.getRecord(1);
    b1 = rs.getRecord(2);
    b2 = rs.getRecord(3);
    b3 = rs.getRecord(4);
    b4 = rs.getRecord(5);
    b5 = rs.getRecord(6);
    b6 = rs.getRecord(7);
    b7 = rs.getRecord(8);
  }catch (RecordStoreNotOpenException e) {
    default_flag = true;
  }catch (InvalidRecordIDException e1) {
    default_flag = true;
  }catch (RecordStoreException e2) {
    default_flag = true;
  }
  if (default_flag) {//default options
    jid = new Jid("username@localhost/JabberMix");
           password = "password";
     server_name = "localhost";
    
   
  }
  else { //the records exist
    jid = new Jid(new String(b, 0, b.length));
   
    password = new String(b1, 0, b1.length);
 
    server_name = new String(b2, 0, b2.length);
   
View Full Code Here

Examples of nu.fw.jeti.jabber.JID

  }
 
//  ---------------------message event---------------------------
  public synchronized void message(Message message)
  {
    JID from = message.getFrom();
    if (message.getType().equals("chat") || (message.getType().equals("error") && message.getThread() != null))
    {
      beep();
      ChatWindow chatWindow;
      JIDStatus jidStatus = backend.getJIDStatus(message.getFrom());
      String server = from.getDomain();
      if(server.indexOf("conference")>-1 ||
        server.indexOf("private")>-1 ||
        server.indexOf("groupchat")>-1)
      {//private messages from groupchat should have a window per resource
        chatWindow = getChatwindow(from,true);
        jidStatus = new UnknownJIDStatus(from,from.getResource());
      }
      else chatWindow = getChatwindow(from,Preferences.getBoolean("jeti","chatwindowPerResource",false));
      if(tabs!=null)
      {
        int index = tabs.indexOfComponent(chatWindow);
        if(index!=-1)
        {
          if(tabs.getSelectedIndex()!=index)
          {
            tabs.setBackgroundAt(index,Color.BLUE);
            tabs.setForegroundAt(index,Color.RED);
          }
          tabs.setToolTipTextAt(index,message.getBody());
        }
      }
      if (chatWindow == null)
      {
        if (jidStatus == nullchatWindow = startChat(new UnknownJIDStatus(from),message.getThread()); // ,"images",true,"unknown",e.getThread());
        else chatWindow = startChat(jidStatus, message.getThread());
//        chatWindow.setExtendedState(JFrame.ICONIFIED); //prevent focus stealing, does not work anymore for some stupid reason 
        //Thread.yield();
        //chatWindow.show();
        //chatWindow.setVisible(true);
        //chatWindow.toBack();
        //setChatWindowPosition(chatWindow);
       
        //chatWindows.add(chatWindow);
      }
      chatWindow.appendMessage(message);
    }
    else if(message.getType().equals("groupchat"))
    {
      //no sound on groupchat server messages
          if(from.getResource()!=null) beep();
    }
    else
    {
      beep();
      new SendMessage(backend, message);
View Full Code Here

Examples of org.agilewiki.jid.Jid

        rightBNode.setNodeType(oldType);
        int h = nodeCapacity / 2;
        int i = 0;
        if (oldType.equals("leaf")) {
            while (i < h) {
                Jid e = (Jid) oldRootNode.iGet(i);
                byte[] bytes = e.getSerializedBytes();
                leftBNode.iAddBytes(-1, bytes);
                i += 1;
            }
            while (i < nodeCapacity) {
                Jid e = (Jid) oldRootNode.iGet(i);
                byte[] bytes = e.getSerializedBytes();
                rightBNode.iAddBytes(-1, bytes);
                i += 1;
            }
        } else {
            while (i < h) {
                BMapJid<KEY_TYPE, Jid> e = (BMapJid) oldRootNode.iGet(i).getValue();
                int eSize = e.size();
                byte[] bytes = e.getSerializedBytes();
                leftBNode.append(bytes, eSize);
                i += 1;
            }
            while (i < nodeCapacity) {
                BMapJid<KEY_TYPE, Jid> e = (BMapJid) oldRootNode.iGet(i).getValue();
                int eSize = e.size();
                byte[] bytes = e.getSerializedBytes();
                rightBNode.append(bytes, eSize);
                i += 1;
            }
        }
        leftEntry.setKey(leftBNode.getLastKey());
View Full Code Here

Examples of org.xmpp.packet.JID

            componentsByDomain.put(subdomain, externalComponent);
            components.put(component, externalComponent);
            // Ask the ExternalComponent to connect with the remote server
            externalComponent.connect(host, port, subdomain);
            // Initialize the component
            JID componentJID = new JID(null, externalComponent.getDomain(), null);
            externalComponent.initialize(componentJID, this);
        } catch (ComponentException e) {
            // Unregister the new component
            componentsByDomain.remove(subdomain);
            components.remove(component);
View Full Code Here

Examples of org.xmpp.packet.JID

            // used for migration
            if (previousDomain != null) {
              jid = jid.replace(previousDomain, serverName);
            }

            rosterItems.add(new RosterItem(new JID(jid),
                RosterItem.SubType.getTypeFromInt(Integer
                    .parseInt(substatus)),
                RosterItem.AskType.getTypeFromInt(Integer
                    .parseInt(askstatus)),
                RosterItem.RecvType.getTypeFromInt(Integer
View Full Code Here

Examples of rocks.xmpp.core.Jid

        Assert.assertEquals(xml, "<message to=\"juliet@example.com\" type=\"error\"><body>test</body><error type=\"cancel\"><conflict xmlns=\"urn:ietf:params:xml:ns:xmpp-stanzas\"></conflict></error></message>");
    }

    @Test
    public void marshalMessage() throws JAXBException, XMLStreamException {
        Message message = new Message(new Jid("to", "domain"), Message.Type.CHAT);
        message.setId("id");
        message.setFrom(new Jid("from", "domain"));
        String xml = marshal(message);
        Assert.assertEquals(xml, "<message from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"chat\"></message>");
    }
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.