1 package org.apache.archiva.admin.model.beans;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. 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,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import javax.xml.bind.annotation.XmlRootElement;
22 import java.io.Serializable;
23 import java.util.ArrayList;
24 import java.util.HashMap;
25 import java.util.List;
29 * @author Olivier Lamy
32 @XmlRootElement(name = "redbackRuntimeConfiguration")
33 public class RedbackRuntimeConfiguration
34 implements Serializable
38 * Field userManagerImpls.
40 private List<String> userManagerImpls = new ArrayList<String>();
43 * Field authorizerImpls.
45 private java.util.List<String> authorizerImpls;
47 private LdapConfiguration ldapConfiguration;
50 * flag to know if redback configuration has been checked/migrated.
52 private boolean migratedFromRedbackConfiguration = false;
54 private Map<String, String> configurationProperties;
57 * field to ease json mapping wrapper on <code>configurationProperties</code> field
59 private List<PropertyEntry> configurationPropertiesEntries;
62 * flag to know if redback will use a cache to prevent
63 * searching users already found.
65 private boolean useUsersCache = false;
67 private CacheConfiguration usersCacheConfiguration;
69 public RedbackRuntimeConfiguration()
74 public List<String> getUserManagerImpls()
76 return userManagerImpls;
79 public void setUserManagerImpls( List<String> userManagerImpls )
81 this.userManagerImpls = userManagerImpls;
84 public LdapConfiguration getLdapConfiguration()
86 return ldapConfiguration;
89 public void setLdapConfiguration( LdapConfiguration ldapConfiguration )
91 this.ldapConfiguration = ldapConfiguration;
94 public boolean isMigratedFromRedbackConfiguration()
96 return migratedFromRedbackConfiguration;
99 public void setMigratedFromRedbackConfiguration( boolean migratedFromRedbackConfiguration )
101 this.migratedFromRedbackConfiguration = migratedFromRedbackConfiguration;
104 public Map<String, String> getConfigurationProperties()
106 if ( this.configurationProperties == null )
108 this.configurationProperties = new HashMap<String, String>();
110 return configurationProperties;
113 public void setConfigurationProperties( Map<String, String> configurationProperties )
115 this.configurationProperties = configurationProperties;
118 public List<PropertyEntry> getConfigurationPropertiesEntries()
120 configurationPropertiesEntries = new ArrayList<PropertyEntry>( getConfigurationProperties().size() );
121 for ( Map.Entry<String, String> entry : getConfigurationProperties().entrySet() )
123 configurationPropertiesEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
125 return configurationPropertiesEntries;
128 public void setConfigurationPropertiesEntries( List<PropertyEntry> configurationPropertiesEntries )
130 this.configurationPropertiesEntries = configurationPropertiesEntries;
131 if ( configurationPropertiesEntries != null )
133 this.configurationProperties = new HashMap<String, String>( configurationPropertiesEntries.size() );
134 for ( PropertyEntry propertyEntry : configurationPropertiesEntries )
136 this.configurationProperties.put( propertyEntry.getKey(), propertyEntry.getValue() );
141 public boolean isUseUsersCache()
143 return useUsersCache;
146 public void setUseUsersCache( boolean useUsersCache )
148 this.useUsersCache = useUsersCache;
151 public CacheConfiguration getUsersCacheConfiguration()
153 return usersCacheConfiguration;
156 public void setUsersCacheConfiguration( CacheConfiguration usersCacheConfiguration )
158 this.usersCacheConfiguration = usersCacheConfiguration;
161 public List<String> getAuthorizerImpls()
163 return authorizerImpls;
166 public void setAuthorizerImpls( List<String> authorizerImpls )
168 this.authorizerImpls = authorizerImpls;
172 public String toString()
174 final StringBuilder sb = new StringBuilder();
175 sb.append( "RedbackRuntimeConfiguration" );
176 sb.append( "{userManagerImpls=" ).append( userManagerImpls );
177 sb.append( ", authorizerImpls=" ).append( authorizerImpls );
178 sb.append( ", ldapConfiguration=" ).append( ldapConfiguration );
179 sb.append( ", migratedFromRedbackConfiguration=" ).append( migratedFromRedbackConfiguration );
180 sb.append( ", configurationProperties=" ).append( configurationProperties );
181 sb.append( ", configurationPropertiesEntries=" ).append( configurationPropertiesEntries );
182 sb.append( ", useUsersCache=" ).append( useUsersCache );
183 sb.append( ", usersCacheConfiguration=" ).append( usersCacheConfiguration );
185 return sb.toString();