class DirectBearerAuthClient extends DirectClient {

    private String realmName = Pac4jConstants.DEFAULT_REALM_NAME;

    /**
     * <p>Constructor for DirectBearerAuthClient.</p>
     */
    public DirectBearerAuthClient() {
    }

    /**
     * <p>Constructor for DirectBearerAuthClient.</p>
     *
     * @param tokenAuthenticator a {@link Authenticator} object
     */
    public DirectBearerAuthClient(final Authenticator tokenAuthenticator) {
        setAuthenticatorIfUndefined(tokenAuthenticator);
    }

    /**
     * <p>Constructor for DirectBearerAuthClient.</p>
     *
     * @param profileCreator a {@link ProfileCreator} object
     */
    public DirectBearerAuthClient(final ProfileCreator profileCreator) {
        setAuthenticatorIfUndefined(Authenticator.ALWAYS_VALIDATE);
        setProfileCreatorIfUndefined(profileCreator);
    }

    /**
     * <p>Constructor for DirectBearerAuthClient.</p>
     *
     * @param tokenAuthenticator a {@link Authenticator} object
     * @param profileCreator a {@link ProfileCreator} object
     */
    public DirectBearerAuthClient(final Authenticator tokenAuthenticator,
                                 final ProfileCreator profileCreator) {
        setAuthenticatorIfUndefined(tokenAuthenticator);
        setProfileCreatorIfUndefined(profileCreator);
    }

    /** {@inheritDoc} */
    @Override
    protected void internalInit(final boolean forceReinit) {
        assertNotBlank("realmName", this.realmName);

        setCredentialsExtractorIfUndefined(new BearerAuthExtractor());
    }

    /** {@inheritDoc} */
    @Override
    public Optional<Credentials> getCredentials(final CallContext ctx) {<FILL_FUNCTION_BODY>}
}

        // set the www-authenticate in case of error
        ctx.webContext().setResponseHeader(HttpConstants.AUTHENTICATE_HEADER,
            HttpConstants.BEARER_HEADER_PREFIX + "realm=\"" + realmName + "\"");

        return super.getCredentials(ctx);
    
<methods>public non-sealed void <init>() ,public final Optional<org.pac4j.core.exception.http.RedirectionAction> getLogoutAction(CallContext, org.pac4j.core.profile.UserProfile, java.lang.String) ,public final Optional<org.pac4j.core.exception.http.RedirectionAction> getRedirectionAction(CallContext) ,public final org.pac4j.core.exception.http.HttpAction processLogout(CallContext, org.pac4j.core.credentials.Credentials) <variables>