public class CloudUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_AUTHENTICATION |
static String |
DEFAULT_CLOUD_NAME |
static String |
DEFAULT_SESSIONNAME |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCloudToThread(Cloud cloud)
Add cloud to the current thread
|
static void |
addCloudToThread(javax.servlet.http.HttpServletRequest request)
Add cloud from the http session to the current thread
|
static Cloud |
createCloud(javax.servlet.http.HttpServletRequest req)
Create a new cloud in the session based on the info of the request (username/password)
The cloud is stored in the session under the DEFAULT_SESSIONNAME
|
static Cloud |
createCloud(javax.servlet.http.HttpServletRequest req,
String sessionname)
Create a new cloud in the session based on the info of the request (username/password)
|
static Cloud |
createCloud(javax.servlet.http.HttpServletRequest req,
String authenticate,
Map<String,?> loginInfo)
Create a new cloud in the session based on the info of the request (username/password)
|
static Cloud |
createCloud(javax.servlet.http.HttpServletRequest req,
String sessionname,
String authenticate,
Map<String,?> loginInfo)
Create a new cloud in the session based on the info of the request (username/password)
|
static Cloud |
getCloudFromSession(javax.servlet.http.HttpServletRequest request)
Get cloud from session.
|
static Cloud |
getCloudFromSession(javax.servlet.http.HttpServletRequest request,
String sessionname)
Get cloud from session.
|
static Cloud |
getCloudFromThread()
Get cloud from current thread
|
static Map<String,String> |
getUserCredentials(String username,
String password)
Get Map with login credentials to pass to MMbase bridge
|
static boolean |
hasCloud(javax.servlet.http.HttpServletRequest request)
Checks if a cloud is on the session with given the default sessionname.
|
static boolean |
hasCloud(javax.servlet.http.HttpServletRequest request,
String sessionname)
Checks if a cloud is on the session with given sessionname.
|
static boolean |
isEmptyOrWhitespace(String str)
is Empty Or Whitespace.String
|
static void |
removeCloudFromThread()
Remove cloud from current thread
|
public static final String DEFAULT_SESSIONNAME
public static final String DEFAULT_CLOUD_NAME
public static final String DEFAULT_AUTHENTICATION
public static Cloud createCloud(javax.servlet.http.HttpServletRequest req)
req - HttpServletRequestpublic static Cloud createCloud(javax.servlet.http.HttpServletRequest req, String sessionname)
req - HttpServletRequestsessionname - session attribute name to store the cloud in.public static Cloud createCloud(javax.servlet.http.HttpServletRequest req, String authenticate, Map<String,?> loginInfo)
req - HttpServletRequestauthenticate - Authentication method (eg. "name/password")loginInfo - Map with login informationpublic static Cloud createCloud(javax.servlet.http.HttpServletRequest req, String sessionname, String authenticate, Map<String,?> loginInfo)
req - HttpServletRequestsessionname - session attribute name to store the cloud in.authenticate - Authentication method (eg. "name/password")loginInfo - Map with login informationpublic static Map<String,String> getUserCredentials(String username, String password)
username - username for loginpassword - password for loginpublic static Cloud getCloudFromSession(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequestpublic static Cloud getCloudFromSession(javax.servlet.http.HttpServletRequest request, String sessionname)
request - HttpServletRequestsessionname - session attribute name to retrieve the cloud frompublic static boolean hasCloud(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest to search for the cloud.public static boolean hasCloud(javax.servlet.http.HttpServletRequest request,
String sessionname)
request - HttpServletRequest to search for the cloud.sessionname - The name of the cloud on the session.public static void addCloudToThread(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest with the sessionpublic static void addCloudToThread(Cloud cloud)
cloud - cloud to add to threadpublic static void removeCloudFromThread()
public static Cloud getCloudFromThread()
public static boolean isEmptyOrWhitespace(String str)
str - String to check emptinessMMBase 1.9-SNAPSHOT - ${javadoctimestamp}