2 * ============LICENSE_START====================================================
4 * ===========================================================================
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
7 * Modifications Copyright (C) 2018 IBM.
8 * ===========================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END====================================================
24 package org.onap.aaf.auth.cmd.ns;
26 import javax.xml.datatype.XMLGregorianCalendar;
28 import org.onap.aaf.auth.cmd.BaseCmd;
29 import org.onap.aaf.cadi.CadiException;
30 import org.onap.aaf.cadi.client.Future;
33 import aaf.v2_0.Users.User;
35 public class ListUsers extends BaseCmd<List> {
37 private static final Future<Nss> dummy = new Future<Nss>(){
40 public boolean get(int timeout) throws CadiException {
50 public String body() {
55 public String header(String tag) {
60 private static final String uformat = "%s%-50s expires:%02d/%02d/%04d\n";
62 public ListUsers(List parent) {
64 cmds.add(new ListUsersWithPerm(this));
65 cmds.add(new ListUsersInRole(this));
68 public void report(String header, String ns) {
69 ((List)parent).report(dummy, header,ns);
72 public void report(String subHead) {
73 pw().println(subHead);
76 public void report(String prefix, User u) {
77 XMLGregorianCalendar xgc = u.getExpires();
78 pw().format(uformat,prefix,u.getId(),xgc.getMonth()+1,xgc.getDay(),xgc.getYear());