|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.evolveum.midpoint.test.ldap.OpenDJController
public class OpenDJController
This class controls embedded OpenDJ instance. It is used in Unit tests. It configures and starts and stops the instance. It can even manage a "template" configuration of OpenDJ and copy it to working instance configuration.
| Field Summary | |
|---|---|
protected java.io.File |
configFile
|
protected org.opends.server.protocols.internal.InternalClientConnection |
internalConnection
|
protected java.io.File |
serverRoot
|
protected java.io.File |
templateRoot
|
| Constructor Summary | |
|---|---|
OpenDJController()
|
|
OpenDJController(java.lang.String serverRoot)
|
|
OpenDJController(java.lang.String serverRoot,
java.lang.String templateServerRoot)
|
|
| Method Summary | |
|---|---|
org.opends.server.types.Entry |
addEntryFromLdifFile(java.lang.String filename)
|
static void |
assertAttribute(org.opends.server.types.SearchResultEntry response,
java.lang.String name,
java.lang.String... values)
|
java.util.Set<java.lang.String> |
asSet(java.util.List<org.opends.server.types.Attribute> attributes)
|
static void |
copyDirectory(java.io.File src,
java.io.File dst)
Copy a directory and its contents. |
static void |
copyFile(java.io.File sourceFile,
java.io.File destFile)
|
static void |
deleteDirectory(java.io.File dir)
Delete a directory and its contents. |
static java.lang.String |
getAttributeValue(org.opends.server.types.SearchResultEntry response,
java.lang.String name)
|
java.io.File |
getConfigFile()
Get the value of configFile File name of primary OpenDS configuration file. |
org.opends.server.protocols.internal.InternalClientConnection |
getInternalConnection()
Get the value of internalConnection The connection to the OpenDS instance. |
java.io.File |
getServerRoot()
Get the value of serverRoot. |
java.io.File |
getTemplateServerRoot()
Get the value of templateServerRoot The top directory of template OpenDS installation. |
boolean |
isAccountEnabled(org.opends.server.types.SearchResultEntry ldapEntry)
|
void |
refreshFromTemplate()
Refresh working OpenDS installation from the template. |
org.opends.server.types.SearchResultEntry |
searchAndAssertByEntryUuid(java.lang.String entryUuid)
|
org.opends.server.types.SearchResultEntry |
searchByEntryUuid(java.lang.String entryUuid)
|
org.opends.server.types.SearchResultEntry |
searchByUid(java.lang.String string)
|
void |
setConfigFile(java.io.File configFile)
Set the value of configFile File name of primary OpenDS configuration file. |
void |
setServerRoot(java.io.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 coppied from the template. |
void |
stop()
Stop the embedded OpenDS server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.File serverRoot
protected java.io.File configFile
protected java.io.File templateRoot
protected org.opends.server.protocols.internal.InternalClientConnection internalConnection
| Constructor Detail |
|---|
public OpenDJController()
public OpenDJController(java.lang.String serverRoot)
public OpenDJController(java.lang.String serverRoot,
java.lang.String templateServerRoot)
| Method Detail |
|---|
public java.io.File getServerRoot()
public void setServerRoot(java.io.File serverRoot)
serverRoot - new value of serverRootpublic java.io.File getConfigFile()
public void setConfigFile(java.io.File configFile)
configFile - new value of configFilepublic java.io.File getTemplateServerRoot()
public org.opends.server.protocols.internal.InternalClientConnection getInternalConnection()
public void refreshFromTemplate()
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxException
public static void copyFile(java.io.File sourceFile,
java.io.File destFile)
throws java.io.IOException
java.io.IOException
public org.opends.server.protocols.internal.InternalClientConnection startCleanServer()
throws java.io.IOException,
java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxExceptionpublic org.opends.server.protocols.internal.InternalClientConnection start()
public void stop()
public static void copyDirectory(java.io.File src,
java.io.File dst)
throws java.io.IOException
src - The name of the directory to copy.dst - The name of the destination directory.
java.io.IOException - If the directory could not be copied.
public static void deleteDirectory(java.io.File dir)
throws java.io.IOException
dir - The name of the directory to delete.
java.io.IOException - If the directory could not be deleted.public java.util.Set<java.lang.String> asSet(java.util.List<org.opends.server.types.Attribute> attributes)
public org.opends.server.types.SearchResultEntry searchByEntryUuid(java.lang.String entryUuid)
throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.SearchResultEntry searchAndAssertByEntryUuid(java.lang.String entryUuid)
throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryException
public org.opends.server.types.SearchResultEntry searchByUid(java.lang.String string)
throws org.opends.server.types.DirectoryException
org.opends.server.types.DirectoryExceptionpublic boolean isAccountEnabled(org.opends.server.types.SearchResultEntry ldapEntry)
public static java.lang.String getAttributeValue(org.opends.server.types.SearchResultEntry response,
java.lang.String name)
public static void assertAttribute(org.opends.server.types.SearchResultEntry response,
java.lang.String name,
java.lang.String... values)
public org.opends.server.types.Entry addEntryFromLdifFile(java.lang.String filename)
throws java.io.IOException,
org.opends.server.util.LDIFException
java.io.IOException
org.opends.server.util.LDIFException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||