Start a new or retrieve the existing chat with <code>jid</code>.

@param jid the XMPP address of the other entity to chat with.
@return the Chat API for the given XMPP address.
14768
public Chat chatWith(EntityBareJid jid) {
        Chat chat = chats.get(jid);
        if (chat == null) {
            synchronized (chats) {
                // Double-checked locking.
                chat = chats.get(jid);
                if (chat != null) {
                    return chat;
                }
                chat = new Chat(connection(), jid);
                chats.put(jid, chat);
            }
        }
        return chat;
    }
97811
public TCConversationRequest createConversation(Dialog d, boolean dialogTermitationPermission) {
        if (d == null) {
            throw new NullPointerException("Dialog is null");
        }
        TCConversationRequestImpl tccr = new TCConversationRequestImpl(dialogTermitationPermission);
        tccr.setDialog(d);
        tccr.setOriginatingAddress(d.getLocalAddress());

        return tccr;
    }
723009
public Message getOrCreateMessage(TextChannel channel, JsonNode data) {
        long id = Long.parseLong(data.get("id").asText());
        synchronized (messages) {
            return getCachedMessageById(id).orElseGet(() -> new MessageImpl(this, channel, data));
        }
    }
816727
public Message getMessage(MessageId id)
  {
    // Performance note: this method uses a lazy initialization pattern. When
    // a MessageId is first requested, we fetch the data from the ResourceBundle
    // and create a new Message object, which is then cached. On the next 
    // request, we'll use the cached version instead. 
    Message message;
    if (cachedMessages.containsKey(id))
    {
      message = cachedMessages.get(id);
    } 
    else
    {
      message = new Message(id, defaultSeverities.get(id), getMessageAsString(id), getSuggestion(id));
      cachedMessages.put(id, message);
    }

    return message;
  }
528397
public synchronized ProxyQueueConversationGroup create(Conversation conversation)
      throws IllegalArgumentException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "create", conversation);
      
      if (convToGroupMap.containsKey(conversation))
      {
         // A proxy queue conversation group is associated one-to-one with a conversation. In this
         // case someone has tried to create 2 for the same conversation.
         SIErrorException e = new SIErrorException(
            nls.getFormattedMessage("PQGROUP_ALREADY_CREATED_SICO1054", null, null)
         );
            
         FFDCFilter.processException(e, CLASS_NAME + ".create",
                                     CommsConstants.PQCONVGRPFACTIMPL_CREATE_01, this);
         
         throw e;
      }
      
      ProxyQueueConversationGroup group =
         new ProxyQueueConversationGroupImpl(conversation, this);
      
      convToGroupMap.put(conversation, group);
      
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "create", group);
      return group;
   }
116990
public boolean enable(Jid pushJid, String node)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        return enable(pushJid, node, null);
    }
