aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java
index 340b54a..9750270 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java
@@ -4,6 +4,7 @@ import java.util.Hashtable;
import org.apache.log4j.Logger;
+import at.knowcenter.wag.egov.egiz.ldap.client.LDAPIssuerNameFilter;
import at.knowcenter.wag.egov.egiz.sig.LDAPAPI;
/**
@@ -13,13 +14,17 @@ public class LDAPAPIFactoryImpl extends LDAPAPIFactory {
private static final Logger log = Logger.getLogger(LDAPAPIFactoryImpl.class);
+ // mapping <full qualified class name, LDAPAPI implementation>
private Hashtable<String, LDAPAPI> ldapImpls;
- protected LDAPAPIFactoryImpl() {
- ldapImpls = new Hashtable<String, LDAPAPI>();
+ private LDAPIssuerNameFilter ldapIssuerNameFilter;
+
+ protected LDAPAPIFactoryImpl(LDAPIssuerNameFilter ldapIssuerNameFilter) {
+ this.ldapImpls = new Hashtable<String, LDAPAPI>();
+ this.ldapIssuerNameFilter = ldapIssuerNameFilter;
}
- private static LDAPAPI instantiatelAPIImpl(String implClassURI) throws LDAPAPIException {
+ private LDAPAPI instantiatelAPIImpl(String implClassURI) throws LDAPAPIException {
if (implClassURI == null) {
throw new NullPointerException("URI of implementing class must not be null.");
}
@@ -36,6 +41,7 @@ public class LDAPAPIFactoryImpl extends LDAPAPIFactory {
}
ldapAPIImpl = (LDAPAPI) ldapAPIImplObj;
log.info("LDAPAPI implementation successfully instantiated.");
+ ldapAPIImpl.setIssuerNameFilter(this.ldapIssuerNameFilter);
} catch (InstantiationException e) {
throw new LDAPAPIException("Declared implementation of \"" + LDAPAPI.class.getName() + "\" cannot be instantiated.");
} catch (IllegalAccessException e) {
@@ -46,15 +52,16 @@ public class LDAPAPIFactoryImpl extends LDAPAPIFactory {
return ldapAPIImpl;
}
+ @Override
public synchronized LDAPAPI createLDAPAPI(String implClassURI) throws LDAPAPIException {
if (implClassURI == null || implClassURI.length() == 0) {
// use internal implementation
implClassURI = LDAPAPIImpl.class.getName();
}
- LDAPAPI impl = ldapImpls.get(implClassURI);
+ LDAPAPI impl = this.ldapImpls.get(implClassURI);
if (impl == null) {
- impl = instantiatelAPIImpl(implClassURI);
- ldapImpls.put(implClassURI, impl);
+ impl = this.instantiatelAPIImpl(implClassURI);
+ this.ldapImpls.put(implClassURI, impl);
}
return impl;
}