blob: bfea73d2364bcfb900b472519f772bb046e26906 [file] [log] [blame]
Brian O'Connorb7baf712015-07-28 23:27:03 -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.incubator.net.domain;
17
18import com.google.common.annotations.Beta;
19
20import java.util.List;
21import java.util.Set;
22
23/**
24 * FIXME.
25 */
26@Beta
27public interface IntentDomainProvider {
28
29 /**
30 * Requests that the provider attempt to satisfy the intent primitive.
31 * The application must apply the context before the intent resource
32 * can be used. Request contexts can be explictly cancelled, or they will
33 * eventually time out so that resources can be reused.
34 *
35 * @param primitive intent primitive
36 * @return request contexts that contain resources to satisfy the intent
37 */
38 //TODO Consider an iterable and/or holds (only hold one or two reservation(s) at a time)
39 List<RequestContext> request(IntentPrimitive primitive);
40
41 /**
42 * Request that the provider attempt to modify an existing resource to satisfy
43 * a new intent primitive. The application must apply the context before
44 * the intent resource can be used.
45 *
46 * @param resource existing resource
47 * @param newPrimitive intent primitive
48 * @return request contexts that contain resources to satisfy the intent
49 */
50 List<RequestContext> modify(IntentResource resource, IntentPrimitive newPrimitive);
51
52 /**
53 * Requests that the provider release an intent resource.
54 *
55 * @param resource intent resource
56 */
57 void release(IntentResource resource);
58
59 /**
60 * Requests that the provider apply the intent resource in the request context.
61 *
62 * @param context request context
63 * @return intent resource that satisfies the intent
64 */
65 IntentResource apply(RequestContext context);
66
67 /**
68 * Requests that the provider cancel the request. Requests that are not applied
69 * will be eventually timed out by the provider.
70 *
71 * @param context request context
72 */
73 void cancel(RequestContext context);
74
75 /**
76 * Returns all intent resources held by the provider.
77 *
78 * @return set of intent resources
79 */
80 Set<IntentResource> getResources();
81}
82
83