KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > adaptor > http > HttpAdaptorMBean


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.http;
10
11 import java.io.IOException JavaDoc;
12 import java.util.Date JavaDoc;
13 import javax.management.MalformedObjectNameException JavaDoc;
14 import javax.management.ObjectName JavaDoc;
15
16 import mx4j.tools.adaptor.AdaptorServerSocketFactory;
17
18 /**
19  * Management interface for the HttpAdaptor MBean.
20  *
21  * @version $Revision: 1.3 $
22  */

23 public interface HttpAdaptorMBean
24 {
25    /**
26     * Sets the value of the server's port
27     *
28     * @param port the new port's value
29     */

30    public void setPort(int port);
31
32    /**
33     * Returns the port where the server is running on. Default is 8080
34     *
35     * @return HTTPServer's port
36     */

37    public int getPort();
38
39    /**
40     * Sets the host name where the server will be listening
41     *
42     * @param host Server's host
43     */

44    public void setHost(java.lang.String JavaDoc host);
45
46    /**
47     * Return the host name the server will be listening to. If null the server listen at the localhost
48     *
49     * @return the current hostname
50     */

51    java.lang.String JavaDoc getHost();
52
53    /**
54     * Sets the Authentication Method.
55     *
56     * @param method none/basic/digest
57     */

58    public void setAuthenticationMethod(String JavaDoc method);
59
60    /**
61     * Authentication Method
62     *
63     * @return authentication method
64     */

65    public String JavaDoc getAuthenticationMethod();
66
67    /**
68     * Sets the object which will post process the XML results.
69     * The last value set between the setPostProcessor and setPostProcessorName will be the valid one
70     *
71     * @param processor a Post processor object
72     */

73    public void setProcessor(ProcessorMBean processor);
74
75    /**
76     * Returns the Processor set by {@link #setProcessor}
77     */

78    public ProcessorMBean getProcessor();
79
80    /**
81     * Sets the classname of the object which will post process the XML results.
82     * The adaptor will try to build the object and use the processor name ObjectName to register it.
83     * The class name has to implements mx4j.tools.adaptor.http.ProcessorMBean and be MBean compliant
84     *
85     * @param processorClass a Post processor object
86     */

87    public void setProcessorClass(String JavaDoc processorClass);
88
89    /**
90     * Sets the object name of the PostProcessor MBean. If ProcessorClass is set the processor will be created
91     *
92     * @param processorName a Post processor object
93     */

94    public void setProcessorNameString(String JavaDoc processorName) throws MalformedObjectNameException JavaDoc;
95
96    /**
97     * Sets the object name which will post process the XML result. The last value set between the setPostProcessor and setPostProcessorName will be the valid one. The MBean will be verified to be of instance HttpPostProcessor
98     *
99     * @param processorName The new processorName value
100     */

101    public void setProcessorName(ObjectName JavaDoc processorName);
102
103    /**
104     * Returns the ObjectName of the processor set by {@link #setProcessorName}
105     */

106    public ObjectName JavaDoc getProcessorName();
107
108    /**
109     * Sets the object which create the server sockets
110     *
111     * @param factory the socket factory
112     */

113    public void setSocketFactory(AdaptorServerSocketFactory factory);
114
115    /**
116     * Sets the factory's object name which will create the server sockets
117     *
118     * @param factoryName the socket factory
119     */

120    public void setSocketFactoryName(ObjectName JavaDoc factoryName);
121
122    /**
123     * Sets the factory's object name which will create the server sockets
124     *
125     * @param factoryName the socket factory
126     */

127    public void setSocketFactoryNameString(String JavaDoc factoryName) throws MalformedObjectNameException JavaDoc;
128
129    /**
130     * Indicates whether the server's running
131     *
132     * @return The active value
133     */

134    public boolean isActive();
135
136    /**
137     * Starting date
138     *
139     * @return The date when the server was started
140     */

141    public Date JavaDoc getStartDate();
142
143    /**
144     * Requests count
145     *
146     * @return The total of requests served so far
147     */

148    public long getRequestsCount();
149
150    /**
151     * Gets the HttpAdaptor version
152     *
153     * @return HttpAdaptor's version
154     */

155    public String JavaDoc getVersion();
156
157    /**
158     * Adds a command processor object
159     */

160    public void addCommandProcessor(String JavaDoc path, HttpCommandProcessor processor);
161
162    /**
163     * Adds a command processor object by class
164     */

165    public void addCommandProcessor(String JavaDoc path, String JavaDoc processorClass);
166
167    /**
168     * Removes a command processor object by class
169     */

170    public void removeCommandProcessor(String JavaDoc path);
171
172    /**
173     * Starts the server
174     */

175    public void start() throws IOException JavaDoc;
176
177    /**
178     * Stops the HTTP daemon
179     */

180    public void stop();
181
182    /**
183     * Adds an authorization pair as username/password
184     */

185    public void addAuthorization(String JavaDoc username, String JavaDoc password);
186 }
187
Popular Tags