Class VHostUtils
- java.lang.Object
-
- org.wso2.carbon.apimgt.impl.utils.VHostUtils
-
public class VHostUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description VHostUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.wso2.carbon.apimgt.api.model.VHost
getVhostFromEnvironment(org.wso2.carbon.apimgt.api.model.Environment environment, String host)
Get VHost object of given environment and given host namestatic String
resolveIfDefaultVhostToNull(String environmentName, String vhost)
Resolve vhost to null if the given vhost is the default (first) vhost of read only environmentstatic String
resolveIfNullToDefaultVhost(String environmentName, String vhost)
Resolve vhost to default vhost if the given vhost is null
-
-
-
Method Detail
-
getVhostFromEnvironment
public static org.wso2.carbon.apimgt.api.model.VHost getVhostFromEnvironment(org.wso2.carbon.apimgt.api.model.Environment environment, String host)
Get VHost object of given environment and given host name- Parameters:
environment
- Gateway environment namehost
- Host name of the VHost- Returns:
- VHost object of the given host
-
resolveIfNullToDefaultVhost
public static String resolveIfNullToDefaultVhost(String environmentName, String vhost) throws org.wso2.carbon.apimgt.api.APIManagementException
Resolve vhost to default vhost if the given vhost is null- Parameters:
environmentName
- Environment namevhost
- Host of the vhost- Returns:
- Resolved vhost
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to find the read only environment
-
resolveIfDefaultVhostToNull
public static String resolveIfDefaultVhostToNull(String environmentName, String vhost) throws org.wso2.carbon.apimgt.api.APIManagementException
Resolve vhost to null if the given vhost is the default (first) vhost of read only environment- Parameters:
environmentName
- Environment namevhost
- Host of the vhost- Returns:
- Resolved vhost
- Throws:
org.wso2.carbon.apimgt.api.APIManagementException
- if failed to find the read only environment
-
-