Search in sources :

Example 1 with SearchingPattern

use of com.att.aro.core.searching.pojo.SearchingPattern in project VideoOptimzer by attdevsupport.

the class KeywordSearchingHandlerTest method testUnknownSearchingPattern.

@Test
public void testUnknownSearchingPattern() {
    SearchingPattern pattern = null;
    SearchingContent content = new SearchingContent("abcde");
    SearchingResult result = searchingHandler.search(pattern, content);
    assertNotNull(result);
    assertEquals(0, result.getWords().size());
}
Also used : SearchingResult(com.att.aro.core.searching.pojo.SearchingResult) SearchingContent(com.att.aro.core.searching.pojo.SearchingContent) SearchingPattern(com.att.aro.core.searching.pojo.SearchingPattern) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 2 with SearchingPattern

use of com.att.aro.core.searching.pojo.SearchingPattern in project VideoOptimzer by attdevsupport.

the class PatternSearchingHandlerTest method testUnknownSearchingPattern.

@Test
public void testUnknownSearchingPattern() {
    SearchingPattern pattern = null;
    SearchingContent content = new SearchingContent("abcde");
    SearchingResult result = searchingHandler.search(pattern, content);
    assertNotNull(result);
    assertEquals(0, result.getWords().size());
}
Also used : SearchingResult(com.att.aro.core.searching.pojo.SearchingResult) SearchingContent(com.att.aro.core.searching.pojo.SearchingContent) SearchingPattern(com.att.aro.core.searching.pojo.SearchingPattern) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 3 with SearchingPattern

use of com.att.aro.core.searching.pojo.SearchingPattern in project VideoOptimzer by attdevsupport.

the class TransmissionPrivateDataImpl method search.

/**
 * searching method depends on the type of searching handler (exact keyword searching or pattern searching)
 * @param sessions
 * @param handler
 * @param privateDataSet
 * @return
 */
private List<TransmissionPrivateDataEntry> search(List<Session> sessions, ISearchingHandler handler, Map<String, String> privateDataSet) {
    List<TransmissionPrivateDataEntry> entries = new LinkedList<>();
    SearchingPattern pattern = getSearchingPattern(handler, privateDataSet);
    if (pattern.isEmpty()) {
        return entries;
    }
    for (Session session : sessions) {
        SearchingContent content = getContent(session);
        SearchingResult result = handler.search(pattern, content);
        List<String> wordsFound = result.getWords();
        List<String> types = result.getTypes();
        for (int i = 0; i < wordsFound.size(); i++) {
            entries.add(populateEntry(session, wordsFound.get(i), types.get(i)));
        }
    }
    return entries;
}
Also used : TransmissionPrivateDataEntry(com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry) SearchingResult(com.att.aro.core.searching.pojo.SearchingResult) SearchingContent(com.att.aro.core.searching.pojo.SearchingContent) SearchingPattern(com.att.aro.core.searching.pojo.SearchingPattern) LinkedList(java.util.LinkedList) Session(com.att.aro.core.packetanalysis.pojo.Session)

Aggregations

SearchingContent (com.att.aro.core.searching.pojo.SearchingContent)3 SearchingPattern (com.att.aro.core.searching.pojo.SearchingPattern)3 SearchingResult (com.att.aro.core.searching.pojo.SearchingResult)3 BaseTest (com.att.aro.core.BaseTest)2 Test (org.junit.Test)2 TransmissionPrivateDataEntry (com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 LinkedList (java.util.LinkedList)1