/** * Creates a new builder. * * @return New builder instance */ public static AuthenticationBuilder newInstance() { return new DefaultAuthenticationBuilder(); } }
throws AuthenticationException { final AuthenticationBuilder builder = new DefaultAuthenticationBuilder(NullPrincipal.getInstance()); for (final Credential c : credentials) { builder.addCredential(new BasicCredentialMetaData(c));
/** * Creates a new builder initialized with data from the given authentication source. * * @param source Authentication source. * * @return New builder instance initialized with all fields in the given authentication source. */ public static AuthenticationBuilder newInstance(final Authentication source) { final DefaultAuthenticationBuilder builder = new DefaultAuthenticationBuilder(source.getPrincipal()); builder.setAuthenticationDate(source.getAuthenticationDate()); builder.setCredentials(source.getCredentials()); builder.setSuccesses(source.getSuccesses()); builder.setFailures(source.getFailures()); builder.setAttributes(source.getAttributes()); return builder; }