blob: 90593ddb37ce3c25dcdbd249a78403435ca0b58a [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
20/**
21 * Context for intent primitive requests to an intent domain provider. A context
22 * must be explicitly applied before it can be used. The purpose of the request
23 * context is so that an application can coordinate multiple requests across multiple
24 * domains before committing. Contexts can be explicitly cancelled if they are not
25 * needed (due to a better context or incomplete path across domains); they can
26 * also be automatically cancelled by a provider after a short timeout.
27 */
28@Beta
Brian O'Connorce2d8b52015-07-29 16:24:13 -070029public class RequestContext {
Brian O'Connor59a92852015-07-30 19:08:24 -070030 private final IntentDomain domain;
31 private final IntentResource resource;
Brian O'Connorb7baf712015-07-28 23:27:03 -070032 //TODO other common parameters:
33 //String cost;
34
Brian O'Connor59a92852015-07-30 19:08:24 -070035 public RequestContext(IntentDomain domain, IntentResource resource) {
36 this.domain = domain;
37 this.resource = resource;
38 }
39
40 public IntentDomain domain() {
41 return domain;
42 }
43
44 public IntentResource resource() {
45 return resource;
46 }
Brian O'Connorb7baf712015-07-28 23:27:03 -070047}