JidCreate.fullFrom
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.jxmpp.jid.impl.JidCreate.fullFrom (Showing top 14 results out of 315)

origin: igniterealtime/Smack

  continue;
packetUnavailable.setFrom(JidCreate.fullFrom(bareUserJid, resource));
try {
  presencePacketListener.processStanza(packetUnavailable);
origin: igniterealtime/Smack

@Test(expected = IllegalArgumentException.class)
public void transportCandidateIllegalPortTest() throws XmppStringprepException {
  FullJid jid = JidCreate.fullFrom("test@test.test/test");
  @SuppressWarnings("unused")
  JingleS5BTransportCandidate candidate = new JingleS5BTransportCandidate(
      "cid", "host", jid, -5555, 30, JingleS5BTransportCandidate.Type.proxy);
}
origin: igniterealtime/Smack

@Test(expected = IllegalArgumentException.class)
public void transportCandidateIllegalPriorityTest() throws XmppStringprepException {
  FullJid jid = JidCreate.fullFrom("test@test.test/test");
  @SuppressWarnings("unused")
  JingleS5BTransportCandidate candidate = new JingleS5BTransportCandidate(
      "cid", "host", jid, 5555, -30, JingleS5BTransportCandidate.Type.proxy);
}
origin: igniterealtime/Smack

@Test
public void candidateFromStreamHostTest() throws XmppStringprepException {
  FullJid jid = JidCreate.fullFrom("test@test.test/test");
  String host = "host.address";
  int port = 1234;
  Bytestream.StreamHost streamHost = new Bytestream.StreamHost(jid, host, port);
  JingleS5BTransportCandidate candidate = new JingleS5BTransportCandidate(streamHost, 2000, JingleS5BTransportCandidate.Type.direct);
  assertEquals(2000, candidate.getPriority());
  assertEquals(jid, candidate.getJid());
  assertEquals(host, candidate.getHost());
  assertEquals(port, candidate.getPort());
  assertEquals(streamHost.toXML(null).toString(), candidate.getStreamHost().toXML(null).toString());
}
origin: igniterealtime/Smack

  @Test
  public void parserTest() throws XmppStringprepException {
    String sessionId = "testSessionId";

    Jingle.Builder builder = Jingle.getBuilder();
    builder.setSessionId(sessionId);
    builder.setAction(JingleAction.session_initiate);

    FullJid romeo = JidCreate.fullFrom("romeo@montague.lit/orchard");
    FullJid juliet = JidCreate.fullFrom("juliet@capulet.lit/balcony");
    builder.setInitiator(romeo);
    builder.setResponder(juliet);

    Jingle jingle = builder.build();
    assertNotNull(jingle);
    assertEquals(romeo, jingle.getInitiator());
    assertEquals(juliet, jingle.getResponder());
    assertEquals(jingle.getAction(), JingleAction.session_initiate);
    assertEquals(sessionId, jingle.getSid());

    String xml = "<jingle xmlns='urn:xmpp:jingle:1' " +
        "initiator='romeo@montague.lit/orchard' " +
        "responder='juliet@capulet.lit/balcony' " +
        "action='session-initiate' " +
        "sid='" + sessionId + "'>" +
        "</jingle>";
    assertTrue(jingle.toXML(null).toString().contains(xml));
  }
}
origin: igniterealtime/Smack

