/** * Create a MailLogger that uses a Logger with the specified name * and prefix. The new MailLogger uses the same debug flag and * PrintStream as this MailLogger. * * @param name the Logger name * @param prefix the prefix for debug output, or null for none * @return a MailLogger for the given name and prefix. */ public MailLogger getLogger(String name, String prefix) { return new MailLogger(name, prefix, debug, out); }
/** * Create a MailLogger that uses a Logger with the specified name * and prefix. The new MailLogger uses the same debug flag and * PrintStream as this MailLogger. * * @param name the Logger name * @param prefix the prefix for debug output, or null for none * @return a MailLogger for the given name and prefix. */ public MailLogger getLogger(String name, String prefix) { return new MailLogger(name, prefix, debug, out); }
/** * Create a MailLogger using the specified class' package * name as the Logger name and the specified prefix. * The new MailLogger uses the same debug flag and * PrintStream as this MailLogger. * * @param clazz the Logger name is the package name of this class * @param prefix the prefix for debug output, or null for none * @return a MailLogger for the given name and prefix. */ public MailLogger getLogger(Class<?> clazz, String prefix) { return new MailLogger(clazz, prefix, debug, out); }
/** * Create a MailLogger using the specified class' package * name as the Logger name and the specified prefix. * The new MailLogger uses the same debug flag and * PrintStream as this MailLogger. * * @param clazz the Logger name is the package name of this class * @param prefix the prefix for debug output, or null for none * @return a MailLogger for the given name and prefix. */ public MailLogger getLogger(Class<?> clazz, String prefix) { return new MailLogger(clazz, prefix, debug, out); }
/** * Create a MailLogger that uses a Logger whose name is composed * of this MailLogger's name plus the specified sub-name, separated * by a dot. The new MailLogger uses the new prefix for debug output. * This is used primarily by the protocol trace code that wants a * different prefix (none). * * @param subname the Logger name relative to this Logger name * @param prefix the prefix for debug output, or null for none * @return a MailLogger for the given name and prefix. */ public MailLogger getSubLogger(String subname, String prefix) { return new MailLogger(logger.getName() + "." + subname, prefix, debug, out); }
/** * Create a MailLogger that uses a Logger whose name is composed * of this MailLogger's name plus the specified sub-name, separated * by a dot. The new MailLogger uses the new prefix for debug output. * This is used primarily by the protocol trace code that wants a * different prefix (none). * * @param subname the Logger name relative to this Logger name * @param prefix the prefix for debug output, or null for none * @return a MailLogger for the given name and prefix. */ public MailLogger getSubLogger(String subname, String prefix) { return new MailLogger(logger.getName() + "." + subname, prefix, debug, out); }
/** * Create a MailLogger that uses a Logger whose name is composed * of this MailLogger's name plus the specified sub-name, separated * by a dot. The new MailLogger uses the new prefix for debug output. * This is used primarily by the protocol trace code that wants a * different prefix (none). * * @param subname the Logger name relative to this Logger name * @param prefix the prefix for debug output, or null for none * @param debug the debug flag for the sub-logger * @return a MailLogger for the given name and prefix. */ public MailLogger getSubLogger(String subname, String prefix, boolean debug) { return new MailLogger(logger.getName() + "." + subname, prefix, debug, out); }
/** * Create a MailLogger that uses a Logger whose name is composed * of this MailLogger's name plus the specified sub-name, separated * by a dot. The new MailLogger uses the new prefix for debug output. * This is used primarily by the protocol trace code that wants a * different prefix (none). * * @param subname the Logger name relative to this Logger name * @param prefix the prefix for debug output, or null for none * @param debug the debug flag for the sub-logger * @return a MailLogger for the given name and prefix. */ public MailLogger getSubLogger(String subname, String prefix, boolean debug) { return new MailLogger(logger.getName() + "." + subname, prefix, debug, out); }
protected POP3Folder(POP3Store store, String name) { super(store); this.name = name; this.store = store; if (name.equalsIgnoreCase("INBOX")) exists = true; logger = new MailLogger(this.getClass(), "DEBUG POP3", store.getSession()); }
private final synchronized void initLogger() { logger = new MailLogger(this.getClass(), "DEBUG", debug, getDebugOut()); }
private final synchronized void initLogger() { logger = new MailLogger(this.getClass(), "DEBUG", debug, getDebugOut()); }
/** * Create an IdleManager. The Session is used only to configure * debugging output. The Executor is used to create the * "select" thread. * * @param session the Session containing configuration information * @param es the Executor used to create threads * @exception IOException for Selector failures */ public IdleManager(Session session, Executor es) throws IOException { this.es = es; logger = new MailLogger(this.getClass(), "DEBUG IMAP", session); selector = Selector.open(); es.execute(new Runnable() { public void run() { logger.fine("IdleManager select starting"); try { running = true; select(); } finally { running = false; logger.fine("IdleManager select terminating"); } } }); }
/** * Constructor for debugging and testing. */ MessageCache(int size, boolean debug) { this.folder = null; logger = new MailLogger( this.getClass(), "messagecache", "DEBUG IMAP MC", debug, System.out); if (logger.isLoggable(Level.CONFIG)) logger.config("create DEBUG cache of size " + size); ensureCapacity(size, 1); }
/** * Constructor for debugging and testing. */ MessageCache(int size, boolean debug) { this.folder = null; logger = new MailLogger( this.getClass(), "messagecache", "DEBUG IMAP MC", debug, System.out); if (logger.isLoggable(Level.CONFIG)) logger.config("create DEBUG cache of size " + size); ensureCapacity(size, 1); }
this.fullName = fullName; this.separator = separator; logger = new MailLogger(this.getClass(), "DEBUG IMAP", store.getSession()); connectionPoolLogger = store.getConnectionPoolLogger();
protected POP3Folder(POP3Store store, String name) { super(store); this.name = name; this.store = store; if (name.equalsIgnoreCase("INBOX")) exists = true; logger = new MailLogger(this.getClass(), "DEBUG POP3", store.getSession().getDebug(), store.getSession().getDebugOut()); }
/** * Create an IdleManager. The Session is used only to configure * debugging output. The Executor is used to create the * "select" thread. * * @param session the Session containing configuration information * @param es the Executor used to create threads * @exception IOException for Selector failures */ public IdleManager(Session session, Executor es) throws IOException { this.es = es; logger = new MailLogger(this.getClass(), "DEBUG IMAP", session.getDebug(), session.getDebugOut()); selector = Selector.open(); es.execute(new Runnable() { @Override public void run() { logger.fine("IdleManager select starting"); try { running = true; select(); } finally { running = false; logger.fine("IdleManager select terminating"); } } }); }
this.fullName = fullName; this.separator = separator; logger = new MailLogger(this.getClass(), "DEBUG IMAP", store.getSession().getDebug(), store.getSession().getDebugOut()); connectionPoolLogger = store.getConnectionPoolLogger();
/** * Constructor for debugging. * * @param in the InputStream to read from * @param out the PrintStream to write to * @param props Properties object used by this protocol * @param debug true to enable debugging output * @exception IOException for I/O errors */ public Protocol(InputStream in, PrintStream out, Properties props, boolean debug) throws IOException { this.host = "localhost"; this.props = props; this.quote = false; logger = new MailLogger(this.getClass(), "DEBUG", debug, System.out); traceLogger = logger.getSubLogger("protocol", null); // XXX - inlined initStreams, won't allow later startTLS traceInput = new TraceInputStream(in, traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(out, traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); timestamp = System.currentTimeMillis(); }
/** * Constructor for debugging. * * @param in the InputStream to read from * @param out the PrintStream to write to * @param props Properties object used by this protocol * @param debug true to enable debugging output * @exception IOException for I/O errors */ public Protocol(InputStream in, PrintStream out, Properties props, boolean debug) throws IOException { this.host = "localhost"; this.props = props; this.quote = false; tagPrefix = computePrefix(props, "mail.imap"); logger = new MailLogger(this.getClass(), "DEBUG", debug, System.out); traceLogger = logger.getSubLogger("protocol", null); // XXX - inlined initStreams, won't allow later startTLS traceInput = new TraceInputStream(in, traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(out, traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); timestamp = System.currentTimeMillis(); }