Tabnine Logo
Affiliate
Code IndexAdd Tabnine to your IDE (free)

How to use
Affiliate
in
org.jivesoftware.smackx.muc

Best Java code snippets using org.jivesoftware.smackx.muc.Affiliate (Showing top 12 results out of 315)

origin: igniterealtime/Smack

/**
 * Returns a collection of <code>Affiliate</code> that have the specified room affiliation
 * sending a request in the admin namespace.
 *
 * @param affiliation the affiliation of the users in the room.
 * @return a collection of <code>Affiliate</code> that have the specified room affiliation.
 * @throws XMPPErrorException if you don't have enough privileges to get this information.
 * @throws NoResponseException if there was no response from the server.
 * @throws NotConnectedException
 * @throws InterruptedException
 */
private List<Affiliate> getAffiliatesByAdmin(MUCAffiliation affiliation) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
  MUCAdmin iq = new MUCAdmin();
  iq.setTo(room);
  iq.setType(IQ.Type.get);
  // Set the specified affiliation. This may request the list of owners/admins/members/outcasts.
  MUCItem item = new MUCItem(affiliation);
  iq.addItem(item);
  MUCAdmin answer = (MUCAdmin) connection.createStanzaCollectorAndSend(iq).nextResultOrThrow();
  // Get the list of affiliates from the server's answer
  List<Affiliate> affiliates = new ArrayList<Affiliate>();
  for (MUCItem mucadminItem : answer.getItems()) {
    affiliates.add(new Affiliate(mucadminItem));
  }
  return affiliates;
}
origin: igniterealtime/Spark

/**
 * Loads all banned users in a ChatRoom.
 */
public void loadAllBannedUsers() {
  // Clear all elements from model
  listModel.clear();
  Iterator<Affiliate> bannedUsers = null;
  try {
    bannedUsers = chat.getOutcasts().iterator();
  }
  catch (XMPPException | SmackException | InterruptedException e) {
    Log.error("Error loading all banned users", e);
  }
  while (bannedUsers != null && bannedUsers.hasNext()) {
    Affiliate bannedUser = bannedUsers.next();
    ImageIcon icon = SparkRes.getImageIcon(SparkRes.STAR_RED_IMAGE);
    icon.setDescription(bannedUser.getJid().toString());
    listModel.addElement(icon);
  }
}
origin: stackoverflow.com

public List<String> retriveAllAffialiateOfMuc(MultiUserChat muc) throws NoResponseException, XMPPErrorException, NotConnectedException
 {
   List<Affiliate> affiliatesMembers = new ArrayList<Affiliate>();
   if (muc.getAdmins() != null)
   {
     affiliatesMembers.addAll( muc.getAdmins() );
   }
   if ( muc.getMembers() != null)
   {
     affiliatesMembers.addAll( muc.getMembers() );
   }
   if ( muc.getOwners() != null )
   {
     affiliatesMembers.addAll( muc.getOwners() );
   }
   if (affiliatesMembers.size() == 0)
   {
     System.out.println("Error: looking for a non existant room");
     return  new ArrayList<String>(0);
   }
   List<String> affiliateMembersNames = new ArrayList<String>(affiliatesMembers.size());
   for (Affiliate affiliate : affiliatesMembers)
   {
     affiliateMembersNames.add(affiliate.getJid().toString());
   }
   return affiliateMembersNames;
 }
origin: org.littleshoot/smack-xmpp-3-2-2

affiliates.add(new Affiliate((MUCAdmin.Item) it.next()));
origin: igniterealtime/Spark

Affiliate bannedUser = bannedUsers.next();
ImageIcon icon = SparkRes.getImageIcon(SparkRes.RED_BALL);
JMenuItem bannedItem = new JMenuItem(bannedUser.getJid().toString(),
  icon);
unbanMenu.add(bannedItem);
origin: tiandawu/IotXmpp

affiliates.add(new Affiliate(it.next()));
origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

affiliates.add(new Affiliate((MUCOwner.Item) it.next()));
origin: org.igniterealtime.smack/smackx

affiliates.add(new Affiliate((MUCAdmin.Item) it.next()));
origin: org.igniterealtime.smack/smackx

affiliates.add(new Affiliate((MUCOwner.Item) it.next()));
origin: org.littleshoot/smack-xmpp-3-2-2

affiliates.add(new Affiliate((MUCOwner.Item) it.next()));
origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

affiliates.add(new Affiliate((MUCAdmin.Item) it.next()));
origin: tiandawu/IotXmpp

affiliates.add(new Affiliate(it.next()));
org.jivesoftware.smackx.mucAffiliate

Javadoc

Represents an affiliation of a user to a given room. The affiliate's information will always have the bare jid of the real user and its affiliation. If the affiliate is an occupant of the room then we will also have information about the role and nickname of the user in the room.

Most used methods

  • <init>
  • getJid
    Returns the bare JID of the affiliated user. This information will always be available.

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now