public class HostNameFilter extends IpFilter implements java.lang.Runnable
HostNameFilter filter = new HostNameFilter();
filter.allow("domain.server**");
route.use(filter);
| Modifier and Type | Class and Description |
|---|---|
protected static class |
HostNameFilter.CachedHostname |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,HostNameFilter.CachedHostname> |
cache |
protected int |
cleanup
Cleanup period in SECONDS (default = 1 minute)
|
protected int |
timeout
Cache entry timeout in SECONDS (default = 10 minute).
|
protected java.util.concurrent.ScheduledFuture<?> |
timer |
allow, deny, htmlTemplate, htmlTemplateBytes, htmlTemplatePath, loggerACCEPT, ACCEPT_ENCODING, AUTHORIZATION, CACHE_CONTROL, CHUNKED, CLOSE, CONNECT, CONNECTION, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, CONTENT_TYPE_HTML, CONTENT_TYPE_JSON, COOKIE, DEFLATE, DELETE, ETAG, GET, GZIP, HEAD, IF_NONE_MATCH, KEEP_ALIVE, LOCATION, META_CONTENT_TYPE, META_HEADERS, META_LOCALE, META_LOCATION, META_SESSION, META_STATUS, META_TEMPLATE, NO_CACHE, OPTIONS, PATCH, POST, PROPERTY_COOKIES, PROPERTY_SESSION_ID, PROPERTY_USER, PUT, SET_COOKIE, TRACE, TRANSFER_ENCODING, WWW_AUTHENTICATE, X_FORWARDED_FOR| Constructor and Description |
|---|
HostNameFilter() |
HostNameFilter(java.lang.String... allow) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getAddress(WebRequest req) |
int |
getCleanup() |
int |
getTimeout() |
void |
run() |
void |
setCleanup(int cleanup) |
void |
setTimeout(int timeout) |
void |
started(services.moleculer.ServiceBroker broker) |
void |
stopped() |
allow, deny, getHtmlTemplate, getHtmlTemplatePath, install, mergeFilters, sendForbidden, setHtmlTemplate, setHtmlTemplatePathprotected int cleanup
protected int timeout
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,HostNameFilter.CachedHostname> cache
protected java.util.concurrent.ScheduledFuture<?> timer
public HostNameFilter()
public HostNameFilter(java.lang.String... allow)
protected java.lang.String getAddress(WebRequest req)
getAddress in class IpFilterpublic void started(services.moleculer.ServiceBroker broker)
throws java.lang.Exception
started in interface services.moleculer.service.MoleculerLifecyclestarted in class services.moleculer.service.MoleculerComponentjava.lang.Exceptionpublic void stopped()
stopped in interface services.moleculer.service.MoleculerLifecyclestopped in class services.moleculer.service.MoleculerComponentpublic void run()
run in interface java.lang.Runnablepublic int getCleanup()
public void setCleanup(int cleanup)
cleanup - the cleanup to setpublic int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout to set