Package com.cellasoft.jchat.exceptions

Examples of com.cellasoft.jchat.exceptions.ClientConnectException


    @Override
    public synchronized void connect(MobileServer user) throws RemoteException,
                                                        ClientBannedException,
                                                        ClientConnectException {
        if (!isActive) {
            throw new ClientConnectException("Il server di chat non è ancora attivo"
                    + "..attendere ancora qualche secondo e riprovare.");
        }
        try {
           
            boolean acquired = addLock.tryLock(5, TimeUnit.SECONDS);

            if (acquired) {

                String nick = user.getUsername();
                if (bannedList.contains(nick)) {
                    throw new ClientBannedException("L'utente " + nick + " è stato bannato!");
                }
                if (userList.containsKey(nick)) {
                    throw new ClientConnectException("L'utente " + nick + " è già connesso!");
                } else {
                    userList.put(nick, user);
                    broadcastMessage(new Message("Connesso.",
                                                 nick,
                                                 Utils.getDate(),
View Full Code Here

TOP

Related Classes of com.cellasoft.jchat.exceptions.ClientConnectException

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.