Package org.apache.james.imap.api.display

Examples of org.apache.james.imap.api.display.HumanReadableText


        final String type = asString(serverResponseType);
        final ResponseCode responseCode = response.getResponseCode();
        final String code = asString(responseCode);
        final String tag = response.getTag();
        final ImapCommand command = response.getCommand();
        final HumanReadableText textKey = response.getTextKey();
        final String text = asString(textKey, session);
        final Collection<String> parameters;
        final long number;
        final boolean useParens;
        if (responseCode == null) {
View Full Code Here


                Object[] params = new Object[] {
                        Rfc4314Rights.a_Administer_RIGHT.toString(),
                        command.getName(),
                        mailboxName
                };
                HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUFFICIENT_RIGHTS_KEY, HumanReadableText.UNSUFFICIENT_RIGHTS_DEFAULT_VALUE, params);
                no(command, tag, responder, text);
            }
            else {
                MetaData metaData = messageManager.getMetaData(false, mailboxSession, FetchGroup.NO_COUNT);
                ACLResponse aclResponse = new ACLResponse(mailboxName, metaData.getACL());
View Full Code Here

            okComplete(command, tag, responder);
        } catch (MailboxException e) {
            if (session.getLog().isInfoEnabled()) {
                session.getLog().info("LSub failed for reference " + referenceName + " and pattern " + mailboxPattern, e);
            }
            final HumanReadableText displayTextKey = HumanReadableText.GENERIC_LSUB_FAILURE;
            no(command, tag, responder, displayTextKey);
        }
    }
View Full Code Here

     * Gets the message key.
     *
     * @return the key, not null
     */
    public final HumanReadableText getKey() {
        final HumanReadableText key;
        if (this.key == null) {
            // API specifies not null but best to default to generic message
            key = HumanReadableText.ILLEGAL_ARGUMENTS;
        } else {
            key = this.key;
View Full Code Here

                Object[] params = new Object[] {
                        Rfc4314Rights.a_Administer_RIGHT.toString(),
                        command.getName(),
                        mailboxName
                };
                HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUFFICIENT_RIGHTS_KEY, HumanReadableText.UNSUFFICIENT_RIGHTS_DEFAULT_VALUE, params);
                no(command, tag, responder, text);
            }
            else {
               
                MailboxACLEntryKey key = new SimpleMailboxACLEntryKey(identifier);
               
                // FIXME check if identifier is a valid user or group
                // FIXME Servers, when processing a command that has an identifier as a
                // parameter (i.e., any of SETACL, DELETEACL, and LISTRIGHTS commands),
                // SHOULD first prepare the received identifier using "SASLprep" profile
                // [SASLprep] of the "stringprep" algorithm [Stringprep].  If the
                // preparation of the identifier fails or results in an empty string,
                // the server MUST refuse to perform the command with a BAD response.
                // Note that Section 6 recommends additional identifier’s verification
                // steps.
               
                messageManager.setRights(key, EditMode.REPLACE, null);
                okComplete(command, tag, responder);
                // FIXME should we send unsolicited responses here?
                // unsolicitedResponses(session, responder, false);
            }
        } catch (UnsupportedRightException e) {
            /*
             * RFc 4314, section 3.1
             * Note that an unrecognized right MUST cause the command to return the
             * BAD response.  In particular, the server MUST NOT silently ignore
             * unrecognized rights.
             * */
            Object[] params = new Object[] {e.getUnsupportedRight()};
            HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUPPORTED_RIGHT_KEY, HumanReadableText.UNSUPPORTED_RIGHT_DEFAULT_VALUE, params);
            taggedBad(command, tag, responder, text);
        } catch (MailboxNotFoundException e) {
            no(command, tag, responder, HumanReadableText.MAILBOX_NOT_FOUND);
        } catch (MailboxException e) {
            Logger log = session.getLog();
View Full Code Here

                Object[] params = new Object[] {
                        Rfc4314Rights.a_Administer_RIGHT.toString(),
                        command.getName(),
                        mailboxName
                };
                HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUFFICIENT_RIGHTS_KEY, HumanReadableText.UNSUFFICIENT_RIGHTS_DEFAULT_VALUE, params);
                no(command, tag, responder, text);
            }
            else {
               
                MailboxACLEntryKey key = new SimpleMailboxACLEntryKey(identifier);
View Full Code Here

                Object[] params = new Object[] {
                        Rfc4314Rights.a_Administer_RIGHT.toString(),
                        command.getName(),
                        mailboxName
                };
                HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUFFICIENT_RIGHTS_KEY, HumanReadableText.UNSUFFICIENT_RIGHTS_DEFAULT_VALUE, params);
                no(command, tag, responder, text);
            }
            else {
               
                MailboxACLEntryKey key = new SimpleMailboxACLEntryKey(identifier);
               
                // FIXME check if identifier is a valid user or group
                // FIXME Servers, when processing a command that has an identifier as a
                // parameter (i.e., any of SETACL, DELETEACL, and LISTRIGHTS commands),
                // SHOULD first prepare the received identifier using "SASLprep" profile
                // [SASLprep] of the "stringprep" algorithm [Stringprep].  If the
                // preparation of the identifier fails or results in an empty string,
                // the server MUST refuse to perform the command with a BAD response.
                // Note that Section 6 recommends additional identifier’s verification
                // steps.
               
                messageManager.setRights(key, editMode, mailboxAclRights);
                okComplete(command, tag, responder);
                // FIXME should we send unsolicited responses here?
                // unsolicitedResponses(session, responder, false);
            }
        } catch (UnsupportedRightException e) {
            /*
             * RFc 4314, section 3.1
             * Note that an unrecognized right MUST cause the command to return the
             * BAD response.  In particular, the server MUST NOT silently ignore
             * unrecognized rights.
             * */
            Object[] params = new Object[] {e.getUnsupportedRight()};
            HumanReadableText text = new HumanReadableText(HumanReadableText.UNSUPPORTED_RIGHT_KEY, HumanReadableText.UNSUPPORTED_RIGHT_DEFAULT_VALUE, params);
            taggedBad(command, tag, responder, text);
        } catch (MailboxNotFoundException e) {
            no(command, tag, responder, HumanReadableText.MAILBOX_NOT_FOUND);
        } catch (MailboxException e) {
            Logger log = session.getLog();
View Full Code Here

        } catch (SubscriptionException e) {
            session.getLog().debug("LSub failed", e);
            no(command, tag, responder, HumanReadableText.GENERIC_LSUB_FAILURE);
        } catch (MailboxException e) {
            session.getLog().debug("LSub failed", e);
            final HumanReadableText displayTextKey = HumanReadableText.GENERIC_LSUB_FAILURE;
            no(command, tag, responder, displayTextKey);
        }
    }
View Full Code Here

        final String type = asString(serverResponseType);
        final ResponseCode responseCode = response.getResponseCode();
        final String code = asString(responseCode);
        final String tag = response.getTag();
        final ImapCommand command = response.getCommand();
        final HumanReadableText textKey = response.getTextKey();
        final String text = asString(textKey, session);
        final Collection<String> parameters;
        final long number;
        final boolean useParens;
        if (responseCode == null) {
View Full Code Here

     * Gets the message key.
     *
     * @return the key, not null
     */
    public final HumanReadableText getKey() {
        final HumanReadableText key;
        if (this.key == null) {
            // API specifies not null but best to default to generic message
            key = HumanReadableText.ILLEGAL_ARGUMENTS;
        } else {
            key = this.key;
View Full Code Here

TOP

Related Classes of org.apache.james.imap.api.display.HumanReadableText

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.