de.comhix.web.auth.internal.UserProviderImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jetty-base Show documentation
Show all versions of jetty-base Show documentation
Package with all needed dependencies for jetty-webapps.
package de.comhix.web.auth.internal;
import de.comhix.web.auth.UserProvider;
import javax.inject.Inject;
import javax.inject.Provider;
import javax.inject.Singleton;
import java.util.Optional;
/**
* @author Benjamin Beeker
*/
@Singleton
public class UserProviderImpl implements UserProvider {
private final Provider providerProvider;
@Inject
public UserProviderImpl(Provider providerProvider) {
this.providerProvider = providerProvider;
}
public Optional getUser() {
return Optional.ofNullable(providerProvider.get().getUser());
}
public void setUser(String user) {
providerProvider.get().setUser(user);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy