30 lines
856 B
Java
30 lines
856 B
Java
package envoy.server;
|
|
|
|
import envoy.data.LoginCredentials;
|
|
import envoy.data.User;
|
|
|
|
/**
|
|
* This {@link ObjectProcessor} handles {@link LoginCredentials}.<br>
|
|
* <br>
|
|
* Project: <strong>envoy-server-standalone</strong><br>
|
|
* File: <strong>LoginCredentialProcessor.java</strong><br>
|
|
* Created: <strong>30.12.2019</strong><br>
|
|
*
|
|
* @author Kai S. K. Engelbart
|
|
* @since Envoy Server Standalone v0.1-alpha
|
|
*/
|
|
public class LoginCredentialProcessor implements ObjectProcessor<LoginCredentials, User> {
|
|
|
|
// TODO: Acquire user IDs from database
|
|
private static long currentUserId = 1;
|
|
|
|
@Override
|
|
public Class<LoginCredentials> getInputClass() { return LoginCredentials.class; }
|
|
|
|
@Override
|
|
public User process(LoginCredentials input) {
|
|
System.out.println("Received login credentials " + input);
|
|
return new User(currentUserId++, input.getName());
|
|
}
|
|
}
|