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;
}
@Override
public Optional getUser() {
return Optional.ofNullable(providerProvider.get().getUser());
}
@Override
public void setUser(String user) {
providerProvider.get().setUser(user);
}
}