protected void processGreeting(Response r) throws ProtocolException { if (r.isBYE()) throw new ConnectionException(this, r); }
protected void processGreeting(Response r) throws ProtocolException { if (r.isBYE()) throw new ConnectionException(this, r); }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Check for an IMAP login REFERRAL response code. * * @exception IMAPReferralException if REFERRAL response code found * @see "RFC 2221" */ private void checkReferral(Response r) throws IMAPReferralException { String s = r.getRest(); // get the text after the response if (s.startsWith("[")) { // a response code int i = s.indexOf(' '); if (i > 0 && s.substring(1, i).equalsIgnoreCase("REFERRAL")) { String url, msg; int j = s.indexOf(']'); if (j > 0) { // should always be true; url = s.substring(i + 1, j); msg = s.substring(j + 1).trim(); } else { url = s.substring(i + 1); msg = ""; } if (r.isBYE()) disconnect(); throw new IMAPReferralException(msg, url); } } }
/** * Response handler method. */ public void handleResponse(Response r) { // Any of these responses may have a response code. if (r.isOK() || r.isNO() || r.isBAD() || r.isBYE()) handleResponseCode(r); if (r.isBYE()) { logger.fine("IMAPStore connection dead"); // Store's IMAP connection is dead, save the response so that // releaseStoreProtocol will cleanup later. synchronized (connectionFailedLock) { connectionFailed = true; if (r.isSynthetic()) forceClose = true; } return; } }
/** * Response handler method. */ @Override public void handleResponse(Response r) { // Any of these responses may have a response code. if (r.isOK() || r.isNO() || r.isBAD() || r.isBYE()) handleResponseCode(r); if (r.isBYE()) { logger.fine("IMAPStore connection dead"); // Store's IMAP connection is dead, save the response so that // releaseStoreProtocol will cleanup later. synchronized (connectionFailedLock) { connectionFailed = true; if (r.isSynthetic()) forceClose = true; } return; } }
/** * Process a response returned by readIdleResponse(). * This method will be called with appropriate locks * held so that the processing of the response is safe. * * @param r the response * @return true if IDLE is done * @exception ProtocolException for protocol failures * @since JavaMail 1.4.1 */ public boolean processIdleResponse(Response r) throws ProtocolException { Response[] responses = new Response[1]; responses[0] = r; boolean done = false; // done reading responses? notifyResponseHandlers(responses); if (r.isBYE()) // shouldn't wait for command completion response done = true; // If this is a matching command completion response, we are done if (r.isTagged() && r.getTag().equals(idleTag)) done = true; if (done) idleTag = null; // no longer in IDLE handleResult(r); return !done; }
/** * Process a response returned by readIdleResponse(). * This method will be called with appropriate locks * held so that the processing of the response is safe. * * @param r the response * @return true if IDLE is done * @exception ProtocolException for protocol failures * @since JavaMail 1.4.1 */ public boolean processIdleResponse(Response r) throws ProtocolException { Response[] responses = new Response[1]; responses[0] = r; boolean done = false; // done reading responses? notifyResponseHandlers(responses); if (r.isBYE()) // shouldn't wait for command completion response done = true; // If this is a matching command completion response, we are done if (r.isTagged() && r.getTag().equals(idleTag)) done = true; if (done) idleTag = null; // no longer in IDLE handleResult(r); return !done; }
if (r.isBYE()) { byeResp = r; continue;
if (r.isBYE()) { byeResp = r; continue;
if (r.isContinuation() || r.isBYE()) done = true;
if (r.isContinuation() || r.isBYE()) done = true;
/** * Convenience routine to handle OK, NO, BAD and BYE responses. * * @param response the response * @exception ProtocolException for protocol failures */ public void handleResult(Response response) throws ProtocolException { if (response.isOK()) return; else if (response.isNO()) throw new CommandFailedException(response); else if (response.isBAD()) throw new BadCommandException(response); else if (response.isBYE()) { disconnect(); throw new ConnectionException(this, response); } }
/** * Convenience routine to handle OK, NO, BAD and BYE responses. * * @param response the response * @exception ProtocolException for protocol failures */ public void handleResult(Response response) throws ProtocolException { if (response.isOK()) return; else if (response.isNO()) throw new CommandFailedException(response); else if (response.isBAD()) throw new BadCommandException(response); else if (response.isBYE()) { disconnect(); throw new ConnectionException(this, response); } }
if (r.isBYE()) {
if (r.isBYE()) {
try { synchronized (messageCacheLock) { if (r.isBYE() && r.isSynthetic() && idleState == IDLE) {
try { synchronized (messageCacheLock) { if (r.isBYE() && r.isSynthetic() && idleState == IDLE) {