congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
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

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • getContentResolver (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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