org.mmbase.bridge
Interface CloudContext

All Known Implementing Classes:
AbstractCloudContext, BasicCloudContext, LocalContext, MockCloudContext, org.mmbase.bridge.remote.proxy.RemoteCloudContext_Proxy, UriRemoteCloudContext_Proxy

public interface CloudContext

A CloudContext is the general 'factory' for a MMBase bridge implementation. A CloudContext object can be aquired by the static methods of ContextProvider. The methods which are used mostly are getCloud(String) to have an 'anonymous' Cloud which normally suffices for readonly acces and getCloud(String, String, Map) returns an Authenticationed Cloud.

Version:
$Id: CloudContext.java 42917 2010-07-15 17:01:52Z michiel $
Author:
Rob Vermeulen, Pierre van Rooden, Jaco de Groot

Method Summary
 CloudContext assertUp()
          Assert whether MMbase is up and running.
 FieldList createFieldList()
          Returns a new, empty field list
 ModuleList createModuleList()
          Returns a new, empty module list
 NodeList createNodeList()
          Returns a new, empty node list.
 NodeManagerList createNodeManagerList()
          Returns a new, empty node manager list Note that it is generally better to use Cloud.createNodeManagerList().
 RelationList createRelationList()
          Returns a new, empty relation list Note that it is generally better to use Cloud.createRelationList() or NodeManager.createRelationList().
 RelationManagerList createRelationManagerList()
          Returns a new, empty relation manager list Note that it is generally better to use Cloud.createRelationManagerList().
 StringList createStringList()
          Returns a new, empty string list
 ActionRepository getActionRepository()
          Returns the Repository with actions
 AuthenticationData getAuthentication()
          Acquires information about the currently configuration Authentication implementation.
 Cloud getCloud(String name)
          Returns the cloud with the specified name.
 Cloud getCloud(String name, String authenticationType, Map<String,?> loginInfo)
          Returns the cloud with the specified name, with authentication
 Cloud getCloud(String name, UserContext user)
          Returns the cloud with the specified name, based on an existing User object.
 StringList getCloudNames()
          Returns the names of all the clouds known to the system.
 String getDefaultCharacterEncoding()
          Returns the default character encoding, which can be used as a default.
 Locale getDefaultLocale()
          Returns the default locale setting.
 TimeZone getDefaultTimeZone()
          Returns the default time zone.
 Module getModule(String name)
          Returns the module with the specified name.
 ModuleList getModules()
          Returns all modules available in this context.
 SearchQueryHandler getSearchQueryHandler()
           
 String getUri()
          The String which was usesd, and could be used again to acquire this cloud context using ContextProvider.getCloudContext(String).
 boolean hasModule(String name)
          Returns whether the module with the specified name is available.
 boolean isUp()
          Returns whether MMbase is up and running
 

Method Detail

getModules

ModuleList getModules()
Returns all modules available in this context.

Returns:
all available modules

getModule

Module getModule(String name)
                 throws NotFoundException
Returns the module with the specified name.

Parameters:
name - the name of the module to be returned
Returns:
the requested module
Throws:
NotFoundException - if the specified module could not be found

hasModule

boolean hasModule(String name)
Returns whether the module with the specified name is available.

Parameters:
name - the name of the module
Returns:
true if the module is available

getCloud

Cloud getCloud(String name)
Returns the cloud with the specified name. The available cloud names are returned by getCloudNames().

Parameters:
name - The name of the cloud to be returned, this is very often "mmbase".
Returns:
The requested cloud
Throws:
NotFoundException - if the specified cloud could not be found
SecurityException - if no anonymous user can be created

getCloud

Cloud getCloud(String name,
               String authenticationType,
               Map<String,?> loginInfo)
               throws NotFoundException
Returns the cloud with the specified name, with authentication

Parameters:
name - The name of the cloud to be returned. See getCloudNames()
authenticationType - The type of authentication, which should be used by the authentication implementation.. This is one of the strings returned by getAuthentication().AuthenticationData.getTypes(). Typically, 'anonymous', 'class' and 'name/password' are supported.
loginInfo - The required user information and credentials. What exactly is required, depends on the Authentication implementation, and the value of the authenticationType parameter. If no credentials are needed null can be specified (This for example is the case with authenticationType 'class'). It is possible to create this Map using #getAuthentcation.AuthenticationData.createParameters(String).Parameters.toMap(java.util.Map). That e.g. makes it possible to know beforehand what keys can be used in the loginInfo Map, given a certain authenticationType.
Returns:
the requested cloud
Throws:
NotFoundException - if the specified cloud could not be found

