001package org.apache.archiva.redback.rest.api.model; 002/* 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, 014 * software distributed under the License is distributed on an 015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 016 * KIND, either express or implied. See the License for the 017 * specific language governing permissions and limitations 018 * under the License. 019 */ 020 021import javax.xml.bind.annotation.XmlRootElement; 022import java.io.Serializable; 023import java.util.Collection; 024 025 026/** 027 * @author Olivier Lamy 028 * @since 2.0 029 */ 030@XmlRootElement( name = "applicationRole" ) 031public class ApplicationRoles 032 implements Serializable 033{ 034 private String name; 035 036 private String description; 037 038 private Collection<String> globalRoles; 039 040 private Collection<RoleTemplate> roleTemplates; 041 042 private Collection<String> resources; 043 044 045 public ApplicationRoles() 046 { 047 // no op 048 } 049 050 public ApplicationRoles( String name, String description, Collection<String> globalRoles, 051 Collection<RoleTemplate> roleTemplates, Collection<String> resources ) 052 { 053 this.name = name; 054 this.description = description; 055 this.globalRoles = globalRoles; 056 this.roleTemplates = roleTemplates; 057 this.resources = resources; 058 } 059 060 public String getName() 061 { 062 return name; 063 } 064 065 public void setName( String name ) 066 { 067 this.name = name; 068 } 069 070 public String getDescription() 071 { 072 return description; 073 } 074 075 public void setDescription( String description ) 076 { 077 this.description = description; 078 } 079 080 public Collection<String> getGlobalRoles() 081 { 082 return globalRoles; 083 } 084 085 public void setGlobalRoles( Collection<String> globalRoles ) 086 { 087 this.globalRoles = globalRoles; 088 } 089 090 public Collection<RoleTemplate> getRoleTemplates() 091 { 092 return roleTemplates; 093 } 094 095 public void setRoleTemplates( Collection<RoleTemplate> roleTemplates ) 096 { 097 this.roleTemplates = roleTemplates; 098 } 099 100 public Collection<String> getResources() 101 { 102 return resources; 103 } 104 105 public void setResources( Collection<String> resources ) 106 { 107 this.resources = resources; 108 } 109 110 @Override 111 public String toString() 112 { 113 final StringBuilder sb = new StringBuilder(); 114 sb.append( "ApplicationRoles" ); 115 sb.append( "{name='" ).append( name ).append( '\'' ); 116 sb.append( ", description='" ).append( description ).append( '\'' ); 117 sb.append( ", globalRoles=" ).append( globalRoles ); 118 sb.append( ", roleTemplates=" ).append( roleTemplates ); 119 sb.append( ", resources=" ).append( resources ); 120 sb.append( '}' ); 121 return sb.toString(); 122 } 123}