BrightSide Workbench Full Report + Source Code
org.turro.elephant.servlet.crawler.CrawlerOptions Class Reference
Inheritance diagram for org.turro.elephant.servlet.crawler.CrawlerOptions:
Collaboration diagram for org.turro.elephant.servlet.crawler.CrawlerOptions:

Public Member Functions

boolean isActive ()
 
int maxMinutes ()
 
int maxRequests ()
 
boolean isWhiteListed (String ip)
 
boolean isBlackListed (String ip)
 
boolean isBadRequest (String request)
 
boolean isBadAgent (String agent)
 
boolean isAllowedDomain (String domain)
 
void whiteList (ActivityAction action)
 
void blackList (ActivityAction action)
 
Consumer< ActivityAction > onWhiteList ()
 
Consumer< ActivityAction > onBlackList ()
 
String toJson ()
 
String toJson (Map< String, Object > properties)
 

Static Public Member Functions

static CrawlerOptions instance ()
 

Static Public Attributes

static final transient String CRAWLERS_RESPONSE = "/WEB-INF/elephant/activity/crawlers.html"
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 40 of file CrawlerOptions.java.

Member Function Documentation

◆ blackList()

void org.turro.elephant.servlet.crawler.CrawlerOptions.blackList ( ActivityAction  action)

Definition at line 106 of file CrawlerOptions.java.

106  {
107  CrawlerLists cl = loadLists();
108  cl.getBlackList().add(action);
109  saveLists(cl);
110  setAllowedFrom(cl);
111  }
Here is the call graph for this function:

◆ instance()

static CrawlerOptions org.turro.elephant.servlet.crawler.CrawlerOptions.instance ( )
static

Definition at line 139 of file CrawlerOptions.java.

139  {
140  return load();
141  }
Here is the caller graph for this function:

◆ isActive()

boolean org.turro.elephant.servlet.crawler.CrawlerOptions.isActive ( )

Definition at line 58 of file CrawlerOptions.java.

58  {
59  return active;
60  }

◆ isAllowedDomain()

boolean org.turro.elephant.servlet.crawler.CrawlerOptions.isAllowedDomain ( String  domain)

Definition at line 93 of file CrawlerOptions.java.

93  {
94  return !Strings.isBlank(domain) && allowedDomains.stream().anyMatch(wd -> domain.endsWith(wd));
95  }

◆ isBadAgent()

boolean org.turro.elephant.servlet.crawler.CrawlerOptions.isBadAgent ( String  agent)

Definition at line 88 of file CrawlerOptions.java.

88  {
89  return agent == null || badAgent.stream().anyMatch(br -> agent.matches(br));
90  }

◆ isBadRequest()

boolean org.turro.elephant.servlet.crawler.CrawlerOptions.isBadRequest ( String  request)

Definition at line 83 of file CrawlerOptions.java.

83  {
84  return request == null || badRequest.stream().anyMatch(br -> request.matches(br));
85  }

◆ isBlackListed()

boolean org.turro.elephant.servlet.crawler.CrawlerOptions.isBlackListed ( String  ip)

Definition at line 78 of file CrawlerOptions.java.

78  {
79  return allowedSet != null && allowedSet.isBlackListed(ip);
80  }
Here is the call graph for this function:

◆ isWhiteListed()

boolean org.turro.elephant.servlet.crawler.CrawlerOptions.isWhiteListed ( String  ip)

Definition at line 73 of file CrawlerOptions.java.

73  {
74  return allowedSet != null && allowedSet.isWhiteListed(ip);
75  }
Here is the call graph for this function:

◆ maxMinutes()

int org.turro.elephant.servlet.crawler.CrawlerOptions.maxMinutes ( )

Definition at line 63 of file CrawlerOptions.java.

63  {
64  return maxMinutes;
65  }

◆ maxRequests()

int org.turro.elephant.servlet.crawler.CrawlerOptions.maxRequests ( )

Definition at line 68 of file CrawlerOptions.java.

68  {
69  return maxRequests;
70  }

◆ onBlackList()

Consumer<ActivityAction> org.turro.elephant.servlet.crawler.CrawlerOptions.onBlackList ( )

Definition at line 125 of file CrawlerOptions.java.

125  {
126  return (action) -> {
127 // MailSenders.getPool()
128 // .addAdministrators()
129 // .send("Blacklisted",
130 // Phrases.start("Blacklisted", action.getIp(), ":", action.getDomain())
131 // .line().add(action.getReason()).toString());
132  };
133  }

◆ onWhiteList()

Consumer<ActivityAction> org.turro.elephant.servlet.crawler.CrawlerOptions.onWhiteList ( )

Definition at line 114 of file CrawlerOptions.java.

114  {
115  return (action) -> {
116 // MailSenders.getPool()
117 // .addAdministrators()
118 // .send("Whitelisted",
119 // Phrases.start("Whitelisted", action.getIp(), ":", action.getDomain())
120 // .line().add(action.getReason()).toString());
121  };
122  }

◆ toJson() [1/2]

String org.turro.elephant.servlet.crawler.CrawlerOptions.toJson ( )

Definition at line 251 of file CrawlerOptions.java.

251  {
252  return toJson(this);
253  }
Here is the caller graph for this function:

◆ toJson() [2/2]

String org.turro.elephant.servlet.crawler.CrawlerOptions.toJson ( Map< String, Object >  properties)

Definition at line 256 of file CrawlerOptions.java.

256  {
257  return toJson(this, properties);
258  }
Here is the call graph for this function:

◆ whiteList()

void org.turro.elephant.servlet.crawler.CrawlerOptions.whiteList ( ActivityAction  action)

Definition at line 98 of file CrawlerOptions.java.

98  {
99  CrawlerLists cl = loadLists();
100  cl.getWhiteList().add(action);
101  saveLists(cl);
102  setAllowedFrom(cl);
103  }
Here is the call graph for this function:

Member Data Documentation

◆ CRAWLERS_RESPONSE

final transient String org.turro.elephant.servlet.crawler.CrawlerOptions.CRAWLERS_RESPONSE = "/WEB-INF/elephant/activity/crawlers.html"
static

Definition at line 137 of file CrawlerOptions.java.


The documentation for this class was generated from the following file: