Files
ReplayModCinematic/src/main/java/com/replaymod/online/api/AuthData.java
johni0702 7c8dde3322 Add online (aka ReplayCenter) module
Add localization extra (formally known as LocalizedResourcePack)
Add version checker extra
2015-11-14 15:38:55 +01:00

46 lines
1.0 KiB
Java

package com.replaymod.online.api;
/**
* Represents a set of persistent authentication data.
*/
public interface AuthData {
/**
* Returns the user name of the authenticated user.
* @return user name or {@code null} if not logged in
*/
String getUserName();
/**
* Returns the authentication key of the authenticated user.
* @return auth key or {@code null} if not logged in
*/
String getAuthKey();
/**
* Store the authentication data after login.
* @param userName The user name
* @param authKey The authentication key
*/
void setData(String userName, String authKey);
/**
* Result of authentication operations.
*/
enum AuthResult {
/**
* The operation succeeded without errors.
*/
SUCCESS,
/**
* The data provided got rejected due to it being invalid.
*/
INVALID_DATA,
/**
* Operation could not be performed due to connectivity problems.
*/
IO_ERROR,
}
}