org.mmbase.bridge.implementation
Class BasicCloudContext

java.lang.Object
  extended by org.mmbase.bridge.implementation.BasicCloudContext
All Implemented Interfaces:
CloudContext
Direct Known Subclasses:
LocalContext

public abstract class BasicCloudContext
extends Object
implements CloudContext

This is the base class for LocalContext (which is probably its only descendant). Some of the (static) members are package, and hence are easily accessible by other implementors of the 'local' cloud in the current package org.mmbase.bridge.implementation.

Version:
$Id: BasicCloudContext.java,v 1.62 2008/09/23 16:31:20 michiel Exp $
Author:
Rob Vermeulen, Pierre van Rooden

Constructor Summary
protected BasicCloudContext()
          constructor to call from the MMBase class (protected, so cannot be reached from a script)
 
Method Summary
 CloudContext assertUp()
          Assert whether MMbase is up and running.
protected  boolean check()
           
protected  void checkExists(String cloudName)
           
 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()
          Acquired information about the currently configuration Authentication implementation.
 Cloud getCloud(String cloudName)
          Returns the cloud with the specified name.
 Cloud getCloud(String cloudName, String authenticationType, Map<String,?> loginInfo)
          Returns the cloud with the specified name, with authentication
 Cloud getCloud(String cloudName, UserContext user)
          Returns the cloud with the specified name, based on an existing User object (e.g. of another Cloud.getUser()
 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 moduleName)
          Returns the module with the specified name.
 ModuleList getModules()
          Returns all modules available in this context.
 boolean hasModule(String moduleName)
          Returns whether the module with the specified name is available.
 boolean isUp()
          Returns whether MMbase is up and running
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.CloudContext
getUri
 

Constructor Detail

BasicCloudContext

protected BasicCloudContext()
constructor to call from the MMBase class (protected, so cannot be reached from a script)

Method Detail

check

protected boolean check()
Throws:
NotFoundException - If mmbase not running and cannot be started because mmbase.config missing
BridgeException - If mmbase not running and cannot be started (but mmbase.config was specified)

getModules

public ModuleList getModules()
Description copied from interface: CloudContext
Returns all modules available in this context.

Specified by:
getModules in interface CloudContext
Returns:
all available modules

getModule

public Module getModule(String moduleName)
                 throws NotFoundException
Description copied from interface: CloudContext
Returns the module with the specified name.

Specified by:
getModule in interface CloudContext
Parameters:
moduleName - the name of the module to be returned
Returns:
the requested module
Throws:
NotFoundException - if the specified module could not be found

hasModule

public boolean hasModule(String moduleName)
Description copied from interface: CloudContext
Returns whether the module with the specified name is available.

Specified by:
hasModule in interface CloudContext
Parameters:
moduleName - the name of the module
Returns:
true if the module is available

checkExists

protected void checkExists(String cloudName)
                    throws NotFoundException
Throws:
NotFoundException

getCloud

public Cloud getCloud(String cloudName)
Description copied from interface: CloudContext
Returns the cloud with the specified name.

Specified by:
getCloud in interface CloudContext
Parameters:
cloudName - The name of the cloud to be returned, this is always "mmbase".
Returns:
The requested cloud

getCloud

public Cloud getCloud(String cloudName,
                      String authenticationType,
                      Map<String,?> loginInfo)
               throws NotFoundException
Description copied from interface: CloudContext
Returns the cloud with the specified name, with authentication

Specified by:
getCloud in interface CloudContext
Parameters:
cloudName - The name of the cloud to be returned, always "mmbase".
authenticationType - The type of authentication, which should be used by the authentication implementation.
loginInfo - the user related login information.
Returns:
the requested cloud
Throws:
NotFoundException - if the specified cloud could not be found

getCloud

public Cloud getCloud(String cloudName,
                      UserContext user)
               throws NotFoundException
