本文整理了Java中org.hippoecm.hst.configuration.hosting.VirtualHost.getHostName()
方法的一些代码示例,展示了VirtualHost.getHostName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。VirtualHost.getHostName()
方法的具体详情如下:
包路径:org.hippoecm.hst.configuration.hosting.VirtualHost
类名称:VirtualHost
方法名:getHostName
[英]The hostName of this VirtualHost. Note that this hostName might contain wildcards, for example www.onehippo.
[中]此虚拟主机的主机名。请注意,此主机名可能包含通配符,例如www.onehippo。
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
@Override
public String getHostName() {
return delegatee.getHostName();
}
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
@Override
public String toString() {
StringBuilder builder = new StringBuilder("MountService [jcrPath=");
builder.append(jcrLocation).append(", hostName=").append(virtualHost.getHostName()).append("]");
return builder.toString();
}
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
@Override
public String getResolvedHostName() {
return mount.getVirtualHost().getHostName();
}
代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer
public MountRepresentation represent(final Mount mount) {
hostName = mount.getVirtualHost().getHostName();
mountPath = mount.getMountPath();
return this;
}
代码示例来源:origin: org.onehippo.ecm.hst.components/hst-core
portMount = virtualHost.getPortMount(0);
if(portMount == null) {
log.warn("Virtual Host '{}' is not (correctly) mounted for portnumber '{}': We cannot return a ResolvedSiteMount. Return null", virtualHost.getHostName(), String.valueOf(portNumber));
return null;
log.warn("Virtual Host '{}' for portnumber '{}' is not (correctly) mounted: We cannot return a ResolvedSiteMount. Return null", virtualHost.getHostName(), String.valueOf(portNumber));
return null;
log.warn("Virtual Host '{}' is not (correctly) mounted for portnumber '{}': We cannot return a ResolvedSiteMount. Return null", virtualHost.getHostName(), String.valueOf(portMount.getPortNumber()));
return null;
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
log.debug("We already did find a possible matching host ('{}') with not an explicit portnumber match but we'll use host ('{}') as this one is equally suited.", host.getHostName() + " (hostgroup="+host.getHostGroupName()+")", tryHost.getHostName() + " (hostgroup="+tryHost.getHostGroupName()+")");
代码示例来源:origin: org.onehippo.ecm.hst.components/hst-core
public PortMountService(Node portMount, VirtualHost virtualHost) throws ServiceException {
super(portMount);
String nodeName = this.getValueProvider().getName();
try {
portNumber = Integer.parseInt(nodeName);
if(portNumber < 1) {
throw new ServiceException("Not allowed PortMount name '"+nodeName+"' : PortMount must be a positive integer larger than 0");
}
} catch(NumberFormatException e) {
throw new ServiceException("Not allowed PortMount name '"+nodeName+"' : PortMount must be a positive integer larger than 0");
}
try {
if(portMount.hasNode(HstNodeTypes.SITEMOUNT_HST_ROOTNAME) && portMount.getNode(HstNodeTypes.SITEMOUNT_HST_ROOTNAME).isNodeType(HstNodeTypes.NODETYPE_HST_SITEMOUNT)) {
// we have a configured root sitemount node without portmount. Let's populate this sitemount. This site mount will be added to
// a portmount service with portnumber 0, which means any port
Node siteMount = portMount.getNode(HstNodeTypes.SITEMOUNT_HST_ROOTNAME);
rootSiteMount = new SiteMountService(siteMount, null, virtualHost);
}
} catch (ServiceException e) {
log.warn("The host '{}' for port '"+portNumber+"' contains an incorrect configured SiteMount. The host with port cannot be used for hst request processing: {}", virtualHost.getHostName(), e.getMessage());
} catch (RepositoryException e) {
throw new ServiceException("Error during creating sitemounts: ", e);
}
}
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
"'alias/type/types' combination within a single hst:hostgroup. Failed for mount '{}' in " +
"hostgroup '" + mount.getVirtualHost().getHostGroupName()+"' for host '" +
mount.getVirtualHost().getHostName() + "'. Make sure that you add a unique 'alias' in " +
"combination with the 'types' on the mount within a single hostgroup. The mount '{}' cannot " +
"be used for lookup. Change alias for it. Conflicting mounts are " + mount + " that " +
代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer
public SiteMapPagesRepresentation represent(final HstSiteMap siteMap,
final Mount mount,
final String previewConfigurationPath) throws IllegalArgumentException {
id = ((CanonicalInfo)siteMap).getCanonicalIdentifier();
host = mount.getVirtualHost().getHostName();
this.mount = mount.getMountPath();
final String homePagePathInfo = HstSiteMapUtils.getPath(mount, mount.getHomePage());
for (HstSiteMapItem child : siteMap.getSiteMapItems()) {
addPages(child, null, homePagePathInfo, previewConfigurationPath);
}
Collections.sort(pages, (o1, o2) -> o1.getPathInfo().compareTo(o2.getPathInfo()));
// move homepage to first location
return this;
}
代码示例来源:origin: org.onehippo.cms7.hst/hst-client
if (!farthestRequestScheme.equals(hstSiteMapItem.getScheme())) {
fullyQualifiedPrefix = hstSiteMapItem.getScheme() + "://" + mount.getVirtualHost().getHostName();
if (mount.isPortInUrl()) {
int port = mount.getPort();
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
public ResolvedMount matchMount(String contextPath, String requestPath) throws MatchException {
log.error("Virtual Host '{}' for portnumber '{}' is not (correctly) mounted: We cannot return a ResolvedMount. Return null", virtualHost.getHostName(), String.valueOf(portMount.getPortNumber()));
return null;
log.warn("Virtual Host '{}' is not (correctly) mounted for portnumber '{}' and contextpath '{}': " +
"We cannot return a ResolvedMount. Return null",
virtualHost.getHostName(), String.valueOf(portMount.getPortNumber()), contextPath);
return null;
代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer
Location findParentLocation(final Mount mount, final HstSiteMapItem item) {
String prefix = mount.getVirtualHost().getHostName();
if (StringUtils.isNotEmpty(mount.getMountPath())) {
prefix += mount.getMountPath();
}
if (item.getParentItem() == null) {
return new Location(prefix + "/", null);
} else {
pathInfo = HstSiteMapUtils.getPath(item.getParentItem(), null);
if (pathInfo.equals(HstSiteMapUtils.getPath(mount, mount.getHomePage()))) {
pathInfo = "/";
} else if (!pathInfo.startsWith("/")) {
pathInfo = "/" + pathInfo;
}
return new Location(prefix + pathInfo + "/", ((CanonicalInfo) item.getParentItem()).getCanonicalIdentifier());
}
}
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
public HstContainerURL parseURL(ResolvedMount mount, String contextPath, String requestPath,
Map<String, String []> queryParams, String requestCharacterEncoding,
String requestURIEncoding) {
HstContainerURLImpl url = new HstContainerURLImpl();
url.setContextPath(contextPath);
url.setHostName(mount.getMount().getVirtualHost().getHostName());
url.setPortNumber(mount.getPortNumber());
url.setResolvedMountPath(mount.getResolvedMountPath());
url.setRequestPath(requestPath);
url.setPathInfo(requestPath.substring(mount.getResolvedMountPath().length()));
url.setCharacterEncoding(requestCharacterEncoding);
url.setURIEncoding(requestURIEncoding);
url.setPathInfo(requestPath.substring(mount.getResolvedMountPath().length()));
url.setParameters(queryParams);
parseRequestInfo(url);
return url;
}
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
if(siteMapPathInfo == null || "".equals(siteMapPathInfo) || "/".equals(siteMapPathInfo)) {
log.warn("Mount '{}' for host '{}' does not have a homepage configured and the path info is empty. Cannot map to sitemap item. Return null",
getMount().getName(), mount.getVirtualHost().getHostName());
throw new MatchException("No homepage configured and empty path after Mount");
} else {
代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-page-composer
private NewPageModelRepresentation getNewPageModelRepresentation(final Mount mount) {
PrototypesRepresentation prototypePagesRepresentation = new PrototypesRepresentation().represent(mount.getHstSite(),
true, getPageComposerContextService());
final SiteMapPagesRepresentation pages = new SiteMapPagesRepresentation().represent(mount.getHstSite().getSiteMap(),
mount, mount.getHstSite().getConfigurationPath());
String prefix = mount.getVirtualHost().getHostName();
if (StringUtils.isNotEmpty(mount.getMountPath())) {
prefix += mount.getMountPath();
}
return new NewPageModelRepresentation(prototypePagesRepresentation.getPrototypes(),
pages.getPages(), prefix);
}
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
log.info("Did not find a matching sitemap item for path '{}', Mount '{}' and Host '"+resolvedMount.getMount().getVirtualHost().getHostName()+"'" +
". Return null", pathInfo, resolvedMount.getMount().getParent() == null ? "hst:root" : resolvedMount.getMount().getMountPath() );
throw new NotFoundException("PathInfo '"+pathInfo+"' could not be matched");
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
ch.setHostname(virtualHost.getHostName());
url.append(virtualHost.getHostName());
if (mount.isPortInUrl()) {
int port = mount.getPort();
代码示例来源:origin: org.onehippo.cms7.hst.client-modules/hst-cms-rest
document.setHostName(link.getMount().getVirtualHost().getHostName());
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
if (!isHostSame(requestContext.getRenderHost(), mount.getVirtualHost().getHostName())) {
renderHost = mount.getVirtualHost().getHostName();
String host = scheme + "://" + mount.getVirtualHost().getHostName();
if (mount.isPortInUrl()) {
int port = mount.getPort();
代码示例来源:origin: org.onehippo.cms7.hst.components/hst-core
url.setHostName(mount.getVirtualHost().getHostName());
url.setRequestPath(mount.getMountPath() + pathInfo);
url.setResolvedMountPath(mount.getMountPath());
内容来源于网络,如有侵权,请联系作者删除!