Class VHostUtils


  • public class VHostUtils
    extends Object
    • Constructor Detail

      • VHostUtils

        public VHostUtils()
    • 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 name
        host - 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 name
        vhost - 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 name
        vhost - Host of the vhost
        Returns:
        Resolved vhost
        Throws:
        org.wso2.carbon.apimgt.api.APIManagementException - if failed to find the read only environment