blob: da0c396151fd2bbb7a60d72736d7ce73d60795f7 [file] [log] [blame]
Ray Milkey140e4782015-04-24 11:25:13 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Ray Milkey140e4782015-04-24 11:25:13 -07003 *
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.xosintegration.cli;
17
18import java.util.List;
19
20import org.onosproject.cli.AbstractChoicesCompleter;
21import org.onosproject.xosintegration.VoltTenant;
22import org.onosproject.xosintegration.VoltTenantService;
23import static java.util.stream.Collectors.toList;
24
25import static org.onosproject.cli.AbstractShellCommand.get;
26
27
28/**
29 * Application command completer.
30 */
31public class TenantIdCompleter extends AbstractChoicesCompleter {
32 @Override
33 public List<String> choices() {
34 VoltTenantService service = get(VoltTenantService.class);
35
36 return service.getAllTenants().stream()
37 .map(VoltTenant::id)
38 .map(Object::toString)
39 .collect(toList());
40
41 }
42
43}