public class EmbeddedOpenDS extends Object
OpenDJ
dependencies.
All the interfaces are invoked from AMSetupServlet
class
at different points : initial installation, normal startup and
normal shutdown of the embedded OpenDJ
instance.Constructor and Description |
---|
EmbeddedOpenDS() |
Modifier and Type | Method and Description |
---|---|
protected static void |
channelCopy(ReadableByteChannel from,
WritableByteChannel to)
Helper Method to Copy from one Byte Channel to another.
|
static void |
delOpenDSServer(org.forgerock.opendj.ldap.Connection lc,
String delServer)
Removes host:port from OpenDJ replication
|
static String |
getAdminPort(String username,
String password,
String hostname,
String port)
Get admin port of the OpenDJ server
|
static String |
getOpenDSVersion() |
static String |
getReplicationPort(String username,
String password,
String hostname,
String port)
Get replication port
|
static int |
getReplicationStatus(String port,
String passwd,
OutputStream oo,
OutputStream err)
Returns Replication Status by invoking OpenDJ
dsreplication
CLI |
static Set |
getServerSet(org.forgerock.opendj.ldap.Connection lc)
Gets list of replicated servers from local OpenDJ directory.
|
static String |
hash(String p)
Returns a one-way hash for passwd using SSHA512 scheme.
|
static void |
initializeForClientUse()
Initialises OpenDJ for client use, used by the CLI tools
|
static boolean |
isMultiServer(Map map) |
static boolean |
isOpenDSVer1Installed() |
static boolean |
isOpenDSVer230Installed() |
static boolean |
isStarted()
Returns
true if the server has already been started. |
static int |
loadLDIF(Map map,
String odsRoot,
String ldif)
Utility function to preload data in the embedded instance.
|
static int |
rebuildIndex(Map map) |
static int |
rebuildIndex(String baseDir,
String baseDN)
Rebuilds indexes for the given base DN and installation directory.
|
static int |
rebuildSMSIndex()
Rebuilds SMS indexes for the embedded DJ config store.
|
static int |
runOpenDSSetup(Map map)
Runs the OpenDJ setup command like this:
$ .
|
static void |
setup(Map map,
javax.servlet.ServletContext servletCtx)
Sets up embedded OpenDJ during initial installation :
lays out the filesystem directory structure needed by OpenDJ
sets up port numbers for ldap and replication
invokes
EmbeddedUtils to start the embedded server. |
static void |
setupOpenDS(Map map)
Runs the OpenDJ setup command to create our instance
|
static void |
setupReplication(Map map) |
static int |
setupReplicationEnable(Map map)
Setups replication between two OpenDJ sms and user stores
|
static int |
setupReplicationInitialize(Map map)
Syncs replication data between two OpenDJ sms and user stores
|
static void |
shutdownServer(String reason)
Gracefully shuts down the embedded OpenDJ instance.
|
static void |
startServer(String odsRoot)
Starts the embedded
OpenDJ instance. |
static boolean |
syncReplicatedDomains(Set currServerSet,
String port,
String passwd)
Synchronizes replication domain info with current list of OpenAM servers.
|
static boolean |
syncReplicatedServerList(Set currServerSet,
String port,
String passwd)
Synchronizes replication domain info with current list of OpenAM servers.
|
static boolean |
syncReplicatedServers(Set currServerSet,
String port,
String passwd)
Synchronizes replication server info with current list of OpenAM servers.
|
public static boolean isStarted()
true
if the server has already been started.true
if the server has already been started.public static void setup(Map map, javax.servlet.ServletContext servletCtx) throws Exception
EmbeddedUtils
to start the embedded server.
map
- Map of properties collected by the configurator.servletCtx
- Servlet Context to read deployed war contents.Exception
- on encountering errors.protected static void channelCopy(ReadableByteChannel from, WritableByteChannel to) throws IOException
from
- to
- IOException
public static void setupOpenDS(Map map) throws Exception
map
- The map of configuration optionsException
- upon encountering errors.public static int runOpenDSSetup(Map map)
map
- Map of properties collected by the configurator.public static void startServer(String odsRoot) throws Exception
OpenDJ
instance.odsRoot
- File system directory where OpenDJ
is installed.Exception
- upon encountering errors.public static void shutdownServer(String reason) throws Exception
reason
- string representing reason why shutdown was called.Exception
- on encountering errors.public static int setupReplicationEnable(Map map)
map
- Map of properties collected by the configurator.public static int setupReplicationInitialize(Map map)
map
- Map of properties collected by the configurator.public static int getReplicationStatus(String port, String passwd, OutputStream oo, OutputStream err)
dsreplication
CLIport
- LDAP port number of embedded OpenDJpasswd
- Directory Manager passwordoo
- Standard outputerr
- : Standard errordsreplication
CLI exit code.public static boolean isMultiServer(Map map)
public static int loadLDIF(Map map, String odsRoot, String ldif)
odsRoot
- Local directory where OpenDJ
is installed.ldif
- Full path of the ldif file to be loaded.public static String hash(String p)
p
- Clear password stringpublic static String getReplicationPort(String username, String password, String hostname, String port)
username
- password
- hostname
- port
- public static String getAdminPort(String username, String password, String hostname, String port)
username
- The username of the directory adminpassword
- The password of the directory adminhostname
- The hostname of the directory serverport
- The port of the directory serverpublic static boolean syncReplicatedServers(Set currServerSet, String port, String passwd)
public static boolean syncReplicatedDomains(Set currServerSet, String port, String passwd)
public static boolean syncReplicatedServerList(Set currServerSet, String port, String passwd)
public static void delOpenDSServer(org.forgerock.opendj.ldap.Connection lc, String delServer)
public static Set getServerSet(org.forgerock.opendj.ldap.Connection lc)
public static int rebuildSMSIndex() throws Exception
Exception
public static int rebuildIndex(String baseDir, String baseDN) throws Exception
baseDir
- the base installation directory.baseDN
- the base DN to rebuild indexes for.Exception
public static boolean isOpenDSVer1Installed()
public static boolean isOpenDSVer230Installed()
public static String getOpenDSVersion()
public static void initializeForClientUse()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.