001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/component/tags/sakai_2-4-1/component-api/api/src/java/org/sakaiproject/component/api/ServerConfigurationService.java $
003: * $Id: ServerConfigurationService.java 22311 2007-03-08 03:36:41Z ggolden@umich.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006, 2007 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.component.api;
021:
022: import java.util.List;
023:
024: /**
025: * <p>
026: * ServerConfigurationService provides information about how the server is configured.
027: * </p>
028: */
029: public interface ServerConfigurationService {
030: /** This string can be used to find the service in the service manager. */
031: public static final String SERVICE_NAME = ServerConfigurationService.class
032: .getName();
033:
034: /** Key in the ThreadLocalManager for the serverUrl based on the current request. */
035: final static String CURRENT_SERVER_URL = "sakai:request.server.url";
036:
037: /** Key in the ThreadLocalManager for the path based on the current request. */
038: final static String CURRENT_PORTAL_PATH = "sakai:request.portal.path";
039:
040: /**
041: * Access the unique (to the cluster) id of the server.
042: *
043: * @return The unique (to the cluster) id of the server.
044: */
045: String getServerId();
046:
047: /**
048: * Access the unique (to the cluster) instance id of the server.
049: *
050: * @return The unique (to the cluster) instance id of the server.
051: */
052: String getServerInstance();
053:
054: /**
055: * Access the combined server / instance id.
056: *
057: * @return The combined server / instance id.
058: */
059: String getServerIdInstance();
060:
061: /**
062: * Access the server DNS name.
063: *
064: * @return The server DNS name.
065: */
066: String getServerName();
067:
068: /**
069: * Access the URL to the root of the server - append any additional path to the end.
070: *
071: * @return The URL to the root of the server.
072: */
073: String getServerUrl();
074:
075: /**
076: * Access the URL to the help service on the server - append in the path the tool well known id for context sensitive help.
077: *
078: * @param helpContext
079: * The context string.
080: * @return The URL to the help service on the server.
081: */
082: String getHelpUrl(String helpContext);
083:
084: /**
085: * Access the URL to the access service on the server - append any additional path to the end.
086: *
087: * @return The URL to the access service on the server.
088: */
089: String getAccessUrl();
090:
091: /**
092: * Access the path to the access service on the server relative to the base URL for the server.
093: *
094: * @return The path to the access service on the server.
095: */
096: String getAccessPath();
097:
098: /**
099: * Access the URL to the portal service on the server - append any additional path to the end.
100: *
101: * @return The URL to the portal service on the server.
102: */
103: String getPortalUrl();
104:
105: /**
106: * Access the URL to the tool dispatcher service on the server - append any additional path to the end.
107: *
108: * @return The URL to the tool dispatcher service on the server.
109: */
110: String getToolUrl();
111:
112: /**
113: * Access the site id for the gateway (public) site.
114: *
115: * @return The site id for the gateway (public) site.
116: */
117: String getGatewaySiteId();
118:
119: /**
120: * Access the URL to use as a redirect when the user has logged out.
121: *
122: * @return The URL to use as a redirect when the user has logged out.
123: */
124: String getLoggedOutUrl();
125:
126: /**
127: * Access the URL to the user's "home" (My Workspace) in the service.
128: *
129: * @return The URL to the user's "home" (My Workspace) in the service.
130: */
131: String getUserHomeUrl();
132:
133: /**
134: * Access the file path to the "sakai home" on the app server.
135: *
136: * @return The file path to the "sakai home" on the app server.
137: */
138: String getSakaiHomePath();
139:
140: /**
141: * Access some named configuration value as a string.
142: *
143: * @param name
144: * The configuration value name.
145: * @return The configuration value with this name, or "" if not found.
146: */
147: String getString(String name);
148:
149: /**
150: * Access some named configuration value as a string.
151: *
152: * @param name
153: * The configuration value name.
154: * @param dflt
155: * The value to return if not found.
156: * @return The configuration value with this name, or the default value if not found.
157: */
158: String getString(String name, String dflt);
159:
160: /**
161: * Access some named configuration values as an array of strings. The name is the base name. name + ".count" must be defined to be a positive integer - how many are defined. name + "." + i (1..count) must be defined to be the values.
162: *
163: * @param name
164: * The configuration value name base.
165: * @return The configuration value with this name, or the null if not found.
166: */
167: String[] getStrings(String name);
168:
169: /**
170: * Access some named configuration value as an int.
171: *
172: * @param name
173: * The configuration value name.
174: * @param dflt
175: * The value to return if not found.
176: * @return The configuration value with this name, or the default value if not found.
177: */
178: int getInt(String name, int dflt);
179:
180: /**
181: * Access some named configuration value as a boolean.
182: *
183: * @param name
184: * The configuration value name.
185: * @param dflt
186: * The value to return if not found.
187: * @return The configuration value with this name, or the default value if not found.
188: */
189: boolean getBoolean(String name, boolean dflt);
190:
191: /**
192: * Access the list of tool ids in order for this category, to impose on the displays of many tools
193: *
194: * @param category
195: * The tool category
196: * @return An ordered list of tool ids (String) indicating the desired tool display order, or an empty list if there are none for this category.
197: */
198: List getToolOrder(String category);
199:
200: /**
201: * Access the list of tool ids that are required for this category.
202: *
203: * @param category
204: * The tool category.
205: * @return A list of tool ids (String) that are required for this category, or an empty list if there are none for this category.
206: */
207: List getToolsRequired(String category);
208:
209: /**
210: * Access the list of tool ids that are selected by default for this category.
211: *
212: * @param category
213: * The tool category.
214: * @return A list of tool ids (String) for this category to use by default, or an empty list if there are none for this category.
215: */
216: List getDefaultTools(String category);
217: }
|