001: /*
002:
003: This software is OSI Certified Open Source Software.
004: OSI Certified is a certification mark of the Open Source Initiative.
005:
006: The license (Mozilla version 1.0) can be read at the MMBase site.
007: See http://www.MMBase.org/license
008:
009: */
010:
011: package org.mmbase.bridge;
012:
013: import java.util.Map;
014: import org.mmbase.security.AuthenticationData;
015: import org.mmbase.security.ActionRepository;
016:
017: /**
018: * The collection of clouds and modules within a Java Virtual Machine.
019: *
020: * @author Rob Vermeulen
021: * @author Pierre van Rooden
022: * @author Jaco de Groot
023: * @version $Id: CloudContext.java,v 1.33 2008/02/16 22:13:53 nklasens Exp $
024: */
025: public interface CloudContext {
026:
027: /**
028: * Returns all modules available in this context.
029: *
030: * @return all available modules
031: */
032: public ModuleList getModules();
033:
034: /**
035: * Returns the module with the specified name.
036: *
037: * @param name the name of the module to be returned
038: * @return the requested module
039: * @throws NotFoundException if the specified module could not be found
040: */
041: public Module getModule(String name) throws NotFoundException;
042:
043: /**
044: * Returns whether the module with the specified name is available.
045: *
046: * @param name the name of the module
047: * @return <code>true</code> if the module is available
048: */
049: public boolean hasModule(String name);
050:
051: /**
052:
053: * Returns the cloud with the specified name.
054: *
055: * @param name The name of the cloud to be returned, this is always "mmbase".
056: * @return The requested cloud
057: * @throws NotFoundException if the specified cloud could not be found
058: * @throws SecurityException if no anonymous user can be created
059: */
060: public Cloud getCloud(String name);
061:
062: /**
063: * Returns the cloud with the specified name, with authentication
064: *
065: * @param name The name of the cloud to be returned, always "mmbase".
066: * @param authenticationType The type of authentication, which should be
067: * used by the authentication implementation.
068: * @param loginInfo the user related login information.
069: * @return the requested cloud
070: * @throws NotFoundException if the specified cloud could not be found
071: */
072: public Cloud getCloud(String name, String authenticationType,
073: Map loginInfo) throws NotFoundException;
074:
075: /**
076: * Returns the cloud with the specified name, based on an existing User object (e.g. of another {@link Cloud#getUser}
077: * @param name The name of the cloud to be returned, always "mmbase".
078: * @param user The user object for which this cloud object must be created.
079: * @return the requested cloud
080: * @throws NotFoundException thrown when cloud not found
081: * @since MMBase-1.8
082: */
083: public Cloud getCloud(String name,
084: org.mmbase.security.UserContext user)
085: throws NotFoundException;
086:
087: /**
088: * Returns the names of all the clouds known to the system
089: *
090: * @return A StringList of all clouds names known to our Context
091: */
092: public StringList getCloudNames();
093:
094: /**
095: * Returns the default character encoding, which can be used as a default.
096: *
097: * @return A string with the character encoding
098: * @since MMBase-1.6
099: *
100: */
101: public String getDefaultCharacterEncoding();
102:
103: /**
104: * Returns the default locale setting.
105: *
106: * @return A Locale object
107: * @since MMBase-1.6
108: */
109: public java.util.Locale getDefaultLocale();
110:
111: /**
112: * Returns the default time zone.
113: * @return the default time zone
114: * @since MMBase-1.8
115: */
116: public java.util.TimeZone getDefaultTimeZone();
117:
118: /**
119: * Returns a new, empty field list
120: *
121: * @return The empty list
122: * @since MMBase-1.6
123: */
124: public FieldList createFieldList();
125:
126: /**
127: * Returns a new, empty node list.
128: * Note that it is generally better to use {@link Cloud#createNodeList} or {@link NodeManager#createNodeList}.
129: *
130: * @return The empty list
131: * @since MMBase-1.6
132: */
133: public NodeList createNodeList();
134:
135: /**
136: * Returns a new, empty relation list
137: * Note that it is generally better to use {@link Cloud#createRelationList} or {@link NodeManager#createRelationList}.
138: *
139: * @return The empty list
140: * @since MMBase-1.6
141: */
142: public RelationList createRelationList();
143:
144: /**
145: * Returns a new, empty node manager list
146: * Note that it is generally better to use {@link Cloud#createNodeManagerList}.
147: *
148: * @return The empty list
149: * @since MMBase-1.6
150: */
151: public NodeManagerList createNodeManagerList();
152:
153: /**
154: * Returns a new, empty relation manager list
155: * Note that it is generally better to use {@link Cloud#createRelationManagerList}.
156: *
157: * @return The empty list
158: * @since MMBase-1.6
159: */
160: public RelationManagerList createRelationManagerList();
161:
162: /**
163: * Returns a new, empty module list
164: *
165: * @return The empty list
166: * @since MMBase-1.6
167: */
168: public ModuleList createModuleList();
169:
170: /**
171: * Returns a new, empty string list
172: *
173: * @return The empty list
174: * @since MMBase-1.6
175: */
176: public StringList createStringList();
177:
178: /**
179: * Acquired information about the currently configuration Authentication implementation.
180: * @return current Authentication information
181: * @since MMBase-1.8
182: */
183: public AuthenticationData getAuthentication();
184:
185: /**
186: * Returns the Repository with actions
187: * @return Repository with actions
188: * @since MMBase-1.9
189: */
190: public ActionRepository getActionRepository();
191:
192: /**
193: * Returns whether MMbase is up and running
194: * @return <code>true</code> when mmbase is running
195: * @since MMBase-1.8
196: */
197: public boolean isUp();
198:
199: /**
200: * Assert whether MMbase is up and running. This will wait until it is.
201: * @since MMBase-1.8
202: */
203: public void assertUp();
204: }
|