For IntelliJ IDEA,
Android Studio or Eclipse



/** * Creates a new message to the specified recipient and with the specified body. * * @param to the user to send the message to. * @param body the body of the message. * @throws XmppStringprepException if 'to' is not a valid XMPP address. */ public Message(String to, String body) throws XmppStringprepException { this(JidCreate.from(to), body); }
protected XmppSenderConnection(XMPPConnection connection, String to, String thread) { Assert.notNull(connection, "'connection' must not be null"); Assert.hasLength(to, "'to' must not be empty"); Assert.hasLength(thread, "'thread' must not be empty"); this.connection = connection; try { this.requestMessage = new Message(JidCreate.from(to), Message.Type.chat); } catch (XmppStringprepException e) { throw new RuntimeException(e); } this.requestMessage.setThread(thread); }
/** * Sets who the stanza(/packet) is being sent "to". The XMPP protocol often makes * the "to" attribute optional, so it does not always need to be set. * * @param to who the stanza(/packet) is being sent to. * @throws IllegalArgumentException if to is not a valid JID String. * @deprecated use {@link #setTo(Jid)} instead. */ @Deprecated public void setTo(String to) { Jid jid; try { jid = JidCreate.from(to); } catch (XmppStringprepException e) { throw new IllegalArgumentException(e); } setTo(jid); }
/** * Method will be called by OSGi after {@link #init()} is called. */ @Override public void start(BundleContext bc) throws Exception { ConfigurationService configService = ServiceUtils.getService(bc, ConfigurationService.class); loadConfig(configService, "org.jitsi.jicofo"); if (!isPingTaskStarted()) startPingTask(); String shutdownAllowedJid = configService.getString(SHUTDOWN_ALLOWED_JID_PNAME); this.shutdownAllowedJid = StringUtils.isNullOrEmpty(shutdownAllowedJid) ? null : JidCreate.from(shutdownAllowedJid); authAuthority = ServiceUtils.getService(bc, AuthenticationAuthority.class); focusManager = ServiceUtils.getService(bc, FocusManager.class); reservationSystem = ServiceUtils.getService(bc, ReservationSystem.class); }
/** * Gets Jibri JID associated with this <tt>JibriEvent</tt> instance. * * @return <tt>String</tt> which is a JID of the Jibri for which this event * instance has been created. */ public Jid getJibriJid() { try { return JidCreate.from(getProperty(JIBRI_JID_KEY).toString()); } catch (XmppStringprepException e) { logger.error("Invalid Jibri JID", e); return null; } }
public static EntityJid getEntityJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException { final String jidString = parser.getAttributeValue("", name); if (jidString == null) { return null; } Jid jid = JidCreate.from(jidString); if (!jid.hasLocalpart()) return null; EntityFullJid fullJid = jid.asEntityFullJidIfPossible(); if (fullJid != null) { return fullJid; } EntityBareJid bareJid = jid.asEntityBareJidIfPossible(); return bareJid; }
@Override public UnblockContactsIQ parse(XmlPullParser parser, int initialDepth) throws Exception { List<Jid> jids = null; outerloop: while (true) { int eventType = parser.next(); switch (eventType) { case XmlPullParser.START_TAG: if (parser.getName().equals("item")) { if (jids == null) { jids = new ArrayList<>(); } jids.add(JidCreate.from(parser.getAttributeValue("", "jid"))); } break; case XmlPullParser.END_TAG: if (parser.getDepth() == initialDepth) { break outerloop; } break; } } return new UnblockContactsIQ(jids); }
@Override public void grantAdmin(String address) { try { muc.grantAdmin(JidCreate.from(address)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Returns pre-configured JVB address of the bridge that must be used in a * conference instead of any other bridges that would come from * <tt>BridgeSelector</tt>. <tt>null</tt> if not specified. * That property is per conference specific. */ public Jid getEnforcedVideobridge() { try { String enforcedBridge = properties.get(ENFORCED_BRIDGE); if (StringUtils.isNullOrEmpty(enforcedBridge)) { return null; } return JidCreate.from(enforcedBridge); } catch (XmppStringprepException e) { logger.error("Invalid JID for enforced videobridge", e); return null; } }
/** * Sets who the stanza(/packet) is being sent "from". The XMPP protocol often * makes the "from" attribute optional, so it does not always need to * be set. * * @param from who the stanza(/packet) is being sent to. * @throws IllegalArgumentException if from is not a valid JID String. * @deprecated use {@link #setFrom(Jid)} instead. */ @Deprecated public void setFrom(String from) { Jid jid; try { jid = JidCreate.from(from); } catch (XmppStringprepException e) { throw new IllegalArgumentException(e); } setFrom(jid); }
public static Jid getJidAttribute(XmlPullParser parser, String name) throws XmppStringprepException { final String jidString = parser.getAttributeValue("", name); if (jidString == null) { return null; } return JidCreate.from(jidString); }
@Override public void grantMembership(String address) { try { muc.grantMembership(JidCreate.from(address)); } catch (Exception e) { throw new RuntimeException(e); } }
/** * Creates a new message to the specified recipient and with the specified body. * * @param to the user to send the message to. * @param body the body of the message. * @throws XmppStringprepException if 'to' is not a valid XMPP address. */ public Message(String to, String body) throws XmppStringprepException { this(JidCreate.from(to), body); }
@Override public UnblockContactsIQ parse(XmlPullParser parser, int initialDepth) throws Exception { List<Jid> jids = null; outerloop: while (true) { int eventType = parser.next(); switch (eventType) { case XmlPullParser.START_TAG: if (parser.getName().equals("item")) { if (jids == null) { jids = new ArrayList<>(); } jids.add(JidCreate.from(parser.getAttributeValue("", "jid"))); } break; case XmlPullParser.END_TAG: if (parser.getDepth() == initialDepth) { break outerloop; } break; } } return new UnblockContactsIQ(jids); }