diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/DefaultAccessValidator.java b/acl-plug/src/main/java/org/apache/rocketmq/acl/DefaultAccessValidator.java
deleted file mode 100644
index 704ace47b7841ba8e0199a17d34b991f15be9f64..0000000000000000000000000000000000000000
--- a/acl-plug/src/main/java/org/apache/rocketmq/acl/DefaultAccessValidator.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.rocketmq.acl;
-
-import org.apache.rocketmq.remoting.protocol.RemotingCommand;
-
-public class DefaultAccessValidator implements AccessValidator {
-
- @Override
- public AccessResource parse(RemotingCommand request, String remoteAddr) {
- return null;
- }
-
- @Override
- public void validate(AccessResource accessResource) {
-
- }
-}
diff --git a/acl-plug/pom.xml b/acl/pom.xml
similarity index 98%
rename from acl-plug/pom.xml
rename to acl/pom.xml
index d91d4203400e4606f25aed61406cf431403dd2ce..3d8d4a7d75c812e01a9e4700fd1ee0f557b5f0a1 100644
--- a/acl-plug/pom.xml
+++ b/acl/pom.xml
@@ -42,7 +42,6 @@
org.yaml
snakeyaml
- 1.19
org.apache.commons
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/AccessResource.java b/acl/src/main/java/org/apache/rocketmq/acl/AccessResource.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/AccessResource.java
rename to acl/src/main/java/org/apache/rocketmq/acl/AccessResource.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/AccessValidator.java b/acl/src/main/java/org/apache/rocketmq/acl/AccessValidator.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/AccessValidator.java
rename to acl/src/main/java/org/apache/rocketmq/acl/AccessValidator.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/DefaultAclRemotingServiceImpl.java b/acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java
similarity index 93%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/DefaultAclRemotingServiceImpl.java
rename to acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java
index 0d5f949c987fc8e5fac08c8b44de6922fd0586c0..b8de0d345a09d66bda1a8064c72e382e52a0b456 100644
--- a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/DefaultAclRemotingServiceImpl.java
+++ b/acl/src/main/java/org/apache/rocketmq/acl/PlainAccessValidator.java
@@ -14,12 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.rocketmq.acl.plug;
+package org.apache.rocketmq.acl;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.acl.AccessResource;
import org.apache.rocketmq.acl.AccessValidator;
+import org.apache.rocketmq.acl.plug.AclRemotingService;
import org.apache.rocketmq.acl.plug.engine.AclPlugEngine;
import org.apache.rocketmq.acl.plug.engine.PlainAclPlugEngine;
import org.apache.rocketmq.acl.plug.entity.AccessControl;
@@ -28,17 +29,17 @@ import org.apache.rocketmq.acl.plug.entity.ControllerParameters;
import org.apache.rocketmq.acl.plug.exception.AclPlugRuntimeException;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
-public class DefaultAclRemotingServiceImpl implements AclRemotingService, AccessValidator {
+public class PlainAccessValidator implements AclRemotingService, AccessValidator {
private AclPlugEngine aclPlugEngine;
- public DefaultAclRemotingServiceImpl() {
+ public PlainAccessValidator() {
ControllerParameters controllerParameters = new ControllerParameters();
this.aclPlugEngine = new PlainAclPlugEngine(controllerParameters);
this.aclPlugEngine.initialize();
}
- public DefaultAclRemotingServiceImpl(AclPlugEngine aclPlugEngine) {
+ public PlainAccessValidator(AclPlugEngine aclPlugEngine) {
this.aclPlugEngine = aclPlugEngine;
}
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AccessContralAnalysis.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/AccessContralAnalysis.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AccessContralAnalysis.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/AccessContralAnalysis.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclPlugController.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/AclPlugController.java
similarity index 94%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclPlugController.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/AclPlugController.java
index 1ec1f1e998f73152c5d57440e89b48e2d234ef9d..8598e93e9c8e28c754c38edf96d2be845f41b449 100644
--- a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclPlugController.java
+++ b/acl/src/main/java/org/apache/rocketmq/acl/plug/AclPlugController.java
@@ -16,6 +16,7 @@
*/
package org.apache.rocketmq.acl.plug;
+import org.apache.rocketmq.acl.PlainAccessValidator;
import org.apache.rocketmq.acl.plug.engine.AclPlugEngine;
import org.apache.rocketmq.acl.plug.engine.PlainAclPlugEngine;
import org.apache.rocketmq.acl.plug.entity.ControllerParameters;
@@ -36,7 +37,7 @@ public class AclPlugController {
this.controllerParameters = controllerParameters;
aclPlugEngine = new PlainAclPlugEngine(controllerParameters);
aclPlugEngine.initialize();
- aclRemotingService = new DefaultAclRemotingServiceImpl(aclPlugEngine);
+ aclRemotingService = new PlainAccessValidator(aclPlugEngine);
this.startSucceed = true;
} catch (Exception e) {
throw new AclPlugRuntimeException(String.format("Start the abnormal , Launch parameters is %s", this.controllerParameters.toString()), e);
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclRemotingService.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/AclRemotingService.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclRemotingService.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/AclRemotingService.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclUtils.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/AclUtils.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/AclUtils.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/AclUtils.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/Authentication.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/Authentication.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/Authentication.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/Authentication.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/AclPlugEngine.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/engine/AclPlugEngine.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/AclPlugEngine.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/engine/AclPlugEngine.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/AuthenticationInfoManagementAclPlugEngine.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/engine/AuthenticationInfoManagementAclPlugEngine.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/AuthenticationInfoManagementAclPlugEngine.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/engine/AuthenticationInfoManagementAclPlugEngine.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/LoginInfoAclPlugEngine.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/engine/LoginInfoAclPlugEngine.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/LoginInfoAclPlugEngine.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/engine/LoginInfoAclPlugEngine.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngine.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngine.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngine.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngine.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/AccessControl.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/AccessControl.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/AccessControl.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/AccessControl.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationInfo.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationInfo.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationInfo.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationInfo.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationResult.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationResult.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationResult.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/AuthenticationResult.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControl.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControl.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControl.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControl.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControlTransport.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControlTransport.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControlTransport.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/BorkerAccessControlTransport.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/ControllerParameters.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/ControllerParameters.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/ControllerParameters.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/ControllerParameters.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/LoginInfo.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/entity/LoginInfo.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/entity/LoginInfo.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/entity/LoginInfo.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/exception/AclPlugRuntimeException.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/exception/AclPlugRuntimeException.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/exception/AclPlugRuntimeException.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/exception/AclPlugRuntimeException.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategy.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategy.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategy.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategy.java
diff --git a/acl-plug/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyFactory.java b/acl/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyFactory.java
similarity index 100%
rename from acl-plug/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyFactory.java
rename to acl/src/main/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyFactory.java
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AccessContralAnalysisTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/AccessContralAnalysisTest.java
similarity index 100%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AccessContralAnalysisTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/AccessContralAnalysisTest.java
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclPlugControllerTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/AclPlugControllerTest.java
similarity index 100%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclPlugControllerTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/AclPlugControllerTest.java
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclRemotingServiceTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/AclRemotingServiceTest.java
similarity index 96%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclRemotingServiceTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/AclRemotingServiceTest.java
index 4830d6d75e114800d1d01a4a858fc9bda6c09f90..37aa38b5919dc45972065fc74f78493dbcfc79ef 100644
--- a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclRemotingServiceTest.java
+++ b/acl/src/test/java/org/apache/rocketmq/acl/plug/AclRemotingServiceTest.java
@@ -20,6 +20,7 @@ import java.util.HashMap;
import org.apache.rocketmq.acl.AccessResource;
import org.apache.rocketmq.acl.AccessValidator;
+import org.apache.rocketmq.acl.PlainAccessValidator;
import org.apache.rocketmq.acl.plug.entity.AccessControl;
import org.apache.rocketmq.acl.plug.entity.AuthenticationResult;
import org.apache.rocketmq.acl.plug.entity.BorkerAccessControl;
@@ -43,7 +44,7 @@ public class AclRemotingServiceTest {
@Before
public void init() {
System.setProperty("rocketmq.home.dir", "src/test/resources");
- DefaultAclRemotingServiceImpl aclRemotingServiceImpl = new DefaultAclRemotingServiceImpl();
+ PlainAccessValidator aclRemotingServiceImpl = new PlainAccessValidator();
defaultAclService = aclRemotingServiceImpl;
accessValidator = aclRemotingServiceImpl;
@@ -64,7 +65,7 @@ public class AclRemotingServiceTest {
@Test
public void defaultConstructorTest() {
System.setProperty("rocketmq.home.dir", "src/test/resources");
- AclRemotingService defaultAclService = new DefaultAclRemotingServiceImpl();
+ AclRemotingService defaultAclService = new PlainAccessValidator();
Assert.assertNotNull(defaultAclService);
}
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclUtilsTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/AclUtilsTest.java
similarity index 100%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AclUtilsTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/AclUtilsTest.java
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AuthenticationTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/AuthenticationTest.java
similarity index 100%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/AuthenticationTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/AuthenticationTest.java
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java
similarity index 100%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/engine/PlainAclPlugEngineTest.java
diff --git a/acl-plug/src/test/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyTest.java b/acl/src/test/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyTest.java
similarity index 100%
rename from acl-plug/src/test/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyTest.java
rename to acl/src/test/java/org/apache/rocketmq/acl/plug/strategy/NetaddressStrategyTest.java
diff --git a/acl-plug/src/test/resources/conf/transport.yml b/acl/src/test/resources/conf/transport.yml
similarity index 100%
rename from acl-plug/src/test/resources/conf/transport.yml
rename to acl/src/test/resources/conf/transport.yml
diff --git a/broker/src/test/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator b/broker/src/test/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator
index 2f26220e5e106536a6b36e32cbf534e874e259fd..bbf21d376c9b4da925243f2cd91575c42f2cdc2d 100644
--- a/broker/src/test/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator
+++ b/broker/src/test/resources/META-INF/service/org.apache.rocketmq.acl.AccessValidator
@@ -1 +1 @@
-org.apache.rocketmq.acl.plug.DefaultAclRemotingServiceImpl
\ No newline at end of file
+org.apache.rocketmq.acl.DefaultAclRemotingServiceImpl
\ No newline at end of file
diff --git a/example/src/main/java/org/apache/rocketmq/example/simple/AclClient.java b/example/src/main/java/org/apache/rocketmq/example/simple/AclClient.java
index d696c91a9290699f72c2b7b69691618a6e4d4943..fa0bf0a1e130e1b401a37e102fbb2830434f8cce 100644
--- a/example/src/main/java/org/apache/rocketmq/example/simple/AclClient.java
+++ b/example/src/main/java/org/apache/rocketmq/example/simple/AclClient.java
@@ -63,7 +63,7 @@ public class AclClient {
}
public static void producer() throws MQClientException {
- DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName", getAalRPCHook());
+ DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName", getAclRPCHook());
producer.setNamesrvAddr("127.0.0.1:9876");
producer.start();
@@ -87,7 +87,7 @@ public class AclClient {
public static void pushConsumer() throws MQClientException {
- DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("please_rename_unique_group_name_5", getAalRPCHook(), new AllocateMessageQueueAveragely());
+ DefaultMQPushConsumer consumer = new DefaultMQPushConsumer("please_rename_unique_group_name_5", getAclRPCHook(), new AllocateMessageQueueAveragely());
consumer.setNamesrvAddr("127.0.0.1:9876");
consumer.subscribe("TopicTest", "*");
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
@@ -107,7 +107,7 @@ public class AclClient {
}
public static void pullConsumer() throws MQClientException {
- DefaultMQPullConsumer consumer = new DefaultMQPullConsumer("please_rename_unique_group_name_6", getAalRPCHook());
+ DefaultMQPullConsumer consumer = new DefaultMQPullConsumer("please_rename_unique_group_name_6", getAclRPCHook());
consumer.setNamesrvAddr("127.0.0.1:9876");
consumer.start();
@@ -169,17 +169,17 @@ public class AclClient {
OFFSE_TABLE.put(mq, offset);
}
- static RPCHook getAalRPCHook() {
- return new AalRPCHook(ACL_RCPHOOK_ACCOUT, ACL_RCPHOOK_PASSWORD);
+ static RPCHook getAclRPCHook() {
+ return new AclRPCHook(ACL_RCPHOOK_ACCOUT, ACL_RCPHOOK_PASSWORD);
}
- static class AalRPCHook implements RPCHook {
+ static class AclRPCHook implements RPCHook {
private String account;
private String password;
- public AalRPCHook(String account, String password) {
+ public AclRPCHook(String account, String password) {
this.account = account;
this.password = password;
}
@@ -198,7 +198,7 @@ public class AclClient {
@Override
public void doAfterResponse(String remoteAddr, RemotingCommand request, RemotingCommand response) {
- // TODO Auto-generated method stub
+ //do nothing
}
diff --git a/pom.xml b/pom.xml
index 4fe56a4bc2e976e26bd7a319b58958695d0e1e8b..84f45fd85dc30508565f687685538f9c50d9f4c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -126,7 +126,7 @@
distribution
openmessaging
logging
- acl-plug
+ acl
@@ -588,6 +588,11 @@
log4j
1.2.17
+
+ org.yaml
+ snakeyaml
+ 1.19
+
org.apache.logging.log4j
log4j-core