@Test public void testTagPrefixReuse() throws IOException, ProtocolException { Properties props = new Properties(); props.setProperty("mail.imap.reusetagprefix", "true"); Protocol p = new Protocol(nullis, nullps, props, false); String tag = p.writeCommand("CMD", null); assertEquals("A0", tag); p = new Protocol(nullis, nullps, props, false); tag = p.writeCommand("CMD", null); assertEquals("A0", tag); }
public String writeCommand(String command, Argument args) throws IOException, ProtocolException { String tag = tagPrefix + Integer.toString(tagCounter++); output.writeBytes(tag + " " + command); if (args != null) { output.write(' '); args.write(this); } output.write(CRLF); output.flush(); return tag; }
Protocol { public String writeCommand(String command, Argument args) throws IOException, ProtocolException { String tag = tagPrefix + Integer.toString(tagCounter++); output.writeBytes(tag + " " + command); if (args != null) { output.write(' '); args.write(this); } output.write(CRLF); output.flush(); return tag; } }
Protocol { public String writeCommand(String command, Argument args) throws IOException, ProtocolException { String tag = tagPrefix + Integer.toString(tagCounter++); output.writeBytes(tag + " " + command); if (args != null) { output.write(' '); args.write(this); } output.write(CRLF); output.flush(); return tag; } Protocol(String host, int port, 
		    Properties props, String prefix,
		    boolean isSSL, MailLogger logger);  Protocol(InputStream in, PrintStream out, Properties props,
				boolean debug); }
Protocol { public String writeCommand(String command, Argument args) throws IOException, ProtocolException { String tag = tagPrefix + Integer.toString(tagCounter++); output.writeBytes(tag + " " + command); if (args != null) { output.write(' '); args.write(this); } output.write(CRLF); output.flush(); return tag; } Protocol(String host, int port, 
		    Properties props, String prefix,
		    boolean isSSL, MailLogger logger);  Protocol(InputStream in, PrintStream out, Properties props,
				boolean debug); long getTimestamp(); void addResponseHandler(ResponseHandler h); void removeResponseHandler(ResponseHandler h); void notifyResponseHandlers(Response[] responses); Response readResponse(); boolean hasResponse(); String writeCommand(String command, Argument args); synchronized Response[] command(String command, Argument args); void handleResult(Response response); void simpleCommand(String cmd, Argument args); synchronized void startTLS(String cmd); synchronized void startCompression(String cmd); boolean isSSL(); InetAddress getInetAddress(); SocketChannel getChannel(); SocketAddress getLocalSocketAddress(); boolean supportsUtf8(); }
Protocol { public String writeCommand(String command, Argument args) throws IOException, ProtocolException { String tag = tagPrefix + Integer.toString(tagCounter++); output.writeBytes(tag + " " + command); if (args != null) { output.write(' '); args.write(this); } output.write(CRLF); output.flush(); return tag; } Protocol(String host, int port, 
		    Properties props, String prefix,
		    boolean isSSL, MailLogger logger);  Protocol(InputStream in, PrintStream out, Properties props,
				boolean debug); long getTimestamp(); void addResponseHandler(ResponseHandler h); void removeResponseHandler(ResponseHandler h); void notifyResponseHandlers(Response[] responses); Response readResponse(); boolean hasResponse(); String writeCommand(String command, Argument args); synchronized Response[] command(String command, Argument args); void handleResult(Response response); void simpleCommand(String cmd, Argument args); synchronized void startTLS(String cmd); synchronized void startCompression(String cmd); boolean isSSL(); InetAddress getInetAddress(); SocketChannel getChannel(); SocketAddress getLocalSocketAddress(); boolean supportsUtf8();  }