A Java Command Line application which implements Transparency concepts of distributed system. Also, implementation of file read/write lock and storing metadata into built in H2 database.
Web Site: https://commons.apache.org/proper/commons-lang/ Apache Commons Lang provides a host of helper utilities for the java.lang API, notably String manipulation methods, basic numerical methods, object reflection, concurrency, creation and serialization and System properties.
Web site: https://commons.apache.org/proper/commons-io/ Library for file related IO operations. Easy to user java classes for file stream operations and file copy and directory related operations.\
Web Site: https://github.com/fusesource/jansi and http://fusesource.github.io/jansi/ Jansi is a small java library that allows developer to use ANSI escape sequences to format the console output which works even on windows.
Web Site: https://github.com/EsotericSoftware/kryonet KryoNet is a Java library that provides a clean and simple API for efficient TCP and UDP client/server network communication using NIO. KryoNet is ideal for any client/server application. It is very efficient. KryoNet can also be useful for inter-process communication.
- Firstly, Set ANT PATH. If not installed ANT; download ANT from: https://ant.apache.org/bindownload.cgi
- SET ANT HOME in System environment variable and copy that path and open build.bat file with any text editor and simply paste it in SET variable.
- I have used several libraries which I have stored in lib folder. Build.xml file has path to ../lib folder which will be used to compile all the java source files.
- I have used several libraries which I have stored in lib folder. Build.xml file has path to ../lib folder which will be used to compile all the java source files.
- Run build.bat file to compile all source java files. Build.bat file will au-tomatically compile all the .java files and compiled .class files will be stored in ../out/test/ folder.
- After all the above steps, double click on run-server.bat file and fol-low-on screen instructions for running the server a. In my application, we do NOT need to run client separately because I have designed my server in such a way that using single command line window and that window will itself work as client side.
- After successfully running above instructions, open a new command line window in the path and test the locking/unlocking and update according to order they appear.
- To lock a file type “file-lock lock [index of the file].
- To unlock that file type “file-lock unlock [index of the file].
- To revert (Applying updates), type “file-lock revert [index of the file].