org.wso2.registry.servlet.utils
Class Utils

java.lang.Object
  extended by org.wso2.registry.servlet.utils.Utils

public class Utils
extends java.lang.Object


Constructor Summary
Utils()
           
 
Method Summary
static java.util.Map getParameters(java.lang.String queryString)
          Extract the paramters from the query string.
static UserRegistry getSecureRegistry(javax.servlet.http.HttpServletRequest request)
          Returns the registry associated with the current session.
static boolean isLoggedIn(javax.servlet.http.HttpServletRequest request)
           
static void logInUser(javax.servlet.http.HttpServletRequest request, java.lang.String userName, java.lang.String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getParameters

public static java.util.Map getParameters(java.lang.String queryString)
Extract the paramters from the query string. e.g. for the URL http://localhost:8080/registry/d1/myresource?action=tag,tag_value=support project we have the query string "action=tag,tag_value=support project" it should be extracted to map as key=action, value=tag key=tag_value, value=support project

Parameters:
queryString - query string of the URL
Returns:
Map containg paramter name --> paramter value pairs

getSecureRegistry

public static UserRegistry getSecureRegistry(javax.servlet.http.HttpServletRequest request)
                                      throws RegistryException
Returns the registry associated with the current session. If a user registry is not found, new SecureRegistry instance is created with annoymous user and associated for the current session.

Parameters:
request - Servlet request
Returns:
SecureRegistry instance for the current session.
Throws:
RegistryException - : if something went wrong

isLoggedIn

public static boolean isLoggedIn(javax.servlet.http.HttpServletRequest request)

logInUser

public static void logInUser(javax.servlet.http.HttpServletRequest request,
                             java.lang.String userName,
                             java.lang.String password)
                      throws RegistryException
Throws:
RegistryException


Copyright © 2007 Apache Web Services Project. All Rights Reserved.