201224
public static void rcvXAForget(CommsByteBuffer request, Conversation conversation,
                                  int requestNumber, boolean allocatedFromBufferPool,
                                  boolean partOfExchange)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvXAForget",
                                           new Object[]
                                           {
                                              request,
                                              conversation,
                                              ""+requestNumber,
                                              ""+allocatedFromBufferPool,
                                              ""+partOfExchange
                                            });

      ConversationState convState = (ConversationState) conversation.getAttachment();
      ServerLinkLevelState linkState = (ServerLinkLevelState) conversation.getLinkLevelAttachment();

      try
      {
         int clientTransactionId = request.getInt();
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
         {
            SibTr.debug(tc, "XAResource Object ID", clientTransactionId);
         }

         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Getting Xid");
         XidProxy xid = (XidProxy) request.getXid();
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Completed:", xid);

         boolean requiresMSResource = false;
         if (conversation.getHandshakeProperties().getFapLevel() >= JFapChannelConstants.FAP_VERSION_5)
         {
            requiresMSResource = request.get() == 0x01;
         }

         // Get the transaction out of the table
         SITransaction tran = linkState.getTransactionTable().getResourceForGlobalTransactionBranch(clientTransactionId, xid);

         if (tran == IdToTransactionTable.INVALID_TRANSACTION)
         {
            // If the UOW was never created (because we were running with the
            // optimization that gets an XAResource and enlists it as part of the
            // first piece of transacted work and this failed) then simply
            // remove any reference of the UOW from out table.
            linkState.getTransactionTable().removeGlobalTransactionBranch(clientTransactionId, xid);
         }
         else
         {
            // Get the actual transaction ...
            SIXAResource xaResource = getResourceFromTran(tran, convState, requiresMSResource);

            // Now call the method on the XA resource
            xaResource.forget(xid);

            // If the transaction was in the in-flight table - remove it.
            if (tran != null)
            {
               linkState.getTransactionTable().removeGlobalTransactionBranch(clientTransactionId, xid);
            }
         }

         try
         {
            conversation.send(poolManager.allocate(),
                              JFapChannelConstants.SEG_XAFORGET_R,
                              requestNumber,
                              JFapChannelConstants.PRIORITY_MEDIUM,
                              true,
                              ThrottlingPolicy.BLOCK_THREAD,
                              null);
         }
         catch (SIException e)
         {
            FFDCFilter.processException(e,
                                        CLASS_NAME + ".rcvXAForget",
                                        CommsConstants.STATICCATXATRANSACTION_XAFORGET_01);

            SibTr.error(tc, "COMMUNICATION_ERROR_SICO2027", e);
         }
      }
      catch (XAException e)
      {
         FFDCFilter.processException(e,
                                     CLASS_NAME + ".rcvXAForget",
                                     CommsConstants.STATICCATXATRANSACTION_XAFORGET_02);

         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "XAException - RC: " + e.errorCode, e);

         StaticCATHelper.sendExceptionToClient(e,
                                               CommsConstants.STATICCATXATRANSACTION_XAFORGET_02,
                                               conversation, requestNumber);
      }

      request.release(allocatedFromBufferPool);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rcvXAForget");
   }
1096497
public static synchronized ChatMarkersManager getInstanceFor(XMPPConnection connection) {
        ChatMarkersManager chatMarkersManager = INSTANCES.get(connection);

        if (chatMarkersManager == null) {
            chatMarkersManager = new ChatMarkersManager(connection);
            INSTANCES.put(connection, chatMarkersManager);
        }

        return chatMarkersManager;
    }
269008
public DialogActivity getNewDialog(Address from, Address to)
			throws SipException {
		checkState();
		if (from == null) {
			throw new IllegalArgumentException("From address cant be null");
		}
		if (to == null) {
			throw new IllegalArgumentException("To address cant be null");
		}
		return _getNewDialog(from, gov.nist.javax.sip.Utils.getInstance()
				.generateTag(), to, null);
	}
444300
public static UniversalIdIntQueueMessage newInstance(Long id, byte[] content) {
        UniversalIdIntQueueMessage msg = newInstance(content);
        msg.setId(id);
        return msg;
    }
415924
public function connect( Net_XMPP_JID $sender, $password )
	{
		$this->xmpp		= new Net_XMPP_XMPPHP_XMPP(
			$sender->getDomain(),
			$this->port,
			$sender->getNode(),
			$password,
			$sender->getResource() ? $sender->getResource() : $this->resource,
			$sender->getDomain(),
			$this->printLog,
			$this->logLevel
		);
		$this->xmpp->use_encyption	= $this->encryption;
		$this->xmpp->connect();
		$this->xmpp->processUntil( 'session_start' );
	}
967893
public Version getVersion(Jid jid) throws NoResponseException, XMPPErrorException,
                    NotConnectedException, InterruptedException {
        if (!isSupported(jid)) {
            return null;
        }
        return connection().createStanzaCollectorAndSend(new Version(jid)).nextResultOrThrow();
    }
1079436
public A messageId(String messageId) {
        this.headers.add(Pair.of("X-MessageId", messageId));
        return (A)this;
    }
165457
public static Zxid fromProtoZxid(ZabMessage.Zxid zxid) {
    return new Zxid(zxid.getEpoch(), zxid.getXid());
  }
541720
public StartPullSessionResponse startPullSession(String sessionId) {
        StartPullSessionRequest request = new StartPullSessionRequest().withSessionId(sessionId);
        return startPullSession(request);
    }
1090931
public void getConversation(@NonNull final String conversationId, @Nullable Callback<ComapiResult<ConversationDetails>> callback) {
        adapter.adapt(getConversation(conversationId), callback);
    }
1262939
protected AJP13Connection createConnection(Socket socket) throws IOException
    {
        return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize());
    }