blob: 2ce840c8873e0d7bbc6fe96b08084e46755b0f23 [file] [log] [blame]
Brian O'Connorb7baf712015-07-28 23:27:03 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Brian O'Connorb7baf712015-07-28 23:27:03 -07003 *
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;
Brian O'Connorbd7f8782015-11-19 23:12:37 -080019import org.onosproject.net.provider.Provider;
Brian O'Connorb7baf712015-07-28 23:27:03 -070020
21import java.util.List;
22import java.util.Set;
23
24/**
25 * FIXME.
26 */
27@Beta
Brian O'Connorbd7f8782015-11-19 23:12:37 -080028public interface IntentDomainProvider extends Provider {
Brian O'Connorb7baf712015-07-28 23:27:03 -070029
30 /**
31 * Requests that the provider attempt to satisfy the intent primitive.
32 * The application must apply the context before the intent resource
33 * can be used. Request contexts can be explictly cancelled, or they will
34 * eventually time out so that resources can be reused.
35 *
Brian O'Connor59a92852015-07-30 19:08:24 -070036 * @param domain intent domain for the request
Brian O'Connorb7baf712015-07-28 23:27:03 -070037 * @param primitive intent primitive
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070038 * @return intent resources that specify paths that satisfy the request.
Brian O'Connorb7baf712015-07-28 23:27:03 -070039 */
40 //TODO Consider an iterable and/or holds (only hold one or two reservation(s) at a time)
Brian O'Connorbd7f8782015-11-19 23:12:37 -080041 List<IntentResource> request(IntentDomain domain, IntentPrimitive primitive);
Brian O'Connorb7baf712015-07-28 23:27:03 -070042
43 /**
44 * Request that the provider attempt to modify an existing resource to satisfy
45 * a new intent primitive. The application must apply the context before
46 * the intent resource can be used.
47 *
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070048 * @param oldResource the resource to be replaced
49 * @param newResource the resource to be applied
Brian O'Connorb7baf712015-07-28 23:27:03 -070050 * @return request contexts that contain resources to satisfy the intent
51 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080052 IntentResource modify(IntentResource oldResource, IntentResource newResource);
Brian O'Connorb7baf712015-07-28 23:27:03 -070053
54 /**
55 * Requests that the provider release an intent resource.
56 *
57 * @param resource intent resource
58 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080059 void release(IntentResource resource);
Brian O'Connorb7baf712015-07-28 23:27:03 -070060
61 /**
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070062 * Requests that the provider apply the path from the intent resource.
Brian O'Connorb7baf712015-07-28 23:27:03 -070063 *
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070064 * @param domainIntentResource request context
Brian O'Connorb7baf712015-07-28 23:27:03 -070065 * @return intent resource that satisfies the intent
66 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080067 IntentResource apply(IntentResource domainIntentResource);
Brian O'Connorb7baf712015-07-28 23:27:03 -070068
69 /**
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070070 * Requests that the provider cancel the path. Requests that are not applied
Brian O'Connorb7baf712015-07-28 23:27:03 -070071 * will be eventually timed out by the provider.
72 *
Aaron Kruglikovb4916d02015-09-08 16:22:25 -070073 * @param domainIntentResource the intent resource whose path should be cancelled.
Brian O'Connorb7baf712015-07-28 23:27:03 -070074 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080075 void cancel(IntentResource domainIntentResource);
Brian O'Connorb7baf712015-07-28 23:27:03 -070076
77 /**
78 * Returns all intent resources held by the provider.
79 *
80 * @return set of intent resources
81 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080082 Set<IntentResource> getResources();
Brian O'Connorb7baf712015-07-28 23:27:03 -070083}
84
85