|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.configuration.hosting.VirtualHostService
public class VirtualHostService
Constructor Summary | |
---|---|
VirtualHostService(VirtualHostService parent,
String[] nameSegments,
int position,
String hostGroupName,
String cmsLocation,
Integer defaultPort,
HstManagerImpl hstManager)
|
|
VirtualHostService(VirtualHostsService virtualHosts,
HstNode virtualHostNode,
VirtualHostService parentHost,
String hostGroupName,
String cmsLocation,
int defaultPort,
HstManagerImpl hstManager)
|
Method Summary | |
---|---|
void |
addPortMount(MutablePortMount portMount)
Add the portMount to this MutableVirtualHost |
void |
addVirtualHost(MutableVirtualHost virtualHost)
Adds the virtualHost as child to this MutableVirtualHost |
String |
getBaseURL(javax.servlet.http.HttpServletRequest request)
Returns the base of the URL as seen by for example a browser. |
VirtualHost |
getChildHost(String name)
|
List<VirtualHost> |
getChildHosts()
|
String |
getCmsLocation()
|
Integer |
getDefaultPort()
|
String |
getHomePage()
|
String |
getHostGroupName()
Returns the name of host group this virtual host belongs to, for example 'prod', 'acct' or 'dev' |
String |
getHostName()
The hostName of this VirtualHost. |
String |
getLocale()
the locale for this VirtualHost or null when it does not contain one. |
String |
getName()
Returns the name of this VirtualHost. |
String |
getPageNotFound()
|
PortMount |
getPortMount(int portNumber)
|
String |
getScheme()
|
VirtualHosts |
getVirtualHosts()
|
boolean |
isContextPathInUrl()
|
boolean |
isPortInUrl()
|
boolean |
isVersionInPreviewHeader()
|
String |
onlyForContextPath()
In case the HttpServletRequest.getContextPath() does not matter, this method returns null or empty. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VirtualHostService(VirtualHostsService virtualHosts, HstNode virtualHostNode, VirtualHostService parentHost, String hostGroupName, String cmsLocation, int defaultPort, HstManagerImpl hstManager) throws ServiceException
ServiceException
public VirtualHostService(VirtualHostService parent, String[] nameSegments, int position, String hostGroupName, String cmsLocation, Integer defaultPort, HstManagerImpl hstManager)
Method Detail |
---|
public void addVirtualHost(MutableVirtualHost virtualHost) throws IllegalArgumentException
MutableVirtualHost
virtualHost
as child to this MutableVirtualHost
addVirtualHost
in interface MutableVirtualHost
virtualHost
- the MutableVirtualHost
to add
IllegalArgumentException
- if the virtualHost
could not be addedpublic void addPortMount(MutablePortMount portMount) throws IllegalArgumentException
MutableVirtualHost
portMount
to this MutableVirtualHost
addPortMount
in interface MutableVirtualHost
portMount
- the MutablePortMount
to add
IllegalArgumentException
- if the portMount
could not be addedpublic String getName()
VirtualHost
name
of this VirtualHost. Note, this is not the hostName, but only part of it. If the hostName
is www.apache.org, then the name of this VirtualHost might be 'www' or 'apache' or 'org'. It is thus one segment of the entire hostName.
getName
in interface VirtualHost
name
of this VirtualHost. Note, this is only part of the entire hostNameVirtualHost.getHostName()
public String getHostName()
VirtualHost
getHostName
in interface VirtualHost
public String getHostGroupName()
VirtualHost
getHostGroupName
in interface VirtualHost
name
of the host group this VirtualHost belongs to.public boolean isContextPathInUrl()
isContextPathInUrl
in interface VirtualHost
true
when the created url should have the contextpath in itpublic String onlyForContextPath()
VirtualHost
HttpServletRequest.getContextPath()
does not matter, this method returns null
or empty. If Mount
s
for this host can be used only for a certain contextPath, this method should return that contextPath. If configured, the contextPath is either an empty string,
or it must start with a "/" and cannot contain any other "/".
onlyForContextPath
in interface VirtualHost
null
or empty if the contextPath does not matter, otherwise the value the contextPath must have to match Mount
s for this host.public boolean isPortInUrl()
isPortInUrl
in interface VirtualHost
true
when the created url should have the port in itpublic String getScheme()
getScheme
in interface VirtualHost
public String getLocale()
VirtualHost
null
when it does not contain one. Note that if an ancestor VirtualHost contains a
locale, this value is inherited unless this VirtualHost explicitly defines its own. The VirtualHost directly below the VirtualHosts
inherits the value from
the VirtualHosts
getLocale
in interface VirtualHost
null
when it does not contain one.public String getHomePage()
getHomePage
in interface VirtualHost
null
when not presentpublic String getPageNotFound()
getPageNotFound
in interface VirtualHost
Mount
or null
when not presentpublic boolean isVersionInPreviewHeader()
isVersionInPreviewHeader
in interface VirtualHost
public String getCmsLocation()
getCmsLocation
in interface MutableVirtualHost
null
if not configuredpublic Integer getDefaultPort()
public VirtualHosts getVirtualHosts()
getVirtualHosts
in interface VirtualHost
VirtualHosts
container of this VirtualHost
public PortMount getPortMount(int portNumber)
getPortMount
in interface VirtualHost
public VirtualHost getChildHost(String name)
getChildHost
in interface VirtualHost
name
- the name segment of the hostname
VirtualHost
or null
if none foundpublic String getBaseURL(javax.servlet.http.HttpServletRequest request)
VirtualHost
URL
as seen by for example a browser. The base URL is consists of scheme + hostname + portnumber
for example 'http://www.hippoecm.org:8081'
The scheme is 'http' by default, unless getScheme()
returns something else
The hostname is the HttpServeltRequest request.getServerName() (proxies must have ProxyPreserveHost On
)
The portnumber is as follows:
#isPortVisible()
is false
, there is no portnumberport = #getPortNumber()
if (port == 0) {port = request.getServerPort()}
getBaseURL
in interface VirtualHost
request
- the HttpServletRequest
URL
until the context path, thus scheme + hostname + portnumber
, for example 'http://www.hippoecm.org:8081'public List<VirtualHost> getChildHosts()
getChildHosts
in interface VirtualHost
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |