1 23 24 28 29 package com.sun.enterprise.config.serverbeans; 30 31 import org.w3c.dom.*; 32 import org.netbeans.modules.schema2beans.*; 33 import java.beans.*; 34 import java.util.*; 35 import java.io.Serializable ; 36 import com.sun.enterprise.config.ConfigBean; 37 import com.sun.enterprise.config.ConfigException; 38 import com.sun.enterprise.config.StaleWriteConfigException; 39 import com.sun.enterprise.util.i18n.StringManager; 40 41 43 public class ModuleLogLevels extends ConfigBean implements Serializable 44 { 45 46 static Vector comparators = new Vector(); 47 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 48 49 static public final String ELEMENT_PROPERTY = "ElementProperty"; 50 51 public ModuleLogLevels() { 52 this(Common.USE_DEFAULT_VALUES); 53 } 54 55 public ModuleLogLevels(int options) 56 { 57 super(comparators, runtimeVersion); 58 initPropertyTables(1); 60 this.createProperty("property", ELEMENT_PROPERTY, 61 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 62 ElementProperty.class); 63 this.createAttribute(ELEMENT_PROPERTY, "name", "Name", 64 AttrProp.CDATA | AttrProp.REQUIRED, 65 null, null); 66 this.createAttribute(ELEMENT_PROPERTY, "value", "Value", 67 AttrProp.CDATA | AttrProp.REQUIRED, 68 null, null); 69 this.initialize(options); 70 } 71 72 void initialize(int options) { 74 75 } 76 77 public void setElementProperty(int index, ElementProperty value) { 79 this.setValue(ELEMENT_PROPERTY, index, value); 80 } 81 82 public ElementProperty getElementProperty(int index) { 84 return (ElementProperty)this.getValue(ELEMENT_PROPERTY, index); 85 } 86 87 public void setElementProperty(ElementProperty[] value) { 89 this.setValue(ELEMENT_PROPERTY, value); 90 } 91 92 public ElementProperty[] getElementProperty() { 94 return (ElementProperty[])this.getValues(ELEMENT_PROPERTY); 95 } 96 97 public int sizeElementProperty() { 99 return this.size(ELEMENT_PROPERTY); 100 } 101 102 public int addElementProperty(ElementProperty value) 104 throws ConfigException{ 105 return addElementProperty(value, true); 106 } 107 108 public int addElementProperty(ElementProperty value, boolean overwrite) 110 throws ConfigException{ 111 ElementProperty old = getElementPropertyByName(value.getName()); 112 if(old != null) { 113 throw new ConfigException(StringManager.getManager(ModuleLogLevels.class).getString("cannotAddDuplicate", "ElementProperty")); 114 } 115 return this.addValue(ELEMENT_PROPERTY, value, overwrite); 116 } 117 118 public int removeElementProperty(ElementProperty value){ 123 return this.removeValue(ELEMENT_PROPERTY, value); 124 } 125 126 public int removeElementProperty(ElementProperty value, boolean overwrite) 132 throws StaleWriteConfigException{ 133 return this.removeValue(ELEMENT_PROPERTY, value, overwrite); 134 } 135 136 public ElementProperty getElementPropertyByName(String id) { 137 if (null != id) { id = id.trim(); } 138 ElementProperty[] o = getElementProperty(); 139 if (o == null) return null; 140 141 for (int i=0; i < o.length; i++) { 142 if(o[i].getAttributeValue(Common.convertName(ServerTags.NAME)).equals(id)) { 143 return o[i]; 144 } 145 } 146 147 return null; 148 149 } 150 154 public String getRoot() { 155 return getAttributeValue(ServerTags.ROOT); 156 } 157 162 public void setRoot(String v, boolean overwrite) throws StaleWriteConfigException { 163 setAttributeValue(ServerTags.ROOT, v, overwrite); 164 } 165 169 public void setRoot(String v) { 170 setAttributeValue(ServerTags.ROOT, v); 171 } 172 175 public static String getDefaultRoot() { 176 return "INFO".trim(); 177 } 178 182 public String getServer() { 183 return getAttributeValue(ServerTags.SERVER); 184 } 185 190 public void setServer(String v, boolean overwrite) throws StaleWriteConfigException { 191 setAttributeValue(ServerTags.SERVER, v, overwrite); 192 } 193 197 public void setServer(String v) { 198 setAttributeValue(ServerTags.SERVER, v); 199 } 200 203 public static String getDefaultServer() { 204 return "INFO".trim(); 205 } 206 210 public String getEjbContainer() { 211 return getAttributeValue(ServerTags.EJB_CONTAINER); 212 } 213 218 public void setEjbContainer(String v, boolean overwrite) throws StaleWriteConfigException { 219 setAttributeValue(ServerTags.EJB_CONTAINER, v, overwrite); 220 } 221 225 public void setEjbContainer(String v) { 226 setAttributeValue(ServerTags.EJB_CONTAINER, v); 227 } 228 231 public static String getDefaultEjbContainer() { 232 return "INFO".trim(); 233 } 234 238 public String getCmpContainer() { 239 return getAttributeValue(ServerTags.CMP_CONTAINER); 240 } 241 246 public void setCmpContainer(String v, boolean overwrite) throws StaleWriteConfigException { 247 setAttributeValue(ServerTags.CMP_CONTAINER, v, overwrite); 248 } 249 253 public void setCmpContainer(String v) { 254 setAttributeValue(ServerTags.CMP_CONTAINER, v); 255 } 256 259 public static String getDefaultCmpContainer() { 260 return "INFO".trim(); 261 } 262 266 public String getMdbContainer() { 267 return getAttributeValue(ServerTags.MDB_CONTAINER); 268 } 269 274 public void setMdbContainer(String v, boolean overwrite) throws StaleWriteConfigException { 275 setAttributeValue(ServerTags.MDB_CONTAINER, v, overwrite); 276 } 277 281 public void setMdbContainer(String v) { 282 setAttributeValue(ServerTags.MDB_CONTAINER, v); 283 } 284 287 public static String getDefaultMdbContainer() { 288 return "INFO".trim(); 289 } 290 294 public String getWebContainer() { 295 return getAttributeValue(ServerTags.WEB_CONTAINER); 296 } 297 302 public void setWebContainer(String v, boolean overwrite) throws StaleWriteConfigException { 303 setAttributeValue(ServerTags.WEB_CONTAINER, v, overwrite); 304 } 305 309 public void setWebContainer(String v) { 310 setAttributeValue(ServerTags.WEB_CONTAINER, v); 311 } 312 315 public static String getDefaultWebContainer() { 316 return "INFO".trim(); 317 } 318 322 public String getClassloader() { 323 return getAttributeValue(ServerTags.CLASSLOADER); 324 } 325 330 public void setClassloader(String v, boolean overwrite) throws StaleWriteConfigException { 331 setAttributeValue(ServerTags.CLASSLOADER, v, overwrite); 332 } 333 337 public void setClassloader(String v) { 338 setAttributeValue(ServerTags.CLASSLOADER, v); 339 } 340 343 public static String getDefaultClassloader() { 344 return "INFO".trim(); 345 } 346 350 public String getConfiguration() { 351 return getAttributeValue(ServerTags.CONFIGURATION); 352 } 353 358 public void setConfiguration(String v, boolean overwrite) throws StaleWriteConfigException { 359 setAttributeValue(ServerTags.CONFIGURATION, v, overwrite); 360 } 361 365 public void setConfiguration(String v) { 366 setAttributeValue(ServerTags.CONFIGURATION, v); 367 } 368 371 public static String getDefaultConfiguration() { 372 return "INFO".trim(); 373 } 374 378 public String getNaming() { 379 return getAttributeValue(ServerTags.NAMING); 380 } 381 386 public void setNaming(String v, boolean overwrite) throws StaleWriteConfigException { 387 setAttributeValue(ServerTags.NAMING, v, overwrite); 388 } 389 393 public void setNaming(String v) { 394 setAttributeValue(ServerTags.NAMING, v); 395 } 396 399 public static String getDefaultNaming() { 400 return "INFO".trim(); 401 } 402 406 public String getSecurity() { 407 return getAttributeValue(ServerTags.SECURITY); 408 } 409 414 public void setSecurity(String v, boolean overwrite) throws StaleWriteConfigException { 415 setAttributeValue(ServerTags.SECURITY, v, overwrite); 416 } 417 421 public void setSecurity(String v) { 422 setAttributeValue(ServerTags.SECURITY, v); 423 } 424 427 public static String getDefaultSecurity() { 428 return "INFO".trim(); 429 } 430 434 public String getJts() { 435 return getAttributeValue(ServerTags.JTS); 436 } 437 442 public void setJts(String v, boolean overwrite) throws StaleWriteConfigException { 443 setAttributeValue(ServerTags.JTS, v, overwrite); 444 } 445 449 public void setJts(String v) { 450 setAttributeValue(ServerTags.JTS, v); 451 } 452 455 public static String getDefaultJts() { 456 return "INFO".trim(); 457 } 458 462 public String getJta() { 463 return getAttributeValue(ServerTags.JTA); 464 } 465 470 public void setJta(String v, boolean overwrite) throws StaleWriteConfigException { 471 setAttributeValue(ServerTags.JTA, v, overwrite); 472 } 473 477 public void setJta(String v) { 478 setAttributeValue(ServerTags.JTA, v); 479 } 480 483 public static String getDefaultJta() { 484 return "INFO".trim(); 485 } 486 490 public String getAdmin() { 491 return getAttributeValue(ServerTags.ADMIN); 492 } 493 498 public void setAdmin(String v, boolean overwrite) throws StaleWriteConfigException { 499 setAttributeValue(ServerTags.ADMIN, v, overwrite); 500 } 501 505 public void setAdmin(String v) { 506 setAttributeValue(ServerTags.ADMIN, v); 507 } 508 511 public static String getDefaultAdmin() { 512 return "INFO".trim(); 513 } 514 518 public String getDeployment() { 519 return getAttributeValue(ServerTags.DEPLOYMENT); 520 } 521 526 public void setDeployment(String v, boolean overwrite) throws StaleWriteConfigException { 527 setAttributeValue(ServerTags.DEPLOYMENT, v, overwrite); 528 } 529 533 public void setDeployment(String v) { 534 setAttributeValue(ServerTags.DEPLOYMENT, v); 535 } 536 539 public static String getDefaultDeployment() { 540 return "INFO".trim(); 541 } 542 546 public String getVerifier() { 547 return getAttributeValue(ServerTags.VERIFIER); 548 } 549 554 public void setVerifier(String v, boolean overwrite) throws StaleWriteConfigException { 555 setAttributeValue(ServerTags.VERIFIER, v, overwrite); 556 } 557 561 public void setVerifier(String v) { 562 setAttributeValue(ServerTags.VERIFIER, v); 563 } 564 567 public static String getDefaultVerifier() { 568 return "INFO".trim(); 569 } 570 574 public String getJaxr() { 575 return getAttributeValue(ServerTags.JAXR); 576 } 577 582 public void setJaxr(String v, boolean overwrite) throws StaleWriteConfigException { 583 setAttributeValue(ServerTags.JAXR, v, overwrite); 584 } 585 589 public void setJaxr(String v) { 590 setAttributeValue(ServerTags.JAXR, v); 591 } 592 595 public static String getDefaultJaxr() { 596 return "INFO".trim(); 597 } 598 602 public String getJaxrpc() { 603 return getAttributeValue(ServerTags.JAXRPC); 604 } 605 610 public void setJaxrpc(String v, boolean overwrite) throws StaleWriteConfigException { 611 setAttributeValue(ServerTags.JAXRPC, v, overwrite); 612 } 613 617 public void setJaxrpc(String v) { 618 setAttributeValue(ServerTags.JAXRPC, v); 619 } 620 623 public static String getDefaultJaxrpc() { 624 return "INFO".trim(); 625 } 626 630 public String getSaaj() { 631 return getAttributeValue(ServerTags.SAAJ); 632 } 633 638 public void setSaaj(String v, boolean overwrite) throws StaleWriteConfigException { 639 setAttributeValue(ServerTags.SAAJ, v, overwrite); 640 } 641 645 public void setSaaj(String v) { 646 setAttributeValue(ServerTags.SAAJ, v); 647 } 648 651 public static String getDefaultSaaj() { 652 return "INFO".trim(); 653 } 654 658 public String getCorba() { 659 return getAttributeValue(ServerTags.CORBA); 660 } 661 666 public void setCorba(String v, boolean overwrite) throws StaleWriteConfigException { 667 setAttributeValue(ServerTags.CORBA, v, overwrite); 668 } 669 673 public void setCorba(String v) { 674 setAttributeValue(ServerTags.CORBA, v); 675 } 676 679 public static String getDefaultCorba() { 680 return "INFO".trim(); 681 } 682 686 public String getJavamail() { 687 return getAttributeValue(ServerTags.JAVAMAIL); 688 } 689 694 public void setJavamail(String v, boolean overwrite) throws StaleWriteConfigException { 695 setAttributeValue(ServerTags.JAVAMAIL, v, overwrite); 696 } 697 701 public void setJavamail(String v) { 702 setAttributeValue(ServerTags.JAVAMAIL, v); 703 } 704 707 public static String getDefaultJavamail() { 708 return "INFO".trim(); 709 } 710 714 public String getJms() { 715 return getAttributeValue(ServerTags.JMS); 716 } 717 722 public void setJms(String v, boolean overwrite) throws StaleWriteConfigException { 723 setAttributeValue(ServerTags.JMS, v, overwrite); 724 } 725 729 public void setJms(String v) { 730 setAttributeValue(ServerTags.JMS, v); 731 } 732 735 public static String getDefaultJms() { 736 return "INFO".trim(); 737 } 738 742 public String getConnector() { 743 return getAttributeValue(ServerTags.CONNECTOR); 744 } 745 750 public void setConnector(String v, boolean overwrite) throws StaleWriteConfigException { 751 setAttributeValue(ServerTags.CONNECTOR, v, overwrite); 752 } 753 757 public void setConnector(String v) { 758 setAttributeValue(ServerTags.CONNECTOR, v); 759 } 760 763 public static String getDefaultConnector() { 764 return "INFO".trim(); 765 } 766 770 public String getJdo() { 771 return getAttributeValue(ServerTags.JDO); 772 } 773 778 public void setJdo(String v, boolean overwrite) throws StaleWriteConfigException { 779 setAttributeValue(ServerTags.JDO, v, overwrite); 780 } 781 785 public void setJdo(String v) { 786 setAttributeValue(ServerTags.JDO, v); 787 } 788 791 public static String getDefaultJdo() { 792 return "INFO".trim(); 793 } 794 798 public String getCmp() { 799 return getAttributeValue(ServerTags.CMP); 800 } 801 806 public void setCmp(String v, boolean overwrite) throws StaleWriteConfigException { 807 setAttributeValue(ServerTags.CMP, v, overwrite); 808 } 809 813 public void setCmp(String v) { 814 setAttributeValue(ServerTags.CMP, v); 815 } 816 819 public static String getDefaultCmp() { 820 return "INFO".trim(); 821 } 822 826 public String getUtil() { 827 return getAttributeValue(ServerTags.UTIL); 828 } 829 834 public void setUtil(String v, boolean overwrite) throws StaleWriteConfigException { 835 setAttributeValue(ServerTags.UTIL, v, overwrite); 836 } 837 841 public void setUtil(String v) { 842 setAttributeValue(ServerTags.UTIL, v); 843 } 844 847 public static String getDefaultUtil() { 848 return "INFO".trim(); 849 } 850 854 public String getResourceAdapter() { 855 return getAttributeValue(ServerTags.RESOURCE_ADAPTER); 856 } 857 862 public void setResourceAdapter(String v, boolean overwrite) throws StaleWriteConfigException { 863 setAttributeValue(ServerTags.RESOURCE_ADAPTER, v, overwrite); 864 } 865 869 public void setResourceAdapter(String v) { 870 setAttributeValue(ServerTags.RESOURCE_ADAPTER, v); 871 } 872 875 public static String getDefaultResourceAdapter() { 876 return "INFO".trim(); 877 } 878 882 public String getSynchronization() { 883 return getAttributeValue(ServerTags.SYNCHRONIZATION); 884 } 885 890 public void setSynchronization(String v, boolean overwrite) throws StaleWriteConfigException { 891 setAttributeValue(ServerTags.SYNCHRONIZATION, v, overwrite); 892 } 893 897 public void setSynchronization(String v) { 898 setAttributeValue(ServerTags.SYNCHRONIZATION, v); 899 } 900 903 public static String getDefaultSynchronization() { 904 return "INFO".trim(); 905 } 906 910 public String getNodeAgent() { 911 return getAttributeValue(ServerTags.NODE_AGENT); 912 } 913 918 public void setNodeAgent(String v, boolean overwrite) throws StaleWriteConfigException { 919 setAttributeValue(ServerTags.NODE_AGENT, v, overwrite); 920 } 921 925 public void setNodeAgent(String v) { 926 setAttributeValue(ServerTags.NODE_AGENT, v); 927 } 928 931 public static String getDefaultNodeAgent() { 932 return "INFO".trim(); 933 } 934 938 public String getSelfManagement() { 939 return getAttributeValue(ServerTags.SELF_MANAGEMENT); 940 } 941 946 public void setSelfManagement(String v, boolean overwrite) throws StaleWriteConfigException { 947 setAttributeValue(ServerTags.SELF_MANAGEMENT, v, overwrite); 948 } 949 953 public void setSelfManagement(String v) { 954 setAttributeValue(ServerTags.SELF_MANAGEMENT, v); 955 } 956 959 public static String getDefaultSelfManagement() { 960 return "INFO".trim(); 961 } 962 966 public String getGroupManagementService() { 967 return getAttributeValue(ServerTags.GROUP_MANAGEMENT_SERVICE); 968 } 969 974 public void setGroupManagementService(String v, boolean overwrite) throws StaleWriteConfigException { 975 setAttributeValue(ServerTags.GROUP_MANAGEMENT_SERVICE, v, overwrite); 976 } 977 981 public void setGroupManagementService(String v) { 982 setAttributeValue(ServerTags.GROUP_MANAGEMENT_SERVICE, v); 983 } 984 987 public static String getDefaultGroupManagementService() { 988 return "INFO".trim(); 989 } 990 994 public String getManagementEvent() { 995 return getAttributeValue(ServerTags.MANAGEMENT_EVENT); 996 } 997 1002 public void setManagementEvent(String v, boolean overwrite) throws StaleWriteConfigException { 1003 setAttributeValue(ServerTags.MANAGEMENT_EVENT, v, overwrite); 1004 } 1005 1009 public void setManagementEvent(String v) { 1010 setAttributeValue(ServerTags.MANAGEMENT_EVENT, v); 1011 } 1012 1015 public static String getDefaultManagementEvent() { 1016 return "INFO".trim(); 1017 } 1018 1022 public ElementProperty newElementProperty() { 1023 return new ElementProperty(); 1024 } 1025 1026 1031 protected String getRelativeXPath() { 1032 String ret = null; 1033 ret = "module-log-levels"; 1034 return (null != ret ? ret.trim() : null); 1035 } 1036 1037 1040 public static String getDefaultAttributeValue(String attr) { 1041 if(attr == null) return null; 1042 attr = attr.trim(); 1043 if(attr.equals(ServerTags.ROOT)) return "INFO".trim(); 1044 if(attr.equals(ServerTags.SERVER)) return "INFO".trim(); 1045 if(attr.equals(ServerTags.EJB_CONTAINER)) return "INFO".trim(); 1046 if(attr.equals(ServerTags.CMP_CONTAINER)) return "INFO".trim(); 1047 if(attr.equals(ServerTags.MDB_CONTAINER)) return "INFO".trim(); 1048 if(attr.equals(ServerTags.WEB_CONTAINER)) return "INFO".trim(); 1049 if(attr.equals(ServerTags.CLASSLOADER)) return "INFO".trim(); 1050 if(attr.equals(ServerTags.CONFIGURATION)) return "INFO".trim(); 1051 if(attr.equals(ServerTags.NAMING)) return "INFO".trim(); 1052 if(attr.equals(ServerTags.SECURITY)) return "INFO".trim(); 1053 if(attr.equals(ServerTags.JTS)) return "INFO".trim(); 1054 if(attr.equals(ServerTags.JTA)) return "INFO".trim(); 1055 if(attr.equals(ServerTags.ADMIN)) return "INFO".trim(); 1056 if(attr.equals(ServerTags.DEPLOYMENT)) return "INFO".trim(); 1057 if(attr.equals(ServerTags.VERIFIER)) return "INFO".trim(); 1058 if(attr.equals(ServerTags.JAXR)) return "INFO".trim(); 1059 if(attr.equals(ServerTags.JAXRPC)) return "INFO".trim(); 1060 if(attr.equals(ServerTags.SAAJ)) return "INFO".trim(); 1061 if(attr.equals(ServerTags.CORBA)) return "INFO".trim(); 1062 if(attr.equals(ServerTags.JAVAMAIL)) return "INFO".trim(); 1063 if(attr.equals(ServerTags.JMS)) return "INFO".trim(); 1064 if(attr.equals(ServerTags.CONNECTOR)) return "INFO".trim(); 1065 if(attr.equals(ServerTags.JDO)) return "INFO".trim(); 1066 if(attr.equals(ServerTags.CMP)) return "INFO".trim(); 1067 if(attr.equals(ServerTags.UTIL)) return "INFO".trim(); 1068 if(attr.equals(ServerTags.RESOURCE_ADAPTER)) return "INFO".trim(); 1069 if(attr.equals(ServerTags.SYNCHRONIZATION)) return "INFO".trim(); 1070 if(attr.equals(ServerTags.NODE_AGENT)) return "INFO".trim(); 1071 if(attr.equals(ServerTags.SELF_MANAGEMENT)) return "INFO".trim(); 1072 if(attr.equals(ServerTags.GROUP_MANAGEMENT_SERVICE)) return "INFO".trim(); 1073 if(attr.equals(ServerTags.MANAGEMENT_EVENT)) return "INFO".trim(); 1074 return null; 1075 } 1076 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 1078 comparators.add(c); 1079 } 1080 1081 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 1083 comparators.remove(c); 1084 } 1085 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 1086 } 1087 1088 public void dump(StringBuffer str, String indent){ 1090 String s; 1091 Object o; 1092 org.netbeans.modules.schema2beans.BaseBean n; 1093 str.append(indent); 1094 str.append("ElementProperty["+this.sizeElementProperty()+"]"); for(int i=0; i<this.sizeElementProperty(); i++) 1096 { 1097 str.append(indent+"\t"); 1098 str.append("#"+i+":"); 1099 n = (org.netbeans.modules.schema2beans.BaseBean) this.getElementProperty(i); 1100 if (n != null) 1101 n.dump(str, indent + "\t"); else 1103 str.append(indent+"\tnull"); this.dumpAttributes(ELEMENT_PROPERTY, i, str, indent); 1105 } 1106 1107 } 1108 public String dumpBeanNode(){ 1109 StringBuffer str = new StringBuffer (); 1110 str.append("ModuleLogLevels\n"); this.dump(str, "\n "); return str.toString(); 1113 }} 1114 1115 1117 | Popular Tags |