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.List;
14 import org.opendaylight.controller.sal.utils.Status;
17 * Configuration Java Object which represents a Local configured Authorization
18 * for a remote authenticated user for User Manager.
20 public class AuthorizationConfig extends UserConfig {
21 private static final long serialVersionUID = 1L;
23 public AuthorizationConfig() {
27 // Constructor may be needed for autocontainer logic
28 public AuthorizationConfig(String user, List<String> roles) {
31 this.roles = (roles == null) ? new ArrayList<String>()
32 : new ArrayList<String>(roles);
36 public Status validate() {
37 Status status = validateUsername();
38 if (status.isSuccess()) {
39 status = validateRoles();
45 public String toString() {
46 return "AuthorizationConfig=[user: " + user + ", roles: " + roles + "]";
50 public String getRolesString() {
51 return super.getRolesString();