1 14 15 package org.quickserver.util.xmlreader; 16 17 import org.quickserver.net.server.*; 18 19 26 public class BasicServerConfig implements java.io.Serializable { 27 28 private String clientAuthenticationHandler; private String clientEventHandler; private String clientExtendedEventHandler; private String clientCommandHandler; 32 private String clientObjectHandler; 33 private String clientBinaryHandler; 34 private String clientData; 35 private String clientWriteHandler; 37 private String serverBanner; 38 private String name = null; 39 private String maxConnectionMsg = "-ERR Server Busy. Max Connection Reached"; 40 private String timeoutMsg = "-ERR Timeout"; 41 private int maxAuthTry = 5; 42 private String maxAuthTryMsg = "-ERR Max Auth Try Reached"; 43 private int port = 9876; 44 private String bindAddr; 45 private long maxConnection = -1; 46 private int timeout = 1 * 60 * 1000; 48 private String consoleLoggingLevel = "INFO"; 49 private String consoleLoggingFormatter; 50 51 private ObjectPoolConfig objectPoolConfig = new ObjectPoolConfig(); 53 private boolean communicationLogging = false; 54 55 private AccessConstraintConfig accessConstraintConfig; 57 private ServerHooks serverHooks; 58 59 private Secure secure = new Secure(); 61 private ServerMode serverMode = new ServerMode(); 62 63 private AdvancedSettings advancedSettings = new AdvancedSettings(); 65 66 private DefaultDataMode defaultDataMode = new DefaultDataMode(); 68 69 73 public String getName() { 74 return name; 75 } 76 82 public void setName(String name) { 83 if(name!=null && name.equals("")==false) 84 this.name = name; 85 } 86 87 91 public String getServerBanner() { 92 return serverBanner; 93 } 94 104 public void setServerBanner(String banner) { 105 if(banner!=null && banner.equals("")==false) 106 serverBanner = banner; 107 } 108 109 116 public void setPort(int port) { 117 if(port>=0) 118 this.port = port; 119 } 120 124 public int getPort() { 125 return port; 126 } 127 128 136 public void setClientCommandHandler(String handler) { 137 if(handler!=null && handler.equals("")==false) 138 clientCommandHandler = handler; 139 } 140 145 public void setClientCommandHandler(ClientCommandHandler handler) { 146 if(handler!=null) 147 clientCommandHandler = handler.getClass().getName(); 148 } 149 154 public String getClientCommandHandler() { 155 return clientCommandHandler; 156 } 157 158 167 public void setClientEventHandler(String handler) { 168 if(handler!=null && handler.equals("")==false) 169 clientEventHandler = handler; 170 } 171 176 public void setClientEventHandler(ClientEventHandler handler) { 177 if(handler!=null) 178 clientEventHandler = handler.getClass().getName(); 179 } 180 186 public String getClientEventHandler() { 187 return clientEventHandler; 188 } 189 190 199 public void setClientExtendedEventHandler(String handler) { 200 if(handler!=null && handler.equals("")==false) 201 clientExtendedEventHandler = handler; 202 } 203 208 public void setClientExtendedEventHandler(ClientExtendedEventHandler handler) { 209 if(handler!=null) 210 clientExtendedEventHandler = handler.getClass().getName(); 211 } 212 218 public String getClientExtendedEventHandler() { 219 return clientExtendedEventHandler; 220 } 221 222 231 public void setAuthenticator(String authenticator) { 232 if(authenticator!=null && authenticator.equals("")==false) 233 this.clientAuthenticationHandler = authenticator; 234 } 235 240 public void setAuthenticator(Authenticator authenticator) { 241 if(authenticator!=null) 242 this.clientAuthenticationHandler = authenticator.getClass().getName(); 243 } 244 250 public String getAuthenticator() { 251 return clientAuthenticationHandler; 252 } 253 254 263 public void setClientAuthenticationHandler(String clientAuthenticationHandler) { 264 if(clientAuthenticationHandler!=null && clientAuthenticationHandler.equals("")==false) 265 this.clientAuthenticationHandler = clientAuthenticationHandler; 266 } 267 272 public void setClientAuthenticationHandler(ClientAuthenticationHandler clientAuthenticationHandler) { 273 if(clientAuthenticationHandler!=null) 274 this.clientAuthenticationHandler = clientAuthenticationHandler.getClass().getName(); 275 } 276 282 public String getClientAuthenticationHandler() { 283 return clientAuthenticationHandler; 284 } 285 286 293 public void setClientData(String data) { 294 if(data!=null && data.equals("")==false) 295 this.clientData = data; 296 } 297 301 public void setClientData(ClientData data) { 302 if(data!=null) 303 this.clientData = data.getClass().getName(); 304 } 305 311 public String getClientData() { 312 return clientData; 313 } 314 315 321 public void setTimeout(int time) { 322 timeout = time; 323 } 324 328 public int getTimeout() { 329 return timeout; 330 } 331 332 336 public void setMaxAuthTry(int authTry) { 337 maxAuthTry = authTry; 338 } 339 343 public int getMaxAuthTry() { 344 return maxAuthTry; 345 } 346 347 354 public void setMaxAuthTryMsg(String msg) { 355 if(msg!=null && msg.equals("")==false) 356 maxAuthTryMsg = msg; 357 } 358 363 public String getMaxAuthTryMsg() { 364 return maxAuthTryMsg; 365 } 366 367 373 public void setTimeoutMsg(String msg) { 374 if(msg!=null && msg.equals("")==false) 375 timeoutMsg = msg; 376 } 377 381 public String getTimeoutMsg() { 382 return timeoutMsg; 383 } 384 385 390 public void setMaxConnection(long maxConnection) { 391 this.maxConnection = maxConnection; 392 } 393 397 public long getMaxConnection() { 398 return maxConnection; 399 } 400 401 408 public void setMaxConnectionMsg(String maxConnectionMsg) { 409 if(maxConnectionMsg!=null && maxConnectionMsg.equals("")==false) 410 this.maxConnectionMsg = maxConnectionMsg; 411 } 412 417 public String getMaxConnectionMsg() { 418 return maxConnectionMsg; 419 } 420 421 430 public void setBindAddr(String bindAddr) { 431 if(bindAddr!=null && bindAddr.equals("")==false) 432 this.bindAddr = bindAddr; 433 } 434 438 public String getBindAddr() { 439 return bindAddr; 440 } 441 442 450 public void setClientObjectHandler(String handler) { 451 if(handler!=null && handler.equals("")==false) 452 clientObjectHandler = handler; 453 } 454 459 public void setClientObjectHandler(ClientObjectHandler handler) { 460 if(handler!=null) 461 clientObjectHandler = handler.getClass().getName(); 462 } 463 468 public String getClientObjectHandler() { 469 return clientObjectHandler; 470 } 471 472 477 public void setConsoleLoggingLevel(String level) { 478 if(level!=null && level.equals("")==false) 479 consoleLoggingLevel = level; 480 } 481 484 public String getConsoleLoggingLevel() { 485 return consoleLoggingLevel; 486 } 487 488 494 public void setConsoleLoggingFormatter(String formatter) { 495 if(formatter!=null && formatter.equals("")==false) 496 consoleLoggingFormatter = formatter; 497 } 498 501 public String getConsoleLoggingFormatter() { 502 return consoleLoggingFormatter; 503 } 504 505 509 public void setObjectPoolConfig(ObjectPoolConfig objectPoolConfig) { 510 if(objectPoolConfig!=null) 511 this.objectPoolConfig = objectPoolConfig; 512 } 513 516 public ObjectPoolConfig getObjectPoolConfig() { 517 return objectPoolConfig; 518 } 519 520 527 public void setCommunicationLogging(boolean enable) { 528 this.communicationLogging = enable; 529 } 530 535 public boolean getCommunicationLogging() { 536 return communicationLogging; 537 } 538 539 543 public void setAccessConstraintConfig( 544 AccessConstraintConfig accessConstraintConfig) { 545 this.accessConstraintConfig = accessConstraintConfig; 546 } 547 551 public AccessConstraintConfig getAccessConstraintConfig() { 552 return accessConstraintConfig; 553 } 554 555 559 public void setServerHooks(ServerHooks serverHooks) { 560 this.serverHooks = serverHooks; 561 } 562 566 public ServerHooks getServerHooks() { 567 return serverHooks; 568 } 569 570 574 public void setSecure(Secure secure) { 575 this.secure = secure; 576 } 577 581 public Secure getSecure() { 582 return secure; 583 } 584 585 593 public void setClientBinaryHandler(String handler) { 594 if(handler!=null && handler.equals("")==false) 595 clientBinaryHandler = handler; 596 } 597 602 public void setClientBinaryHandler(ClientBinaryHandler handler) { 603 if(handler!=null) 604 clientBinaryHandler = handler.getClass().getName(); 605 } 606 611 public String getClientBinaryHandler() { 612 return clientBinaryHandler; 613 } 614 615 621 public void setServerMode(ServerMode serverMode) { 622 if(serverMode==null) serverMode = new ServerMode(); 623 this.serverMode = serverMode; 624 } 625 630 public ServerMode getServerMode() { 631 return serverMode; 632 } 633 634 643 public void setClientWriteHandler(String handler) { 644 if(handler!=null && handler.equals("")==false) 645 clientWriteHandler = handler; 646 } 647 652 public void setClientWriteHandler(ClientWriteHandler handler) { 653 if(handler!=null) 654 clientWriteHandler = handler.getClass().getName(); 655 } 656 661 public String getClientWriteHandler() { 662 return clientWriteHandler; 663 } 664 665 671 public void setAdvancedSettings(AdvancedSettings advancedSettings) { 672 this.advancedSettings = advancedSettings; 673 } 674 679 public AdvancedSettings getAdvancedSettings() { 680 if(advancedSettings==null) advancedSettings = new AdvancedSettings(); 681 return advancedSettings; 682 } 683 684 690 public void setDefaultDataMode(DefaultDataMode defaultDataMode) { 691 this.defaultDataMode = defaultDataMode; 692 } 693 698 public DefaultDataMode getDefaultDataMode() { 699 if(defaultDataMode==null) 700 defaultDataMode = new DefaultDataMode(); 701 return defaultDataMode; 702 } 703 } 704 | Popular Tags |