01: package org.enhydra.server;
02:
03: import java.util.Hashtable;
04:
05: /**
06: *
07: * <p>Description: This interface bridges the gap between Application
08: * Server (Servlet Container) and Enhydra Server. Application Server must have
09: * appropriate class, that implement this interface. That class is responsible
10: * to call <code>EnhydraServer.startup()</code> after application server
11: * initialization. It enable EnhydraServer to add/remove connections and
12: * start/stop applications into Application Server.</p>
13: * <p>Copyright: Copyright (c) 2002</p>
14: * <p>Company: </p>
15: * @author Damir Milovic, damir@uns.ns.ac.yu
16: * @version 1.1 date: 9.12.2002
17: */
18:
19: public interface ApplicationServer {
20: /**
21: * @return Application Server name.
22: */
23: public String getName();
24:
25: /**
26: *
27: * @return Application Server version.
28: */
29: public String getVersion();
30:
31: /**
32: * @return Application Server short description.
33: */
34: public String getInfo();
35:
36: /**
37: * Start application.
38: * @param appName Application name.
39: * @return <code>true</code> if succeed, else <code>false</code>.
40: */
41: public boolean startApp(String appName);
42:
43: /**
44: * Stop application.
45: * @param appName application name.
46: * @return <code>true</code> if succeed, else <code>false</code>.
47: */
48: public boolean stopApp(String appName);
49:
50: /**
51: * @return String representation of connection types that application server support.
52: */
53: public String[] getConnectionTypes();
54:
55: /**
56: * Add a new connection for listening requests.
57: * @param type connection type (e.g "http")
58: * @param portNumber port number.
59: * @return <code>true</code> if succeed, else <code>false</code>.
60: */
61: public boolean addConnection(String type, String portNumber);
62:
63: /**
64: * Add a new https connection for listening requests
65: * @param type connection type (e.g "https")
66: * @param portNumber port number.
67: * @param password password needed for "https" connection.
68: * @param pathToKeyStoreFile pathname of the keystore file where you have
69: * stored the server certificate to be loaded
70: * @return <code>true</code> if succeed, else <code>false</code>.
71: */
72: public boolean addConnection(String type, String portNumber,
73: String password, String pathToKeyStoreFile);
74:
75: /**
76: * Remove connection for listening requests.
77: * @param port connection port number.
78: * @return <code>true</code> if succeed, else <code>false</code>.
79: */
80: public boolean removeConnection(String portNumber);
81:
82: /**
83: * Get currently active connections.
84: * @return key,value pairs (key = port, value = value)
85: */
86: public Hashtable getConnections();
87:
88: /**
89: * Shutdown Application Server
90: */
91: public void stop();
92:
93: }
|