2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.usermanager;
11 import java.util.ArrayList;
12 import java.util.Iterator;
13 import java.util.List;
15 import org.opendaylight.controller.sal.utils.Status;
18 * Configuration Java Object which represents a Local configured Authorization
19 * for a remote authenticated user for User Manager.
21 public class AuthorizationConfig extends UserConfig {
22 private static final long serialVersionUID = 1L;
24 public AuthorizationConfig() {
28 // Constructor may be needed for autocontainer logic
29 public AuthorizationConfig(String user, List<String> roles) {
32 this.roles = (roles == null) ? new ArrayList<String>()
33 : new ArrayList<String>(roles);
37 public Status validate() {
38 Status status = validateUsername();
39 if (status.isSuccess()) {
40 status = validateRoles();
45 public String toString() {
46 return "AuthorizationConfig=[user: " + user + ", roles: " + roles + "]";
49 public String getRolesString() {
50 return super.getRolesString();