Class RepositoryManager
java.lang.Object
com.sun.enterprise.admin.servermgmt.KeystoreManager
com.sun.enterprise.admin.servermgmt.MasterPasswordFileManager
com.sun.enterprise.admin.servermgmt.RepositoryManager
- Direct Known Subclasses:
PEDomainsManager
The RepositoryManager serves as a common base class for the following PEDomainsManager,
PEInstancesManager, AgentManager (the SE Node Agent).
It's purpose is to abstract out any shared functionality related to lifecycle management of
domains, instances and node agents.
This includes creation, deletion, listing, and starting and stopping.
- Author:
- kebbs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThe RepositoryManagerMessages class is used to abstract out ResourceBundle messages that are specific to a domain, node-agent, or server instance.Nested classes/interfaces inherited from class com.sun.enterprise.admin.servermgmt.KeystoreManager
KeystoreManager.KeytoolExecutor -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringstatic final Stringprotected static final StringFields inherited from class com.sun.enterprise.admin.servermgmt.KeystoreManager
_fileLayout, CERTIFICATE_ALIAS, DEFAULT_MASTER_PASSWORD, INSTANCE_SECURE_ADMIN_ALIAS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangePasswordAliasKeystorePassword(RepositoryConfig config, String oldPassword, String newPassword) Change the password protecting the password alias keystoreprotected voidcheckRepository(RepositoryConfig config) voidcheckRepository(RepositoryConfig config, boolean existingRepository) voidcheckRepository(RepositoryConfig config, boolean existingRepository, boolean checkRootDir) Sanity check on the repository.protected voidcreateTimerDbn(RepositoryConfig config) Create the timer database dbn file.protected voidcreateTimerWal(RepositoryConfig config) Create the timer database wal file.protected voiddeleteRepository(RepositoryConfig config) Deletes the repository (domain, node agent, server instance).protected voiddeleteRepository(RepositoryConfig config, boolean deleteJMSProvider) Deletes the repository (domain, node agent, server instance).protected voidgenerateFromTemplate(com.sun.enterprise.admin.util.TokenValueSet tokens, File template, File destinationFile) getClearPasswordForAlias(RepositoryConfig config, String password, String alias) retrieve clear password from password alias keystoreprotected RepositoryConfiggetConfigForRepositoryStatus(RepositoryConfig config, String repository) Return all repositories (domains, node agents, server instances) and their corresponding status (e.g.protected String[]getInteractiveOptions(String user, String password, String masterPassword, HashMap<Object, Object> extraPasswords) Cleans the mq broker instances created for all the server instances that are managed by this domain.protected FilegetRepositoryDir(RepositoryConfig config) protected FilegetRepositoryRootDir(RepositoryConfig config) static booleanDetermines if the NSS support is available in this installation.protected booleanisValidRepository(RepositoryConfig config) protected booleanprotected String[]listRepository(RepositoryConfig config) Return all repositories (domains, node agents, server instances)protected booleanrepositoryExists(RepositoryConfig config) protected voidprotected voidsetPermissions(RepositoryConfig repositoryConfig) Sets the permissions for the domain directory, its config directory, startserv/stopserv scripts etc.voidvalidateMasterPassword(RepositoryConfig config, String password) We validate the master password by trying to open the password alias keystore.Methods inherited from class com.sun.enterprise.admin.servermgmt.MasterPasswordFileManager
changeMasterPasswordInMasterPasswordFile, changeMasterPasswordInMasterPasswordFile, createMasterPasswordFile, deleteMasterPasswordFile, readMasterPasswordFileMethods inherited from class com.sun.enterprise.admin.servermgmt.KeystoreManager
changeKeystorePassword, changeS1ASAliasPassword, changeSSLCertificateDatabasePassword, chmod, copyCertificatesToTrustStore, createKeyStore, getCertificateDN, getDASCertDN, getFileLayout, getInstanceCertDN
-
Field Details
-
CERTUTIL_CMD
-
NEW_LINE
-
_messages
-
DEBUG
- See Also:
-
-
Constructor Details
-
RepositoryManager
public RepositoryManager()Creates a new instance of RepositoryManager
-
-
Method Details
-
setMessages
-
getMessages
-
generateFromTemplate
protected void generateFromTemplate(com.sun.enterprise.admin.util.TokenValueSet tokens, File template, File destinationFile) throws IOException - Throws:
IOException
-
repositoryExists
-
isValidRepository
-
isValidRepository
-
getRepositoryDir
-
getRepositoryRootDir
-
checkRepository
- Throws:
RepositoryException
-
checkRepository
public void checkRepository(RepositoryConfig config, boolean existingRepository) throws RepositoryException - Throws:
RepositoryException
-
checkRepository
public void checkRepository(RepositoryConfig config, boolean existingRepository, boolean checkRootDir) throws RepositoryException Sanity check on the repository. This is executed prior to create/delete/start/stop.- Throws:
RepositoryException
-
setPermissions
Sets the permissions for the domain directory, its config directory, startserv/stopserv scripts etc.- Throws:
RepositoryException
-
deleteRepository
Deletes the repository (domain, node agent, server instance).- Throws:
RepositoryException
-
deleteRepository
protected void deleteRepository(RepositoryConfig config, boolean deleteJMSProvider) throws RepositoryException Deletes the repository (domain, node agent, server instance). If the deleteJMSProvider flag is set, we delete the jms instance. The jms instance is present in the domain only and not when the repository corresponds to a server instance or node agent.- Throws:
RepositoryException
-
listRepository
Return all repositories (domains, node agents, server instances)- Throws:
RepositoryException
-
getConfigForRepositoryStatus
Return all repositories (domains, node agents, server instances) and their corresponding status (e.g. running or stopped) in string form. -
validateMasterPassword
public void validateMasterPassword(RepositoryConfig config, String password) throws RepositoryException We validate the master password by trying to open the password alias keystore. This means that the keystore must already exist.- Parameters:
config-password-- Throws:
RepositoryException
-
getClearPasswordForAlias
public String getClearPasswordForAlias(RepositoryConfig config, String password, String alias) throws RepositoryException retrieve clear password from password alias keystore- Parameters:
config-password-alias- for which the clear text password would returns- Throws:
RepositoryException
-
changePasswordAliasKeystorePassword
protected void changePasswordAliasKeystorePassword(RepositoryConfig config, String oldPassword, String newPassword) throws RepositoryException Change the password protecting the password alias keystore- Parameters:
config-oldPassword- old passwordnewPassword- new password- Throws:
RepositoryException
-
createTimerWal
Create the timer database wal file.- Throws:
RepositoryException
-
createTimerDbn
Create the timer database dbn file.- Throws:
RepositoryException
-
getInteractiveOptions
protected String[] getInteractiveOptions(String user, String password, String masterPassword, HashMap<Object, Object> extraPasswords) Cleans the mq broker instances created for all the server instances that are managed by this domain. This method is added to this class for the following reasons 1) Depends on the preConditions of the deleteRespository method - like instance not running. 2) Requires the repository to exist.- Parameters:
config-- Throws:
RepositoryException
-
isNSSSupportAvailable
public static boolean isNSSSupportAvailable()Determines if the NSS support is available in this installation. The check involves availability of thecertutilexecutable.- Returns:
- true if certutil exists false otherwise
-