Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* .
*/
package org.graylog2.streams;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.bson.types.ObjectId;
import org.graylog2.database.DbEntity;
import org.graylog2.database.PersistedImpl;
import org.graylog2.database.validators.DateValidator;
import org.graylog2.database.validators.FilledStringValidator;
import org.graylog2.database.validators.MapValidator;
import org.graylog2.database.validators.OptionalStringValidator;
import org.graylog2.indexer.IndexSet;
import org.graylog2.plugin.Tools;
import org.graylog2.plugin.database.validators.Validator;
import org.graylog2.plugin.streams.Output;
import org.graylog2.plugin.streams.Stream;
import org.graylog2.plugin.streams.StreamRule;
import org.joda.time.DateTime;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.graylog2.shared.security.RestPermissions.STREAMS_READ;
/**
* Representing a single stream from the streams collection. Also provides method
* to get all streams of this collection.
*/
@DbEntity(collection = "streams",
readPermission = STREAMS_READ)
public class StreamImpl extends PersistedImpl implements Stream {
public static final String FIELD_ID = "_id";
public static final String FIELD_TITLE = "title";
public static final String FIELD_DESCRIPTION = "description";
public static final String FIELD_RULES = "rules";
public static final String FIELD_OUTPUTS = "outputs";
public static final String FIELD_CONTENT_PACK = "content_pack";
public static final String FIELD_DISABLED = "disabled";
public static final String FIELD_CREATED_AT = "created_at";
public static final String FIELD_CREATOR_USER_ID = "creator_user_id";
public static final String FIELD_MATCHING_TYPE = "matching_type";
public static final String FIELD_DEFAULT_STREAM = "is_default_stream";
public static final String FIELD_REMOVE_MATCHES_FROM_DEFAULT_STREAM = "remove_matches_from_default_stream";
public static final String FIELD_INDEX_SET_ID = "index_set_id";
public static final String EMBEDDED_ALERT_CONDITIONS = "alert_conditions";
private final List streamRules;
private final Set