@Test
public void sessionInitiateTest() throws XmppStringprepException {
  FullJid romeo = connection.getUser().asFullJidOrThrow();
  FullJid juliet = JidCreate.fullFrom("juliet@capulet.example/yn0cl4bnw0yr3vym");
origin: jitsi/jicofo

/**
 * {@inheritDoc}
 */
@Override
public EntityFullJid getFocusJid()
{
  return JidCreate.fullFrom(roomName, focusUserName);
}
origin: org.jxmpp/jxmpp-jid

/**
 * Get a {@link FullJid} from a given {@link CharSequence} or {@code null} if the input does not represent a JID.
 *
 * @param cs the input {@link CharSequence}
 * @return a JID or {@code null}
 */
public static FullJid fullFromOrNull(CharSequence cs) {
  try {
    return fullFrom(cs);
  } catch (XmppStringprepException e) {
    return null;
  }
}
origin: org.jxmpp/jxmpp-jid

/**
 * Get a {@link FullJid} representing the given CharSequence.
 *
 * @param jid a CharSequence representing a JID.
 * @return a full JID representing the given CharSequence.
 * @throws XmppStringprepException if an error occurs.
 */
public static FullJid fullFrom(CharSequence jid) throws XmppStringprepException {
  return fullFrom(jid.toString());
}
origin: org.jxmpp/jxmpp-jid

/**
 * Like {@link #fullFrom(CharSequence)} but does throw an unchecked {@link IllegalArgumentException} instead of a
 * {@link XmppStringprepException}.
 *
 * @param cs the character sequence which should be transformed to a {@link FullJid}
 * @return the {@link FullJid} if no exception occurs
 * @throws IllegalArgumentException if the given input is not a valid JID
 * @see #fullFrom(CharSequence)
 * @since 0.6.2
 */
public static FullJid fullFromOrThrowUnchecked(CharSequence cs) {
  try {
    return fullFrom(cs);
  } catch (XmppStringprepException e) {
    throw new IllegalArgumentException(e);
  }
}
origin: org.jxmpp/jxmpp-jid

/**
 * Get a {@link FullJid} constructed from the given parts.
 *
 * @param localpart the optional localpart.
 * @param domainpart the domainpart.
 * @param resource the resourcepart.
 * @return a full JID.
 */
public static FullJid fullFrom(Localpart localpart, Domainpart domainpart, Resourcepart resource) {
  return fullFrom(entityBareFrom(localpart, domainpart), resource);
}
origin: org.jxmpp/jxmpp-jid

/**
 * Get a {@link FullJid} constructed from the given parts.
 *
 * @param localpart a optional localpart.
 * @param domainBareJid a domain bare JID. 
 * @param resource a resourcepart
 * @return a full JID.
 */
public static FullJid fullFrom(Localpart localpart, DomainBareJid domainBareJid, Resourcepart resource) {
  return fullFrom(localpart, domainBareJid.getDomain(), resource);
}
origin: org.igniterealtime.smack/smack-im

  continue;
packetUnavailable.setFrom(JidCreate.fullFrom(bareUserJid, resource));
try {
  presencePacketListener.processStanza(packetUnavailable);
origin: org.jxmpp/jxmpp-jid

/**
 * Get a {@link FullJid} representing the given String.
 *
 * @param jid the JID's String.
 * @return a full JID representing the input String.
 * @throws XmppStringprepException if an error occurs.
 */
public static FullJid fullFrom(String jid) throws XmppStringprepException {
  FullJid fullJid = FULLJID_CACHE.lookup(jid);
  if (fullJid != null) {
    return fullJid;
  }
  String localpart = XmppStringUtils.parseLocalpart(jid);
  String domainpart = XmppStringUtils.parseDomain(jid);
  String resource = XmppStringUtils.parseResource(jid);
  try {
    fullJid = fullFrom(localpart, domainpart, resource);
  } catch (XmppStringprepException e) {
    throw new XmppStringprepException(jid, e);
  }
  FULLJID_CACHE.put(jid, fullJid);
  return fullJid;
}
org.jxmpp.jid.implJidCreatefullFrom

Javadoc

Get a FullJid representing the given CharSequence.

Popular methods of JidCreate

  • from
    Get a Jid from the given parts. Only the domainpart is required.
  • bareFrom
    Get a BareJid constructed from the optionally given Localpart and Domainpart.
  • domainBareFrom
    Get a DomainBareJid consisting of the given Domainpart.
  • entityBareFrom
    Get a EntityBareJid constructed from the given Localpart and Domainpart.
  • entityFullFrom
    Get a EntityFullJid constructed from the given parts.
  • entityFrom
    Get a EntityJid representing the given String.
  • entityBareFromUnescaped
    Get a EntityBareJid representing the given unescaped String.
  • fromUnescaped
    Get a Jid from the given unescaped String.
  • bareFromOrThrowUnchecked
    Like #bareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a XmppS
  • bareFromUrlEncoded
  • domainBareFromOrThrowUnchecked
    Like #domainBareFrom(CharSequence) but does throw an unchecked IllegalArgumentException instead of a
  • domainFullFrom
    Get a domain full JID.
  • domainBareFromOrThrowUnchecked,
  • domainFullFrom,
  • donmainFullFrom,
  • entityBareFromOrThrowUnchecked,
  • entityBareFromUnescapedOrThrowUnchecked,
  • entityFromUnescaped,
  • entityFullFromUnescaped,
  • fromOrThrowUnchecked

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)