Class SetQuotaCommand
- java.lang.Object
-
- com.icegreen.greenmail.imap.commands.SetQuotaCommand
-
- All Implemented Interfaces:
ImapCommand,ImapConstants
public class SetQuotaCommand extends Object
Implements IMAP Quota Extension. See rfc2087- Author:
- mm
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Loggerlogstatic StringNAMEprotected CommandParserparser-
Fields inherited from interface com.icegreen.greenmail.imap.ImapConstants
BAD, BYE, HIERARCHY_DELIMITER, HIERARCHY_DELIMITER_CHAR, INBOX_NAME, MESSAGES, NAMESPACE_PREFIX, NAMESPACE_PREFIX_CHAR, NO, OK, SP, STORAGE, UNTAGGED, USER_NAMESPACE, VERSION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoProcess(ImapRequestLineReader request, ImapResponse response, ImapSession session)This is the method overridden by specific command implementations to perform commend-specific processing.protected StringgetArgSyntax()Provides the syntax for the command arguments if any.protected StringgetExpectedMessage()Provides a message which describes the expected format and arguments for this command.protected MailFoldergetMailbox(String mailboxName, ImapSession session, boolean mustExist)StringgetName()CommandParsergetParser()voidprocess(ImapRequestLineReader request, ImapResponse response, ImapSession session)Template methods for handling command processing.booleanvalidForState(ImapSessionState state)Check that the state isImapSessionState.AUTHENTICATEDorImapSessionState.SELECTED
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
log
protected final org.slf4j.Logger log
-
parser
protected CommandParser parser
-
-
Method Detail
-
doProcess
protected void doProcess(ImapRequestLineReader request, ImapResponse response, ImapSession session)
This is the method overridden by specific command implementations to perform commend-specific processing.- Parameters:
request- The client requestresponse- The server responsesession- The current client session
-
validForState
public boolean validForState(ImapSessionState state)
Check that the state isImapSessionState.AUTHENTICATEDorImapSessionState.SELECTED- Specified by:
validForStatein interfaceImapCommand- Parameters:
state- The currentstateof theImapSession- Returns:
trueif the command is valid in this state.- See Also:
ImapCommand.validForState(com.icegreen.greenmail.imap.ImapSessionState)
-
process
public void process(ImapRequestLineReader request, ImapResponse response, ImapSession session)
Template methods for handling command processing. This method reads argument values (validating them), and checks the request for correctness. If correct, the command processing is delegated to the specific command implementation.- Specified by:
processin interfaceImapCommand- Parameters:
request- The current client requestresponse- The current server responsesession- The current session- See Also:
ImapCommand.process(com.icegreen.greenmail.imap.ImapRequestLineReader, com.icegreen.greenmail.imap.ImapResponse, com.icegreen.greenmail.imap.ImapSession)
-
getExpectedMessage
protected String getExpectedMessage()
Provides a message which describes the expected format and arguments for this command. This is used to provide user feedback when a command request is malformed.- Returns:
- A message describing the command protocol format.
-
getArgSyntax
protected final String getArgSyntax()
Provides the syntax for the command arguments if any. This value is used to provide user feedback in the case of a malformed request. For commands which do not allow any arguments,nullshould be returned.- Returns:
- The syntax for the command arguments, or
nullfor commands without arguments.
-
getMailbox
protected MailFolder getMailbox(String mailboxName, ImapSession session, boolean mustExist) throws FolderException
- Throws:
FolderException
-
getParser
public CommandParser getParser()
-
getName
public final String getName()
- Specified by:
getNamein interfaceImapCommand- Returns:
- the name of the command, as specified in rfc2060.
-
-