- public void validate(){
- super.validate();
- checkState(getAddress() != null,"Address must be set.");
- //checkState(getAddress().getIpv4Address() != null || getAddress().getIpv6Address() != null,"Address must be set.");
- checkState(getPort() != null,"Port must be set.");
- checkState(getDomRegistry() != null,"Dom Registry must be provided.");
+ protected void customValidation() {
+ checkNotNull(getAddress(), addressJmxAttribute);
+ checkCondition(isHostAddressPresent(getAddress()), "Host address not present in " + getAddress(), addressJmxAttribute);
+ checkNotNull(getPort(), portJmxAttribute);
+ checkNotNull(getDomRegistry(), portJmxAttribute);
+ checkNotNull(getDomRegistry(), domRegistryJmxAttribute);
+
+ checkNotNull(getConnectionTimeoutMillis(), connectionTimeoutMillisJmxAttribute);
+ checkCondition(getConnectionTimeoutMillis() > 0, "must be > 0", connectionTimeoutMillisJmxAttribute);
+
+ checkNotNull(getBetweenAttemptsTimeoutMillis(), betweenAttemptsTimeoutMillisJmxAttribute);
+ checkCondition(getBetweenAttemptsTimeoutMillis() > 0, "must be > 0", betweenAttemptsTimeoutMillisJmxAttribute);
+
+ checkNotNull(getClientDispatcher(), clientDispatcherJmxAttribute);
+ checkNotNull(getBindingRegistry(), bindingRegistryJmxAttribute);
+ checkNotNull(getProcessingExecutor(), processingExecutorJmxAttribute);
+
+ // Check username + password in case of ssh
+ if(getTcpOnly() == false) {
+ checkNotNull(getUsername(), usernameJmxAttribute);
+ checkNotNull(getPassword(), passwordJmxAttribute);
+ }
+