| | |
| | | import javax.security.auth.callback.ConfirmationCallback; |
| | | |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.controls.PersistentSearchChangeType; |
| | | import org.opends.server.protocols.ldap.LDAPFilter; |
| | | import org.opends.server.tools.ClientException; |
| | | import org.opends.server.tools.upgrade.UpgradeTask.TaskType; |
| | | import org.opends.server.util.BuildVersion; |
| | | import org.opends.server.util.ChangeOperationType; |
| | | |
| | | /** |
| | | * Factory methods for create new upgrade tasks. |
| | |
| | | static int countErrors = 0; |
| | | |
| | | /** |
| | | * Upgrade's logger. |
| | | * Logger for the upgrade |
| | | */ |
| | | static private final Logger LOG = Logger |
| | | .getLogger(UpgradeCli.class.getName()); |
| | |
| | | try |
| | | { |
| | | final File oldSnmpConfig = |
| | | new File(UpgradeUtils.configSnmpSecurityDirectory |
| | | + File.separator + "opends-snmp.security"); |
| | | new File(UpgradeUtils.configSnmpSecurityDirectory, |
| | | "opends-snmp.security"); |
| | | if (oldSnmpConfig.exists()) |
| | | { |
| | | context.notifyProgress(pnc.setProgress(20)); |
| | | LOG.log(Level.INFO, summary.toString()); |
| | | |
| | | final File snmpConfig = |
| | | new File(UpgradeUtils.configSnmpSecurityDirectory |
| | | + File.separator + "opendj-snmp.security"); |
| | | new File(UpgradeUtils.configSnmpSecurityDirectory, |
| | | "opendj-snmp.security"); |
| | | |
| | | FileManager.rename(oldSnmpConfig, snmpConfig); |
| | | |
| | |
| | | |
| | | final int changeCount = |
| | | updateConfigFile(configFile.getPath(), null, |
| | | PersistentSearchChangeType.ADD, ldif); |
| | | ChangeOperationType.ADD, ldif); |
| | | |
| | | displayChangeCount(configFile.getPath(), changeCount); |
| | | |
| | |
| | | LOG.log(Level.INFO, summary); |
| | | if (filter != null) |
| | | { |
| | | LOG.log(Level.INFO, filter.toString()); |
| | | LOG.log(Level.INFO, filter); |
| | | } |
| | | if (ldif != null) |
| | | { |
| | |
| | | |
| | | final int changeCount = |
| | | updateConfigFile(configFile.getPath(), LDAPFilter |
| | | .decode(filter), PersistentSearchChangeType.MODIFY, ldif); |
| | | .decode(filter), ChangeOperationType.MODIFY, ldif); |
| | | |
| | | displayChangeCount(configFile.getPath(), changeCount); |
| | | |