https://issues.apache.org/jira/browse/AMQ-4555 - fix regression that groupClass cannot be set on <cachedLDAPAuthorizationMap/>

This commit is contained in:
Dejan Bosanac 2014-05-26 16:42:38 +02:00
parent 6c859676b3
commit 9d656731ab
2 changed files with 13 additions and 1 deletions

View File

@ -90,6 +90,8 @@ public class SimpleCachedLDAPAuthorizationMap implements AuthorizationMap {
private int refreshInterval = -1;
private boolean refreshDisabled = false;
protected String groupClass = DefaultAuthorizationMap.DEFAULT_GROUP_CLASS;
// Internal State
private long lastUpdated;
@ -255,6 +257,7 @@ public class SimpleCachedLDAPAuthorizationMap implements AuthorizationMap {
// Create and swap in the new instance with updated LDAP data.
newMap.setAuthorizationEntries(new ArrayList<DestinationMapEntry>(entries.values()));
newMap.setGroupClass(groupClass);
this.map.set(newMap);
updated();
@ -1107,6 +1110,15 @@ public class SimpleCachedLDAPAuthorizationMap implements AuthorizationMap {
this.refreshInterval = refreshInterval;
}
public String getGroupClass() {
return groupClass;
}
public void setGroupClass(String groupClass) {
this.groupClass = groupClass;
map.get().setGroupClass(groupClass);
}
protected static enum DestinationType {
QUEUE, TOPIC, TEMP;
}

View File

@ -39,7 +39,7 @@
<authorizationPlugin>
<map>
<cachedLDAPAuthorizationMap legacyGroupMapping="false" connectionURL="ldap://localhost:${ldapPort}"/>
<cachedLDAPAuthorizationMap legacyGroupMapping="false" connectionURL="ldap://localhost:${ldapPort}" groupClass="org.apache.activemq.jaas.GroupPrincipal"/>
</map>
</authorizationPlugin>
</plugins>