blob: 5fcb132b6ca32036d2f29debe07c1a163b1870c3 [file] [log] [blame]
Sho SHIMIZU70ee1ee2015-08-06 11:11:52 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.net.newresource;
17
18import com.google.common.annotations.Beta;
19
20import java.util.function.Predicate;
21
22/**
23 * Service for administering resource service behavior.
24 */
25@Beta
26public interface ResourceAdminService {
27 /**
28 * Define a boundary of the resource specified by the class.
29 * The specified predicate is expected to return true if the supplied value is
30 * in the resource boundary and return false if it is out of the boundary.
31 *
32 * @param cls class of the resource type
33 * @param predicate predicate returning true if the value is in the boundary
34 * @param <T> type of the resource
35 */
36 <T> void defineResourceBoundary(Class<T> cls, Predicate<T> predicate);
37}