use of com.enonic.xp.web.vhost.impl.mapping.VirtualHostIdProvidersMapping in project xp by enonic.
the class VirtualHostConfigMap method buildMapping.
private VirtualHostMapping buildMapping(final String name) {
final String prefix = "mapping." + name + ".";
final String hostString = getString(prefix + "host");
final String host = hostString != null ? hostString : "localhost";
final String source = normalizePath(getString(prefix + "source"));
final String target = normalizePath(getString(prefix + "target"));
final VirtualHostIdProvidersMapping idProvidersMapping = getHostIdProvidersMapping(prefix);
final int order = getInt(prefix + "order", Integer.MAX_VALUE);
return new VirtualHostMapping(name, host, source, target, idProvidersMapping, order);
}
use of com.enonic.xp.web.vhost.impl.mapping.VirtualHostIdProvidersMapping in project xp by enonic.
the class VirtualHostConfigMap method getHostIdProvidersMapping.
private VirtualHostIdProvidersMapping getHostIdProvidersMapping(final String mappingPrefix) {
final String idProviderPrefix = mappingPrefix + "idProvider" + ".";
final VirtualHostIdProvidersMapping.Builder hostIdProvidersMapping = VirtualHostIdProvidersMapping.create();
getIdProviders(idProviderPrefix).forEach((idProviderName, idProviderStatus) -> {
final IdProviderKey idProviderKey = IdProviderKey.from(idProviderName);
if (DEFAULT_ID_PROVIDER_VALUE.equals(idProviderStatus)) {
hostIdProvidersMapping.setDefaultIdProvider(idProviderKey);
}
if (ENABLED_ID_PROVIDER_VALUE.equals(idProviderStatus)) {
hostIdProvidersMapping.addIdProviderKey(idProviderKey);
}
});
return hostIdProvidersMapping.build();
}
Aggregations