blob: 29bfd20d3e880545c4aa6722f99a28861edc5a54 [file] [log] [blame]
alshabibbf70b082016-02-03 10:25:49 -08001/*
Brian O'Connord4fbd352016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
alshabibbf70b082016-02-03 10:25:49 -08003 *
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
alshabib36a4d732016-06-01 16:03:59 -070017package org.opencord.olt.cli;
alshabibbf70b082016-02-03 10:25:49 -080018
19import org.apache.karaf.shell.commands.Argument;
20import org.apache.karaf.shell.commands.Command;
21import org.onosproject.cli.AbstractShellCommand;
22import org.onosproject.net.ConnectPoint;
23import org.onosproject.net.DeviceId;
24import org.onosproject.net.PortNumber;
alshabib36a4d732016-06-01 16:03:59 -070025import org.opencord.olt.AccessDeviceService;
alshabibbf70b082016-02-03 10:25:49 -080026
27/**
28 * Adds a subscriber to an access device.
29 */
30@Command(scope = "onos", name = "remove-subscriber-access",
31 description = "Adds a subscriber to an access device")
32public class SubscriberRemoveCommand extends AbstractShellCommand {
33
34 @Argument(index = 0, name = "deviceId", description = "Access device ID",
35 required = true, multiValued = false)
36 private String strDeviceId = null;
37
38 @Argument(index = 1, name = "port", description = "Subscriber port number",
39 required = true, multiValued = false)
40 private String strPort = null;
41
42 @Override
43 protected void execute() {
44 AccessDeviceService service = AbstractShellCommand.get(AccessDeviceService.class);
45
46 DeviceId deviceId = DeviceId.deviceId(strDeviceId);
47 PortNumber port = PortNumber.portNumber(strPort);
48 ConnectPoint connectPoint = new ConnectPoint(deviceId, port);
49
50 service.removeSubscriber(connectPoint);
51
52 }
53}