use of org.jivesoftware.xmpp.workgroup.UnauthorizedException in project Openfire by igniterealtime.
the class WorkgroupMacros method saveMacros.
public void saveMacros(Workgroup workgroup) {
long id = workgroup.getID();
MacroGroup group = getMacroGroup(workgroup);
String saveString = xstream.toXML(group);
DbProperties props = workgroup.getProperties();
try {
props.deleteProperty("jive.macro" + id);
props.setProperty("jive.macro" + id, saveString);
} catch (UnauthorizedException e) {
Log.error(e.getMessage(), e);
}
}
use of org.jivesoftware.xmpp.workgroup.UnauthorizedException in project Openfire by igniterealtime.
the class DbDispatcherInfoProvider method insertDispatcherInfo.
/**
* Adds a new DispathcerInfo to the requestQueue.
* @param queueID the id of the queue to add the Dispatcher to.
* @param info the DispatcherInfo to add.
* @throws UserAlreadyExistsException
* @throws UnauthorizedException
*/
public void insertDispatcherInfo(long queueID, DispatcherInfo info) throws UserAlreadyExistsException, UnauthorizedException {
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(INSERT_DISPATCHER);
pstmt.setString(1, info.getName());
pstmt.setString(2, info.getDescription());
pstmt.setInt(3, (int) info.getOfferTimeout());
pstmt.setInt(4, (int) info.getRequestTimeout());
pstmt.setLong(5, queueID);
pstmt.executeUpdate();
} catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
throw new UnauthorizedException();
} finally {
DbConnectionManager.closeConnection(pstmt, con);
}
}
use of org.jivesoftware.xmpp.workgroup.UnauthorizedException in project Openfire by igniterealtime.
the class DbDispatcherInfoProvider method updateDispatcherInfo.
/**
* Updates a RequestQueues dispatcher.
* @param queueID the id of the queue to update.
* @param info the new DispatcherInfo.
* @throws NotFoundException
* @throws UnauthorizedException
*/
public void updateDispatcherInfo(long queueID, DispatcherInfo info) throws NotFoundException, UnauthorizedException {
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(UPDATE_DISPATCHER);
pstmt.setString(1, info.getName());
pstmt.setString(2, info.getDescription());
pstmt.setInt(3, (int) info.getOfferTimeout());
pstmt.setInt(4, (int) info.getRequestTimeout());
pstmt.setLong(5, queueID);
pstmt.executeUpdate();
} catch (SQLException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
throw new UnauthorizedException();
} finally {
DbConnectionManager.closeConnection(pstmt, con);
}
}
Aggregations