1 17 18 package org.apache.james.remotemanager; 19 20 import org.apache.avalon.cornerstone.services.connection.ConnectionHandler; 21 import org.apache.avalon.excalibur.pool.Poolable; 22 import org.apache.avalon.framework.configuration.Configurable; 23 import org.apache.avalon.framework.configuration.Configuration; 24 import org.apache.avalon.framework.configuration.ConfigurationException; 25 import org.apache.avalon.framework.activity.Disposable; 26 import org.apache.avalon.framework.logger.AbstractLogEnabled; 27 import org.apache.james.Constants; 28 import org.apache.james.services.*; 29 import org.apache.james.userrepository.DefaultUser; 30 import org.apache.james.util.watchdog.Watchdog; 31 import org.apache.james.util.watchdog.WatchdogTarget; 32 import org.apache.mailet.MailAddress; 33 34 import javax.mail.internet.ParseException ; 35 import java.io.BufferedReader ; 36 import java.io.BufferedWriter ; 37 import java.io.IOException ; 38 import java.io.InputStreamReader ; 39 import java.io.OutputStreamWriter ; 40 import java.io.PrintWriter ; 41 import java.net.Socket ; 42 import java.util.HashMap ; 43 import java.util.Iterator ; 44 import java.util.Locale ; 45 import java.util.StringTokenizer ; 46 47 56 public class RemoteManagerHandler 57 extends AbstractLogEnabled 58 implements ConnectionHandler, Poolable { 59 60 63 private static final String COMMAND_ADDUSER = "ADDUSER"; 64 65 68 private static final String COMMAND_SETPASSWORD = "SETPASSWORD"; 69 70 73 private static final String COMMAND_DELUSER = "DELUSER"; 74 75 78 private static final String COMMAND_LISTUSERS = "LISTUSERS"; 79 80 83 private static final String COMMAND_COUNTUSERS = "COUNTUSERS"; 84 85 88 private static final String COMMAND_VERIFY = "VERIFY"; 89 90 93 private static final String COMMAND_HELP = "HELP"; 94 95 98 private static final String COMMAND_SETFORWARDING = "SETFORWARDING"; 99 100 103 private static final String COMMAND_SHOWFORWARDING = "SHOWFORWARDING"; 104 105 108 private static final String COMMAND_UNSETFORWARDING = "UNSETFORWARDING"; 109 110 113 private static final String COMMAND_SETALIAS = "SETALIAS"; 114 115 118 private static final String COMMAND_SHOWALIAS = "SHOWALIAS"; 119 120 123 private static final String COMMAND_UNSETALIAS = "UNSETALIAS"; 124 125 128 private static final String COMMAND_USER = "USER"; 129 130 133 private static final String COMMAND_QUIT = "QUIT"; 134 135 138 private static final String COMMAND_SHUTDOWN = "SHUTDOWN"; 139 140 143 private RemoteManagerHandlerConfigurationData theConfigData; 144 145 148 private UsersRepository users; 149 150 154 private boolean inLocalUsers = true; 155 156 159 private BufferedReader in; 160 161 164 private PrintWriter out; 165 166 169 private Thread handlerThread; 170 171 175 private Socket socket; 176 177 180 private Watchdog theWatchdog; 181 182 185 private WatchdogTarget theWatchdogTarget = new RemoteManagerWatchdogTarget(); 186 187 192 void setConfigurationData(RemoteManagerHandlerConfigurationData theData) { 193 theConfigData = theData; 194 195 users = theConfigData.getUsersRepository(); 197 inLocalUsers = true; 198 } 199 200 205 void setWatchdog(Watchdog theWatchdog) { 206 this.theWatchdog = theWatchdog; 207 } 208 209 215 WatchdogTarget getWatchdogTarget() { 216 return theWatchdogTarget; 217 } 218 219 222 void idleClose() { 223 if (getLogger() != null) { 224 getLogger().error("Remote Manager Connection has idled out."); 225 } 226 try { 227 if (socket != null) { 228 socket.close(); 229 } 230 } catch (Exception e) { 231 } finally { 233 socket = null; 234 } 235 236 synchronized (this) { 237 if (handlerThread != null) { 239 handlerThread.interrupt(); 240 handlerThread = null; 241 } 242 } 243 } 244 245 248 public void handleConnection( final Socket connection ) 249 throws IOException { 250 251 socket = connection; 252 String remoteIP = socket.getInetAddress().getHostAddress(); 253 String remoteHost = socket.getInetAddress().getHostName(); 254 255 synchronized (this) { 256 handlerThread = Thread.currentThread(); 257 } 258 259 try { 260 in = new BufferedReader (new InputStreamReader (socket.getInputStream(), "ASCII"), 512); 261 out = new PrintWriter (new BufferedWriter (new OutputStreamWriter (socket.getOutputStream()), 512), false); 262 if (getLogger().isInfoEnabled()) { 263 StringBuffer infoBuffer = 264 new StringBuffer (128) 265 .append("Access from ") 266 .append(remoteHost) 267 .append("(") 268 .append(remoteIP) 269 .append(")"); 270 getLogger().info( infoBuffer.toString() ); 271 } 272 writeLoggedResponse("JAMES Remote Administration Tool " + Constants.SOFTWARE_VERSION ); 273 writeLoggedResponse("Please enter your login and password"); 274 String login = null; 275 String password = null; 276 do { 277 if (login != null) { 278 final String message = "Login failed for " + login; 279 writeLoggedFlushedResponse(message); 280 } 281 writeLoggedFlushedResponse("Login id:"); 282 login = in.readLine().trim(); 283 writeLoggedFlushedResponse("Password:"); 284 password = in.readLine().trim(); 285 } while (!password.equals(theConfigData.getAdministrativeAccountData().get(login)) || password.length() == 0); 286 287 StringBuffer messageBuffer = 288 new StringBuffer (64) 289 .append("Welcome ") 290 .append(login) 291 .append(". HELP for a list of commands"); 292 out.println( messageBuffer.toString() ); 293 out.flush(); 294 if (getLogger().isInfoEnabled()) { 295 StringBuffer infoBuffer = 296 new StringBuffer (128) 297 .append("Login for ") 298 .append(login) 299 .append(" successful"); 300 getLogger().info(infoBuffer.toString()); 301 } 302 303 try { 304 theWatchdog.start(); 305 while (parseCommand(in.readLine())) { 306 theWatchdog.reset(); 307 } 308 theWatchdog.stop(); 309 } catch (IOException ioe) { 310 } catch (Throwable thr) { 312 System.out.println("Exception: " + thr.getMessage()); 313 getLogger().error("Encountered exception in handling the remote manager connection.", thr); 314 } 315 StringBuffer infoBuffer = 316 new StringBuffer (64) 317 .append("Logout for ") 318 .append(login) 319 .append("."); 320 getLogger().info(infoBuffer.toString()); 321 322 } catch ( final IOException e ) { 323 out.println("Error. Closing connection"); 324 out.flush(); 325 if (getLogger().isErrorEnabled()) { 326 StringBuffer exceptionBuffer = 327 new StringBuffer (128) 328 .append("Exception during connection from ") 329 .append(remoteHost) 330 .append(" (") 331 .append(remoteIP) 332 .append("): ") 333 .append(e.getMessage()); 334 getLogger().error(exceptionBuffer.toString()); 335 } 336 } finally { 337 resetHandler(); 338 } 339 } 340 341 344 private void resetHandler() { 345 346 if (theWatchdog != null) { 348 if (theWatchdog instanceof Disposable) { 349 ((Disposable)theWatchdog).dispose(); 350 } 351 theWatchdog = null; 352 } 353 354 in = null; 355 out = null; 356 try { 357 if (socket != null) { 358 socket.close(); 359 } 360 } catch (IOException e) { 361 if (getLogger().isErrorEnabled()) { 362 getLogger().error("Exception closing socket: " 363 + e.getMessage()); 364 } 365 } finally { 366 socket = null; 367 } 368 369 synchronized (this) { 370 handlerThread = null; 371 } 372 373 users = theConfigData.getUsersRepository(); 375 inLocalUsers = true; 376 377 theConfigData = null; 379 } 380 381 390 private boolean parseCommand( String rawCommand ) { 391 if (rawCommand == null) { 392 return false; 393 } 394 String command = rawCommand.trim(); 395 String argument = null; 396 int breakIndex = command.indexOf(" "); 397 if (breakIndex > 0) { 398 argument = command.substring(breakIndex + 1); 399 command = command.substring(0, breakIndex); 400 } 401 command = command.toUpperCase(Locale.US); 402 String argument1 = null; 403 if (command.equals(COMMAND_ADDUSER)) { 404 doADDUSER(argument); 405 } else if (command.equals(COMMAND_SETPASSWORD)) { 406 return doSETPASSWORD(argument); 407 } else if (command.equals(COMMAND_DELUSER)) { 408 return doDELUSER(argument); 409 } else if (command.equals(COMMAND_LISTUSERS)) { 410 return doLISTUSERS(argument); 411 } else if (command.equals(COMMAND_COUNTUSERS)) { 412 return doCOUNTUSERS(argument); 413 } else if (command.equals(COMMAND_VERIFY)) { 414 return doVERIFY(argument); 415 } else if (command.equals(COMMAND_HELP)) { 416 return doHELP(argument); 417 } else if (command.equals(COMMAND_SETALIAS)) { 418 return doSETALIAS(argument); 419 } else if (command.equals(COMMAND_SETFORWARDING)) { 420 return doSETFORWARDING(argument); 421 } else if (command.equals(COMMAND_SHOWALIAS)) { 422 return doSHOWALIAS(argument); 423 } else if (command.equals(COMMAND_SHOWFORWARDING)) { 424 return doSHOWFORWARDING(argument); 425 } else if (command.equals(COMMAND_UNSETALIAS)) { 426 return doUNSETALIAS(argument); 427 } else if (command.equals(COMMAND_UNSETFORWARDING)) { 428 return doUNSETFORWARDING(argument); 429 } else if (command.equals(COMMAND_USER)) { 430 return doUSER(argument); 431 } else if (command.equals(COMMAND_QUIT)) { 432 return doQUIT(argument); 433 } else if (command.equals(COMMAND_SHUTDOWN)) { 434 return doSHUTDOWN(argument); 435 } else { 436 return doUnknownCommand(rawCommand); 437 } 438 return true; 439 } 440 441 447 private boolean doADDUSER(String argument) { 448 int breakIndex = -1; 449 if ((argument == null) || 450 (argument.equals("")) || 451 ((breakIndex = argument.indexOf(" ")) < 0)) { 452 writeLoggedFlushedResponse("Usage: adduser [username] [password]"); 453 return true; 454 } 455 String username = argument.substring(0,breakIndex); 456 String passwd = argument.substring(breakIndex + 1); 457 if (username.equals("") || passwd.equals("")) { 458 writeLoggedFlushedResponse("Usage: adduser [username] [password]"); 459 return true; 460 } 461 462 boolean success = false; 463 if (users.contains(username)) { 464 StringBuffer responseBuffer = 465 new StringBuffer (64) 466 .append("User ") 467 .append(username) 468 .append(" already exists"); 469 String response = responseBuffer.toString(); 470 writeLoggedResponse(response); 471 } else if ( inLocalUsers ) { 472 success = theConfigData.getMailServer().addUser(username, passwd); 475 } else { 476 DefaultUser user = new DefaultUser(username, "SHA"); 477 user.setPassword(passwd); 478 success = users.addUser(user); 479 } 480 if ( success ) { 481 StringBuffer responseBuffer = 482 new StringBuffer (64) 483 .append("User ") 484 .append(username) 485 .append(" added"); 486 String response = responseBuffer.toString(); 487 out.println(response); 488 getLogger().info(response); 489 } else { 490 out.println("Error adding user " + username); 491 getLogger().error("Error adding user " + username); 492 } 493 out.flush(); 494 return true; 495 } 496 497 503 private boolean doSETPASSWORD(String argument) { 504 505 int breakIndex = -1; 506 if ((argument == null) || 507 (argument.equals("")) || 508 ((breakIndex = argument.indexOf(" ")) < 0)) { 509 writeLoggedFlushedResponse("Usage: setpassword [username] [password]"); 510 return true; 511 } 512 String username = argument.substring(0,breakIndex); 513 String passwd = argument.substring(breakIndex + 1); 514 515 if (username.equals("") || passwd.equals("")) { 516 writeLoggedFlushedResponse("Usage: adduser [username] [password]"); 517 return true; 518 } 519 User user = users.getUserByName(username); 520 if (user == null) { 521 writeLoggedFlushedResponse("No such user " + username); 522 return true; 523 } 524 boolean success = user.setPassword(passwd); 525 if (success) { 526 users.updateUser(user); 527 StringBuffer responseBuffer = 528 new StringBuffer (64) 529 .append("Password for ") 530 .append(username) 531 .append(" reset"); 532 String response = responseBuffer.toString(); 533 out.println(response); 534 getLogger().info(response); 535 } else { 536 out.println("Error resetting password"); 537 getLogger().error("Error resetting password"); 538 } 539 out.flush(); 540 return true; 541 } 542 543 549 private boolean doDELUSER(String argument) { 550 String user = argument; 551 if ((user == null) || (user.equals(""))) { 552 writeLoggedFlushedResponse("Usage: deluser [username]"); 553 return true; 554 } 555 if (users.contains(user)) { 556 try { 557 users.removeUser(user); 558 StringBuffer responseBuffer = 559 new StringBuffer (64) 560 .append("User ") 561 .append(user) 562 .append(" deleted"); 563 String response = responseBuffer.toString(); 564 out.println(response); 565 getLogger().info(response); 566 } catch (Exception e) { 567 StringBuffer exceptionBuffer = 568 new StringBuffer (128) 569 .append("Error deleting user ") 570 .append(user) 571 .append(" : ") 572 .append(e.getMessage()); 573 String exception = exceptionBuffer.toString(); 574 out.println(exception); 575 getLogger().error(exception); 576 } 577 } else { 578 StringBuffer responseBuffer = 579 new StringBuffer (64) 580 .append("User ") 581 .append(user) 582 .append(" doesn't exist"); 583 String response = responseBuffer.toString(); 584 out.println(response); 585 } 586 out.flush(); 587 return true; 588 } 589 590 596 private boolean doLISTUSERS(String argument) { 597 writeLoggedResponse("Existing accounts " + users.countUsers()); 598 for (Iterator it = users.list(); it.hasNext();) { 599 writeLoggedResponse("user: " + (String ) it.next()); 600 } 601 out.flush(); 602 return true; 603 } 604 605 611 private boolean doCOUNTUSERS(String argument) { 612 writeLoggedFlushedResponse("Existing accounts " + users.countUsers()); 613 return true; 614 } 615 616 622 private boolean doVERIFY(String argument) { 623 String user = argument; 624 if (user == null || user.equals("")) { 625 writeLoggedFlushedResponse("Usage: verify [username]"); 626 return true; 627 } 628 if (users.contains(user)) { 629 StringBuffer responseBuffer = 630 new StringBuffer (64) 631 .append("User ") 632 .append(user) 633 .append(" exists"); 634 String response = responseBuffer.toString(); 635 writeLoggedResponse(response); 636 } else { 637 StringBuffer responseBuffer = 638 new StringBuffer (64) 639 .append("User ") 640 .append(user) 641 .append(" does not exist"); 642 String response = responseBuffer.toString(); 643 writeLoggedResponse(response); 644 } 645 out.flush(); 646 return true; 647 } 648 649 655 private boolean doHELP(String argument) { 656 out.println("Currently implemented commands:"); 657 out.println("help display this help"); 658 out.println("listusers display existing accounts"); 659 out.println("countusers display the number of existing accounts"); 660 out.println("adduser [username] [password] add a new user"); 661 out.println("verify [username] verify if specified user exist"); 662 out.println("deluser [username] delete existing user"); 663 out.println("setpassword [username] [password] sets a user's password"); 664 out.println("setalias [user] [alias] locally forwards all email for 'user' to 'alias'"); 665 out.println("showalias [username] shows a user's current email alias"); 666 out.println("unsetalias [user] unsets an alias for 'user'"); 667 out.println("setforwarding [username] [emailaddress] forwards a user's email to another email address"); 668 out.println("showforwarding [username] shows a user's current email forwarding"); 669 out.println("unsetforwarding [username] removes a forward"); 670 out.println("user [repositoryname] change to another user repository"); 671 out.println("shutdown kills the current JVM (convenient when James is run as a daemon)"); 672 out.println("quit close connection"); 673 out.flush(); 674 return true; 675 } 676 677 683 private boolean doSETALIAS(String argument) { 684 int breakIndex = -1; 685 if ((argument == null) || 686 (argument.equals("")) || 687 ((breakIndex = argument.indexOf(" ")) < 0)) { 688 writeLoggedFlushedResponse("Usage: setalias [username] [emailaddress]"); 689 return true; 690 } 691 String username = argument.substring(0,breakIndex); 692 String alias = argument.substring(breakIndex + 1); 693 if (username.equals("") || alias.equals("")) { 694 writeLoggedFlushedResponse("Usage: setalias [username] [alias]"); 695 return true; 696 } 697 JamesUser user = (JamesUser) users.getUserByName(username); 698 if (user == null) { 699 writeLoggedFlushedResponse("No such user " + username); 700 return true; 701 } 702 JamesUser aliasUser = (JamesUser) users.getUserByName(alias); 703 if (aliasUser == null) { 704 writeLoggedFlushedResponse("Alias unknown to server - create that user first."); 705 return true; 706 } 707 708 boolean success = user.setAlias(alias); 709 if (success) { 710 user.setAliasing(true); 711 users.updateUser(user); 712 StringBuffer responseBuffer = 713 new StringBuffer (64) 714 .append("Alias for ") 715 .append(username) 716 .append(" set to:") 717 .append(alias); 718 String response = responseBuffer.toString(); 719 out.println(response); 720 getLogger().info(response); 721 } else { 722 out.println("Error setting alias"); 723 getLogger().error("Error setting alias"); 724 } 725 out.flush(); 726 return true; 727 } 728 729 735 private boolean doSETFORWARDING(String argument) { 736 int breakIndex = -1; 737 if ((argument == null) || 738 (argument.equals("")) || 739 ((breakIndex = argument.indexOf(" ")) < 0)) { 740 writeLoggedFlushedResponse("Usage: setforwarding [username] [emailaddress]"); 741 return true; 742 } 743 String username = argument.substring(0,breakIndex); 744 String forward = argument.substring(breakIndex + 1); 745 if (username.equals("") || forward.equals("")) { 746 writeLoggedFlushedResponse("Usage: setforwarding [username] [emailaddress]"); 747 return true; 748 } 749 User baseuser = users.getUserByName(username); 751 if (baseuser == null) { 752 writeLoggedFlushedResponse("No such user " + username); 753 return true; 754 } else if (! (baseuser instanceof JamesUser ) ) { 755 writeLoggedFlushedResponse("Can't set forwarding for this user type."); 756 return true; 757 } 758 JamesUser user = (JamesUser)baseuser; 759 MailAddress forwardAddr; 761 try { 762 forwardAddr = new MailAddress(forward); 763 } catch(ParseException pe) { 764 writeLoggedResponse("Parse exception with that email address: " + pe.getMessage()); 765 writeLoggedFlushedResponse("Forwarding address not added for " + username); 766 return true; 767 } 768 769 boolean success = user.setForwardingDestination(forwardAddr); 770 if (success) { 771 user.setForwarding(true); 772 users.updateUser(user); 773 StringBuffer responseBuffer = 774 new StringBuffer (64) 775 .append("Forwarding destination for ") 776 .append(username) 777 .append(" set to:") 778 .append(forwardAddr.toString()); 779 String response = responseBuffer.toString(); 780 out.println(response); 781 getLogger().info(response); 782 } else { 783 out.println("Error setting forwarding"); 784 getLogger().error("Error setting forwarding"); 785 } 786 out.flush(); 787 return true; 788 } 789 790 796 private boolean doSHOWALIAS(String username) { 797 if ( username == null || username.equals("") ) { 798 writeLoggedFlushedResponse("Usage: showalias [username]"); 799 return true; 800 } 801 802 JamesUser user = (JamesUser)users.getUserByName(username); 803 if ( user == null ) { 804 writeLoggedFlushedResponse("No such user " + username); 805 return true; 806 } 807 808 if ( !user.getAliasing() ) { 809 writeLoggedFlushedResponse("User " + username + " does not currently have an alias"); 810 return true; 811 } 812 813 String alias = user.getAlias(); 814 815 if ( alias == null || alias.equals("") ) { String errmsg = "For user " + username + ", the system indicates that aliasing is set but no alias was found"; 817 out.println(errmsg); 818 getLogger().error(errmsg); 819 return true; 820 } 821 822 writeLoggedFlushedResponse("Current alias for " + username + " is: " + alias); 823 return true; 824 } 825 826 832 private boolean doSHOWFORWARDING(String username) { 833 if ( username == null || username.equals("") ) { 834 writeLoggedFlushedResponse("Usage: showforwarding [username]"); 835 return true; 836 } 837 838 JamesUser user = (JamesUser)users.getUserByName(username); 839 if ( user == null ) { 840 writeLoggedFlushedResponse("No such user " + username); 841 return true; 842 } 843 844 if ( !user.getForwarding() ) { 845 writeLoggedFlushedResponse("User " + username + " is not currently being forwarded"); 846 return true; 847 } 848 849 MailAddress fwdAddr = user.getForwardingDestination(); 850 851 if ( fwdAddr == null ) { String errmsg = "For user " + username + ", the system indicates that forwarding is set but no forwarding destination was found"; 853 out.println(errmsg); 854 getLogger().error(errmsg); 855 return true; 856 } 857 858 writeLoggedFlushedResponse("Current forwarding destination for " + username + " is: " + fwdAddr); 859 return true; 860 } 861 862 868 private boolean doUNSETALIAS(String argument) { 869 if ((argument == null) || (argument.equals(""))) { 870 writeLoggedFlushedResponse("Usage: unsetalias [username]"); 871 return true; 872 } 873 String username = argument; 874 JamesUser user = (JamesUser) users.getUserByName(username); 875 if (user == null) { 876 writeLoggedResponse("No such user " + username); 877 } else if (user.getAliasing()){ 878 user.setAliasing(false); 879 users.updateUser(user); 880 StringBuffer responseBuffer = 881 new StringBuffer (64) 882 .append("Alias for ") 883 .append(username) 884 .append(" unset"); 885 String response = responseBuffer.toString(); 886 out.println(response); 887 getLogger().info(response); 888 } else { 889 writeLoggedResponse("Aliasing not active for" + username); 890 } 891 out.flush(); 892 return true; 893 } 894 895 901 private boolean doUNSETFORWARDING(String argument) { 902 if ((argument == null) || (argument.equals(""))) { 903 writeLoggedFlushedResponse("Usage: unsetforwarding [username]"); 904 return true; 905 } 906 String username = argument; 907 JamesUser user = (JamesUser) users.getUserByName(username); 908 if (user == null) { 909 writeLoggedFlushedResponse("No such user " + username); 910 } else if (user.getForwarding()){ 911 user.setForwarding(false); 912 users.updateUser(user); 913 StringBuffer responseBuffer = 914 new StringBuffer (64) 915 .append("Forward for ") 916 .append(username) 917 .append(" unset"); 918 String response = responseBuffer.toString(); 919 out.println(response); 920 out.flush(); 921 getLogger().info(response); 922 } else { 923 writeLoggedFlushedResponse("Forwarding not active for" + username); 924 } 925 return true; 926 } 927 928 934 private boolean doUSER(String argument) { 935 if (argument == null || argument.equals("")) { 936 writeLoggedFlushedResponse("Usage: user [repositoryName]"); 937 return true; 938 } 939 String repositoryName = argument.toLowerCase(Locale.US); 940 UsersRepository repos = theConfigData.getUserStore().getRepository(repositoryName); 941 if ( repos == null ) { 942 writeLoggedFlushedResponse("No such repository: " + repositoryName); 943 } else { 944 users = repos; 945 StringBuffer responseBuffer = 946 new StringBuffer (64) 947 .append("Changed to repository '") 948 .append(repositoryName) 949 .append("'."); 950 writeLoggedFlushedResponse(responseBuffer.toString()); 951 if ( repositoryName.equals("localusers") ) { 952 inLocalUsers = true; 953 } else { 954 inLocalUsers = false; 955 } 956 } 957 return true; 958 } 959 960 966 private boolean doQUIT(String argument) { 967 writeLoggedFlushedResponse("Bye"); 968 return false; 969 } 970 971 977 private boolean doSHUTDOWN(String argument) { 978 writeLoggedFlushedResponse("Shutting down, bye bye"); 979 System.exit(0); 980 return false; 981 } 982 983 989 private boolean doUnknownCommand(String argument) { 990 writeLoggedFlushedResponse("Unknown command " + argument); 991 return true; 992 } 993 994 1002 private final void logResponseString(String responseString) { 1003 if (getLogger().isDebugEnabled()) { 1004 getLogger().debug("Sent: " + responseString); 1005 } 1006 } 1007 1008 1015 final void writeLoggedFlushedResponse(String responseString) { 1016 out.println(responseString); 1017 out.flush(); 1018 logResponseString(responseString); 1019 } 1020 1021 1027 final void writeLoggedResponse(String responseString) { 1028 out.println(responseString); 1029 logResponseString(responseString); 1030 } 1031 1032 1037 private class RemoteManagerWatchdogTarget 1038 implements WatchdogTarget { 1039 1040 1043 public void execute() { 1044 RemoteManagerHandler.this.idleClose(); 1045 } 1046 } 1047} 1048 | Popular Tags |