Package org.jivesoftware.util

Examples of org.jivesoftware.util.NotFoundException


    }

    public Element updateVCard(String username, Element vCardElement) throws NotFoundException {
        if (loadVCard(username) == null) {
            // The user already has a vCard
            throw new NotFoundException("Username " + username + " does not have a vCard");
        }
        Connection con = null;
        PreparedStatement pstmt = null;
        try {
            con = DbConnectionManager.getConnection();
View Full Code Here


     * @param description New description to assign to the service.
     * @throws NotFoundException if service was not found.
     */
    public void updateMultiUserChatService(Long serviceID, String subdomain, String description) throws NotFoundException {
        MultiUserChatServiceImpl muc = (MultiUserChatServiceImpl) getMultiUserChatService(serviceID);
        if (muc == null) throw new NotFoundException();
        // A NotFoundException is thrown if the specified service was not found.
        String oldsubdomain = muc.getServiceName();
        if (!mucServices.containsKey(oldsubdomain)) {
            // This should never occur, but just in case...
            throw new NotFoundException();
        }
        if (oldsubdomain.equals(subdomain)) {
            // Alright, all we're changing is the description.  This is easy.
            updateService(serviceID, subdomain, description);
            // Update the existing service's description.
View Full Code Here

     * @param description New description to assign to the service.
     * @throws NotFoundException if service was not found.
     */
    public void updateMultiUserChatService(String cursubdomain, String newsubdomain, String description) throws NotFoundException {
        Long serviceID = getMultiUserChatServiceID(cursubdomain);
        if (serviceID == null) throw new NotFoundException();
        updateMultiUserChatService(serviceID, newsubdomain, description);
    }
View Full Code Here

     */
    public void removeMultiUserChatService(String subdomain) throws NotFoundException {
        Long serviceID = getMultiUserChatServiceID(subdomain);
        if (serviceID == null) {
            Log.error("MultiUserChatManager: Unable to find service to remove for "+subdomain);
            throw new NotFoundException();
        }
        removeMultiUserChatService(serviceID);
    }
View Full Code Here

     */
    public void removeMultiUserChatService(Long serviceID) throws NotFoundException {
        MultiUserChatServiceImpl muc = (MultiUserChatServiceImpl) getMultiUserChatService(serviceID);
        if (muc == null) {
            Log.error("MultiUserChatManager: Unable to find service to remove for service ID "+serviceID);
            throw new NotFoundException();
        }
        unregisterMultiUserChatService(muc.getServiceName());
        deleteService(serviceID);
    }
View Full Code Here

            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(LOAD_BOOKMARK);
            pstmt.setLong(1, bookmarkID);
            rs = pstmt.executeQuery();
            if (!rs.next()) {
                throw new NotFoundException("Bookmark not found: " + bookmarkID);
            }
            this.type = Type.valueOf(rs.getString(1));
            this.name = rs.getString(2);
            this.value = rs.getString(3);
            this.global = rs.getInt(4) == 1;
View Full Code Here

                 MUCEventDispatcher.privateMessageRecieved(occupant.getUserAddress(), senderRole.getUserAddress(),
                         message);
            }
        }
        else {
            throw new NotFoundException();
        }
    }
View Full Code Here

    }

    public RequestQueue getRequestQueue(long queueID) throws NotFoundException {
        RequestQueue requestQueue = queues.get(queueID);
        if (requestQueue == null) {
            throw new NotFoundException("Queue not found for ID: " + queueID);
        }
        return requestQueue;
    }
View Full Code Here

        for (RequestQueue queue : queues.values()) {
            if (queueName.equals(queue.getName())) {
                return queue;
            }
        }
        throw new NotFoundException("Queue not found for name: " + queueName);
    }
View Full Code Here

            pstmt = con.prepareStatement(LOAD_DISPATCHER_BY_ID);
            pstmt.setLong(1, queueID);

            rs = pstmt.executeQuery();
            if (!rs.next()) {
                throw new NotFoundException();
            }
            userInfo = new BasicDispatcherInfo(workgroup,
                    queueID,
                    rs.getString(1), // name
                    rs.getString(2), // description
                    rs.getInt(3), // offer timeout
                    rs.getInt(4)); // request timeout

        }
        catch (SQLException e) {
            throw new NotFoundException("Failed to read dispatcher " + queueID + " from database. " + e.getMessage());
        }
        catch (NumberFormatException nfe) {
            Log.error("WARNING: There was an error parsing the dates " +
                    "returned from the database. Ensure that they're being stored " +
                    "correctly.");
            throw new NotFoundException("Dispatcher with id "
                    + queueID + " could not be loaded from the database.");
        }
        finally {
            DbConnectionManager.closeConnection(rs, pstmt, con);
        }
View Full Code Here

TOP

Related Classes of org.jivesoftware.util.NotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.