Tabnine Logo
ImapCommand.validForState
Code IndexAdd Tabnine to your IDE (free)

How to use
validForState
method
in
org.apache.james.imap.api.ImapCommand

Best Java code snippets using org.apache.james.imap.api.ImapCommand.validForState (Showing top 4 results out of 315)

origin: org.apache.james.protocols/protocols-imap

/**
 * Parses a request into a command message for later processing.
 * 
 * @param request
 *            <code>ImapRequestLineReader</code>, not null
 * @return <code>ImapCommandMessage</code>, not null
 */
@Override
public final ImapMessage parse(ImapRequestLineReader request, String tag, ImapSession session) {
  ImapMessage result;
  if (!command.validForState(session.getState())) {
    result = statusResponseFactory.taggedNo(tag, command, HumanReadableText.INVALID_COMMAND);
  } else {
    try {
      result = decode(command, request, tag, session);
    } catch (DecodingException e) {
      LOGGER.debug("Cannot parse protocol ", e);
      result = statusResponseFactory.taggedBad(tag, command, e.getKey());
    }
  }
  return result;
}
origin: org.apache.james/apache-james-imap-message

/**
 * Parses a request into a command message for later processing.
 * 
 * @param request
 *            <code>ImapRequestLineReader</code>, not null
 * @return <code>ImapCommandMessage</code>, not null
 */
public final ImapMessage parse(ImapRequestLineReader request, String tag, ImapSession session) {
  ImapMessage result;
  if (!command.validForState(session.getState())) {
    result = statusResponseFactory.taggedNo(tag, command, HumanReadableText.INVALID_COMMAND);
  } else {
    try {
      result = decode(command, request, tag, session);
    } catch (DecodingException e) {
      if (session.getLog().isDebugEnabled()) {
        session.getLog().debug("Cannot parse protocol ", e);
      }
      result = statusResponseFactory.taggedBad(tag, command, e.getKey());
    }
  }
  return result;
}
origin: org.apache.james/apache-james-imap-processor

final void doProcess(final M message, final ImapCommand command, final String tag, Responder responder, ImapSession session) {
  if (!command.validForState(session.getState())) {
    ImapResponseMessage response = factory.taggedNo(tag, command, HumanReadableText.INVALID_COMMAND);
    responder.respond(response);
  } else {
    getMailboxManager().startProcessingRequest(ImapSessionUtils.getMailboxSession(session));
    doProcess(message, session, tag, command, responder);
    getMailboxManager().endProcessingRequest(ImapSessionUtils.getMailboxSession(session));
  }
}
origin: org.apache.james.protocols/protocols-imap

final void doProcess(M message, ImapCommand command, String tag, Responder responder, ImapSession session) {
  try {
    if (!command.validForState(session.getState())) {
      ImapResponseMessage response = factory.taggedNo(tag, command, HumanReadableText.INVALID_COMMAND);
      responder.respond(response);
    } else {
      getMailboxManager().startProcessingRequest(ImapSessionUtils.getMailboxSession(session));
      doProcess(message, session, tag, command, responder);
      getMailboxManager().endProcessingRequest(ImapSessionUtils.getMailboxSession(session));
    }
  } catch (DeniedAccessOnSharedMailboxException e) {
    no(command, tag, responder, HumanReadableText.DENIED_SHARED_MAILBOX);
  }
}
org.apache.james.imap.apiImapCommandvalidForState

Popular methods of ImapCommand

  • anyStateCommand
  • getName
  • <init>
  • authenticatedStateCommand
  • nonAuthenticatedStateCommand
  • selectedStateCommand

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • getSystemService (Context)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Runner (org.openjdk.jmh.runner)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now