| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange( |
| | | final FileBasedAccessLogPublisherCfg config) |
| | | { |
| | |
| | | final boolean writerAutoFlush = cfg.isAutoFlush() |
| | | && !cfg.isAsynchronous(); |
| | | |
| | | final MultifileTextWriter writer = new MultifileTextWriter( |
| | | final MultifileTextWriter theWriter = new MultifileTextWriter( |
| | | "Multifile Text Writer for " + cfg.dn().toNormalizedString(), |
| | | cfg.getTimeInterval(), fnPolicy, perm, errorHandler, "UTF-8", |
| | | writerAutoFlush, cfg.isAppend(), (int) cfg.getBufferSize()); |
| | |
| | | // Validate retention and rotation policies. |
| | | for (final DN dn : cfg.getRotationPolicyDNs()) |
| | | { |
| | | writer.addRotationPolicy(DirectoryServer.getRotationPolicy(dn)); |
| | | theWriter.addRotationPolicy(DirectoryServer.getRotationPolicy(dn)); |
| | | } |
| | | |
| | | for (final DN dn : cfg.getRetentionPolicyDNs()) |
| | | { |
| | | writer.addRetentionPolicy(DirectoryServer.getRetentionPolicy(dn)); |
| | | theWriter.addRetentionPolicy(DirectoryServer.getRetentionPolicy(dn)); |
| | | } |
| | | |
| | | if (cfg.isAsynchronous()) |
| | |
| | | { |
| | | this.writer = new AsyncronousTextWriter( |
| | | "Asyncronous Text Writer for " + cfg.dn().toNormalizedString(), |
| | | cfg.getQueueSize(), cfg.isAutoFlush(), writer); |
| | | cfg.getQueueSize(), cfg.isAutoFlush(), theWriter); |
| | | } |
| | | else |
| | | { |
| | | this.writer = new ParallelTextWriter("Parallel Text Writer for " |
| | | + cfg.dn().toNormalizedString(), cfg.isAutoFlush(), writer); |
| | | + cfg.dn().toNormalizedString(), cfg.isAutoFlush(), theWriter); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | this.writer = writer; |
| | | this.writer = theWriter; |
| | | } |
| | | } |
| | | catch (final DirectoryException e) |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | final FileBasedAccessLogPublisherCfg config, |
| | | final List<Message> unacceptableReasons) |
| | |
| | | final String formatString = config.getLogRecordTimeFormat(); |
| | | try |
| | | { |
| | | new SimpleDateFormat(formatString); |
| | | new SimpleDateFormat(formatString); |
| | | } |
| | | catch (final Exception e) |
| | | { |
| | |
| | | appendExtendedRequest(extendedOperation, buffer); |
| | | } |
| | | |
| | | String name = null; |
| | | final String oid = extendedOperation.getResponseOID(); |
| | | if (oid != null) |
| | | { |
| | |
| | | .getExtendedOperationHandler(oid); |
| | | if (extOpHandler != null) |
| | | { |
| | | name = extOpHandler.getExtendedOperationName(); |
| | | String name = extOpHandler.getExtendedOperationName(); |
| | | if (name != null) |
| | | { |
| | | buffer.append(" name=\""); |
| | |
| | | { |
| | | buffer.append(" newSuperior=\""); |
| | | buffer.append(newSuperior.toString()); |
| | | buffer.append("\""); |
| | | } |
| | | appendRequestControls(modifyDNOperation, buffer); |
| | | if (modifyDNOperation.isSynchronizationOperation()) |