Package edu.suffolk.litlab.efspserver.db
Class LoginDatabase
java.lang.Object
edu.suffolk.litlab.efspserver.db.Database
edu.suffolk.litlab.efspserver.db.LoginDatabase
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddNewUser
(String serverName, boolean tylerEnabled, boolean jeffNetEnabled) void
static LoginDatabase
fromDS
(DataSource ds) getAtRestInfo
(String apiKey) login
(String apiKey, String jsonLoginInfo, Map<String, Function<com.fasterxml.jackson.databind.JsonNode, Optional<Map<String, String>>>> loginFunctions) Actually completes the REST client's login to the server.static void
Example on how to trigger: java -cp efspserver-with-deps.jar edu.suffolk.litlab.efspserver.db.LoginDatabase localhostServer true trueboolean
boolean
updateServerName
(AtRest atRest, String apiKey, String newName) Methods inherited from class edu.suffolk.litlab.efspserver.db.Database
close, commit, rollback, setAutoCommit, setSavepoint
-
Constructor Details
-
LoginDatabase
-
-
Method Details
-
fromDS
-
createTablesIfAbsent
- Specified by:
createTablesIfAbsent
in classDatabase
- Throws:
SQLException
-
tablesExist
- Throws:
SQLException
-
addNewUser
public String addNewUser(String serverName, boolean tylerEnabled, boolean jeffNetEnabled) throws SQLException - Throws:
SQLException
-
getAtRestInfo
-
updateServerName
-
makeHash
-
login
public Optional<NewTokens> login(String apiKey, String jsonLoginInfo, Map<String, Function<com.fasterxml.jackson.databind.JsonNode, throws SQLExceptionOptional<Map<String, String>>>> loginFunctions) Actually completes the REST client's login to the server. Completes each login to the EFMFiling Interfaces separately.- Parameters:
apiKey
- The api key that the server can use for logging injsonLoginInfo
- The JSON string with login info for whatever modules it's wants to login to- Returns:
- If the optional is empty, the apikey or one of the attempted logins failed. If not empty, it contains the new API Token that the REST client should now send to the Server, or an empty token list (which happens when querying Tyler code endpoints before the user is logged in)
- Throws:
SQLException
-
main
public static void main(String[] args) throws SQLException, NumberFormatException, ClassNotFoundException, NoSuchAlgorithmException Example on how to trigger: java -cp efspserver-with-deps.jar edu.suffolk.litlab.efspserver.db.LoginDatabase localhostServer true true
-