-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.dal.distributeddatabase</groupId> | ||
<artifactId>DistributedDatabase</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.dal.distributed.authentication; | ||
|
||
public class Login { | ||
|
||
public void accessSystem() { | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/dal/distributed/authentication/Registration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.dal.distributed.authentication; | ||
|
||
public class Registration { | ||
|
||
public void registerUser() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.dal.distributed.logger; | ||
|
||
public class Logger { | ||
|
||
private static Logger instance = null; | ||
|
||
private Logger() { | ||
|
||
} | ||
|
||
/** | ||
* This method returns the object of PrintMessage. | ||
* | ||
* @return PrintMessage singleton object | ||
*/ | ||
public static Logger instance() { | ||
if (null == instance) { | ||
return new Logger(); | ||
} else { | ||
return instance; | ||
} | ||
} | ||
|
||
public void info(String message) { | ||
System.out.println(message); | ||
//To Do: Write to info log file | ||
} | ||
|
||
public void error(String message) { | ||
System.err.println(message); | ||
//To Do: Write to error log file | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.dal.distributed.main; | ||
|
||
import com.dal.distributed.authentication.Login; | ||
import com.dal.distributed.authentication.Registration; | ||
import com.dal.distributed.logger.Logger; | ||
|
||
import java.util.Scanner; | ||
|
||
public class Main { | ||
|
||
public static void main(String [] args) { | ||
Logger logger = Logger.instance(); | ||
|
||
logger.info("Welcome to DPG9 Distributed Database\n"); | ||
logger.info("Please select an option from the below list"); | ||
logger.info("1. User Registration"); | ||
logger.info("2. Login"); | ||
logger.info("3. Exit"); | ||
|
||
Scanner sc = new Scanner(System.in); | ||
final String userInput = sc.nextLine(); | ||
|
||
while (true) { | ||
switch (userInput) { | ||
case "1": | ||
Registration registration = new Registration(); | ||
registration.registerUser(); | ||
break; | ||
case "2": | ||
Login login = new Login(); | ||
login.accessSystem(); | ||
break; | ||
case "3": | ||
System.exit(0); | ||
default: | ||
logger.error("Please enter a valid input."); | ||
} | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/dal/distributed/model/SecurityQuestions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.dal.distributed.model; | ||
|
||
public class SecurityQuestions { | ||
private String question; | ||
private String answer; | ||
|
||
public String getQuestion() { | ||
return question; | ||
} | ||
|
||
public void setQuestion(String question) { | ||
this.question = question; | ||
} | ||
|
||
public String getAnswer() { | ||
return answer; | ||
} | ||
|
||
public void setAnswer(String answer) { | ||
this.answer = answer; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/com/dal/distributed/model/UserRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.dal.distributed.model; | ||
|
||
import java.util.List; | ||
|
||
public class UserRegistration { | ||
private String username; | ||
private String password; | ||
private List<SecurityQuestions> securityQuestions; | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public List<SecurityQuestions> getSecurityQuestions() { | ||
return securityQuestions; | ||
} | ||
|
||
public void setSecurityQuestions(List<SecurityQuestions> securityQuestions) { | ||
this.securityQuestions = securityQuestions; | ||
} | ||
} |