@Test public void validateTest() { SendMessageRequestHeader messageRequestHeader = new SendMessageRequestHeader(); messageRequestHeader.setTopic("topicB"); RemotingCommand remotingCommand = RemotingCommand.createRequestCommand(RequestCode.SEND_MESSAGE, messageRequestHeader); aclClient.doBeforeRequest("", remotingCommand); ByteBuffer buf = remotingCommand.encodeHeader(); buf.getInt(); buf = ByteBuffer.allocate(buf.limit() - buf.position()).put(buf); buf.position(0); PlainAccessResource accessResource = (PlainAccessResource) plainAccessValidator.parse(RemotingCommand.decode(buf), "192.168.0.1"); plainAccessValidator.validate(accessResource); }
@Override public void validate(AccessResource accessResource) { aclPlugEngine.validate((PlainAccessResource) accessResource); }
PlainAccessValidator implements AccessValidator { @Override public void validate(AccessResource accessResource) { aclPlugEngine.validate((PlainAccessResource) accessResource); } }
PlainAccessValidator implements AccessValidator { @Override public void validate(AccessResource accessResource) { aclPlugEngine.validate((PlainAccessResource) accessResource); } PlainAccessValidator(); }
PlainAccessValidator implements AccessValidator { @Override public void validate(AccessResource accessResource) { aclPlugEngine.validate((PlainAccessResource) accessResource); } PlainAccessValidator(); @Override AccessResource parse(RemotingCommand request, String remoteAddr); @Override void validate(AccessResource accessResource); @Override boolean updateAccessConfig(PlainAccessConfig plainAccessConfig); @Override boolean deleteAccessConfig(String accesskey); @Override String getAclConfigVersion(); @Override boolean updateGlobalWhiteAddrsConfig(List<String> globalWhiteAddrsList); @Override AclConfig getAllAclConfig(); }
PlainAccessValidator implements AccessValidator { @Override public void validate(AccessResource accessResource) { aclPlugEngine.validate((PlainAccessResource) accessResource); } PlainAccessValidator(); @Override AccessResource parse(RemotingCommand request, String remoteAddr); @Override void validate(AccessResource accessResource); @Override boolean updateAccessConfig(PlainAccessConfig plainAccessConfig); @Override boolean deleteAccessConfig(String accesskey); @Override String getAclConfigVersion(); @Override boolean updateGlobalWhiteAddrsConfig(List<String> globalWhiteAddrsList); @Override AclConfig getAllAclConfig();  }