Description copied from interface: CloudContext
Returns the cloud with the specified name, based on an existing User object (e.g. of another Cloud.getUser()

Specified by:
getCloud in interface CloudContext
Parameters:
cloudName - The name of the cloud to be returned, always "mmbase".
user - The user object for which this cloud object must be created.
Returns:
the requested cloud
Throws:
NotFoundException - thrown when cloud not found

getCloudNames

public StringList getCloudNames()
Description copied from interface: CloudContext
Returns the names of all the clouds known to the system

Specified by:
getCloudNames in interface CloudContext
Returns:
A StringList of all clouds names known to our Context

getDefaultCharacterEncoding

public String getDefaultCharacterEncoding()
Description copied from interface: CloudContext
Returns the default character encoding, which can be used as a default.

Specified by:
getDefaultCharacterEncoding in interface CloudContext
Returns:
String describing the encoding.
Since:
MMBase-1.6

getDefaultLocale

public Locale getDefaultLocale()
Description copied from interface: CloudContext
Returns the default locale setting.

Specified by:
getDefaultLocale in interface CloudContext
Returns:
A Locale object

getDefaultTimeZone

public TimeZone getDefaultTimeZone()
Description copied from interface: CloudContext
Returns the default time zone.

Specified by:
getDefaultTimeZone in interface CloudContext
Returns:
the default time zone

createFieldList

public FieldList createFieldList()
Description copied from interface: CloudContext
Returns a new, empty field list

Specified by:
createFieldList in interface CloudContext
Returns:
The empty list

createNodeList

public NodeList createNodeList()
Description copied from interface: CloudContext
Returns a new, empty node list. Note that it is generally better to use Cloud.createNodeList() or NodeManager.createNodeList().

Specified by:
createNodeList in interface CloudContext
Returns:
The empty list

createRelationList

public RelationList createRelationList()
Description copied from interface: CloudContext
Returns a new, empty relation list Note that it is generally better to use Cloud.createRelationList() or NodeManager.createRelationList().

Specified by:
createRelationList in interface CloudContext
Returns:
The empty list

createNodeManagerList

public NodeManagerList createNodeManagerList()
Description copied from interface: CloudContext
Returns a new, empty node manager list Note that it is generally better to use Cloud.createNodeManagerList().

Specified by:
createNodeManagerList in interface CloudContext
Returns:
The empty list

createRelationManagerList

public RelationManagerList createRelationManagerList()
Description copied from interface: CloudContext
Returns a new, empty relation manager list Note that it is generally better to use Cloud.createRelationManagerList().

Specified by:
createRelationManagerList in interface CloudContext
Returns:
The empty list

createModuleList

public ModuleList createModuleList()
Description copied from interface: CloudContext
Returns a new, empty module list

Specified by:
createModuleList in interface CloudContext
Returns:
The empty list

createStringList

public StringList createStringList()
Description copied from interface: CloudContext
Returns a new, empty string list

Specified by:
createStringList in interface CloudContext
Returns:
The empty list

getAuthentication

public AuthenticationData getAuthentication()
                                     throws NotFoundException
Description copied from interface: CloudContext
Acquired information about the currently configuration Authentication implementation.

Specified by:
getAuthentication in interface CloudContext
Returns:
current Authentication information
Throws:
NotFoundException

getActionRepository

public ActionRepository getActionRepository()
                                     throws NotFoundException
Description copied from interface: CloudContext
Returns the Repository with actions

Specified by:
getActionRepository in interface CloudContext
Returns:
Repository with actions
Throws:
NotFoundException

isUp

public boolean isUp()
Description copied from interface: CloudContext
Returns whether MMbase is up and running

Specified by:
isUp in interface CloudContext
Returns:
true when mmbase is running

assertUp

public CloudContext assertUp()
Description copied from interface: CloudContext
Assert whether MMbase is up and running. This will wait until it is.

Specified by:
assertUp in interface CloudContext


MMBase build 1.9.0.20081107