aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIException.java1
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactory.java9
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactoryImpl.java8
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactory.java15
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactoryImpl.java7
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientImpl.java1
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMapping.java1
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMappingStore.java37
8 files changed, 40 insertions, 39 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIException.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIException.java
index 4f2e363..0436609 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIException.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIException.java
@@ -43,7 +43,6 @@ public class LDAPAPIException extends Exception {
}
- @Override
public String toString() {
if (exception != null) {
return exception.toString();
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactory.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactory.java
index 6b71551..a54d861 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactory.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/api/LDAPAPIFactory.java
@@ -4,6 +4,9 @@ import iaik.asn1.ObjectID;
import iaik.security.ecc.provider.ECCProvider;
import iaik.security.provider.IAIK;
import iaik.utils.RFC2253NameParser;
+
+import org.apache.log4j.Logger;
+
import at.knowcenter.wag.egov.egiz.ldap.client.LDAPIssuerNameFilter;
import at.knowcenter.wag.egov.egiz.sig.LDAPAPI;
@@ -13,13 +16,15 @@ import at.knowcenter.wag.egov.egiz.sig.LDAPAPI;
public abstract class LDAPAPIFactory {
private static LDAPAPIFactory ldapAPIfactoryInstance;
+ private final Logger log = Logger.getLogger(LDAPAPIFactory.class);
protected LDAPAPIFactory() {
IAIK.addAsProvider();
ECCProvider.addAsProvider();
- // Does not conform with PKIX, but is used by belgium citizen card
- RFC2253NameParser.register("SERIALNUMBER", ObjectID.serialNumber);
+ // Does not conform with PKIX, but is used by belgium citizen card
+// log.info("Registering RDN \"SERIALNUMBER\" as " + ObjectID.serialNumber + ".");
+ RFC2253NameParser.register("SERIALNUMBER", ObjectID.serialNumber);
}
public static synchronized LDAPAPIFactory getInstance(LDAPIssuerNameFilter ldapIssuerNameFilter) {
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 9750270..dab42ee 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
@@ -15,12 +15,13 @@ 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;
+// private Hashtable<String, LDAPAPI> ldapImpls;
+ private Hashtable ldapImpls;
private LDAPIssuerNameFilter ldapIssuerNameFilter;
protected LDAPAPIFactoryImpl(LDAPIssuerNameFilter ldapIssuerNameFilter) {
- this.ldapImpls = new Hashtable<String, LDAPAPI>();
+ this.ldapImpls = new Hashtable();
this.ldapIssuerNameFilter = ldapIssuerNameFilter;
}
@@ -52,13 +53,12 @@ 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 = this.ldapImpls.get(implClassURI);
+ LDAPAPI impl = (LDAPAPI) this.ldapImpls.get(implClassURI);
if (impl == null) {
impl = this.instantiatelAPIImpl(implClassURI);
this.ldapImpls.put(implClassURI, impl);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactory.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactory.java
index f8ce4f2..0d51f96 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactory.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactory.java
@@ -20,7 +20,8 @@ public abstract class LDAPClientFactory {
* Mapping of category/identifier to LDAPClientFactory.
* Allows the usage of multiple independently configured LDAPClientFactoryImpls.
*/
- private static Hashtable<String, LDAPClientFactory> ldapClientFactoryInstances = new Hashtable<String, LDAPClientFactory>();
+// private static Hashtable<String, LDAPClientFactory> ldapClientFactoryInstances = new Hashtable<String, LDAPClientFactory>();
+ private static Hashtable ldapClientFactoryInstances = new Hashtable();
private LDAPMappingStore ldapMappingStore;
@@ -44,18 +45,16 @@ public abstract class LDAPClientFactory {
return !this.ldapMappingStore.isEmpty();
}
- public synchronized void registerMappings(Iterable<LDAPMapping> iterable) {
+// public synchronized void registerMappings(Iterable<LDAPMapping> iterable) {
+ public synchronized void registerMappings(Iterable iterable) {
if (!iterable.iterator().hasNext()) {
log.warn("There were no ldap mappings provided.");
}
this.ldapMappingStore.storeMappings(iterable);
}
- public synchronized void registerMapping(LDAPMapping... ldapMappings) {
- if (ldapMappings.length == 0) {
- log.warn("There were no ldap mappings provided.");
- }
- this.ldapMappingStore.storeMapping(ldapMappings);
+ public synchronized void registerMapping(LDAPMapping ldapMapping) {
+ this.ldapMappingStore.storeMapping(ldapMapping);
}
public void setLDAPIssuerNameFilter(LDAPIssuerNameFilter filter) throws LDAPException {
@@ -70,7 +69,7 @@ public abstract class LDAPClientFactory {
}
public static synchronized LDAPClientFactory getInstance(String idenfifier) {
- LDAPClientFactory ldapClientFactoryInstance = ldapClientFactoryInstances.get(idenfifier);
+ LDAPClientFactory ldapClientFactoryInstance = (LDAPClientFactory) ldapClientFactoryInstances.get(idenfifier);
if (ldapClientFactoryInstance == null) {
ldapClientFactoryInstance = new LDAPClientFactoryImpl();
ldapClientFactoryInstances.put(idenfifier, ldapClientFactoryInstance);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactoryImpl.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactoryImpl.java
index b4d0fa7..ad19df5 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactoryImpl.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientFactoryImpl.java
@@ -16,10 +16,11 @@ public final class LDAPClientFactoryImpl extends LDAPClientFactory {
private final Logger log = Logger.getLogger(getClass());
- private Hashtable<String, LDAPClient> ldapClients;
+// private Hashtable<String, LDAPClient> ldapClients;
+ private Hashtable ldapClients;
protected LDAPClientFactoryImpl() {
- this.ldapClients = new Hashtable<String, LDAPClient>();
+ this.ldapClients = new Hashtable();
}
public static String rfc2253Name2Domain(Name name) {
@@ -71,7 +72,7 @@ public final class LDAPClientFactoryImpl extends LDAPClientFactory {
if (issuerName == null || issuerName.length() == 0) {
throw new NullPointerException("Issuer name must not be null or empty.");
}
- LDAPClient ldapClient = ldapClients.get(issuerName);
+ LDAPClient ldapClient = (LDAPClient) ldapClients.get(issuerName);
if (ldapClient == null) {
ldapClient = instantiateLDAPClient(issuerName);
ldapClients.put(issuerName, ldapClient);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientImpl.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientImpl.java
index 2ba802d..2794c99 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientImpl.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPClientImpl.java
@@ -180,7 +180,6 @@ public final class LDAPClientImpl implements LDAPClient {
}
}
- @Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("ldapURL = ").append(this.url);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMapping.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMapping.java
index d341155..c232adc 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMapping.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMapping.java
@@ -147,7 +147,6 @@ public class LDAPMapping {
}
}
- @Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("issuerName = ").append(this.issuerName != null ? this.issuerName.getName() : null);
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMappingStore.java b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMappingStore.java
index 324e859..2cd51ba 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMappingStore.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/ldap/client/LDAPMappingStore.java
@@ -14,12 +14,13 @@ import org.apache.log4j.Logger;
*/
public class LDAPMappingStore {
- private Hashtable<Name, LDAPMapping> storedMappings;
+// private Hashtable<Name, LDAPMapping> storedMappings;
+ private Hashtable storedMappings;
private LDAPIssuerNameFilter issuerNameFilter;
private Logger log = Logger.getLogger(getClass());
public LDAPMappingStore(LDAPIssuerNameFilter issuerNameFilter) {
- this.storedMappings = new Hashtable<Name, LDAPMapping>();
+ this.storedMappings = new Hashtable();
this.issuerNameFilter = issuerNameFilter;
}
@@ -28,7 +29,7 @@ public class LDAPMappingStore {
}
public void clearStore() {
- this.storedMappings = new Hashtable<Name, LDAPMapping>();
+ this.storedMappings = new Hashtable();
}
public boolean isEmpty() {
@@ -39,25 +40,23 @@ public class LDAPMappingStore {
return this.issuerNameFilter != null;
}
- public void storeMapping(LDAPMapping... mappings) {
- for (LDAPMapping mapping : mappings) {
- Name name = mapping.getIssuerName();
- if (issuerNameFilter != null) {
- name = this.issuerNameFilter.applyFilter(name);
- }
- if (this.storedMappings.containsKey(name)) {
- log.warn("Skipping mapping \"" + mapping + "\" because is has already been stored under \"" + name.getName() + "\".");
- } else {
- log.debug("Storing mapping \"" + mapping + "\" under \"" + name.getName() + "\".");
- this.storedMappings.put(name, mapping);
- }
+ public void storeMapping(LDAPMapping mapping) {
+ Name name = mapping.getIssuerName();
+ if (issuerNameFilter != null) {
+ name = this.issuerNameFilter.applyFilter(name);
+ }
+ if (this.storedMappings.containsKey(name)) {
+ log.warn("Skipping mapping \"" + mapping + "\" because is has already been stored under \"" + name.getName() + "\".");
+ } else {
+ log.debug("Storing mapping \"" + mapping + "\" under \"" + name.getName() + "\".");
+ this.storedMappings.put(name, mapping);
}
}
- public void storeMappings(Iterable<LDAPMapping> iterable) {
- Iterator<LDAPMapping> it = iterable.iterator();
+ public void storeMappings(Iterable iterable) {
+ Iterator it = iterable.iterator();
while (it.hasNext()) {
- this.storeMapping(it.next());
+ this.storeMapping((LDAPMapping) it.next());
}
}
@@ -65,7 +64,7 @@ public class LDAPMappingStore {
if (issuerNameFilter != null) {
name = this.issuerNameFilter.applyFilter(name);
}
- return this.storedMappings.get(name);
+ return (LDAPMapping) this.storedMappings.get(name);
}
public LDAPMapping getMapping(String nameString) throws LDAPException {