1 8 9 package mx4j.tools.adaptor.ssl; 10 11 import java.lang.reflect.Constructor ; 12 import java.lang.reflect.Method ; 13 14 import mx4j.MBeanDescriptionAdapter; 15 16 19 public class SSLAdaptorServerSocketFactoryMBeanDescription extends MBeanDescriptionAdapter 20 { 21 public String getMBeanDescription() 22 { 23 return "Factory for SSLServerSockets used by adaptors"; 24 } 25 26 public String getConstructorDescription(Constructor ctor) 27 { 28 return "Creates a new SSLServerSocket factory for adaptors"; 29 } 30 31 public String getAttributeDescription(String attribute) 32 { 33 if (attribute.equals("KeyStoreType")) 34 { 35 return "The type of the keystore, default is 'JKS'"; 36 } 37 if (attribute.equals("TrustStoreType")) 38 { 39 return "The type of the truststore, default is 'JKS'"; 40 } 41 if (attribute.equals("KeyStoreName")) 42 { 43 return "The keystore name"; 44 } 45 if (attribute.equals("TrustStoreName")) 46 { 47 return "The truststore name"; 48 } 49 if (attribute.equals("KeyStorePassword")) 50 { 51 return "The keystore password"; 52 } 53 if (attribute.equals("TrustStorePassword")) 54 { 55 return "The truststore password"; 56 } 57 if (attribute.equals("KeyManagerAlgorithm")) 58 { 59 return "The key algorithm, default is 'SunX509'"; 60 } 61 if (attribute.equals("TrustManagerAlgorithm")) 62 { 63 return "The trust algorithm, default is 'SunX509'"; 64 } 65 if (attribute.equals("KeyManagerPassword")) 66 { 67 return "The key password"; 68 } 69 if (attribute.equals("SSLProtocol")) 70 { 71 return "The SSL protocol version, default is 'TLS'"; 72 } 73 return super.getAttributeDescription(attribute); 74 } 75 76 public String getOperationDescription(Method operation) 77 { 78 String name = operation.getName(); 79 if (name.equals("createServerSocket")) 80 { 81 return "Creates a new SSLServerSocket"; 82 } 83 return super.getOperationDescription(operation); 84 } 85 86 public String getOperationParameterName(Method method, int index) 87 { 88 String name = method.getName(); 89 if (name.equals("createServerSocket")) 90 { 91 switch (index) 92 { 93 case 0: 94 return "port"; 95 case 1: 96 return "backlog"; 97 case 2: 98 return "host"; 99 } 100 } 101 return super.getOperationParameterName(method, index); 102 } 103 104 public String getOperationParameterDescription(Method method, int index) 105 { 106 String name = method.getName(); 107 if (name.equals("createServerSocket")) 108 { 109 switch (index) 110 { 111 case 0: 112 return "The port on which the SSLServerSocket listens for incoming connections"; 113 case 1: 114 return "The backlog for this SSLServerSocket"; 115 case 2: 116 return "The host name or IP address on which the SSLServerSocket is opened"; 117 } 118 } 119 return super.getOperationParameterDescription(method, index); 120 } 121 } 122 | Popular Tags |