Author: lquack
Date: Wed Sep 28 15:25:38 2016
New Revision: 1762682
URL: http://svn.apache.org/viewvc?rev=1762682&view=rev
Log:
QPID-7438: [Java Broker] Add changesConfiguredObjectState arguments to
ManagedOperation annotations
Modified:
qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBEnvironmentContainer.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedOperation.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStore.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestCar.java
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCar.java
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCar.java
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/AclFileAccessControlProvider.java
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedAccessControlProvider.java
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedVirtualHostAccessControlProvider.java
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerFileLogger.java
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerMemoryLogger.java
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/VirtualHostFileLogger.java
Modified:
qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBEnvironmentContainer.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBEnvironmentContainer.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBEnvironmentContainer.java
(original)
+++
qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBEnvironmentContainer.java
Wed Sep 28 15:25:38 2016
@@ -29,21 +29,27 @@ public interface BDBEnvironmentContainer
{
void setBDBCacheSize(long cacheSize);
- @ManagedOperation(description = "Update BDB mutable configuration from
settings in context variables")
+ @ManagedOperation(description = "Update BDB mutable configuration from
settings in context variables",
+ changesConfiguredObjectState = false)
void updateMutableConfig();
- @ManagedOperation(description = "Instruct BDB to attempt to clean up its
log files")
+ @ManagedOperation(description = "Instruct BDB to attempt to clean up its
log files",
+ changesConfiguredObjectState = false)
int cleanLog();
- @ManagedOperation(description = "Instruct BDB to perform a checkpoint
operation")
+ @ManagedOperation(description = "Instruct BDB to perform a checkpoint
operation",
+ changesConfiguredObjectState = false)
void checkpoint(@Param(name = "force", defaultValue = "false") boolean
force);
- @ManagedOperation(description = "Get the BDB environment statistics",
nonModifying = true)
+ @ManagedOperation(description = "Get the BDB environment statistics",
nonModifying = true,
+ changesConfiguredObjectState = false)
Map<String,Map<String,Object>> environmentStatistics(@Param(name="reset",
defaultValue = "false", description = "If true, reset the statistics") boolean
reset);
- @ManagedOperation(description = "Get the BDB transaction statistics",
nonModifying = true)
+ @ManagedOperation(description = "Get the BDB transaction statistics",
nonModifying = true,
+ changesConfiguredObjectState = false)
Map<String, Object> transactionStatistics(@Param(name="reset",
defaultValue = "false", description = "If true, reset the statistics")boolean
reset);
- @ManagedOperation(description = "Get the BDB database statistics",
nonModifying = true)
+ @ManagedOperation(description = "Get the BDB database statistics",
nonModifying = true,
+ changesConfiguredObjectState = false)
Map<String, Object> databaseStatistics(@Param(name="database", description
= "database table for which to retrieve statistics")String database,
@Param(name="reset", defaultValue = "false", description = "If true, reset the
statistics") boolean reset);
}
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Broker.java
Wed Sep 28 15:25:38 2016
@@ -189,10 +189,15 @@ public interface Broker<X extends Broker
@ManagedStatistic(statisticType = StatisticType.CUMULATIVE, units =
StatisticUnit.MESSAGES, label = "Outbound")
long getMessagesOut();
- @ManagedOperation(nonModifying = true, description = "Initiates an orderly
shutdown of the Broker.")
+ @ManagedOperation(nonModifying = true,
+ description = "Initiates an orderly shutdown of the Broker.",
+ changesConfiguredObjectState = false)
void initiateShutdown();
- @ManagedOperation(nonModifying = true, description = "Extract
configuration", paramRequiringSecure = "includeSecureAttributes")
+ @ManagedOperation(nonModifying = true,
+ description = "Extract configuration",
+ paramRequiringSecure = "includeSecureAttributes",
+ changesConfiguredObjectState = false)
Map<String,Object> extractConfig(@Param(name="includeSecureAttributes",
description = "include attributes
that may contain passwords or other"
+ " confidential
information",
@@ -240,29 +245,38 @@ public interface Broker<X extends Broker
description = "Number of objects pending finalization")
int getNumberOfObjectsPendingFinalization();
- @ManagedOperation(nonModifying = true, description = "Initiates garbage
collection")
+ @ManagedOperation(nonModifying = true,
+ description = "Initiates garbage collection",
+ changesConfiguredObjectState = false)
void performGC();
@ManagedOperation(nonModifying = true,
- description = "Collects thread stack traces and dead
locks. Dumps stack traces into logs if requested")
+ description = "Collects thread stack traces and dead
locks. Dumps stack traces into logs if requested",
+ changesConfiguredObjectState = false)
Content getThreadStackTraces(@Param(name="appendToLog",
defaultValue = "false",
description = "If true, appends stack
traces into logs")
boolean appendToLog);
@ManagedOperation(nonModifying = true,
- description = "Collects thread stack traces for the threads with
names containing matching characters for given regular expression")
+ description = "Collects thread stack traces for the threads with
names containing matching characters for given regular expression",
+ changesConfiguredObjectState = false)
Content findThreadStackTraces(@Param(name="threadNameFindExpression",
description = "Regular expression to
find threads with names containing matching characters")
String threadNameFindExpression);
- @ManagedOperation(nonModifying = true, description = "Returns the
principal of the currently authenticated user")
+ @ManagedOperation(nonModifying = true,
+ description = "Returns the principal of the currently
authenticated user",
+ changesConfiguredObjectState = false)
Principal getUser();
- @ManagedOperation(nonModifying = true, description = "Returns the groups
to which the currently authenticated user belongs")
+ @ManagedOperation(nonModifying = true,
+ description = "Returns the groups to which the currently
authenticated user belongs",
+ changesConfiguredObjectState = false)
Set<Principal> getGroups();
- @ManagedOperation(description = "Removes a user and all associated
preferences from the brokers configuration")
+ @ManagedOperation(description = "Removes a user and all associated
preferences from the brokers configuration",
+ changesConfiguredObjectState = true)
void purgeUser(@Param(name="origin", description="The
AuthenticationProvider the username is associated
with")AuthenticationProvider<?> origin,
@Param(name="username", description="The unqualified
username that should be purged from the broker")String username);
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
Wed Sep 28 15:25:38 2016
@@ -54,13 +54,11 @@ import org.apache.qpid.configuration.Com
import org.apache.qpid.server.BrokerOptions;
import org.apache.qpid.server.BrokerPrincipal;
import org.apache.qpid.server.configuration.IllegalConfigurationException;
-import org.apache.qpid.server.configuration.updater.Task;
import org.apache.qpid.server.configuration.updater.TaskExecutor;
import org.apache.qpid.server.configuration.updater.TaskExecutorImpl;
import org.apache.qpid.server.logging.EventLogger;
import org.apache.qpid.server.logging.messages.BrokerMessages;
import org.apache.qpid.server.logging.messages.VirtualHostMessages;
-import org.apache.qpid.server.model.preferences.GenericPrincipal;
import org.apache.qpid.server.model.preferences.Preference;
import org.apache.qpid.server.model.preferences.UserPreferences;
import org.apache.qpid.server.model.preferences.UserPreferencesImpl;
@@ -1012,33 +1010,7 @@ public class BrokerImpl extends Abstract
@Override
public void purgeUser(final AuthenticationProvider<?> origin, final String
username)
{
- doSync(doOnConfigThread(new Task<ListenableFuture<Void>, Exception>()
- {
- @Override
- public ListenableFuture<Void> execute() throws Exception
- {
- doPurgeUser(origin, username);
- return Futures.immediateFuture(null);
- }
-
- @Override
- public String getObject()
- {
- return BrokerImpl.this.toString();
- }
-
- @Override
- public String getAction()
- {
- return "purgeUser";
- }
-
- @Override
- public String getArguments()
- {
- return String.format("%s@%s('%s')", username,
origin.getType(), origin.getName());
- }
- }));
+ doPurgeUser(origin, username);
}
private void doPurgeUser(final AuthenticationProvider<?> origin, final
String username)
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedOperation.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedOperation.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedOperation.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/ManagedOperation.java
Wed Sep 28 15:25:38 2016
@@ -33,5 +33,5 @@ public @interface ManagedOperation
boolean nonModifying() default false;
boolean secure() default false;
String paramRequiringSecure() default "";
- boolean changesConfiguredObjectState() default true;
+ boolean changesConfiguredObjectState();
}
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
Wed Sep 28 15:25:38 2016
@@ -281,30 +281,30 @@ public interface Queue<X extends Queue<X
@ManagedStatistic(statisticType = StatisticType.POINT_IN_TIME, units =
StatisticUnit.ABSOLUTE_TIME, label = "Oldest Message")
long getOldestMessageAge();
- @ManagedOperation
+ @ManagedOperation(description = "move messages from this queue to
another", changesConfiguredObjectState = false)
List<Long> moveMessages(@Param(name = "destination", description = "The
queue to which the messages should be moved") Queue<?> destination,
@Param(name = "messageIds", description = "If
provided, only messages in the queue whose (internal) message-id is supplied
will be considered for moving") List<Long> messageIds,
@Param(name = "selector", description = "A (JMS)
selector - if provided, only messages which match the selector will be
considered for moving") String selector,
@Param(name = "limit", description = "Maximum
number of messages to move", defaultValue = "-1") int limit);
- @ManagedOperation
+ @ManagedOperation(description = "copies messages from this queue to
another", changesConfiguredObjectState = false)
List<Long> copyMessages(@Param(name = "destination", description = "The
queue to which the messages should be copied") Queue<?> destination,
@Param(name = "messageIds", description = "If
provided, only messages in the queue whose (internal) message-id is supplied
will be considered for copying") List<Long> messageIds,
@Param(name = "selector", description = "A (JMS)
selector - if provided, only messages which match the selector will be
considered for copying") String selector,
@Param(name = "limit", description = "Maximum
number of messages to copy", defaultValue = "-1") int limit);
- @ManagedOperation
+ @ManagedOperation(description = "removes messages from this queue",
changesConfiguredObjectState = false)
List<Long> deleteMessages(@Param(name = "messageIds", description = "If
provided, only messages in the queue whose (internal) message-id is supplied
will be considered for deletion") List<Long> messageIds,
@Param(name = "selector", description = "A (JMS)
selector - if provided, only messages which match the selector will be
considered for deletion") String selector,
@Param(name = "limit", description = "Maximum
number of messages to delete", defaultValue = "-1") int limit);
- @ManagedOperation
+ @ManagedOperation(description = "removes all messages from this queue",
changesConfiguredObjectState = false)
long clearQueue();
- @ManagedOperation(nonModifying = true, secure = true)
+ @ManagedOperation(nonModifying = true, secure = true,
changesConfiguredObjectState = false)
Content getMessageContent(@Param(name = "messageId") long messageId,
@Param(name = "limit", defaultValue = "-1",
description = "Number of bytes to
return") long limit,
@@ -317,12 +317,18 @@ public interface Queue<X extends Queue<X
+ "(should it be
compressed) before applying any limit. If"
+ "decompression fails the
operation will fail.") boolean decompressBeforeLimiting);
- @ManagedOperation(nonModifying = true, paramRequiringSecure =
"includeHeaders")
+ @ManagedOperation(description = "get information about a range of
messages",
+ nonModifying = true,
+ paramRequiringSecure = "includeHeaders",
+ changesConfiguredObjectState = false)
List<MessageInfo> getMessageInfo(@Param(name = "first", defaultValue =
"-1") int first,
@Param(name = "last", defaultValue =
"-1") int last,
@Param(name = "includeHeaders",
defaultValue = "false") boolean includeHeaders);
- @ManagedOperation(nonModifying = true, paramRequiringSecure =
"includeHeaders")
+ @ManagedOperation(description = "get information about the message with
the given Id",
+ nonModifying = true,
+ paramRequiringSecure = "includeHeaders",
+ changesConfiguredObjectState = false)
MessageInfo getMessageInfoById(@Param(name = "messageId") long messageId,
@Param(name = "includeHeaders",
defaultValue = "true") boolean includeHeaders);
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
Wed Sep 28 15:25:38 2016
@@ -202,28 +202,38 @@ public interface VirtualHost<X extends V
Broker<?> getBroker();
+ // LQ TODO: I think this is not being processed correctly because it is
not annotated on the base. At least is does not show up in the generated
overrides
@Override
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Collection<? extends Connection<?>> getConnections();
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Connection<?> getConnection(@Param(name="name") String name);
@ManagedOperation(secure = true,
description = "Publishes a message to a specified
address. "
+ "Returns the number of queues onto which
it has been placed, "
- + " or zero, if the address routes to no
queues.")
+ + " or zero, if the address routes to no
queues.",
+ changesConfiguredObjectState = false)
int publishMessage(@Param(name = "message")ManageableMessage message);
- @ManagedOperation(nonModifying = true, description = "Extract
configuration", paramRequiringSecure = "includeSecureAttributes")
+ @ManagedOperation(nonModifying = true,
+ description = "Extract configuration",
+ paramRequiringSecure = "includeSecureAttributes",
+ changesConfiguredObjectState = false)
Map<String,Object> exportConfig(@Param(name="includeSecureAttributes",
description = "include attributes
that may contain passwords or other "
+ "confidential
information",
defaultValue = "false") boolean
includeSecureAttributes);
- @ManagedOperation(nonModifying = true, description = "Extract message
store content", secure = true)
+ @ManagedOperation(nonModifying = true,
+ description = "Extract message store content",
+ secure = true,
+ changesConfiguredObjectState = true)
Content exportMessageStore();
- @ManagedOperation(description = "Import message store content", secure =
true)
+ @ManagedOperation(description = "Import message store content",
+ secure = true,
+ changesConfiguredObjectState = true)
void importMessageStore(@Param(name="source", description = "Extract
file")String source);
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStore.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStore.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStore.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/AutoGeneratedSelfSignedKeyStore.java
Wed Sep 28 15:25:38 2016
@@ -51,13 +51,19 @@ public interface AutoGeneratedSelfSigned
@DerivedAttribute(persist = true, secure = true)
String getEncodedPrivateKey();
- @ManagedOperation
+ @ManagedOperation(description = "create a new private key and a new
certificate",
+ changesConfiguredObjectState = true)
void regenerateCertificate();
- @ManagedOperation(nonModifying = true, description = "Extract a Java
KeyStore containing the certificate for the autogenerated key. The KeyStore
can be used as a trust store by JMS client connecting to the broker")
+ @ManagedOperation(nonModifying = true,
+ description = "Extract a Java KeyStore containing the certificate
for the autogenerated key."
+ + " The KeyStore can be used as a trust store by
JMS client connecting to the broker",
+ changesConfiguredObjectState = false)
Content getClientTrustStore(@Param(name="password", defaultValue = "",
description = "The password to use to secure the keystore (by default the empty
string is used).") String password);
- @ManagedOperation(nonModifying = true, description = "Extract a PEM file
containing the certificate for the autogenerated key.")
+ @ManagedOperation(nonModifying = true,
+ description = "Extract a PEM file containing the certificate for
the autogenerated key.",
+ changesConfiguredObjectState = false)
Content getCertificate();
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStore.java
Wed Sep 28 15:25:38 2016
@@ -44,14 +44,16 @@ public interface ManagedPeerCertificateT
@ManagedAttribute(oversize = true, defaultValue = "[]", description =
"List of base64 encoded representations of the ASN.1 DER encoded certificates")
List<Certificate> getStoredCertificates();
- @ManagedOperation(description = "Add a given certificate to the Trust
Store")
+ @ManagedOperation(description = "Add a given certificate to the Trust
Store",
+ changesConfiguredObjectState = true)
void addCertificate(@Param(name = "certificate", description = "PEM or
base64 encoded DER certificate to be added to the Trust Store")
Certificate certificate);
@DerivedAttribute(description = "List of details about the certificates
like validity dates, SANs, issuer and subject names, etc.")
List<CertificateDetails> getCertificateDetails();
- @ManagedOperation(description = "Remove given certificates from the Trust
Store.")
+ @ManagedOperation(description = "Remove given certificates from the Trust
Store.",
+ changesConfiguredObjectState = true)
void removeCertificates(@Param(name = "certificates", description = "List
of certificate details to be removed. The details should take the form given by
the certificateDetails attribute")
List<CertificateDetails> certificates);
}
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/ManagedPeerCertificateTrustStoreImpl.java
Wed Sep 28 15:25:38 2016
@@ -33,10 +33,10 @@ import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.Callable;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
@@ -44,7 +44,6 @@ import javax.net.ssl.X509TrustManager;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import org.apache.qpid.server.configuration.updater.Task;
import org.apache.qpid.server.logging.EventLogger;
import org.apache.qpid.server.logging.messages.TrustStoreMessages;
import org.slf4j.Logger;
@@ -267,56 +266,11 @@ public class ManagedPeerCertificateTrust
@Override
public void addCertificate(final Certificate cert)
{
- final Map<String, Object> updateMap = new HashMap<>();
-
- doAfter(doOnConfigThread(new Task<ListenableFuture<Void>,
RuntimeException>()
- {
- @Override
- public ListenableFuture<Void> execute()
- {
- Set<Certificate> certs = new
HashSet<>(_storedCertificates);
- if(certs.add(cert))
- {
-
updateMap.put("storedCertificates", new ArrayList<>(certs));
- }
- return
Futures.immediateFuture(null);
- }
-
- @Override
- public String getObject()
- {
- return
ManagedPeerCertificateTrustStoreImpl.this.toString();
- }
-
- @Override
- public String getAction()
- {
- return "add certificate";
- }
-
- @Override
- public String getArguments()
- {
- return String.valueOf(cert);
- }
- }),
- new Callable<ListenableFuture<Void>>()
- {
- @Override
- public ListenableFuture<Void> call() throws Exception
- {
- if(updateMap.isEmpty())
- {
- return Futures.immediateFuture(null);
- }
- else
- {
- return setAttributesAsync(updateMap);
- }
- }
-
- });
-
+ final Set<Certificate> certificates = new
LinkedHashSet<>(_storedCertificates);
+ if (certificates.add(cert))
+ {
+ setAttributesAsync(Collections.<String,
Object>singletonMap("storedCertificates", certificates));
+ }
}
@Override
@@ -337,85 +291,38 @@ public class ManagedPeerCertificateTrust
@Override
public void removeCertificates(final List<CertificateDetails> certs)
{
- final Map<String,Set<BigInteger>> certsToRemove = new HashMap<>();
- for(CertificateDetails cert : certs)
+ final Map<String, Set<BigInteger>> certsToRemove = new HashMap<>();
+ for (CertificateDetails cert : certs)
{
- if(!certsToRemove.containsKey(cert.getIssuerName()))
+ if (!certsToRemove.containsKey(cert.getIssuerName()))
{
certsToRemove.put(cert.getIssuerName(), new
HashSet<BigInteger>());
}
certsToRemove.get(cert.getIssuerName()).add(new
BigInteger(cert.getSerialNumber()));
}
- final Map<String, Object> updateMap = new HashMap<>();
-
- doAfter(doOnConfigThread(new Task<ListenableFuture<Void>,
RuntimeException>()
- {
- @Override
- public ListenableFuture<Void> execute()
- {
-
- Set<Certificate> certs = new
HashSet<>(_storedCertificates);
-
- boolean updated = false;
- Iterator<Certificate> iter = certs.iterator();
- while(iter.hasNext())
- {
- Certificate cert = iter.next();
- if(cert instanceof X509Certificate)
- {
- X509Certificate x509Certificate =
(X509Certificate) cert;
- String issuerName =
x509Certificate.getIssuerX500Principal().getName();
- if(certsToRemove.containsKey(issuerName) &&
certsToRemove.get(issuerName).contains(x509Certificate.getSerialNumber()))
- {
- iter.remove();
- updated = true;
- }
- }
- }
-
-
- if(updated)
- {
- updateMap.put("storedCertificates", new
ArrayList<>(certs));
- }
- return Futures.immediateFuture(null);
- }
-
- @Override
- public String getObject()
- {
- return
ManagedPeerCertificateTrustStoreImpl.this.toString();
- }
-
- @Override
- public String getAction()
- {
- return "remove certificates";
- }
-
- @Override
- public String getArguments()
- {
- return String.valueOf(certs);
- }
- }),
- new Callable<ListenableFuture<Void>>()
+ boolean updated = false;
+ Set<Certificate> currentCerts = new
LinkedHashSet<>(_storedCertificates);
+ Iterator<Certificate> iter = currentCerts.iterator();
+ while (iter.hasNext())
+ {
+ Certificate cert = iter.next();
+ if (cert instanceof X509Certificate)
+ {
+ X509Certificate x509Certificate = (X509Certificate) cert;
+ String issuerName =
x509Certificate.getIssuerX500Principal().getName();
+ if(certsToRemove.containsKey(issuerName) &&
certsToRemove.get(issuerName).contains(x509Certificate.getSerialNumber()))
{
- @Override
- public ListenableFuture<Void> call() throws Exception
- {
- if(updateMap.isEmpty())
- {
- return Futures.immediateFuture(null);
- }
- else
- {
- return setAttributesAsync(updateMap);
- }
- }
+ iter.remove();
+ updated = true;
+ }
+ }
+ }
- });
+ if (updated)
+ {
+ setAttributesAsync(Collections.<String,
Object>singletonMap("storedCertificates", currentCerts));
+ }
}
public static class CertificateDetailsImpl implements CertificateDetails,
ManagedAttributeValue
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
(original)
+++
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/security/SiteSpecificTrustStore.java
Wed Sep 28 15:25:38 2016
@@ -58,6 +58,7 @@ public interface SiteSpecificTrustStore<
@DerivedAttribute(description = "The end date of the validity of the
certificate")
Date getCertificateValidUntilDate();
- @ManagedOperation(description = "Re-download the certificate from the URL")
+ @ManagedOperation(description = "Re-download the certificate from the URL",
+ changesConfiguredObjectState = false)
void refreshCertificate();
}
Modified:
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestCar.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestCar.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestCar.java
(original)
+++
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestCar.java
Wed Sep 28 15:25:38 2016
@@ -45,6 +45,6 @@ public interface TestCar<X extends TestC
enum Door { DRIVER, PASSENGER }
- @ManagedOperation
+ @ManagedOperation(changesConfiguredObjectState = false)
Door openDoor(@Param(name = "door") Door door);
}
Modified:
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCar.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCar.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCar.java
(original)
+++
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestKitCar.java
Wed Sep 28 15:25:38 2016
@@ -28,7 +28,7 @@ import org.apache.qpid.server.model.Para
@ManagedObject(category = false)
public interface TestKitCar<X extends TestKitCar<X>> extends TestCar<X>
{
- @ManagedOperation
+ @ManagedOperation(changesConfiguredObjectState = false)
Door openDoor(@Param(name = "door", defaultValue = "PASSENGER") Door door);
@ManagedAttribute
Modified:
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCar.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCar.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCar.java
(original)
+++
qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/model/testmodels/hierarchy/TestStandardCar.java
Wed Sep 28 15:25:38 2016
@@ -28,6 +28,6 @@ import org.apache.qpid.server.store.pref
public interface TestStandardCar<X extends TestStandardCar<X>> extends
TestCar<X>, UserPreferencesCreator
{
- @ManagedOperation
+ @ManagedOperation(changesConfiguredObjectState = false)
Door openDoor(@Param(name = "door", defaultValue = "DRIVER") Door door);
}
Modified:
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/AclFileAccessControlProvider.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/AclFileAccessControlProvider.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/AclFileAccessControlProvider.java
(original)
+++
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/AclFileAccessControlProvider.java
Wed Sep 28 15:25:38 2016
@@ -35,6 +35,7 @@ public interface AclFileAccessControlPro
@ManagedAttribute( mandatory = true, description = "File location",
oversize = true, oversizedAltText = OVER_SIZED_ATTRIBUTE_ALTERNATIVE_TEXT)
String getPath();
- @ManagedOperation( description = "Causes the ACL rules to be reloaded.
Changes are applied immediately.")
+ @ManagedOperation( description = "Causes the ACL rules to be reloaded.
Changes are applied immediately.",
+ changesConfiguredObjectState = true)
void reload();
}
Modified:
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedAccessControlProvider.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedAccessControlProvider.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedAccessControlProvider.java
(original)
+++
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedAccessControlProvider.java
Wed Sep 28 15:25:38 2016
@@ -44,9 +44,12 @@ public interface RuleBasedAccessControlP
@ManagedAttribute( mandatory = true, defaultValue = "[ { \"identity\" :
\"ALL\", \"objectType\" : \"ALL\", \"operation\" : \"ALL\", \"attributes\" :
{}, \"outcome\" : \"ALLOW\"} ]", description = "the ordered list of ACL rules")
List<AclRule> getRules();
- @ManagedOperation(description = "Load access control rules from a file in
the legacy access control rule format")
+ @ManagedOperation(description = "Load access control rules from a file in
the legacy access control rule format",
+ changesConfiguredObjectState = true)
void loadFromFile(@Param(name = "path")String path);
- @ManagedOperation(nonModifying = true, description = "Extract the access
control rules in the legacy access control rule format")
+ @ManagedOperation(nonModifying = true,
+ description = "Extract the access control rules in the legacy
access control rule format",
+ changesConfiguredObjectState = false)
Content extractRules();
}
Modified:
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedVirtualHostAccessControlProvider.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedVirtualHostAccessControlProvider.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedVirtualHostAccessControlProvider.java
(original)
+++
qpid/java/trunk/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/RuleBasedVirtualHostAccessControlProvider.java
Wed Sep 28 15:25:38 2016
@@ -44,9 +44,9 @@ public interface RuleBasedVirtualHostAcc
@ManagedAttribute( mandatory = true, defaultValue = "[ ]")
List<AclRule> getRules();
- @ManagedOperation
+ @ManagedOperation(changesConfiguredObjectState = true)
void loadFromFile(@Param(name = "path") String path);
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Content extractRules();
}
Modified:
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerFileLogger.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerFileLogger.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerFileLogger.java
(original)
+++
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerFileLogger.java
Wed Sep 28 15:25:38 2016
@@ -68,12 +68,13 @@ public interface BrokerFileLogger<X exte
@DerivedAttribute
List<LogFileDetails> getLogFiles();
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Content getFile(@Param(name = "fileName") String fileName);
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Content getFiles(@Param(name = "fileName") Set<String> fileName);
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true,
+ changesConfiguredObjectState = false)
Content getAllFiles();
}
Modified:
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerMemoryLogger.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerMemoryLogger.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerMemoryLogger.java
(original)
+++
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/BrokerMemoryLogger.java
Wed Sep 28 15:25:38 2016
@@ -45,7 +45,7 @@ public interface BrokerMemoryLogger<X ex
@ManagedAttribute( defaultValue = "4096" )
int getMaxRecords();
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Collection<LogRecord> getLogEntries(@Param(name="lastLogId",
defaultValue="0") long lastLogId);
}
Modified:
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/VirtualHostFileLogger.java
URL:
http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/VirtualHostFileLogger.java?rev=1762682&r1=1762681&r2=1762682&view=diff
==============================================================================
---
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/VirtualHostFileLogger.java
(original)
+++
qpid/java/trunk/broker-plugins/logging-logback/src/main/java/org/apache/qpid/server/logging/logback/VirtualHostFileLogger.java
Wed Sep 28 15:25:38 2016
@@ -64,12 +64,12 @@ public interface VirtualHostFileLogger<X
@DerivedAttribute
List<LogFileDetails> getLogFiles();
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Content getFile(@Param(name = "fileName") String fileName);
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Content getFiles(@Param(name = "fileName") Set<String> fileName);
- @ManagedOperation(nonModifying = true)
+ @ManagedOperation(nonModifying = true, changesConfiguredObjectState =
false)
Content getAllFiles();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]