From 755bb76c94953b62a08e9fecf523bc5c42ec79ac Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 26 Feb 2014 10:29:36 +0100 Subject: Properties extended as ObjectProperties, which can return any Object, and wrap int and boolean parsing. Gateway.getProperties() returns the new ObjectProperty instance. Old Gateway property methods still present but deprecated. Refs #149 --- src/main/java/com/c2kernel/lookup/LDAPLookup.java | 2 +- src/main/java/com/c2kernel/lookup/LDAPProperties.java | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src/main/java/com/c2kernel/lookup') diff --git a/src/main/java/com/c2kernel/lookup/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/LDAPLookup.java index c6f86d0..08a80b6 100644 --- a/src/main/java/com/c2kernel/lookup/LDAPLookup.java +++ b/src/main/java/com/c2kernel/lookup/LDAPLookup.java @@ -71,7 +71,7 @@ public class LDAPLookup DomainPath.mTypeRoot = "cn=domain,"+props.mLocalPath; mNextKeyManager = new NextKeyManager(this, "cn=last,"+EntityPath.mTypeRoot); - Logger.msg(7, "LDAP.useOldProps="+Gateway.getProperty("LDAP.useOldProps", "false")); + Logger.msg(7, "LDAP.useOldProps="+Gateway.getProperties().getBoolean("LDAP.useOldProps", false)); mPropManager = new LDAPPropertyManager(this); mRoleManager = new LDAPRoleManager(this, "cn=agent,"+DomainPath.mTypeRoot, EntityPath.mTypeRoot); diff --git a/src/main/java/com/c2kernel/lookup/LDAPProperties.java b/src/main/java/com/c2kernel/lookup/LDAPProperties.java index a9ae699..df0b85d 100644 --- a/src/main/java/com/c2kernel/lookup/LDAPProperties.java +++ b/src/main/java/com/c2kernel/lookup/LDAPProperties.java @@ -27,14 +27,13 @@ public class LDAPProperties public LDAPProperties() { - mGlobalPath = Gateway.getProperty( "LDAP.GlobalPath" ); - mRootPath = Gateway.getProperty( "LDAP.RootPath" ); - mLocalPath = Gateway.getProperty( "LDAP.LocalPath" ); - mPort = Integer.valueOf(Gateway.getProperty( "LDAP.port", "389" )); - mHost = Gateway.getProperty( "LDAP.host" ); - mUser = Gateway.getProperty( "LDAP.user" ); - mPassword = Gateway.getProperty( "LDAP.password" ); - mDbPath = Gateway.getProperty( "LDAP.dbPath" ); + mGlobalPath = Gateway.getProperties().getProperty( "LDAP.GlobalPath" ); + mRootPath = Gateway.getProperties().getProperty( "LDAP.RootPath" ); + mLocalPath = Gateway.getProperties().getProperty( "LDAP.LocalPath" ); + mPort = Gateway.getProperties().getInt( "LDAP.port", 389 ); + mHost = Gateway.getProperties().getProperty( "LDAP.host" ); + mUser = Gateway.getProperties().getProperty( "LDAP.user" ); + mPassword = Gateway.getProperties().getProperty( "LDAP.password" ); mRootPath += "," + mGlobalPath; mLocalPath += "," + mRootPath; -- cgit v1.2.3