मैं उस क्षेत्र से एलडीएपी लेआउट/स्कीमा को डुप्लिकेट करने का प्रयास कर रहा हूं, जिसमें मेरे एप्लिकेशन को सौदा करना है- और मैं फिर से बनाने की कोशिश कर रहा हूं + एम्बेडेड UnboundID LDAP सर्वर के साथ स्वचालित परीक्षण के माध्यम से इसका परीक्षण करें।कस्टम स्कीमा बनाना/इन-मेमोरी के लिए मौजूदा स्कीमा में जोड़ें UnboundID LDAP सर्वर
स्थिति इससे निपटने के लिए है उपयोगकर्ता स्कीमा की 'memberOf' सक्रिय निर्देशिका की तरह संपत्ति है ... लेकिन मैं काफी स्मृति में इस ldap के लिए एक 'उपयोगकर्ता' वर्ग को जोड़ने का तरीका यकीन नहीं है।
1) क्या यह संभव है? 2) क्या कोई बेहतर रणनीति है? 3) और मुझे विशेष रूप से क्या करना चाहिए? मैं एक एलडीएपी नौसिखिया हूँ।
नीचे मेरा nonworking कोड है।
धन्यवाद, माइक Kohout
public class TestOpenLdap2
{
private InMemoryDirectoryServer server;
@Before
public void start() throws Exception
{
InMemoryDirectoryServerConfig config = new InMemoryDirectoryServerConfig("dc=com");
config.addAdditionalBindCredentials("cn=admin,ou=People,dc=example,dc=com", "cred");
InMemoryListenerConfig listenerConfig = new InMemoryListenerConfig("test", null, 33390, null, null, null);
config.setListenerConfigs(listenerConfig);
server = new InMemoryDirectoryServer(config);
server.startListening();
}
@Test
public void testMemberOf() throws Exception
{
addEntry("dn: dc=com", "objectClass: top", "objectClass: domain", "dc: com");
ObjectClassDefinition oc = new ObjectClassDefinition("10.19.19.78", new String[]{"user"}, "", false, new String[]{"TOP"},
ObjectClassType.STRUCTURAL, new String[]{"memberOf"},
new String[]{}, new HashMap());
addEntry("dn: cn=schema2,dc=com", "objectClass: top", "objectClass: ldapSubEntry", "objectClass: subschema", "cn: schema2",
"objectClasses: " + oc.toString());
addEntry("dn: dc=people,dc=com", "objectClass: top", "objectClass: domain", "dc: people");
addEntry("dn: dc=groups,dc=com", "objectClass: top", "objectClass: domain", "dc: groups");
addEntry("dn: cn=test-group,dc=groups,dc=com", "objectClass: groupOfUniqueNames", "cn: test group");
addEntry("dn: cn=Testy Tester,dc=people,dc=com", "objectClass: Person", "objectClass: user", "objectClass: organizationalPerson", "sn: Tester", "cn: Testy Tester", "memberOf: cn=test-group,dc=groups,dc=com");
}
public void addEntry(String... args) throws LDIFException, LDAPException
{
LDAPResult result = server.add(args);
assert (result.getResultCode().intValue() == 0);
System.out.println("added entry:" + Arrays.asList(args));
}
मुझे एक डीएन के साथ एक एंट्री जोड़ने में असमर्थ है जो सबस्कमा सबेंट्री डीएन 'सीएन = स्कीमा' त्रुटि के समान है या जब मैं इसे कोशिश करता हूं, एसडीके v.2.3.4 – SelimOber