KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > adaptor > ssl > SSLAdaptorServerSocketFactoryMBeanDescription


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.adaptor.ssl;
10
11 import java.lang.reflect.Constructor JavaDoc;
12 import java.lang.reflect.Method JavaDoc;
13
14 import mx4j.MBeanDescriptionAdapter;
15
16 /**
17  * @version $Revision: 1.3 $
18  */

19 public class SSLAdaptorServerSocketFactoryMBeanDescription extends MBeanDescriptionAdapter
20 {
21    public String JavaDoc getMBeanDescription()
22    {
23       return "Factory for SSLServerSockets used by adaptors";
24    }
25
26    public String JavaDoc getConstructorDescription(Constructor JavaDoc ctor)
27    {
28       return "Creates a new SSLServerSocket factory for adaptors";
29    }
30
31    public String JavaDoc getAttributeDescription(String JavaDoc 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 JavaDoc getOperationDescription(Method JavaDoc operation)
77    {
78       String JavaDoc 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 JavaDoc getOperationParameterName(Method JavaDoc method, int index)
87    {
88       String JavaDoc 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 JavaDoc getOperationParameterDescription(Method JavaDoc method, int index)
105    {
106       String JavaDoc 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