예제 #1
0
  @Override
  public HashMap<Integer, TagValue> getDIMFields() throws RemoteException {
    Set<TagValue> fields = TagsStruct.getInstance().getDIMFields();
    HashMap<Integer, TagValue> map = new HashMap<>(fields.size());
    for (TagValue tag : fields) map.put(tag.getTagNumber(), tag);

    return map;
  }
예제 #2
0
  @Override
  public ArrayList<SearchResult> SearchIndexedMetaData(SearchResult searchResult)
      throws RemoteException {

    TagsStruct tags = TagsStruct.getInstance();

    ArrayList<String> extraFields = new ArrayList<>();

    for (TagValue tag : tags.getAllFields()) extraFields.add(tag.getAlias());

    String query =
        "FileName:" + searchResult.getURI() + " AND FileHash:" + searchResult.get("filehash");

    SearchDumper sdumper = new SearchDumper();
    sdumper.search(searchResult, query, extraFields);
    List<SearchResult> result = sdumper.getResults();
    // System.out.println("Result + " +result);
    if (result.size() > 0) {

      SearchResult r = (SearchResult) result.get(0);
      for (String s : r.getExtraData().keySet()) {
        if (s.contains("Sequence")) {
          String[] fields = r.getExtraData().get(s).toString().split(" ");
          for (int i = 0; i < fields.length; i++) {
            extraFields.add(fields[i]);
          }
        }
      }

      sdumper = new SearchDumper();
      sdumper.search(searchResult, query, extraFields);
      result = sdumper.getResults();
    }

    return (ArrayList<SearchResult>) result;
  }