28 lines
744 B
Java
28 lines
744 B
Java
|
package envoy.server;
|
||
|
|
||
|
import envoy.data.LoginCredentials;
|
||
|
import envoy.data.User;
|
||
|
|
||
|
/**
|
||
|
* 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
|
||
|
*/
|
||
|
public class LoginCredentialProcessor implements ObjectProcessor<LoginCredentials, User> {
|
||
|
|
||
|
// TODO: Acquire user IDs from database
|
||
|
private static long currentUserId = 1;
|
||
|
|
||
|
@Override
|
||
|
public User process(LoginCredentials input) {
|
||
|
System.out.println("Received login credentials " + input);
|
||
|
return new User(currentUserId++, input.getName());
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Class<LoginCredentials> getInputClass() { return LoginCredentials.class; }
|
||
|
}
|