2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowplugin.api.openflow.configuration;
12 import java.util.function.Function;
13 import javax.annotation.Nonnull;
16 * Manages OpenFlowPlugin configuration
18 public interface ConfigurationService extends AutoCloseable {
21 * Update map of properties.
23 * @param properties properties
25 void update(@Nonnull Map<String, String> properties);
28 * Register listener for configuration changes.
30 * @param listener the listener
31 * @return the auto closeable listener registration
34 AutoCloseable registerListener(@Nonnull ConfigurationListener listener);
37 * Get single property from configuration service.
39 * @param <T> property type
40 * @param key property key
41 * @param transformer property type transformer
42 * @return property property
45 <T> T getProperty(@Nonnull String key, @Nonnull Function<String, T> transformer);