org.apache.stratos.register.ui.utils
Class TenantConfigUtil

java.lang.Object
  extended by org.apache.stratos.register.ui.utils.TenantConfigUtil

public class TenantConfigUtil
extends Object

Utility methods for tenant configuration


Constructor Summary
TenantConfigUtil()
           
 
Method Summary
static boolean checkDomainAvailability(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletConfig config, javax.servlet.http.HttpSession session)
          Checks the availability of the domain
static org.apache.stratos.tenant.register.stub.beans.xsd.CaptchaInfoBean generateRandomCaptcha(javax.servlet.ServletConfig config, javax.servlet.http.HttpSession session)
          Generates a random captcha
static javax.servlet.http.HttpServletRequest readIntermediateData(javax.servlet.http.HttpServletRequest request, String data)
           
static String registerTenantConfigBean(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletConfig config, javax.servlet.http.HttpSession session)
          Registers the tenant
static String resolveDomainName(String domainNameUserInput)
          Resolves the correct domain name in the form of example.com from the user input domain name.
static void setSubmissionValuesForSession(javax.servlet.http.HttpServletRequest request)
           
static String validateOrSuggestDomain(javax.servlet.ServletConfig config, javax.servlet.http.HttpSession session)
          Validates or suggests the domain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TenantConfigUtil

public TenantConfigUtil()
Method Detail

registerTenantConfigBean

public static String registerTenantConfigBean(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.ServletConfig config,
                                              javax.servlet.http.HttpSession session)
                                       throws org.wso2.carbon.registry.common.ui.UIException
Registers the tenant

Parameters:
request - HttpServletRequest
config - ServletConfig
session - HttpSession
Returns:
String
Throws:
org.wso2.carbon.registry.common.ui.UIException

setSubmissionValuesForSession

public static void setSubmissionValuesForSession(javax.servlet.http.HttpServletRequest request)

checkDomainAvailability

public static boolean checkDomainAvailability(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.ServletConfig config,
                                              javax.servlet.http.HttpSession session)
                                       throws org.wso2.carbon.registry.common.ui.UIException
Checks the availability of the domain

Parameters:
request - HttpServletRequest
config - ServletConfig
session - HttpSession
Returns:
true, if domain is available to register
Throws:
org.wso2.carbon.registry.common.ui.UIException - if failed to check the availability.

validateOrSuggestDomain

public static String validateOrSuggestDomain(javax.servlet.ServletConfig config,
                                             javax.servlet.http.HttpSession session)
                                      throws org.wso2.carbon.registry.common.ui.UIException
Validates or suggests the domain

Parameters:
config - ServletConfig
session - HttpSession
Returns:
domain
Throws:
UIException, - if validating or suggesting the domain failed.
org.wso2.carbon.registry.common.ui.UIException

generateRandomCaptcha

public static org.apache.stratos.tenant.register.stub.beans.xsd.CaptchaInfoBean generateRandomCaptcha(javax.servlet.ServletConfig config,
                                                                                                      javax.servlet.http.HttpSession session)
                                                                                               throws org.wso2.carbon.registry.common.ui.UIException
Generates a random captcha

Parameters:
config - ServletConfig
session - HttpSession
Returns:
CaptchaInfoBean
Throws:
UIException, - if generating the random captcha fails.
org.wso2.carbon.registry.common.ui.UIException

readIntermediateData

public static javax.servlet.http.HttpServletRequest readIntermediateData(javax.servlet.http.HttpServletRequest request,
                                                                         String data)

resolveDomainName

public static String resolveDomainName(String domainNameUserInput)
Resolves the correct domain name in the form of example.com from the user input domain name. Currently strips out "www."and white space. Can add more checks.

Parameters:
domainNameUserInput - the user input domain name
Returns:
the domain after removing (if entered) www. from the input.


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.