Class RegexAnalyzer
-
- All Implemented Interfaces:
public class RegexAnalyzer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
RegexAnalyzer.AnalyzeRequest
Instantiate it to request a regex analysis.
public class
RegexAnalyzer.AnalysisResult
Object given to the concerned requester. When an AnalyzeRequest obj is evaluated
public class
RegexAnalyzer.Device
-
Constructor Summary
Constructors Constructor Description RegexAnalyzer(ArrayList<RegexAnalyzer.Device> devices)
-
Method Summary
Modifier and Type Method Description void
addSubscriber(int identifierRequester, GollumCallbackGetGeneric<List<RegexAnalyzer.AnalysisResult>> cbSubscriber)
void
removeSubscriber(int subscriberId)
int
getFreeSubscriberId()
void
clearAllRequestsOfRequester(int requesterId)
Clear all running/pending runnable associated to the requester id. void
analyze(RegexAnalyzer.AnalyzeRequest request)
check if the given request match with one of the pattern hosted in regex_remote_patterns. List<RegexAnalyzer.AnalysisResult>
evaluate(RegexAnalyzer.AnalyzeRequest request)
Hexa converted to binary, binary converted to durations. static ArrayList<RegexAnalyzer.Device>
loadRegex(XmlPullParser xmlPullParser)
load All devices from an XML. void
stop()
When called, object is dead. static boolean
isDeviceInfoAndRegexFoundMatches(@Nullable() List<RegexAnalyzer.AnalysisResult> results, @Nullable() DeviceInfo deviceInfo)
For the given list of analysis results, indicates if found remote matches with found pattern -
-
Constructor Detail
-
RegexAnalyzer
RegexAnalyzer(ArrayList<RegexAnalyzer.Device> devices)
-
-
Method Detail
-
addSubscriber
void addSubscriber(int identifierRequester, GollumCallbackGetGeneric<List<RegexAnalyzer.AnalysisResult>> cbSubscriber)
-
removeSubscriber
void removeSubscriber(int subscriberId)
-
getFreeSubscriberId
int getFreeSubscriberId()
-
clearAllRequestsOfRequester
void clearAllRequestsOfRequester(int requesterId)
Clear all running/pending runnable associated to the requester id.
-
analyze
void analyze(RegexAnalyzer.AnalyzeRequest request)
check if the given request match with one of the pattern hosted in regex_remote_patterns.xml
-
evaluate
@Nullable() List<RegexAnalyzer.AnalysisResult> evaluate(RegexAnalyzer.AnalyzeRequest request)
Hexa converted to binary, binary converted to durations. durations splitted in codewords. (codewords are in duration) For each regex: For each codewords (in durations): convert code word durations to code word bitstream. check if bitstream match with regex.: If true: return result. For each regex: convert whole durations to bitstream check if bitstream match with regex.: If true: return result. Return no result.
-
loadRegex
static ArrayList<RegexAnalyzer.Device> loadRegex(XmlPullParser xmlPullParser)
load All devices from an XML. Each item contains a brand, model and a regex.
-
stop
void stop()
When called, object is dead. new instance must be created.
-
isDeviceInfoAndRegexFoundMatches
static boolean isDeviceInfoAndRegexFoundMatches(@Nullable() List<RegexAnalyzer.AnalysisResult> results, @Nullable() DeviceInfo deviceInfo)
For the given list of analysis results, indicates if found remote matches with found pattern
-
-
-
-