blob: fce75aada55993971fff835896b5826d05564ffb [file] [log] [blame]
Sean Condon0e89bda2017-03-21 14:23:19 +00001/*
2 * Copyright 2017-present Open Networking Foundation
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.l2monitoring.cfm;
17
18import org.onlab.packet.MacAddress;
19import org.onosproject.incubator.net.l2monitoring.cfm.identifier.MepId;
20
21import java.util.Optional;
22
23/**
24 * Grouping of parameters used to create a Test Signal test on a MEP.
25 */
26public interface MepTsCreate {
27 /**
28 * The remote Mep will be identified by either a MacAddress or a MEPId.
29 * @return The MAC address of the remoteMep
30 */
31 MacAddress remoteMepAddress();
32
33 /**
34 * The remote Mep will be identified by either a MacAddress or a MEPId.
35 * @return The id of the remoteMep
36 */
37 MepId remoteMepId();
38
39 /**
40 * Indicates the MEP is acting in the role of a receiver.
41 * True by default
42 * @return true if MEP is acting as a receiver
43 */
44 Optional<Boolean> isReceiver();
45
46 /**
47 * Indicates the MEP is acting in the role of a generator.
48 * False by default
49 * @return true if MEP is acting as a generator
50 */
51 Optional<Boolean> isGenerator();
52
53 /**
54 * This attribute specifies the type of ETH-Test to perform whether it is service interrupting or not.
55 * An 'in-service' value indicates that the ETH-Test is in service and normal
56 * client service traffic is not interrupted. A 'out-of-service' value
57 * indicates that the ETH-Test is out of service and normal client service
58 * traffic is disrupted.
59 * The test-type parameter is only relevant for the generator side
60 * @return test type enumeration
61 */
62 Optional<TestType> testType();
63
64 /**
65 * Builder for {@link org.onosproject.incubator.net.l2monitoring.cfm.MepTsCreate}.
66 */
67 interface MepTsCreateBuilder {
68 MepTsCreateBuilder isReceiver(Optional<Boolean> isReceiver);
69
70 MepTsCreateBuilder isGenerator(Optional<Boolean> isGenerator);
71
72 MepTsCreateBuilder testType(Optional<TestType> testType);
73
74 MepTsCreateBuilder build();
75 }
76
77 /**
78 * Types of Test Signal test.
79 */
80 public enum TestType {
81 /**
82 * Indicates the ETH-Test is in-service and normal client service traffic is not interrupted.
83 */
84 INSERVICE,
85 /**
86 * Indicates the ETH-Test is out-of-service and normal client service traffic is disrupted.
87 */
88 OUTOFSERVICE
89 }
90}