public class HostBasedVirtualUriMapping extends DefaultVirtualUriMapping
# [module]/virtualUriMappings/[mapping-name].yaml --- class: info.magnolia.virtualuri.mapping.HostBasedVirtualUriMapping fromUri: / toUri: redirect:/.magnolia/admincentral mappings: - host: www.acme.com toUri: forward:/acme/en/index.html - host: www.acme.de toUri: forward:/acme/de/index.html
Modifier and Type | Class and Description |
---|---|
static class |
HostBasedVirtualUriMapping.HostUriMapping
HostUriMapping object to receive "mapping" nodes in configuration.
|
VirtualUriMapping.Result
Constructor and Description |
---|
HostBasedVirtualUriMapping() |
Modifier and Type | Method and Description |
---|---|
List<HostBasedVirtualUriMapping.HostUriMapping> |
getMappings() |
boolean |
isValid()
Validate necessary info to check VirtualUriMapping is valid.
|
Optional<VirtualUriMapping.Result> |
mapUri(URI uri)
Choose shortest HostMapping matching request host, with the least number of additional characters.
|
void |
setMappings(List<HostBasedVirtualUriMapping.HostUriMapping> hostMappings) |
String |
toString() |
protected Optional<String> |
tryToMapHost()
Choose the longest host-mapping matching the request host from its end (most specific).
|
getFromUri, getPattern, getToUri, setFromUri, setInternalFromUri, setToUri
public List<HostBasedVirtualUriMapping.HostUriMapping> getMappings()
public void setMappings(List<HostBasedVirtualUriMapping.HostUriMapping> hostMappings)
public Optional<VirtualUriMapping.Result> mapUri(URI uri)
mapUri
in interface VirtualUriMapping
mapUri
in class DefaultVirtualUriMapping
uri
- a relative URI containing only the path and query components.
The path is relative to the magnolia servlet mapping; context path is already stripped.public boolean isValid()
VirtualUriMapping
isValid
in interface VirtualUriMapping
isValid
in class DefaultVirtualUriMapping
protected Optional<String> tryToMapHost()
public String toString()
toString
in class DefaultVirtualUriMapping
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.