@Test public void testCustomValidate() throws InitializationException { runner.setProperty(ListenTCPRecord.PORT, "1"); runner.assertValid(); configureProcessorSslContextService(); runner.setProperty(ListenTCPRecord.CLIENT_AUTH, ""); runner.assertNotValid(); runner.setProperty(ListenTCPRecord.CLIENT_AUTH, SslContextFactory.ClientAuth.REQUIRED.name()); runner.assertValid(); }
@Override protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) { final List<ValidationResult> results = new ArrayList<>(); final String clientAuth = validationContext.getProperty(CLIENT_AUTH).getValue(); final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); if (sslContextService != null && StringUtils.isBlank(clientAuth)) { results.add(new ValidationResult.Builder() .explanation("Client Auth must be provided when using TLS/SSL") .valid(false).subject("Client Auth").build()); } return results; }
ListenTCPRecord extends AbstractProcessor { @Override protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) { final List<ValidationResult> results = new ArrayList<>(); final String clientAuth = validationContext.getProperty(CLIENT_AUTH).getValue(); final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); if (sslContextService != null && StringUtils.isBlank(clientAuth)) { results.add(new ValidationResult.Builder() .explanation("Client Auth must be provided when using TLS/SSL") .valid(false).subject("Client Auth").build()); } return results; } }
ListenTCPRecord extends AbstractProcessor { @Override protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) { final List<ValidationResult> results = new ArrayList<>(); final String clientAuth = validationContext.getProperty(CLIENT_AUTH).getValue(); final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); if (sslContextService != null && StringUtils.isBlank(clientAuth)) { results.add(new ValidationResult.Builder() .explanation("Client Auth must be provided when using TLS/SSL") .valid(false).subject("Client Auth").build()); } return results; }  }
ListenTCPRecord extends AbstractProcessor { @Override protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) { final List<ValidationResult> results = new ArrayList<>(); final String clientAuth = validationContext.getProperty(CLIENT_AUTH).getValue(); final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); if (sslContextService != null && StringUtils.isBlank(clientAuth)) { results.add(new ValidationResult.Builder() .explanation("Client Auth must be provided when using TLS/SSL") .valid(false).subject("Client Auth").build()); } return results; }  @Override Set<Relationship> getRelationships(); @OnScheduled void onScheduled(final ProcessContext context); @OnStopped void onStopped(); @Override void onTrigger(final ProcessContext context, final ProcessSession session); final int getDispatcherPort(); }
ListenTCPRecord extends AbstractProcessor { @Override protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) { final List<ValidationResult> results = new ArrayList<>(); final String clientAuth = validationContext.getProperty(CLIENT_AUTH).getValue(); final SSLContextService sslContextService = validationContext.getProperty(SSL_CONTEXT_SERVICE).asControllerService(SSLContextService.class); if (sslContextService != null && StringUtils.isBlank(clientAuth)) { results.add(new ValidationResult.Builder() .explanation("Client Auth must be provided when using TLS/SSL") .valid(false).subject("Client Auth").build()); } return results; }  @Override Set<Relationship> getRelationships(); @OnScheduled void onScheduled(final ProcessContext context); @OnStopped void onStopped(); @Override void onTrigger(final ProcessContext context, final ProcessSession session); final int getDispatcherPort();  }