001: // ServerInterface.java
002: // $Id: ServerInterface.java,v 1.9 2002/08/27 12:34:51 ylafon Exp $
003: // (c) COPYRIGHT MIT and INRIA, 1996.
004: // Please first read the full copyright statement in file COPYRIGHT.html
005:
006: package org.w3c.tools.resources;
007:
008: import java.net.URL;
009: import java.io.File;
010: import org.w3c.util.ObservableProperties;
011: import org.w3c.jigsaw.daemon.ServerHandler;
012: import org.w3c.tools.resources.indexer.IndexersCatalog;
013: import org.w3c.tools.resources.store.ResourceStoreManager;
014:
015: //FIXME ServerHandler should be in this package
016: public interface ServerInterface extends ServerHandler {
017:
018: /**
019: * Another nice way of reporting errors from a Resource.
020: * @param from The resource that trigered the error.
021: * @param msg The error message.
022: */
023: public void errlog(Resource from, String msg);
024:
025: /**
026: * Lookup in the root entry for some resource.
027: * @param name The name of the resource to lookup in the root entry.
028: * @return The loaded resource, or <strong>null</strong>.
029: */
030: public ResourceReference loadResource(String name);
031:
032: /**
033: * Checkpoint all cached data, by saving them to disk.
034: */
035: public void checkpoint();
036:
037: /**
038: * Dynamically change the root resource for the server.
039: * This is kind a dangerous operation !
040: * @param name The name of the new root resource, to be found in the
041: * root entry.
042: * @return The new installed root resource, or <strong>null</strong>
043: * if we couldn't load the given resource.
044: */
045: public ResourceReference loadRoot(String name);
046:
047: /**
048: * Get this server properties.
049: */
050: public ObservableProperties getProperties();
051:
052: /**
053: * Is the underlying file-system case sensitive ?
054: * @return A boolean, <strong>true</strong> if file system is case
055: * sensitive, <strong>false</strong> otherwise.
056: */
057: public boolean checkFileSystemSensitivity();
058:
059: /**
060: * Get the full URL of Jigsaw's documentation.
061: * @return A String encoded URL.
062: */
063: public String getDocumentationURL();
064:
065: /**
066: * Get the tracsh directory
067: */
068: public String getTrashDirectory();
069:
070: /**
071: * Get the client's debug flags from the properties.
072: */
073: public boolean getClientDebug();
074:
075: /**
076: * Does this server wants clients to try keeping connections alive ?
077: */
078: public boolean getClientKeepConnection();
079:
080: /**
081: * Get the request allowed time slice from the properties.
082: */
083: public int getRequestTimeOut();
084:
085: /**
086: * Get the connection allowed idle time from the properties.
087: */
088: public int getConnectionTimeOut();
089:
090: /**
091: * Get the client's threads priority from the properties.
092: */
093: public int getClientThreadPriority();
094:
095: /**
096: * Get the client's buffer size.
097: */
098: public int getClientBufferSize();
099:
100: /**
101: * Get this server host name.
102: */
103: public String getHost();
104:
105: /**
106: * Get this server port number.
107: */
108: public int getPort();
109:
110: /**
111: * Get the server current root resource.
112: */
113: public FramedResource getRoot();
114:
115: /**
116: * Get the server URL.
117: */
118: public URL getURL();
119:
120: /**
121: * Get the server software string.
122: */
123: public String getSoftware();
124:
125: /**
126: * Get the server local port
127: */
128: public int getLocalPort();
129:
130: /**
131: * Get this server root directory.
132: */
133: public File getRootDirectory();
134:
135: /**
136: * Get this server config directory.
137: */
138: public File getConfigDirectory();
139:
140: /**
141: * Get this server authentication directory.
142: */
143: public File getAuthDirectory();
144:
145: /**
146: * Get this server store directory.
147: */
148: public File getStoreDirectory();
149:
150: public File getIndexerDirectory();
151:
152: /**
153: * Get temp directory
154: */
155: public File getTempDirectory();
156:
157: public IndexersCatalog getIndexersCatalog();
158:
159: /**
160: * Get this server resource space.
161: */
162: public ResourceSpace getResourceSpace();
163:
164: /**
165: * Get the default resource context for that server.
166: */
167: public ResourceContext getDefaultContext();
168:
169: /**
170: * Get the Resource store manager of this server
171: */
172: public ResourceStoreManager getResourceStoreManager();
173:
174: /**
175: * Perform the given request on behalf of this server.
176: * @param request The request to perform.
177: * @return A non-null Reply instance.
178: * @exception ProtocolException If some error occurs during processing the
179: * request.
180: * @exception ResourceException If some error not relative to the
181: * protocol occurs.
182: */
183: public ReplyInterface perform(RequestInterface request)
184: throws ProtocolException, ResourceException;
185:
186: }
|