use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class XMPPChatRoomManager method sendInvitation.
/**
* @param room
* @param targetUser
* @param subject
* @param body
*/
protected void sendInvitation(ID room, ID targetUser, String subject, String body) throws ECFException {
final XMPPChatRoomContainer chatRoomContainer = getChatRoomContainer(room);
if (chatRoomContainer == null)
throw new ECFException(NLS.bind(Messages.XMPPChatRoomManager_ROOM_NOT_FOUND, room.getName()));
chatRoomContainer.sendInvitation(targetUser, subject, body);
}
use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class XMPPUserSearchManager method getUserPropertiesFields.
/**
* Returns the user properties fields available on the XMPP server
*
* @param form
* @return String[] fields for form
* @throws ECFException
*/
public String[] getUserPropertiesFields() throws ECFException {
try {
if (form == null)
form = manager.getSearchForm(ecfConnection.getXMPPConnection(), SERVICE_SEARCH + ecfConnection.getXMPPConnection().getServiceName());
Set fields = new HashSet();
Iterator userProperties = form.getFields();
while (userProperties.hasNext()) {
FormField field = (FormField) userProperties.next();
String variable = field.getVariable();
// ignore these fields
if (!variable.equalsIgnoreCase(FORM_TYPE) && !variable.equalsIgnoreCase(SEARCH_ACTION))
fields.add(variable);
}
return (String[]) fields.toArray(new String[0]);
} catch (final XMPPException e) {
String message = null;
if (e.getXMPPError() != null && e.getXMPPError().getCode() == 404) {
message = Messages.XMPPContainer_UNRECOGONIZED_SEARCH_SERVICE;
} else {
message = e.getLocalizedMessage();
}
throw new ECFException(message, e);
}
}
Aggregations