public class OpenDJController extends AbstractResourceController
Modifier and Type | Field and Description |
---|---|
protected File |
configFile |
static String |
DEFAULT_TEMPLATE_NAME |
protected org.opends.server.protocols.internal.InternalClientConnection |
internalConnection |
static String |
RI_TEMPLATE_NAME |
protected File |
serverRoot |
protected File |
templateRoot |
resource
Constructor and Description |
---|
OpenDJController() |
OpenDJController(String serverRoot) |
Modifier and Type | Method and Description |
---|---|
List<org.opends.server.types.Entry> |
addEntriesFromLdifFile(String filename) |
void |
addEntry(org.opends.server.types.Entry ldapEntry) |
void |
addEntry(String ldif) |
org.opends.server.types.Entry |
addEntryFromLdifFile(File file) |
org.opends.server.types.Entry |
addEntryFromLdifFile(String filename) |
org.opends.server.util.ChangeRecordEntry |
addGroupUniqueMember(String groupDn,
String memberDn) |
org.opends.server.util.ChangeRecordEntry |
addGroupUniqueMembers(String groupDn,
List<String> memberDns) |
void |
assertActive(org.opends.server.types.Entry response,
boolean active) |
static void |
assertAttribute(org.opends.server.types.Entry response,
String name,
String... values) |
static void |
assertContainsDn(String message,
Collection<String> actualValues,
String expectedValue) |
static void |
assertDn(org.opends.server.types.Entry response,
String expected) |
static void |
assertNoAttribute(org.opends.server.types.Entry response,
String name) |
void |
assertNoEntry(String dn) |
static void |
assertNoObjectClass(org.opends.server.types.Entry response,
String unexpected) |
void |
assertNoUniqueMember(org.opends.server.types.Entry groupEntry,
String accountDn) |
void |
assertNoUniqueMember(String groupDn,
String accountDn) |
static void |
assertObjectClass(org.opends.server.types.Entry response,
String expected) |
void |
assertPassword(String entryDn,
String password) |
void |
assertUniqueMember(org.opends.server.types.Entry groupEntry,
String accountDn) |
void |
assertUniqueMember(String groupDn,
String accountDn) |
Set<String> |
asSet(List<org.opends.server.types.Attribute> attributes) |
void |
assumeRunning() |
void |
assumeStopped() |
boolean |
checkPassword(String entryDn,
String password) |
void |
delete(String entryDn) |
static void |
deleteDirectory(File dir)
Delete a directory and its contents.
|
String |
dumpEntries() |
String |
dumpTree() |
org.opends.server.util.ChangeRecordEntry |
executeLdifChange(File file) |
org.opends.server.util.ChangeRecordEntry |
executeLdifChange(String ldif) |
org.opends.server.util.ChangeRecordEntry |
executeRenameChange(String filename) |
org.opends.server.types.Entry |
fetchAndAssertEntry(String dn,
String objectClass) |
org.opends.server.types.Entry |
fetchEntry(String dn) |
static String |
getAttributeValue(org.opends.server.types.Attribute attribute) |
static String |
getAttributeValue(org.opends.server.types.Entry response,
String name) |
static byte[] |
getAttributeValueBinary(org.opends.server.types.Entry response,
String name) |
static Collection<String> |
getAttributeValues(org.opends.server.types.Entry response,
String name) |
File |
getConfigFile()
Get the value of configFile
File name of primary OpenDS configuration file.
|
static String |
getDn(org.opends.server.types.Entry response) |
Collection<String> |
getGroupUniqueMembers(String groupDn) |
org.opends.server.protocols.internal.InternalClientConnection |
getInternalConnection()
Get the value of internalConnection
The connection to the OpenDS instance.
|
File |
getServerRoot()
Get the value of serverRoot.
|
String |
getSuffix() |
String |
getSuffixPeople() |
File |
getTemplateServerRoot()
Get the value of templateServerRoot
The top directory of template OpenDS installation.
|
boolean |
isAccountEnabled(org.opends.server.types.Entry ldapEntry) |
boolean |
isRunning() |
org.opends.server.util.ChangeRecordEntry |
modifyReplace(String entryDn,
String attributeName,
String value) |
void |
refreshFromTemplate(String templateName)
Refresh working OpenDS installation from the template.
|
org.opends.server.util.ChangeRecordEntry |
removeGroupUniqueMember(String groupDn,
String memberDn) |
org.opends.server.types.Entry |
searchAndAssertByEntryUuid(String entryUuid) |
org.opends.server.types.Entry |
searchByEntryUuid(String entryUuid) |
org.opends.server.types.Entry |
searchByUid(String string) |
org.opends.server.types.Entry |
searchSingle(String filter) |
void |
setConfigFile(File configFile)
Set the value of configFile
File name of primary OpenDS configuration file.
|
void |
setServerRoot(File serverRoot)
Set the value of serverRoot
The top directory of working OpenDS installation.
|
org.opends.server.protocols.internal.InternalClientConnection |
start()
Start the embedded OpenDJ directory server.
|
org.opends.server.protocols.internal.InternalClientConnection |
startCleanServer()
Start the embedded OpenDJ directory server using files copied from the default
template.
|
org.opends.server.protocols.internal.InternalClientConnection |
startCleanServer(String templateName)
Start the embedded OpenDJ directory server using files copied from the specified
template.
|
org.opends.server.protocols.internal.InternalClientConnection |
startCleanServerRI()
Start the embedded OpenDJ directory server using files copied from the
template with referential integrity plugin turned on.
|
void |
stop()
Stop the embedded OpenDS server.
|
String |
toHumanReadableLdifoid(org.opends.server.types.Entry entry) |
getAttributePath, getAttributeQName, getNamespace, getResource, setResource
public static final String DEFAULT_TEMPLATE_NAME
public static final String RI_TEMPLATE_NAME
protected File serverRoot
protected File configFile
protected File templateRoot
protected org.opends.server.protocols.internal.InternalClientConnection internalConnection
public OpenDJController()
public OpenDJController(String serverRoot)
public File getServerRoot()
public void setServerRoot(File serverRoot)
serverRoot
- new value of serverRootpublic File getConfigFile()
public void setConfigFile(File configFile)
configFile
- new value of configFilepublic File getTemplateServerRoot()
public String getSuffix()
public String getSuffixPeople()
public org.opends.server.protocols.internal.InternalClientConnection getInternalConnection()
public void refreshFromTemplate(String templateName) throws IOException, URISyntaxException
IOException
URISyntaxException
public org.opends.server.protocols.internal.InternalClientConnection startCleanServer() throws IOException, URISyntaxException
IOException
URISyntaxException
public org.opends.server.protocols.internal.InternalClientConnection startCleanServerRI() throws IOException, URISyntaxException
IOException
URISyntaxException
public org.opends.server.protocols.internal.InternalClientConnection startCleanServer(String templateName) throws IOException, URISyntaxException
IOException
URISyntaxException
public org.opends.server.protocols.internal.InternalClientConnection start()
public void stop()
public boolean isRunning()
public void assumeRunning()
public void assumeStopped()
public static void deleteDirectory(File dir) throws IOException
dir
- The name of the directory to delete.IOException
- If the directory could not be deleted.public org.opends.server.types.Entry searchByEntryUuid(String entryUuid) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.Entry searchAndAssertByEntryUuid(String entryUuid) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.Entry searchSingle(String filter) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.Entry searchByUid(String string) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.Entry fetchEntry(String dn) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.Entry fetchAndAssertEntry(String dn, String objectClass) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public boolean isAccountEnabled(org.opends.server.types.Entry ldapEntry)
public static String getAttributeValue(org.opends.server.types.Entry response, String name)
public static String getAttributeValue(org.opends.server.types.Attribute attribute)
public static byte[] getAttributeValueBinary(org.opends.server.types.Entry response, String name)
public static Collection<String> getAttributeValues(org.opends.server.types.Entry response, String name)
public static String getDn(org.opends.server.types.Entry response)
public static void assertDn(org.opends.server.types.Entry response, String expected) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public void assertNoEntry(String dn) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public static void assertObjectClass(org.opends.server.types.Entry response, String expected) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public static void assertNoObjectClass(org.opends.server.types.Entry response, String unexpected) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public void assertUniqueMember(org.opends.server.types.Entry groupEntry, String accountDn) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public static void assertContainsDn(String message, Collection<String> actualValues, String expectedValue) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public void assertUniqueMember(String groupDn, String accountDn) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public void assertNoUniqueMember(String groupDn, String accountDn) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public void assertNoUniqueMember(org.opends.server.types.Entry groupEntry, String accountDn)
public static void assertAttribute(org.opends.server.types.Entry response, String name, String... values)
public static void assertNoAttribute(org.opends.server.types.Entry response, String name)
public void assertActive(org.opends.server.types.Entry response, boolean active)
public org.opends.server.types.Entry addEntryFromLdifFile(File file) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public org.opends.server.types.Entry addEntryFromLdifFile(String filename) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public List<org.opends.server.types.Entry> addEntriesFromLdifFile(String filename) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public void addEntry(org.opends.server.types.Entry ldapEntry)
public void addEntry(String ldif) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public org.opends.server.util.ChangeRecordEntry executeRenameChange(String filename) throws org.opends.server.util.LDIFException, IOException
org.opends.server.util.LDIFException
IOException
public org.opends.server.util.ChangeRecordEntry executeLdifChange(File file) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public org.opends.server.util.ChangeRecordEntry executeLdifChange(String ldif) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public org.opends.server.util.ChangeRecordEntry modifyReplace(String entryDn, String attributeName, String value) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public void delete(String entryDn)
public String dumpEntries() throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public String dumpTree() throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public String toHumanReadableLdifoid(org.opends.server.types.Entry entry)
public Collection<String> getGroupUniqueMembers(String groupDn) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.util.ChangeRecordEntry removeGroupUniqueMember(String groupDn, String memberDn) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public org.opends.server.util.ChangeRecordEntry addGroupUniqueMember(String groupDn, String memberDn) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public org.opends.server.util.ChangeRecordEntry addGroupUniqueMembers(String groupDn, List<String> memberDns) throws IOException, org.opends.server.util.LDIFException
IOException
org.opends.server.util.LDIFException
public boolean checkPassword(String entryDn, String password) throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
Copyright © 2016 evolveum. All rights reserved.