001/*
002 * (C) Copyright 2017 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     bdelbosc
018 */
019package org.nuxeo.runtime.stream;
020
021import org.nuxeo.lib.stream.computation.StreamManager;
022import org.nuxeo.lib.stream.log.LogManager;
023
024/**
025 * @since 9.3
026 */
027public interface StreamService {
028
029    LogManager getLogManager();
030
031    StreamManager getStreamManager();
032
033    /**
034     * Gets a {@link LogManager} corresponding to the config name. The service takes care of closing the manager on
035     * shutdown you should not do it directly.
036     *
037     * @deprecated since 11.1 just use {@link #getLogManager()}.
038     */
039    @Deprecated(since = "11.1")
040    default LogManager getLogManager(String configName) {
041        return getLogManager();
042    }
043
044
045    /**
046     * Gets a {@link StreamManager} that uses a LogManager matching the config name.
047     *
048     * @deprecated since 11.1 just use {@link #getStreamManager()}.
049     */
050    @Deprecated(since = "11.1")
051    default StreamManager getStreamManager(String configName) {
052        return getStreamManager();
053    }
054
055    // exposed for test
056    void stopProcessors();
057}