blob: c9936ae4be6a2223babe5da40f72182222daa4f1 [file] [log] [blame]
Daniele Moro94660a02019-12-02 12:02:07 -08001/*
2 * Copyright 2019-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 */
16
17package org.opencord.bng;
18
19import org.onosproject.net.DeviceId;
20
21import java.util.Map;
22
23/**
24 * Service for managing attachments.
25 */
26public interface BngService {
27
28 String ONU_ANNOTATION = "onu";
29
30 /**
31 * Sets up the given attachment with the given attachemtn key in the BNG
32 * app. If the attachment is already registered it will be updated. It will
33 * also trigger the termination of the attachment user traffic on the ASG
34 * device.
35 *
36 * @param attachmentKey The key for the given attachment
37 * @param attachment The attachment to be installed or updated
38 */
39 void setupAttachment(String attachmentKey, BngAttachment attachment);
40
41 /**
42 * Removes an attachment given its attachment ID. It will also trigger the
43 * removal of all the related attachment flows from the ASG device.
44 *
45 * @param attachmentKey The ID of the attachment to be removed
46 */
47 void removeAttachment(String attachmentKey);
48
49 /**
50 * Returns a map with the registered attachments.
51 *
52 * @return The map of attachemtn keys and attachments. Empty map if no
53 * attachment is registered.
54 */
55 Map<String, BngAttachment> getAttachments();
56
57 /**
58 * Returns the registered attachment given the ID.
59 *
60 * @param attachmentKey The attachment ID
61 * @return The attachment if it is present, null otherwise
62 */
63 BngAttachment getAttachment(String attachmentKey);
64
65 /**
66 * Returns the BNG device ID currently used.
67 *
68 * @return The BNG device ID.
69 */
70 DeviceId getBngDeviceId();
71}