Class UserData

  • Direct Known Subclasses:
    UninstallUserData

    public class UserData
    extends Object
    This class is used to provide a data model for the different parameters that the user can provide in the installation wizard.
    • Field Detail

      • SERVER_SCRIPT_NAME

        public static final String SERVER_SCRIPT_NAME
        The script name to be used to get and set the java arguments for the server runtime.
        See Also:
        Constant Field Values
      • IMPORT_SCRIPT_NAME

        public static final String IMPORT_SCRIPT_NAME
        The script name to be used to get and set the java arguments for the (off-line) import.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UserData

        public UserData()
        Creates a user data object with default values.
    • Method Detail

      • setServerLocation

        public void setServerLocation​(String serverLocation)
        Sets the location of the server (installation path).
        Parameters:
        serverLocation - the new server location (installation path).
      • getServerLocation

        public String getServerLocation()
        Returns the location of the server (installation path).
        Returns:
        the location of the server (installation path).
      • setHostName

        public void setHostName​(String hostName)
        Sets the host name.
        Parameters:
        hostName - the server host name.
      • getHostName

        public String getHostName()
        Returns the server host name.
        Returns:
        the server host name.
      • getHostPort

        public HostPort getHostPort()
        Returns the server host name and LDAP port.
        Returns:
        the server host name and LDAP port.
      • setServerPort

        public void setServerPort​(int serverPort)
        Sets the server LDAP port.
        Parameters:
        serverPort - the new server LDAP port.
      • getServerPort

        public int getServerPort()
        Returns the server LDAP port.
        Returns:
        the server LDAP port.
      • setAdminConnectorPort

        public void setAdminConnectorPort​(int adminConnectorPort)
        Sets the admin connector port.
        Parameters:
        adminConnectorPort - the new admin connector port.
      • getAdminConnectorPort

        public int getAdminConnectorPort()
        Returns the admin connector port.
        Returns:
        the admin connector port.
      • setServerJMXPort

        public void setServerJMXPort​(int serverJMXPort)
        Sets the server JMX port.
        Parameters:
        serverJMXPort - the new server JMX port.
      • getServerJMXPort

        public int getServerJMXPort()
        Returns the server JMX port.
        Returns:
        the server JMX port.
      • getDirectoryManagerDn

        public DN getDirectoryManagerDn()
        Returns the Directory Manager DN.
        Returns:
        the Directory Manager DN.
      • setDirectoryManagerDn

        public void setDirectoryManagerDn​(DN directoryManagerDn)
        Sets the new Directory Manager DN.
        Parameters:
        directoryManagerDn - the new Directory Manager DN.
      • getDirectoryManagerPwd

        public String getDirectoryManagerPwd()
        Returns the Directory Manager password.
        Returns:
        the Directory Manager password.
      • setDirectoryManagerPwd

        public void setDirectoryManagerPwd​(String directoryManagerPwd)
        Sets the new Directory Manager password.
        Parameters:
        directoryManagerPwd - the new Directory Manager password.
      • getStartServer

        public boolean getStartServer()
        Returns true if the server must be started once the installation is finished, false if not.
        Returns:
        true if the server must be started once the installation is finished, false if not.
      • setStartServer

        public void setStartServer​(boolean startServer)
        Sets whether we want to start the server once the installation is finished or not.
        Parameters:
        startServer - the boolean indicating whether to start the server or not.
      • setStopServer

        public void setStopServer​(boolean stopServer)
        Sets whether to stop the server or not.
        Parameters:
        stopServer - stop the server or not.
      • getStopServer

        public boolean getStopServer()
        Returns whether the user wants to stop the server or not.
        Returns:
        true if the user wants to stop the server and \ false otherwise.
      • getEnableWindowsService

        public boolean getEnableWindowsService()
        Returns true if the windows service must be enabled during installation, false if not.
        Returns:
        true if the windows service must be enabled during installation, false if not.
      • setEnableWindowsService

        public void setEnableWindowsService​(boolean enableWindowsService)
        Sets whether we want to enable windows service during installation or not.
        Parameters:
        enableWindowsService - the boolean indicating whether we want to enable windows service during installation or not.
      • setBackendType

        public void setBackendType​(ManagedObjectDefinition<? extends BackendCfgClient,​? extends BackendCfg> backendType)
        Sets the new userRoot backend type.
        Parameters:
        backendType - The new backend type. This string must be compatible with dsconfig tool.
      • getNewSuffixOptions

        public NewSuffixOptions getNewSuffixOptions()
        Returns the NewSuffixOptions object representing the data in the New Suffix Data Options panel.
        Returns:
        the NewSuffixOptions object representing the data in the New Suffix Data Options panel.
      • setNewSuffixOptions

        public void setNewSuffixOptions​(NewSuffixOptions newSuffixOptions)
        Sets the NewSuffixOptions object representing the data in the New Suffix Data Options panel.
        Parameters:
        newSuffixOptions - the NewSuffixOptions object representing the data in the New Suffix Data Options panel.
      • getReplicationOptions

        public DataReplicationOptions getReplicationOptions()
        Returns the DataReplicationOptions object representing the data in the Data Replication panel.
        Returns:
        the DataReplicationOptions object representing the data in the Data Replication panel.
      • setReplicationOptions

        public void setReplicationOptions​(DataReplicationOptions replicationOptions)
        Sets the DataReplicationOptions object representing the data in the Data Replication panel.
        Parameters:
        replicationOptions - the DataReplicationOptions object representing the data in the Data Replication panel.
      • mustCreateAdministrator

        public boolean mustCreateAdministrator()
        Returns whether must create a global administrator or not.
        Returns:
        true if we must create a global administrator and false otherwise.
      • createAdministrator

        public void createAdministrator​(boolean createAdministrator)
        Sets whether must create a global administrator or not.
        Parameters:
        createAdministrator - whether we must create a global administrator or not.
      • getGlobalAdministratorUID

        public String getGlobalAdministratorUID()
        Returns the UID of the global administrator.
        Returns:
        the UID of the global administrator.
      • setGlobalAdministratorUID

        public void setGlobalAdministratorUID​(String globalAdministratorUID)
        Sets the UID of the global administrator.
        Parameters:
        globalAdministratorUID - the UID of the global administrator.
      • getGlobalAdministratorPassword

        public String getGlobalAdministratorPassword()
        Returns the password of the global administrator.
        Returns:
        the password of the global administrator.
      • setGlobalAdministratorPassword

        public void setGlobalAdministratorPassword​(String globalAdministratorPwd)
        Sets the password of the global administrator.
        Parameters:
        globalAdministratorPwd - the password of the global administrator.
      • setSuffixesToReplicateOptions

        public void setSuffixesToReplicateOptions​(SuffixesToReplicateOptions suffixesToReplicateOptions)
        Sets the suffixes to replicate options.
        Parameters:
        suffixesToReplicateOptions - the suffixes to replicate options object.
      • getSuffixesToReplicateOptions

        public SuffixesToReplicateOptions getSuffixesToReplicateOptions()
        Returns the suffixes to replicate options.
        Returns:
        the suffixes to replicate options.
      • getSecurityOptions

        public SecurityOptions getSecurityOptions()
        Returns the SecurityOptions representing the SSL/StartTLS configuration chosen by the user.
        Returns:
        the SecurityOptions representing the SSL/StartTLS configuration chosen by the user.
      • setSecurityOptions

        public void setSecurityOptions​(SecurityOptions securityOptions)
        Sets the SecurityOptions representing the SSL/StartTLS configuration chosen by the user.
        Parameters:
        securityOptions - the SecurityOptions representing the SSL/StartTLS configuration chosen by the user.
      • setQuiet

        public void setQuiet​(boolean quiet)
        Sets whether this session should print messages to the console if in CLI mode.
        Parameters:
        quiet - where true indicates this session should be quiet
      • isQuiet

        public boolean isQuiet()
        Indicates whether the user has requested quiet mode.

        Quiet mode in the CLI means that nothing is written to output including prompts for information and whether to continue an operation experiencing errors.

        Returns:
        boolean where true indicates this session should be quiet.
      • setVerbose

        public void setVerbose​(boolean verbose)
        Sets whether this session should be verbose.
        Parameters:
        verbose - where true indicates this session should be verbose
      • isVerbose

        public boolean isVerbose()
        Indicates whether the user has requested verbose mode.
        Returns:
        boolean where true indicates this session should be verbose.
      • setForceOnError

        public void setForceOnError​(boolean forceOnError)
        Sets whether we must continue when there is a non critical error.
        Parameters:
        forceOnError - where true indicates to continue uninstall if there is a non critical error.
      • isForceOnError

        public boolean isForceOnError()
        Indicates whether the user has requested to continue when a non critical error occurs.
        Returns:
        boolean where true indicates to continue uninstall if there is a non critical error.
      • isInteractive

        public boolean isInteractive()
        Indicates whether the user has requested interactive mode.

        Interactive mode in the CLI means that the CLI will prompt the user for more information if it is required. Interactivity does NOT affect prompts to the user regarding actions like continuing an operation that is experiencing errors.

        Returns:
        boolean where true indicates this session should be interactive
      • getDefaultPort

        public static int getDefaultPort()
        Provides the port that will be proposed to the user in the second page of the installation wizard. It will check whether we can use ports of type X389 and if not it will return -1.
        Returns:
        the free port of type x389 if it is available and we can use and -1 if not.
      • getDefaultAdminConnectorPort

        public static int getDefaultAdminConnectorPort()
        Provides the administration port that will be proposed to the user in the second page of the installation wizard. It will check whether we can use ports of type X444 and if not it will return -1.
        Returns:
        the free port of type x444 if it is available and we can use and -1 if not.
      • getDefaultSslPort

        public static int getDefaultSslPort​(int defaultLdapPort)
        Provides the port that will be proposed to the user in the security dialog of the installation wizard. It will check whether we can use ports of type X636 and if not it will return -1.
        Parameters:
        defaultLdapPort - the default port used for LDAP.
        Returns:
        the free port of type X636 if it is available and we can use and -1 if not.
      • getDefaultJMXPort

        public static int getDefaultJMXPort​(int[] forbiddenPorts)
        Provides the port that will be used by default for JMX.
        Parameters:
        forbiddenPorts - an array of ports that we cannot use.
        Returns:
        the port X689 if it is available and we can use and -1 if not.
      • getDefaultHostName

        public static String getDefaultHostName()
        Provides the default host name that will be proposed to the user for the local host.
        Returns:
        the default host name that will be proposed to the user for the local host.
      • getRemoteWithNoReplicationPort

        public Map<ServerDescriptor,​AuthenticationData> getRemoteWithNoReplicationPort()
        Returns a Map containing as key a ServerDescriptor and as value an Integer corresponding to the Replication Port chosen by the user. Only the servers that have no replication port appear on this map.
        Returns:
        a Map containing as key a ServerDescriptor and as value an AuthenticationData corresponding to the Replication Port chosen by the user.
      • setRemoteWithNoReplicationPort

        public void setRemoteWithNoReplicationPort​(Map<ServerDescriptor,​AuthenticationData> remoteWithNoReplicationPort)
        Sets a the Replication Ports chosen by the user in the remote servers.
        Parameters:
        remoteWithNoReplicationPort - the Map containing as key a ServerDescriptor and as value an AuthenticationData corresponding to the Replication Port chosen by the user.
      • getScriptNamesForJavaArguments

        public Set<String> getScriptNamesForJavaArguments()
        Returns the different script names for which there are java arguments.
        Returns:
        the different script names for which there are java arguments.
      • getJavaArguments

        public JavaArguments getJavaArguments​(String scriptName)
        Returns the java arguments associated with a script name. Returns null if no java arguments are defined.
        Parameters:
        scriptName - the script name.
        Returns:
        the java arguments associated with a script name.
      • getDefaultJavaArguments

        public JavaArguments getDefaultJavaArguments​(String scriptName)
        Returns the default java arguments associated with a script name. Returns null if no java arguments are defined.
        Parameters:
        scriptName - the script name.
        Returns:
        the default java arguments associated with a script name.
      • setJavaArguments

        public void setJavaArguments​(String scriptName,
                                     JavaArguments args)
        Sets the java arguments associated with a script name.
        Parameters:
        scriptName - the script name.
        args - the java arguments associated with a script name.
      • setConnectTimeout

        public void setConnectTimeout​(int connectTimeout)
        Sets the timeout to be used to establish a connection.
        Parameters:
        connectTimeout - the timeout to be used to establish a connection.
      • getConnectTimeout

        public int getConnectTimeout()
        Returns the timeout to be used to connect in milliseconds.
        Returns:
        the timeout to be used to connect in milliseconds. Returns 0 if there is no timeout.