private String asString(StatusResponse.ResponseCode code) { final String result; if (code == null) { result = null; } else { result = code.getCode(); } return result; }
/** * Create a RFC4551 <code>HIGESTMODSEQ</code> response code * * @param modSeq positive non-zero long * @return <code>ResponseCode</code> */ public static ResponseCode highestModSeq(long modSeq) { return new ResponseCode("HIGHESTMODSEQ", modSeq); }
private String asString(StatusResponse.Type type) { final String result; if (type == null) { result = null; } else { result = type.getCode(); } return result; }
private void highestModSeq(Responder responder, MetaData metaData, SelectedMailbox selected) { final StatusResponse untaggedOk; if (metaData.isModSeqPermanent()) { final long highestModSeq = metaData.getHighestModSeq(); untaggedOk = statusResponseFactory.untaggedOk(HumanReadableText.HIGHEST_MOD_SEQ, ResponseCode.highestModSeq(highestModSeq)); } else { untaggedOk = statusResponseFactory.untaggedOk(HumanReadableText.NO_MOD_SEQ, ResponseCode.noModSeq()); } responder.respond(untaggedOk); }
private ImapMessage unsupportedCharset(String tag, ImapCommand command) { final StatusResponseFactory factory = getStatusResponseFactory(); final ResponseCode badCharset = StatusResponse.ResponseCode.badCharset(CharsetUtil.getAvailableCharsetNames()); return factory.taggedNo(tag, command, HumanReadableText.BAD_CHARSET, badCharset); }
private void uidValidity(Responder responder, MessageManager.MetaData metaData) throws MailboxException { final long uidValidity = metaData.getUidValidity(); final StatusResponse untaggedOk = statusResponseFactory.untaggedOk(HumanReadableText.UID_VALIDITY, ResponseCode.uidValidity(uidValidity)); responder.respond(untaggedOk); }
@Override public boolean matches(Object o) { if (o instanceof StatusResponse) { StatusResponse sr = (StatusResponse) o; return this.serverResponseType.equals(sr.getServerResponseType()); } return false; }
/** * Creates a RFC2060 <code>BADCHARSET</code> response code. * * @param charsetNames * <code>Collection<String></code> containing charset names * @return <code>ResponseCode</code>, not null */ public static ResponseCode badCharset(Collection<String> charsetNames) { return new ResponseCode("BADCHARSET", charsetNames); }
private String asString(StatusResponse.ResponseCode code) { final String result; if (code == null) { result = null; } else { result = code.getCode(); } return result; }
private String asString(StatusResponse.Type type) { final String result; if (type == null) { result = null; } else { result = type.getCode(); } return result; }
/** * Creates a RFC2060 <code>UNSEEN</code> response code. * * @param numberUnseen * positive non-zero integer * @return <code>ResponseCode</code>, not null */ public static ResponseCode unseen(int numberUnseen) { return new ResponseCode("UNSEEN", numberUnseen); }
/** * Create a RFC4551 <code>HIGESTMODSEQ</code> response code * * @param modSeq positive non-zero long * @return <code>ResponseCode</code> */ public static ResponseCode highestModSeq(long modSeq) { return new ResponseCode("HIGHESTMODSEQ", modSeq); }
/** * Create a RFC4551 <code>NOMODSEQ</code> response code * * @return <code>ResponseCode</code> */ public static ResponseCode noModSeq() { return new ResponseCode("NOMODSEQ"); }
/** * Creates a RFC2060 <code>UIDVALIDITY</code> response code. * * @param uid * positive non-zero integer * @return <code>ResponseCode</code>, not null */ public static ResponseCode uidValidity(long uid) { return new ResponseCode("UIDVALIDITY", uid); }
/** * Create a RFC5464 getMetadata which support MAXSIZE * @param entryLong positive non-zero long * @return <code>ResponseCode</code> */ public static ResponseCode longestMetadataEntry(long entryLong) { return new ResponseCode("METADATA LONGENTRIES", entryLong); }
/** * Creates a RFC2060 <code>BADCHARSET</code> response code. * * @param charsetNames * <code>Collection<String></code> containing charset names * @return <code>ResponseCode</code>, not null */ public static ResponseCode badCharset(Collection<String> charsetNames) { return new ResponseCode("BADCHARSET", charsetNames); }
/** * Creates a RFC2060 <code>UNSEEN</code> response code. * * @param numberUnseen * positive non-zero integer * @return <code>ResponseCode</code>, not null */ public static ResponseCode unseen(int numberUnseen) { return new ResponseCode("UNSEEN", numberUnseen); }
/** * Creates a RFC2060 <code>UIDNEXT</code> response code. * * @param uid * positive non-zero integer * @return <code>ResponseCode</code>, not null */ public static ResponseCode uidNext(long uid) { return new ResponseCode("UIDNEXT", uid); }
/** * Creates a RFC2060 <code>UIDVALIDITY</code> response code. * * @param uid * positive non-zero integer * @return <code>ResponseCode</code>, not null */ public static ResponseCode uidValidity(long uid) { return new ResponseCode("UIDVALIDITY", uid); }
/** * Create a RFC4551 <code>NOMODSEQ</code> response code * * @return <code>ResponseCode</code> */ public static ResponseCode noModSeq() { return new ResponseCode("NOMODSEQ"); }