blob: b3fdc398a59114e4fe9366bd10ccf8b33f75493b [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.event.ListenerService;
Brian O'Connorb7baf712015-07-28 23:27:03 -070020import org.onosproject.net.DeviceId;
21
Brian O'Connorbd7f8782015-11-19 23:12:37 -080022import java.util.List;
Brian O'Connorb7baf712015-07-28 23:27:03 -070023import java.util.Set;
24
25/**
26 * Service for that maintains a graph of intent domains and a registry of intent
27 * domain providers.
28 */
29@Beta
Brian O'Connorbd7f8782015-11-19 23:12:37 -080030public interface IntentDomainService
31 extends ListenerService<IntentDomainEvent, IntentDomainListener> {
Brian O'Connorb7baf712015-07-28 23:27:03 -070032
33 /**
34 * Returns the intent domain for the given id.
35 *
36 * @param id id to look up
37 * @return the intent domain; null if none found
38 */
39 IntentDomain getDomain(IntentDomainId id);
40
41 /**
42 * Returns a set of all intent domains.
43 *
44 * @return set of intent domains
45 */
46 Set<IntentDomain> getDomains();
47
48 /**
49 * Returns any network domains associated with the given device id.
50 *
51 * @param deviceId device id to look up
52 * @return set of intent domain
53 */
54 Set<IntentDomain> getDomains(DeviceId deviceId);
55
56 /**
Brian O'Connorbd7f8782015-11-19 23:12:37 -080057 * Requests an intent primitive from the intent domain.
Brian O'Connorb7baf712015-07-28 23:27:03 -070058 *
Brian O'Connorbd7f8782015-11-19 23:12:37 -080059 * @param domainId id of target domain
60 * @param primitive intent primitive
61 * @return set of intent resources that satisfy the primitive
Brian O'Connorb7baf712015-07-28 23:27:03 -070062 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080063 List<IntentResource> request(IntentDomainId domainId, IntentPrimitive primitive);
Brian O'Connorb7baf712015-07-28 23:27:03 -070064
65 /**
Brian O'Connorbd7f8782015-11-19 23:12:37 -080066 * Submits an intent resource to the intent domain for installation.
Brian O'Connorb7baf712015-07-28 23:27:03 -070067 *
Brian O'Connorbd7f8782015-11-19 23:12:37 -080068 * @param domainId id of target domain
69 * @param resource intent resource
Brian O'Connorb7baf712015-07-28 23:27:03 -070070 */
Brian O'Connorbd7f8782015-11-19 23:12:37 -080071 void submit(IntentDomainId domainId, IntentResource resource);
Brian O'Connorb7baf712015-07-28 23:27:03 -070072}
73
74
75
76
77