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