Search in sources :

Example 1 with InMemoryMetaAlertRetrieveLatestDao

use of org.apache.metron.indexing.InMemoryMetaAlertRetrieveLatestDao in project metron by apache.

the class InMemoryMetaAlertDao method init.

@Override
public void init(IndexDao indexDao, Optional<String> threatSort) {
    this.indexDao = indexDao;
    this.metaAlertRetrieveLatestDao = new InMemoryMetaAlertRetrieveLatestDao(indexDao);
    Supplier<Map<String, Object>> globalConfigSupplier = () -> new HashMap<>();
    MetaAlertConfig config = new MetaAlertConfig(METAALERT_INDEX, null, globalConfigSupplier) {

        @Override
        protected String getDefaultThreatTriageField() {
            return MetaAlertConstants.THREAT_FIELD_DEFAULT;
        }

        @Override
        protected String getDefaultSourceTypeField() {
            return SENSOR_TYPE;
        }
    };
    this.metaAlertUpdateDao = new InMemoryMetaAlertUpdateDao(indexDao, metaAlertRetrieveLatestDao, config, -1);
// Ignore threatSort for test.
}
Also used : InMemoryMetaAlertRetrieveLatestDao(org.apache.metron.indexing.InMemoryMetaAlertRetrieveLatestDao) MetaAlertConfig(org.apache.metron.indexing.dao.metaalert.MetaAlertConfig) HashMap(java.util.HashMap) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 InMemoryMetaAlertRetrieveLatestDao (org.apache.metron.indexing.InMemoryMetaAlertRetrieveLatestDao)1 MetaAlertConfig (org.apache.metron.indexing.dao.metaalert.MetaAlertConfig)1