public class HostUtil extends Object
Constructor and Description |
---|
HostUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addDomainToServiceEpr(String hostName,
String url,
String appType)
adding domain for service in registry
|
static org.apache.catalina.Host |
addHostToEngine(String hostName)
add host to engine.
|
static void |
addServiceMapping(String epr)
add the service mapping when an actual service got deleted.
|
static void |
addServiceParameter(String url) |
static void |
addServiceUrlMapping(int tenantId,
String serviceName) |
static void |
addWebAppToHost(String hostName,
String uri,
String appType)
It is taken the webApp which is already deployed in
/repository/../webapps and redeploy it within added virtual host.
|
static void |
deleteHostDirectory(String hostName)
edit the host from CATALINA-HOME directory
|
static void |
deleteResourceToRegistry(String host)
deleting resource in registry when deleting host
|
static void |
deleteServiceMapping(String epr)
edit the service mapping when an actual service got deleted.
|
static void |
editHostInEngine(String webAppName,
String newHost,
String oldHost)
delete the existing host with the given name
|
static MappingData[] |
getAllMappingsFromRegistry() |
static String |
getApplicationContextForHost(String hostName)
retrieving host for a specific service
|
static String |
getContextFromUri(String uri)
getting context of the webapp from the uri
|
static String |
getHttpPort() |
static List<String> |
getMappingsPerEppr(String url)
This method is used to retrieve list of host names for a given
webapplication.
|
static List<String> |
getMappingsPerWebApp(String webAppName)
This method is used to retrieve list of host names for a given
webapplication.
|
static String |
getServiceEndpoint(String url)
getting service endpoint from url
|
static String |
getServiceName(String serviceContext) |
static String |
getServiceNameForHost(String hostName)
retrieving host for a specific service
|
static String |
getTenantDomainFromTID(int tenantId) |
static MappingData[] |
getTenantSpecificMappingsFromRegistry(String tenantName) |
static String |
getUrlSuffix() |
static String |
getWebappPath(String webappsDir,
String uri,
String appType) |
static boolean |
isMappingExist(String mappingName)
Find out whether the hostname exists already
|
static boolean |
isMappingLimitExceeded(String webAppName)
This method is used to check if the maximum no of mappings are exceeded
webapplication.
|
static boolean |
isServiceURLPattern(String url)
checking for the pattern of the url for service
|
static void |
removeHost(String hostName)
remove the host from the engine and registry
|
static void |
removeHostForCluster(String hostName) |
static void |
removeServiceMapping(String epr)
remove the service mapping when an actual service got deleted.
|
static void |
removeUrlMappingFromMap(int tenantId,
String serviceName) |
static void |
setUrlSuffix(String urlSuffix) |
static void |
updateEprToRegistry(String newHost,
String oldHost)
update endpoint in the registry for host
|
public static List<String> getMappingsPerWebApp(String webAppName) throws UrlMapperException
webAppName
- the webapp nameUrlMapperException
- throws it when failing to get resource from registrypublic static boolean isMappingLimitExceeded(String webAppName) throws UrlMapperException
webAppName
- the webapp nameUrlMapperException
- throws it when failing to get resource from registrypublic static boolean isMappingExist(String mappingName) throws UrlMapperException
mappingName
- the host name to be mappedUrlMapperException
- throws when error while retrieve from registrypublic static MappingData[] getAllMappingsFromRegistry() throws UrlMapperException
UrlMapperException
public static MappingData[] getTenantSpecificMappingsFromRegistry(String tenantName) throws UrlMapperException
UrlMapperException
public static List<String> getMappingsPerEppr(String url) throws UrlMapperException
url
- UrlMapperException
public static String getServiceNameForHost(String hostName) throws UrlMapperException
hostName
- name of the hostUrlMapperException
public static String getApplicationContextForHost(String hostName) throws UrlMapperException
hostName
- name of the hostUrlMapperException
public static String getHttpPort() throws UrlMapperException
UrlMapperException
public static void addWebAppToHost(String hostName, String uri, String appType) throws UrlMapperException
hostName
- The virtual host nameuri
- The web app to be deployed in the virtual hostUrlMapperException
- When adding directory throws an Exceptionpublic static org.apache.catalina.Host addHostToEngine(String hostName)
hostName
- name of the hostpublic static void deleteHostDirectory(String hostName)
hostName
- public static void editHostInEngine(String webAppName, String newHost, String oldHost) throws UrlMapperException
webAppName
- the associated webapp name of the host to be editedoldHost
- the existing hostname to be editednewHost
- the hostname givenUrlMapperException
- throws when error while removing oldHost or adding newHostpublic static void removeHost(String hostName) throws UrlMapperException
hostName
- name of the host to be removedUrlMapperException
- throws when error while removing context or host from engine
and from registrypublic static void removeHostForCluster(String hostName) throws UrlMapperException
UrlMapperException
public static void deleteServiceMapping(String epr)
epr
- service endpoint of a servicepublic static void removeServiceMapping(String epr)
epr
- service endpoint of a servicepublic static void addServiceMapping(String epr)
epr
- seice endpoint of a servicepublic static void addDomainToServiceEpr(String hostName, String url, String appType) throws UrlMapperException
hostName
- url
- UrlMapperException
public static void addServiceParameter(String url)
public static void updateEprToRegistry(String newHost, String oldHost) throws UrlMapperException
newHost
- new host to be updatedoldHost
- existing old hostUrlMapperException
public static void deleteResourceToRegistry(String host) throws UrlMapperException
host
- hostNameUrlMapperException
public static String getContextFromUri(String uri)
uri
- uri of the actual webapp urlpublic static String getServiceEndpoint(String url) throws UrlMapperException
url
- url of the serviceUrlMapperException
public static boolean isServiceURLPattern(String url)
url
- url of the service invokedpublic static void addServiceUrlMapping(int tenantId, String serviceName)
public static void removeUrlMappingFromMap(int tenantId, String serviceName)
public static String getTenantDomainFromTID(int tenantId)
public static String getUrlSuffix()
public static void setUrlSuffix(String urlSuffix)
Copyright © 2017 WSO2. All rights reserved.