Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.incubator.net.domain; |
| 17 | |
| 18 | import com.google.common.annotations.Beta; |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 19 | import org.onosproject.event.ListenerService; |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 20 | import org.onosproject.net.DeviceId; |
| 21 | |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 22 | import java.util.List; |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 23 | import 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'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 30 | public interface IntentDomainService |
| 31 | extends ListenerService<IntentDomainEvent, IntentDomainListener> { |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 32 | |
| 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'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 57 | * Requests an intent primitive from the intent domain. |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 58 | * |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 59 | * @param domainId id of target domain |
| 60 | * @param primitive intent primitive |
| 61 | * @return set of intent resources that satisfy the primitive |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 62 | */ |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 63 | List<IntentResource> request(IntentDomainId domainId, IntentPrimitive primitive); |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 64 | |
| 65 | /** |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 66 | * Submits an intent resource to the intent domain for installation. |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 67 | * |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 68 | * @param domainId id of target domain |
| 69 | * @param resource intent resource |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 70 | */ |
Brian O'Connor | bd7f878 | 2015-11-19 23:12:37 -0800 | [diff] [blame] | 71 | void submit(IntentDomainId domainId, IntentResource resource); |
Brian O'Connor | b7baf71 | 2015-07-28 23:27:03 -0700 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |