/** * Returns a list of <code>Occupant</code> with the room moderators. * * @return a list of <code>Occupant</code> with the room moderators. * @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 */ public List<Occupant> getModerators() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getOccupants(MUCRole.moderator); }
private void refreshOnlineStatus() throws MissingResourceException { if (muc!=null) { online.setText(muc.getOccupantsCount()+""); //NOI18N Iterator<String> string = muc.getOccupants(); StringBuffer buffer = new StringBuffer(); buffer.append("<html><body>"); // NOI18N while (string.hasNext()) { buffer.append(StringUtils.parseResource(string.next()) + "<br>"); // NOI18N } buffer.append("</body></html>"); // NOI18N online.setToolTipText(buffer.toString()); } }
/** * Returns a list of <code>Occupant</code> with the room participants. * * @return a list of <code>Occupant</code> with the room participants. * @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 */ public List<Occupant> getParticipants() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getOccupants(MUCRole.participant); }
for (EntityFullJid e : muc.getOccupants()) { recipients.add(muc.getOccupant(e).getJid().asBareJid());
/** * Returns a collection of <code>Occupant</code> with the room moderators. * * @return a collection of <code>Occupant</code> with the room moderators. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection<Occupant> getModerators() throws XMPPException { return getOccupants("moderator"); }
/** * Returns a collection of <code>Occupant</code> with the room participants. * * @return a collection of <code>Occupant</code> with the room participants. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection<Occupant> getParticipants() throws XMPPException { return getOccupants("participant"); }
/** * Returns a collection of <code>Occupant</code> with the room participants. * * @return a collection of <code>Occupant</code> with the room participants. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection<Occupant> getParticipants() throws XMPPException { return getOccupants("participant"); }
/** * Returns a collection of <code>Occupant</code> with the room participants. * * @return a collection of <code>Occupant</code> with the room participants. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection<Occupant> getParticipants() throws XMPPException { return getOccupants("participant"); }
/** * Returns a collection of <code>Occupant</code> with the room moderators. * * @return a collection of <code>Occupant</code> with the room moderators. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection getModerators() throws XMPPException { return getOccupants("moderator"); }
/** * Returns a collection of <code>Occupant</code> with the room participants. * * @return a collection of <code>Occupant</code> with the room participants. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection getParticipants() throws XMPPException { return getOccupants("participant"); }
/** * Returns a collection of <code>Occupant</code> with the room moderators. * * @return a collection of <code>Occupant</code> with the room moderators. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection<Occupant> getModerators() throws XMPPException { return getOccupants("moderator"); }
/** * Returns a collection of <code>Occupant</code> with the room moderators. * * @return a collection of <code>Occupant</code> with the room moderators. * @throws XMPPException if an error occured while performing the request to the server or you * don't have enough privileges to get this information. */ public Collection<Occupant> getModerators() throws XMPPException { return getOccupants("moderator"); }
/** * temporary method do not use it * @return */ public Collection<String> getMembers(String id) { MultiUserChat muc=getChat(id); if (muc!=null) { Iterator<String> i = muc.getOccupants(); ArrayList<String> result = new ArrayList<String>(); while (i.hasNext()) { result.add(StringUtils.parseResource(i.next())); } return result; } else { return Collections.emptyList(); } }
/** Send an invitation to the new logged in member */ protected void sendInvitations() throws Exception { synchronized (registeredServices) { for (MultiUserChat mucServiceChannel : mucServiceChannels) { for (String occupant : mucServiceChannel.getOccupants()) { final Name serviceName = extractServiceName(occupant); // send invitation and register source JID String[] serviceJIDParts = occupant.split("/"); if (serviceJIDParts.length == 3 && (serviceJIDParts[2].startsWith("master") || serviceJIDParts[2].indexOf("@") < 0)) { sendMessage(occupant, "topic=invite"); } // register service on listeners if (!registeredServices.contains(serviceName)) { registeredServices.add(serviceName); } } } } }
public Collection<FakeRosterEntry> getEntries() { TreeSet<FakeRosterEntry> entries = new TreeSet(); Iterator<String> i = muc.getOccupants(); while (i.hasNext()) { String name = i.next(); if (!StringUtils.parseResource(name).equals(KenaiConnection.getKenaiProject(muc).getKenai().getPasswordAuthentication().getUserName())) { entries.add(new FakeRosterEntry(muc.getOccupant(name))); } } return entries; }
/** * Scan Remote Processing Machines availability and average load * * @throws Exception */ protected void getEndpointsLoadAverages() throws Exception { synchronized (registeredProcessingMachines) { List<String> nodeJIDs = new ArrayList<String>(); for (RemoteMachineDescriptor node : registeredProcessingMachines) { nodeJIDs.add(node.getNodeJID()); // node.setAvailable(false); } for (MultiUserChat mucServiceChannel : mucServiceChannels) { for (String occupant : mucServiceChannel.getOccupants()) { if (!nodeJIDs.contains(occupant)) { registeredProcessingMachines.add( new RemoteMachineDescriptor( occupant, extractServiceName(occupant), false, 0.0, 0.0)); } // send invitation and register source JID String[] serviceJIDParts = occupant.split("/"); if (serviceJIDParts.length == 3 && (serviceJIDParts[2].startsWith("master") || serviceJIDParts[2].indexOf("@") < 0)) { sendMessage(occupant, "topic=getloadavg"); } } } } }
for (String occupant : mucServiceChannel.getOccupants()) { if (!occupant.equals(p.getFrom())) { final Name occupantServiceName =
@Override protected void sendChatState(ChatState state) throws SmackException.NotConnectedException, InterruptedException { if (!chatStatEnabled || !SparkManager.getConnection().isConnected() ) { return; } // XEP-0085: SHOULD NOT send 'gone' in a MUC. if ( state == ChatState.gone ) { return; } for ( final EntityFullJid occupant : chat.getOccupants() ) { final Resourcepart occupantNickname = occupant.getResourcepart(); final Resourcepart myNickname = chat.getNickname(); if (occupantNickname != null && !occupantNickname.equals(myNickname)) { SparkManager.getMessageEventManager().sendComposingNotification(occupant, "djn"); } } } }