getCloud

Cloud getCloud(String name,
               UserContext user)
               throws NotFoundException
Returns the cloud with the specified name, based on an existing User object. This user object may originate from a call to Cloud.getUser() or directly from Authentication.login(java.lang.String, java.util.Map, java.lang.Object[])). The security implementation may depend on implementation details of this UserContext.

Parameters:
name - The name of the cloud to be returned. See getCloudNames().
user - The user object for which this cloud object must be created. Many security implementation require this object to be created by themselves.
Returns:
the requested cloud
Throws:
NotFoundException - thrown when cloud not found
Since:
MMBase-1.8

getCloudNames

StringList getCloudNames()
Returns the names of all the clouds known to the system. Most bridge implementations return a list with one entry 'mmbase'.

Returns:
A StringList of all clouds names known to our Context

getDefaultCharacterEncoding

String getDefaultCharacterEncoding()
Returns the default character encoding, which can be used as a default. E.g. 'UTF-8'. This is a setting in MMBase which you may want to access. It is nowadays of little importance, and you can ignore it and simply always use UTF-8 or so.

Returns:
A string with the character encoding
Since:
MMBase-1.6

getDefaultLocale

Locale getDefaultLocale()
Returns the default locale setting. This may correspond to the JVM default, but it also may not. The point is that the JVM may be shared by other applications. It corresponds to a property of the mmbase module (in 'mmbaseroot.xml').

Returns:
A Locale object
Since:
MMBase-1.6

getDefaultTimeZone

TimeZone getDefaultTimeZone()
Returns the default time zone. This may or may not correspond to the JVM default. It corresponds to a property of the mmbase module (in 'mmbaseroot.xml').

Returns:
the default time zone
Since:
MMBase-1.8

createFieldList

FieldList createFieldList()
Returns a new, empty field list

Returns:
The empty list
Since:
MMBase-1.6

createNodeList

NodeList createNodeList()
Returns a new, empty node list. Note that it is generally better to use Cloud.createNodeList() or NodeManager.createNodeList(), because then the object can be properly associated with a Cloud.

Returns:
The empty list
Since:
MMBase-1.6

createRelationList

RelationList createRelationList()
Returns a new, empty relation list Note that it is generally better to use Cloud.createRelationList() or NodeManager.createRelationList().

Returns:
The empty list
Since:
MMBase-1.6

createNodeManagerList

NodeManagerList createNodeManagerList()
Returns a new, empty node manager list Note that it is generally better to use Cloud.createNodeManagerList().

Returns:
The empty list
Since:
MMBase-1.6

createRelationManagerList

RelationManagerList createRelationManagerList()
Returns a new, empty relation manager list Note that it is generally better to use Cloud.createRelationManagerList().

Returns:
The empty list
Since:
MMBase-1.6

createModuleList

ModuleList createModuleList()
Returns a new, empty module list

Returns:
The empty list
Since:
MMBase-1.6

createStringList

StringList createStringList()
Returns a new, empty string list

Returns:
The empty list
Since:
MMBase-1.6

getAuthentication

AuthenticationData getAuthentication()
Acquires information about the currently configuration Authentication implementation.

Returns:
current Authentication information
Since:
MMBase-1.8

getActionRepository

ActionRepository getActionRepository()
Returns the Repository with actions

Returns:
Repository with actions
Since:
MMBase-1.9

isUp

boolean isUp()
Returns whether MMbase is up and running

Returns:
true when mmbase is running
Since:
MMBase-1.8

assertUp

CloudContext assertUp()
Assert whether MMbase is up and running. This will wait until it is.

Since:
MMBase-1.8

getUri

String getUri()
The String which was usesd, and could be used again to acquire this cloud context using ContextProvider.getCloudContext(String).

Since:
MMBase-1.9

getSearchQueryHandler

SearchQueryHandler getSearchQueryHandler()
Since:
MMBase-2.0


MMBase 2.0-SNAPSHOT - null