| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | // The write lock used to ensure that only one thread can apply a |
| | | // configuration update at any given time. |
| | | private Object configLock; |
| | | private final Object configLock = new Object(); |
| | | |
| | | // The path to the configuration file. |
| | | private String configFile; |
| | |
| | | public void initializeConfigHandler(String configFile, boolean checkSchema) |
| | | throws InitializationException |
| | | { |
| | | // Initialize the config lock. |
| | | configLock = new Object(); |
| | | |
| | | |
| | | // Determine whether we should try to start using the last known good |
| | | // configuration. If so, then only do so if such a file exists. If it |
| | | // doesn't exist, then fall back on the active configuration file. |
| | |
| | | DirectoryEnvironmentConfig envConfig = |
| | | DirectoryServer.getEnvironmentConfig(); |
| | | useLastKnownGoodConfig = envConfig.useLastKnownGoodConfiguration(); |
| | | File f = null; |
| | | File f; |
| | | if (useLastKnownGoodConfig) |
| | | { |
| | | f = new File(configFile + ".startok"); |
| | |
| | | // Determine the appropriate server root. If it's not defined in the |
| | | // environment config, then try to figure it out from the location of the |
| | | // configuration file. |
| | | File instanceFile = envConfig.getInstanceRootFromServerRoot(new File( |
| | | serverRoot)); |
| | | File instanceFile = |
| | | DirectoryEnvironmentConfig.getInstanceRootFromServerRoot(new File( |
| | | serverRoot)); |
| | | if (instanceFile == null) |
| | | { |
| | | Message message = |
| | |
| | | CryptoManager cryptoManager = DirectoryServer.getCryptoManager(); |
| | | Mac mac = null; |
| | | MessageDigest digest = null; |
| | | String digestAlgorithm = null; |
| | | String macKeyID = null; |
| | | |
| | | if (hash) |
| | |
| | | } |
| | | else |
| | | { |
| | | digestAlgorithm = cryptoManager.getPreferredMessageDigestAlgorithm(); |
| | | String digestAlgorithm = cryptoManager.getPreferredMessageDigestAlgorithm(); |
| | | backupProperties.put(BACKUP_PROPERTY_DIGEST_ALGORITHM, digestAlgorithm); |
| | | |
| | | try |
| | |
| | | logError(message); |
| | | } |
| | | |
| | | Message message = ERR_CONFIG_RESTORE_SIGNED_HASH_INVALID.get( |
| | | configBackupDir.getPath()); |
| | | Message message = |
| | | ERR_CONFIG_RESTORE_SIGNED_HASH_INVALID.get(backupID); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public DN getComponentEntryDN() |
| | | { |
| | | return configRootEntry.getDN(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getClassName() |
| | | { |
| | | return CLASS_NAME; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void preloadEntryCache() throws UnsupportedOperationException { |
| | | throw new UnsupportedOperationException("Operation not supported."); |
| | | } |