Renamed all instances of RESTaurant to Everest
This commit is contained in:
parent
178779706e
commit
95ea98227e
49 changed files with 342 additions and 239 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,10 +1,10 @@
|
||||||
/target/
|
/target/
|
||||||
/RESTaurant.iml
|
/Everest.iml
|
||||||
.idea/
|
.idea/
|
||||||
RESTaurant.iml
|
Everest.iml
|
||||||
classes/
|
classes/
|
||||||
src/main/java/META-INF/
|
src/main/java/META-INF/
|
||||||
dependency-reduced-pom.xml
|
dependency-reduced-pom.xml
|
||||||
config/
|
config/
|
||||||
logs/
|
logs/
|
||||||
/RESTaurant/BugReporter.jar
|
/Everest/BugReporter.jar
|
||||||
|
|
34
Everest.iml
Normal file
34
Everest.iml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||||
|
<output url="file://$MODULE_DIR$/target/classes" />
|
||||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="Maven: com.jfoenix:jfoenix:1.4.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-client:2.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.jersey.core:jersey-common:2.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.hk2.external:javax.inject:2.5.0-b42" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.ws.rs:javax.ws.rs-api:2.1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.jersey.media:jersey-media-multipart:2.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.jvnet.mimepull:mimepull:1.9.6" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.jersey.inject:jersey-hk2:2.26" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-locator:2.5.0-b42" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b42" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-api:2.5.0-b42" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.glassfish.hk2:hk2-utils:2.5.0-b42" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.javassist:javassist:3.22.0-CR2" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.3" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
|
||||||
|
<orderEntry type="library" name="Maven: org.xerial:sqlite-jdbc:3.21.0.1" level="project" />
|
||||||
|
</component>
|
||||||
|
</module>
|
26
README.md
26
README.md
|
@ -1,25 +1,25 @@
|
||||||
# RESTaurant
|
# Everest
|
||||||
RESTaurant is an upcoming native REST client written in JavaFX. It is currently in the initial stages of development.
|
Everest is an upcoming native REST client written in JavaFX. It is currently in the initial stages of development.
|
||||||
|
|
||||||
![restaurant1](https://user-images.githubusercontent.com/23148259/36366992-9570476a-1576-11e8-8405-485c460a553c.png)
|
![Everest1](https://user-images.githubusercontent.com/23148259/36366992-9570476a-1576-11e8-8405-485c460a553c.png)
|
||||||
|
|
||||||
# Why RESTaurant?
|
# Why Everest?
|
||||||
- Unlike other REST clients like Postman and Insomnia, RESTaurant is a **native** application written in Java. Thus, it is significantly
|
- Unlike other REST clients like Postman and Insomnia, Everest is a **native** application written in Java. Thus, it is significantly
|
||||||
**lighter on resources and more responsive** than the Electron-based options. The goal with RESTaurant is to provide pretty much the same
|
**lighter on resources and more responsive** than the Electron-based options. The goal with Everest is to provide pretty much the same
|
||||||
level of functionality as the formerly mentioned options, but in a lighter, native but equally slick package. It is a big and slightly arrogant bet,
|
level of functionality as the formerly mentioned options, but in a lighter, native but equally slick package. It is a big and slightly arrogant bet,
|
||||||
but then I don't think anyone other than me would use this! So heck, at least I'll learnt a lot. _Not bad for a Comp Sci student, eh?_
|
but then I don't think anyone other than me would use this! So heck, at least I'll learnt a lot. _Not bad for a Comp Sci student, eh?_
|
||||||
- In all of my projects, design is of paramount importance. And RESTaurant is no exception.
|
- In all of my projects, design is of paramount importance. And Everest is no exception.
|
||||||
With a **gorgeous, flat design and a neutral color scheme**, RESTaurant is a pleasure to look at and to work with.
|
With a **gorgeous, flat design and a neutral color scheme**, Everest is a pleasure to look at and to work with.
|
||||||
_I want you to want to use it!_
|
_I want you to want to use it!_
|
||||||
- RESTaurant is powered by **Jersey**, the robust and powerful Java library to build and consume RESTful web services.
|
- Everest is powered by **Jersey**, the robust and powerful Java library to build and consume RESTful web services.
|
||||||
|
|
||||||
![restaurant2](https://user-images.githubusercontent.com/23148259/36367048-f6cea2a4-1576-11e8-84a4-9854ec30f992.png)
|
![Everest2](https://user-images.githubusercontent.com/23148259/36367048-f6cea2a4-1576-11e8-84a4-9854ec30f992.png)
|
||||||
|
|
||||||
# Planned features
|
# Planned features
|
||||||
- Ability to make requests with the common HTTP methods. _(duh)_
|
- Ability to make requests with the common HTTP methods. _(duh)_
|
||||||
- **Syntax highlighting**: I had tried using [RichTextFX](https://github.com/FXMisc/RichTextFX) for my text editor,
|
- **Syntax highlighting**: I had tried using [RichTextFX](https://github.com/FXMisc/RichTextFX) for my text editor,
|
||||||
[Ballad](https://github.com/RohitAwate/Ballad), and failed. And I really don't wish to embed an
|
[Ballad](https://github.com/RohitAwate/Ballad), and failed. And I really don't wish to embed an
|
||||||
online editor like Ace into RESTaurant. So, for the time being, I'm gonna use JavaFX's inbuilt TextArea which doesn't offer syntax highlighting.
|
online editor like Ace into Everest. So, for the time being, I'm gonna use JavaFX's inbuilt TextArea which doesn't offer syntax highlighting.
|
||||||
- **History tab**, for quickly looking at your request history. 🕒
|
- **History tab**, for quickly looking at your request history. 🕒
|
||||||
- **API Authentication**: This is of course a primary feature of any REST client, but currently, not something I've done or used before.
|
- **API Authentication**: This is of course a primary feature of any REST client, but currently, not something I've done or used before.
|
||||||
So I will need some time to learn this stuff.
|
So I will need some time to learn this stuff.
|
||||||
|
@ -33,7 +33,7 @@ _That's all the core stuff that I can think of at the moment. Will keep updating
|
||||||
- Postman has this really cool feature wherein it can create a **mock server**. Maybe do that.
|
- Postman has this really cool feature wherein it can create a **mock server**. Maybe do that.
|
||||||
|
|
||||||
|
|
||||||
![restaurant3](https://user-images.githubusercontent.com/23148259/36366994-95df94c6-1576-11e8-8368-c0f325f54a6f.png)
|
![Everest3](https://user-images.githubusercontent.com/23148259/36366994-95df94c6-1576-11e8-8368-c0f325f54a6f.png)
|
||||||
|
|
||||||
|
|
||||||
# Features currently live
|
# Features currently live
|
||||||
|
@ -43,7 +43,7 @@ _That's all the core stuff that I can think of at the moment. Will keep updating
|
||||||
- **Custom themes!** Changing themes needs a manual edit to the settings.json file. This will be properly integrated into a Settings menu later.
|
- **Custom themes!** Changing themes needs a manual edit to the settings.json file. This will be properly integrated into a Settings menu later.
|
||||||
- **Multi-tab layout**. I'm battling with JavaFX to allow me to add a simple '+' button for adding a new tab. So far, not successful. However, you can use the Ctrl+T keyboard shortcut.
|
- **Multi-tab layout**. I'm battling with JavaFX to allow me to add a simple '+' button for adding a new tab. So far, not successful. However, you can use the Ctrl+T keyboard shortcut.
|
||||||
- **History tab!** All the requests you ever made are now shown to the left of the app.
|
- **History tab!** All the requests you ever made are now shown to the left of the app.
|
||||||
- RESTaurant now maintains its state between sessions so you don't lose your work.
|
- Everest now maintains its state between sessions so you don't lose your work.
|
||||||
|
|
||||||
# Releases
|
# Releases
|
||||||
I mean, it's open-source. You can build yourself a 'release' right now!
|
I mean, it's open-source. You can build yourself a 'release' right now!
|
||||||
|
|
20
pom.xml
20
pom.xml
|
@ -1,9 +1,25 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright 2018 Rohit Awate.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.rohitawate</groupId>
|
<groupId>com.rohitawate</groupId>
|
||||||
<artifactId>RESTaurant</artifactId>
|
<artifactId>Everest</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -29,7 +45,7 @@
|
||||||
<!-- add Main-Class to manifest file -->
|
<!-- add Main-Class to manifest file -->
|
||||||
<transformer
|
<transformer
|
||||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
<mainClass>com.rohitawate.restaurant.main.Main</mainClass>
|
<mainClass>com.rohitawate.everest.main.Main</mainClass>
|
||||||
</transformer>
|
</transformer>
|
||||||
</transformers>
|
</transformers>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.exceptions;
|
package com.rohitawate.everest.exceptions;
|
||||||
|
|
||||||
public class RedirectException extends Exception {
|
public class RedirectException extends Exception {
|
||||||
private final String newLocation;
|
private final String newLocation;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.exceptions;
|
package com.rohitawate.everest.exceptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thrown when the server sends ambiguous responses.
|
* Thrown when the server sends ambiguous responses.
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.models.DashboardState;
|
import com.rohitawate.everest.models.DashboardState;
|
||||||
import com.rohitawate.restaurant.models.requests.DataDispatchRequest;
|
import com.rohitawate.everest.models.requests.DataDispatchRequest;
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.themes.ThemeManager;
|
import com.rohitawate.everest.util.themes.ThemeManager;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
|
@ -76,7 +76,7 @@ public class BodyTabController implements Initializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a RestaurantRequest object initialized with the request body.
|
* Returns a EverestRequest object initialized with the request body.
|
||||||
*/
|
*/
|
||||||
public DataDispatchRequest getBasicRequest(String requestType) {
|
public DataDispatchRequest getBasicRequest(String requestType) {
|
||||||
DataDispatchRequest request = new DataDispatchRequest(requestType);
|
DataDispatchRequest request = new DataDispatchRequest(requestType);
|
|
@ -13,26 +13,26 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.jfoenix.controls.JFXSnackbar;
|
import com.jfoenix.controls.JFXSnackbar;
|
||||||
import com.rohitawate.restaurant.exceptions.RedirectException;
|
import com.rohitawate.everest.exceptions.RedirectException;
|
||||||
import com.rohitawate.restaurant.exceptions.UnreliableResponseException;
|
import com.rohitawate.everest.exceptions.UnreliableResponseException;
|
||||||
import com.rohitawate.restaurant.models.DashboardState;
|
import com.rohitawate.everest.models.DashboardState;
|
||||||
import com.rohitawate.restaurant.models.requests.DELETERequest;
|
import com.rohitawate.everest.models.requests.DELETERequest;
|
||||||
import com.rohitawate.restaurant.models.requests.DataDispatchRequest;
|
import com.rohitawate.everest.models.requests.DataDispatchRequest;
|
||||||
import com.rohitawate.restaurant.models.requests.GETRequest;
|
import com.rohitawate.everest.models.requests.GETRequest;
|
||||||
import com.rohitawate.restaurant.models.responses.RestaurantResponse;
|
import com.rohitawate.everest.models.responses.EverestResponse;
|
||||||
import com.rohitawate.restaurant.requestmanager.DELETERequestManager;
|
import com.rohitawate.everest.requestmanager.DELETERequestManager;
|
||||||
import com.rohitawate.restaurant.requestmanager.DataDispatchRequestManager;
|
import com.rohitawate.everest.requestmanager.DataDispatchRequestManager;
|
||||||
import com.rohitawate.restaurant.requestmanager.GETRequestManager;
|
import com.rohitawate.everest.requestmanager.GETRequestManager;
|
||||||
import com.rohitawate.restaurant.requestmanager.RequestManager;
|
import com.rohitawate.everest.requestmanager.RequestManager;
|
||||||
import com.rohitawate.restaurant.util.RestaurantUtilities;
|
import com.rohitawate.everest.util.EverestUtilities;
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.settings.Settings;
|
import com.rohitawate.everest.util.settings.Settings;
|
||||||
import com.rohitawate.restaurant.util.themes.ThemeManager;
|
import com.rohitawate.everest.util.themes.ThemeManager;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
||||||
|
@ -132,7 +132,7 @@ public class DashboardController implements Initializable {
|
||||||
);
|
);
|
||||||
|
|
||||||
errorTitle.setText("Oops... That's embarrassing!");
|
errorTitle.setText("Oops... That's embarrassing!");
|
||||||
errorDetails.setText("Something went wrong. Try to make another request.\nRestart RESTaurant if that doesn't work.");
|
errorDetails.setText("Something went wrong. Try to make another request.\nRestart Everest if that doesn't work.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
|
@ -223,7 +223,7 @@ public class DashboardController implements Initializable {
|
||||||
Services.loggingService.logSevere("Request execution failed.", E, LocalDateTime.now());
|
Services.loggingService.logSevere("Request execution failed.", E, LocalDateTime.now());
|
||||||
errorLayer.setVisible(true);
|
errorLayer.setVisible(true);
|
||||||
errorTitle.setText("Oops... That's embarrassing!");
|
errorTitle.setText("Oops... That's embarrassing!");
|
||||||
errorDetails.setText("Something went wrong. Try to make another request.\nRestart RESTaurant if that doesn't work.");
|
errorDetails.setText("Something went wrong. Try to make another request.\nRestart Everest if that doesn't work.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ public class DashboardController implements Initializable {
|
||||||
errorTitle.setText(URE.getExceptionTitle());
|
errorTitle.setText(URE.getExceptionTitle());
|
||||||
errorDetails.setText(URE.getExceptionDetails());
|
errorDetails.setText(URE.getExceptionDetails());
|
||||||
} else if (throwable.getClass() == ProcessingException.class) {
|
} else if (throwable.getClass() == ProcessingException.class) {
|
||||||
errorTitle.setText("RESTaurant couldn't connect.");
|
errorTitle.setText("Everest couldn't connect.");
|
||||||
errorDetails.setText("Either you are not connected to the Internet or the server is offline.");
|
errorDetails.setText("Either you are not connected to the Internet or the server is offline.");
|
||||||
} else if (throwable.getClass() == RedirectException.class) {
|
} else if (throwable.getClass() == RedirectException.class) {
|
||||||
RedirectException redirect = (RedirectException) throwable;
|
RedirectException redirect = (RedirectException) throwable;
|
||||||
|
@ -291,7 +291,7 @@ public class DashboardController implements Initializable {
|
||||||
loadingLayer.setVisible(true);
|
loadingLayer.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDashboard(RestaurantResponse response) {
|
private void updateDashboard(EverestResponse response) {
|
||||||
prettifyResponseBody(response);
|
prettifyResponseBody(response);
|
||||||
responseBox.getChildren().add(0, responseDetails);
|
responseBox.getChildren().add(0, responseDetails);
|
||||||
statusCode.setText(Integer.toString(response.getStatusCode()));
|
statusCode.setText(Integer.toString(response.getStatusCode()));
|
||||||
|
@ -300,7 +300,7 @@ public class DashboardController implements Initializable {
|
||||||
responseSize.setText(Integer.toString(response.getSize()) + " B");
|
responseSize.setText(Integer.toString(response.getSize()) + " B");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prettifyResponseBody(RestaurantResponse response) {
|
private void prettifyResponseBody(EverestResponse response) {
|
||||||
String type;
|
String type;
|
||||||
|
|
||||||
if (response.getMediaType() != null)
|
if (response.getMediaType() != null)
|
||||||
|
@ -318,12 +318,12 @@ public class DashboardController implements Initializable {
|
||||||
switch (type.toLowerCase()) {
|
switch (type.toLowerCase()) {
|
||||||
case "application/json":
|
case "application/json":
|
||||||
responseType.setText("JSON");
|
responseType.setText("JSON");
|
||||||
JsonNode node = RestaurantUtilities.mapper.readTree(responseBody);
|
JsonNode node = EverestUtilities.mapper.readTree(responseBody);
|
||||||
responseArea.setText(RestaurantUtilities.mapper.writeValueAsString(node));
|
responseArea.setText(EverestUtilities.mapper.writeValueAsString(node));
|
||||||
break;
|
break;
|
||||||
case "application/xml":
|
case "application/xml":
|
||||||
responseType.setText("XML");
|
responseType.setText("XML");
|
||||||
responseArea.setText(RestaurantUtilities.mapper.writeValueAsString(responseBody));
|
responseArea.setText(EverestUtilities.mapper.writeValueAsString(responseBody));
|
||||||
break;
|
break;
|
||||||
case "text/html":
|
case "text/html":
|
||||||
responseType.setText("HTML");
|
responseType.setText("HTML");
|
||||||
|
@ -342,7 +342,7 @@ public class DashboardController implements Initializable {
|
||||||
Services.loggingService.logSevere("Response could not be parsed.", e, LocalDateTime.now());
|
Services.loggingService.logSevere("Response could not be parsed.", e, LocalDateTime.now());
|
||||||
errorLayer.setVisible(true);
|
errorLayer.setVisible(true);
|
||||||
errorTitle.setText("Parsing Error");
|
errorTitle.setText("Parsing Error");
|
||||||
errorDetails.setText("RESTaurant could not parse the response.");
|
errorDetails.setText("Everest could not parse the response.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.jfoenix.controls.JFXCheckBox;
|
import com.jfoenix.controls.JFXCheckBox;
|
|
@ -14,10 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.themes.ThemeManager;
|
import com.rohitawate.everest.util.themes.ThemeManager;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
|
@ -14,10 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.themes.ThemeManager;
|
import com.rohitawate.everest.util.themes.ThemeManager;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
|
@ -1,6 +1,22 @@
|
||||||
package com.rohitawate.restaurant.homewindow;
|
/*
|
||||||
|
* Copyright 2018 Rohit Awate.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
import com.rohitawate.restaurant.models.DashboardState;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
|
import com.rohitawate.everest.models.DashboardState;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.rohitawate.restaurant.models.DashboardState;
|
import com.rohitawate.everest.models.DashboardState;
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
|
@ -177,11 +177,11 @@ public class HomeWindowController implements Initializable {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
File configFolder = new File("RESTaurant/config/");
|
File configFolder = new File("Everest/config/");
|
||||||
if (!configFolder.exists())
|
if (!configFolder.exists())
|
||||||
configFolder.mkdirs();
|
configFolder.mkdirs();
|
||||||
|
|
||||||
OutputStream fileStream = new FileOutputStream("RESTaurant/config/restaurant.state");
|
OutputStream fileStream = new FileOutputStream("Everest/config/everest.state");
|
||||||
ObjectOutputStream objectStream = new ObjectOutputStream(fileStream);
|
ObjectOutputStream objectStream = new ObjectOutputStream(fileStream);
|
||||||
objectStream.writeObject(dashboardStates);
|
objectStream.writeObject(dashboardStates);
|
||||||
objectStream.close();
|
objectStream.close();
|
||||||
|
@ -194,7 +194,7 @@ public class HomeWindowController implements Initializable {
|
||||||
|
|
||||||
private void recoverState() {
|
private void recoverState() {
|
||||||
try {
|
try {
|
||||||
InputStream fileStream = new FileInputStream("RESTaurant/config/restaurant.state");
|
InputStream fileStream = new FileInputStream("Everest/config/everest.state");
|
||||||
ObjectInputStream objectStream = new ObjectInputStream(fileStream);
|
ObjectInputStream objectStream = new ObjectInputStream(fileStream);
|
||||||
|
|
||||||
Services.loggingService.logInfo("Application state file found.", LocalDateTime.now());
|
Services.loggingService.logInfo("Application state file found.", LocalDateTime.now());
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.jfoenix.controls.JFXCheckBox;
|
import com.jfoenix.controls.JFXCheckBox;
|
|
@ -14,10 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.homewindow;
|
package com.rohitawate.everest.homewindow;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.themes.ThemeManager;
|
import com.rohitawate.everest.util.themes.ThemeManager;
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.beans.property.IntegerProperty;
|
import javafx.beans.property.IntegerProperty;
|
||||||
import javafx.beans.property.SimpleIntegerProperty;
|
import javafx.beans.property.SimpleIntegerProperty;
|
|
@ -1,55 +1,57 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2018 Rohit Awate.
|
* Copyright 2018 Rohit Awate.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.rohitawate.restaurant.main;
|
package com.rohitawate.everest.main;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.util.RestaurantUtilities;
|
import com.rohitawate.everest.util.EverestUtilities;
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.settings.SettingsLoader;
|
import com.rohitawate.everest.util.settings.SettingsLoader;
|
||||||
import com.rohitawate.restaurant.util.themes.ThemeManager;
|
import com.rohitawate.everest.util.themes.ThemeManager;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
public class Main extends Application {
|
public class Main extends Application {
|
||||||
@Override
|
public static final String applicationName = "Everest";
|
||||||
public void start(Stage primaryStage) throws Exception {
|
|
||||||
Services.start();
|
@Override
|
||||||
Services.startServicesThread.join();
|
public void start(Stage primaryStage) throws Exception {
|
||||||
|
Services.start();
|
||||||
SettingsLoader settingsLoader = new SettingsLoader();
|
Services.startServicesThread.join();
|
||||||
settingsLoader.settingsLoaderThread.join();
|
|
||||||
|
SettingsLoader settingsLoader = new SettingsLoader();
|
||||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/homewindow/HomeWindow.fxml"));
|
settingsLoader.settingsLoaderThread.join();
|
||||||
Parent homeWindow = loader.load();
|
|
||||||
Services.homeWindowController = loader.getController();
|
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/homewindow/HomeWindow.fxml"));
|
||||||
Stage dashboardStage = new Stage();
|
Parent homeWindow = loader.load();
|
||||||
ThemeManager.setTheme(homeWindow);
|
Services.homeWindowController = loader.getController();
|
||||||
|
Stage dashboardStage = new Stage();
|
||||||
dashboardStage.getIcons().add(new Image(getClass().getResource("/assets/LogoWithoutText.png").toExternalForm()));
|
ThemeManager.setTheme(homeWindow);
|
||||||
dashboardStage.setScene(new Scene(homeWindow));
|
|
||||||
dashboardStage.setTitle("RESTaurant");
|
dashboardStage.getIcons().add(new Image(getClass().getResource("/assets/LogoWithoutText.png").toExternalForm()));
|
||||||
dashboardStage.show();
|
dashboardStage.setScene(new Scene(homeWindow));
|
||||||
|
dashboardStage.setTitle(applicationName);
|
||||||
RestaurantUtilities.createBugReporter();
|
dashboardStage.show();
|
||||||
}
|
|
||||||
|
EverestUtilities.createBugReporter();
|
||||||
public static void main(String args[]) {
|
}
|
||||||
launch(args);
|
|
||||||
}
|
public static void main(String args[]) {
|
||||||
}
|
launch(args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,9 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.models;
|
package com.rohitawate.everest.models;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.models.requests.DataDispatchRequest;
|
import com.rohitawate.everest.models.requests.DataDispatchRequest;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.models.requests;
|
package com.rohitawate.everest.models.requests;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
public class DELETERequest extends RestaurantRequest {
|
public class DELETERequest extends EverestRequest {
|
||||||
public DELETERequest() {
|
public DELETERequest() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.models.requests;
|
package com.rohitawate.everest.models.requests;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -22,7 +22,7 @@ import java.util.HashMap;
|
||||||
/**
|
/**
|
||||||
* Represents HTTP requests which contain data viz. POST and PUT.
|
* Represents HTTP requests which contain data viz. POST and PUT.
|
||||||
*/
|
*/
|
||||||
public class DataDispatchRequest extends RestaurantRequest implements Serializable {
|
public class DataDispatchRequest extends EverestRequest implements Serializable {
|
||||||
private String requestType;
|
private String requestType;
|
||||||
private String body;
|
private String body;
|
||||||
private String contentType;
|
private String contentType;
|
|
@ -14,25 +14,25 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.models.requests;
|
package com.rohitawate.everest.models.requests;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public abstract class RestaurantRequest implements Serializable {
|
public abstract class EverestRequest implements Serializable {
|
||||||
private URL target;
|
private URL target;
|
||||||
private HashMap<String, String> headers;
|
private HashMap<String, String> headers;
|
||||||
|
|
||||||
RestaurantRequest() {
|
EverestRequest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
RestaurantRequest(String target) throws MalformedURLException {
|
EverestRequest(String target) throws MalformedURLException {
|
||||||
this.target = new URL(target);
|
this.target = new URL(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
RestaurantRequest(URL target) {
|
EverestRequest(URL target) {
|
||||||
this.target = target;
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.models.requests;
|
package com.rohitawate.everest.models.requests;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
public class GETRequest extends RestaurantRequest {
|
public class GETRequest extends EverestRequest {
|
||||||
public GETRequest() {
|
public GETRequest() {
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.models.responses;
|
package com.rohitawate.everest.models.responses;
|
||||||
|
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
public class RestaurantResponse {
|
public class EverestResponse {
|
||||||
private String body;
|
private String body;
|
||||||
private int statusCode;
|
private int statusCode;
|
||||||
private long time;
|
private long time;
|
|
@ -14,10 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.requestmanager;
|
package com.rohitawate.everest.requestmanager;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.models.requests.RestaurantRequest;
|
import com.rohitawate.everest.models.requests.EverestRequest;
|
||||||
import com.rohitawate.restaurant.models.responses.RestaurantResponse;
|
import com.rohitawate.everest.models.responses.EverestResponse;
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
|
|
||||||
import javax.ws.rs.client.Invocation;
|
import javax.ws.rs.client.Invocation;
|
||||||
|
@ -25,15 +25,15 @@ import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
public class DELETERequestManager extends RequestManager {
|
public class DELETERequestManager extends RequestManager {
|
||||||
|
|
||||||
public DELETERequestManager(RestaurantRequest request) {
|
public DELETERequestManager(EverestRequest request) {
|
||||||
super(request);
|
super(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Task<RestaurantResponse> createTask() {
|
protected Task<EverestResponse> createTask() {
|
||||||
return new Task<RestaurantResponse>() {
|
return new Task<EverestResponse>() {
|
||||||
@Override
|
@Override
|
||||||
protected RestaurantResponse call() throws Exception {
|
protected EverestResponse call() throws Exception {
|
||||||
Invocation invocation = requestBuilder.buildDelete();
|
Invocation invocation = requestBuilder.buildDelete();
|
||||||
|
|
||||||
long initialTime = System.currentTimeMillis();
|
long initialTime = System.currentTimeMillis();
|
|
@ -14,11 +14,11 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.requestmanager;
|
package com.rohitawate.everest.requestmanager;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.models.requests.DataDispatchRequest;
|
import com.rohitawate.everest.models.requests.DataDispatchRequest;
|
||||||
import com.rohitawate.restaurant.models.requests.RestaurantRequest;
|
import com.rohitawate.everest.models.requests.EverestRequest;
|
||||||
import com.rohitawate.restaurant.models.responses.RestaurantResponse;
|
import com.rohitawate.everest.models.responses.EverestResponse;
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
import org.glassfish.jersey.media.multipart.FormDataMultiPart;
|
||||||
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
|
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
|
||||||
|
@ -42,15 +42,15 @@ public class DataDispatchRequestManager extends RequestManager {
|
||||||
private DataDispatchRequest dataDispatchRequest;
|
private DataDispatchRequest dataDispatchRequest;
|
||||||
private String requestType;
|
private String requestType;
|
||||||
|
|
||||||
public DataDispatchRequestManager(RestaurantRequest request) {
|
public DataDispatchRequestManager(EverestRequest request) {
|
||||||
super(request);
|
super(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Task<RestaurantResponse> createTask() {
|
protected Task<EverestResponse> createTask() {
|
||||||
return new Task<RestaurantResponse>() {
|
return new Task<EverestResponse>() {
|
||||||
@Override
|
@Override
|
||||||
protected RestaurantResponse call() throws Exception {
|
protected EverestResponse call() throws Exception {
|
||||||
dataDispatchRequest = (DataDispatchRequest) request;
|
dataDispatchRequest = (DataDispatchRequest) request;
|
||||||
requestType = dataDispatchRequest.getRequestType();
|
requestType = dataDispatchRequest.getRequestType();
|
||||||
|
|
|
@ -14,25 +14,25 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.requestmanager;
|
package com.rohitawate.everest.requestmanager;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.models.requests.RestaurantRequest;
|
import com.rohitawate.everest.models.requests.EverestRequest;
|
||||||
import com.rohitawate.restaurant.models.responses.RestaurantResponse;
|
import com.rohitawate.everest.models.responses.EverestResponse;
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
|
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
public class GETRequestManager extends RequestManager {
|
public class GETRequestManager extends RequestManager {
|
||||||
|
|
||||||
public GETRequestManager(RestaurantRequest request) {
|
public GETRequestManager(EverestRequest request) {
|
||||||
super(request);
|
super(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Task<RestaurantResponse> createTask() {
|
protected Task<EverestResponse> createTask() {
|
||||||
return new Task<RestaurantResponse>() {
|
return new Task<EverestResponse>() {
|
||||||
@Override
|
@Override
|
||||||
protected RestaurantResponse call() throws Exception {
|
protected EverestResponse call() throws Exception {
|
||||||
long initialTime = System.currentTimeMillis();
|
long initialTime = System.currentTimeMillis();
|
||||||
Response serverResponse = requestBuilder.get();
|
Response serverResponse = requestBuilder.get();
|
||||||
response.setTime(initialTime, System.currentTimeMillis());
|
response.setTime(initialTime, System.currentTimeMillis());
|
|
@ -13,13 +13,13 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package com.rohitawate.restaurant.requestmanager;
|
package com.rohitawate.everest.requestmanager;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.exceptions.RedirectException;
|
import com.rohitawate.everest.exceptions.RedirectException;
|
||||||
import com.rohitawate.restaurant.exceptions.UnreliableResponseException;
|
import com.rohitawate.everest.exceptions.UnreliableResponseException;
|
||||||
import com.rohitawate.restaurant.models.requests.RestaurantRequest;
|
import com.rohitawate.everest.models.requests.EverestRequest;
|
||||||
import com.rohitawate.restaurant.models.responses.RestaurantResponse;
|
import com.rohitawate.everest.models.responses.EverestResponse;
|
||||||
import com.rohitawate.restaurant.util.settings.Settings;
|
import com.rohitawate.everest.util.settings.Settings;
|
||||||
import javafx.concurrent.Service;
|
import javafx.concurrent.Service;
|
||||||
import org.glassfish.jersey.client.ClientProperties;
|
import org.glassfish.jersey.client.ClientProperties;
|
||||||
import org.glassfish.jersey.client.HttpUrlConnectorProvider;
|
import org.glassfish.jersey.client.HttpUrlConnectorProvider;
|
||||||
|
@ -32,13 +32,13 @@ import javax.ws.rs.core.Response;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public abstract class RequestManager extends Service<RestaurantResponse> {
|
public abstract class RequestManager extends Service<EverestResponse> {
|
||||||
private final Client client;
|
private final Client client;
|
||||||
RestaurantRequest request;
|
EverestRequest request;
|
||||||
RestaurantResponse response;
|
EverestResponse response;
|
||||||
Builder requestBuilder;
|
Builder requestBuilder;
|
||||||
|
|
||||||
RequestManager(RestaurantRequest request) {
|
RequestManager(EverestRequest request) {
|
||||||
client = ClientBuilder.newBuilder()
|
client = ClientBuilder.newBuilder()
|
||||||
.register(MultiPartFeature.class)
|
.register(MultiPartFeature.class)
|
||||||
.build();
|
.build();
|
||||||
|
@ -51,11 +51,11 @@ public abstract class RequestManager extends Service<RestaurantResponse> {
|
||||||
|
|
||||||
this.request = request;
|
this.request = request;
|
||||||
this.requestBuilder = client.target(request.getTarget().toString()).request();
|
this.requestBuilder = client.target(request.getTarget().toString()).request();
|
||||||
response = new RestaurantResponse();
|
response = new EverestResponse();
|
||||||
appendHeaders();
|
appendHeaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequest(RestaurantRequest request) {
|
public void setRequest(EverestRequest request) {
|
||||||
this.request = request;
|
this.request = request;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util;
|
package com.rohitawate.everest.util;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
@ -27,7 +27,7 @@ import java.util.zip.ZipOutputStream;
|
||||||
public class BugReporter {
|
public class BugReporter {
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
Scanner scanner = new Scanner(System.in);
|
Scanner scanner = new Scanner(System.in);
|
||||||
System.out.println("RESTaurant Bug Reporting Service");
|
System.out.println("Everest Bug Reporting Service");
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println("Please describe the issue with as much detail and clarity as possible: ");
|
System.out.println("Please describe the issue with as much detail and clarity as possible: ");
|
||||||
String userMessage = scanner.nextLine();
|
String userMessage = scanner.nextLine();
|
||||||
|
@ -52,7 +52,7 @@ public class BugReporter {
|
||||||
report.append(generateSystemDetails());
|
report.append(generateSystemDetails());
|
||||||
System.out.println("\nThat's great! We will include your system details in with the bug report.");
|
System.out.println("\nThat's great! We will include your system details in with the bug report.");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("\nAlrighty! We will only include RESTaurant's log files in the report.");
|
System.out.println("\nAlrighty! We will only include Everest's log files in the report.");
|
||||||
}
|
}
|
||||||
|
|
||||||
scanner.close();
|
scanner.close();
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util;
|
package com.rohitawate.everest.util;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
|
@ -27,7 +27,7 @@ import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
public class RestaurantUtilities {
|
public class EverestUtilities {
|
||||||
public static ObjectMapper mapper;
|
public static ObjectMapper mapper;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -50,10 +50,10 @@ public class RestaurantUtilities {
|
||||||
*/
|
*/
|
||||||
public static void createBugReporter() {
|
public static void createBugReporter() {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
File bugReporterFile = new File("RESTaurant/BugReporter.jar");
|
File bugReporterFile = new File("Everest/BugReporter.jar");
|
||||||
if (!bugReporterFile.exists()) {
|
if (!bugReporterFile.exists()) {
|
||||||
InputStream inputStream = RestaurantUtilities.class.getResourceAsStream("/BugReporter.jar");
|
InputStream inputStream = EverestUtilities.class.getResourceAsStream("/BugReporter.jar");
|
||||||
Path bugReporter = Paths.get("RESTaurant/BugReporter.jar");
|
Path bugReporter = Paths.get("Everest/BugReporter.jar");
|
||||||
try {
|
try {
|
||||||
Files.copy(inputStream, bugReporter);
|
Files.copy(inputStream, bugReporter);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util;
|
package com.rohitawate.everest.util;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.homewindow.HomeWindowController;
|
import com.rohitawate.everest.homewindow.HomeWindowController;
|
||||||
import com.rohitawate.restaurant.util.history.HistoryManager;
|
import com.rohitawate.everest.util.history.HistoryManager;
|
||||||
import com.rohitawate.restaurant.util.logging.Level;
|
import com.rohitawate.everest.util.logging.Level;
|
||||||
import com.rohitawate.restaurant.util.logging.LoggingService;
|
import com.rohitawate.everest.util.logging.LoggingService;
|
||||||
|
|
||||||
public class Services {
|
public class Services {
|
||||||
public static Thread startServicesThread;
|
public static Thread startServicesThread;
|
|
@ -14,14 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.history;
|
package com.rohitawate.everest.util.history;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.rohitawate.restaurant.models.DashboardState;
|
import com.rohitawate.everest.models.DashboardState;
|
||||||
import com.rohitawate.restaurant.util.RestaurantUtilities;
|
import com.rohitawate.everest.util.EverestUtilities;
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
import com.rohitawate.restaurant.util.settings.Settings;
|
import com.rohitawate.everest.util.settings.Settings;
|
||||||
|
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -42,11 +42,11 @@ public class HistoryManager {
|
||||||
|
|
||||||
public HistoryManager() {
|
public HistoryManager() {
|
||||||
try {
|
try {
|
||||||
File configFolder = new File("RESTaurant/config/");
|
File configFolder = new File("Everest/config/");
|
||||||
if (!configFolder.exists())
|
if (!configFolder.exists())
|
||||||
configFolder.mkdirs();
|
configFolder.mkdirs();
|
||||||
|
|
||||||
conn = DriverManager.getConnection("jdbc:sqlite:RESTaurant/config/history.sqlite");
|
conn = DriverManager.getConnection("jdbc:sqlite:Everest/config/history.sqlite");
|
||||||
|
|
||||||
// Read all queries from Queries.json
|
// Read all queries from Queries.json
|
||||||
InputStream queriesFile = getClass().getResourceAsStream("/sql/Queries.json");
|
InputStream queriesFile = getClass().getResourceAsStream("/sql/Queries.json");
|
||||||
|
@ -54,23 +54,23 @@ public class HistoryManager {
|
||||||
queries = mapper.readTree(queriesFile);
|
queries = mapper.readTree(queriesFile);
|
||||||
|
|
||||||
statement =
|
statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("createRequestsTable").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("createRequestsTable").toString()));
|
||||||
statement.execute();
|
statement.execute();
|
||||||
|
|
||||||
statement =
|
statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("createHeadersTable").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("createHeadersTable").toString()));
|
||||||
statement.execute();
|
statement.execute();
|
||||||
|
|
||||||
statement =
|
statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("createRequestContentMapTable").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("createRequestContentMapTable").toString()));
|
||||||
statement.execute();
|
statement.execute();
|
||||||
|
|
||||||
statement =
|
statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("createBodiesTable").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("createBodiesTable").toString()));
|
||||||
statement.execute();
|
statement.execute();
|
||||||
|
|
||||||
statement =
|
statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("createTuplesTable").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("createTuplesTable").toString()));
|
||||||
statement.execute();
|
statement.execute();
|
||||||
} catch (Exception E) {
|
} catch (Exception E) {
|
||||||
Services.loggingService.logSevere("Exception while initializing HistoryManager.", E, LocalDateTime.now());
|
Services.loggingService.logSevere("Exception while initializing HistoryManager.", E, LocalDateTime.now());
|
||||||
|
@ -93,7 +93,7 @@ public class HistoryManager {
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
statement =
|
statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveRequest").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("saveRequest").toString()));
|
||||||
|
|
||||||
statement.setString(1, state.getHttpMethod());
|
statement.setString(1, state.getHttpMethod());
|
||||||
statement.setString(2, String.valueOf(state.getTarget()));
|
statement.setString(2, String.valueOf(state.getTarget()));
|
||||||
|
@ -111,7 +111,7 @@ public class HistoryManager {
|
||||||
|
|
||||||
if (state.getHeaders().size() > 0) {
|
if (state.getHeaders().size() > 0) {
|
||||||
// Saves request headers
|
// Saves request headers
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveHeader").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveHeader").toString()));
|
||||||
for (Entry entry : state.getHeaders().entrySet()) {
|
for (Entry entry : state.getHeaders().entrySet()) {
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, entry.getKey().toString());
|
statement.setString(2, entry.getKey().toString());
|
||||||
|
@ -123,7 +123,7 @@ public class HistoryManager {
|
||||||
|
|
||||||
if (state.getParams().size() > 0) {
|
if (state.getParams().size() > 0) {
|
||||||
// Saves request parameters
|
// Saves request parameters
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveTuple").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveTuple").toString()));
|
||||||
for (Entry entry : state.getParams().entrySet()) {
|
for (Entry entry : state.getParams().entrySet()) {
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, "Param");
|
statement.setString(2, "Param");
|
||||||
|
@ -136,7 +136,7 @@ public class HistoryManager {
|
||||||
|
|
||||||
if (!(state.getHttpMethod().equals("GET") || state.getHttpMethod().equals("DELETE"))) {
|
if (!(state.getHttpMethod().equals("GET") || state.getHttpMethod().equals("DELETE"))) {
|
||||||
// Maps the request to its ContentType for faster recovery
|
// Maps the request to its ContentType for faster recovery
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveRequestContentPair").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveRequestContentPair").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, state.getContentType());
|
statement.setString(2, state.getContentType());
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public class HistoryManager {
|
||||||
case MediaType.TEXT_HTML:
|
case MediaType.TEXT_HTML:
|
||||||
case MediaType.APPLICATION_OCTET_STREAM:
|
case MediaType.APPLICATION_OCTET_STREAM:
|
||||||
// Saves the body in case of raw content, or the file location in case of binary
|
// Saves the body in case of raw content, or the file location in case of binary
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveBody").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveBody").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, state.getBody());
|
statement.setString(2, state.getBody());
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
|
@ -159,7 +159,7 @@ public class HistoryManager {
|
||||||
if (state.getStringTuples().size() > 0) {
|
if (state.getStringTuples().size() > 0) {
|
||||||
for (Entry<String, String> entry : state.getStringTuples().entrySet()) {
|
for (Entry<String, String> entry : state.getStringTuples().entrySet()) {
|
||||||
// Saves the string tuples
|
// Saves the string tuples
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveTuple").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveTuple").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, "String");
|
statement.setString(2, "String");
|
||||||
statement.setString(3, entry.getKey());
|
statement.setString(3, entry.getKey());
|
||||||
|
@ -173,7 +173,7 @@ public class HistoryManager {
|
||||||
if (state.getStringTuples().size() > 0) {
|
if (state.getStringTuples().size() > 0) {
|
||||||
for (Entry<String, String> entry : state.getStringTuples().entrySet()) {
|
for (Entry<String, String> entry : state.getStringTuples().entrySet()) {
|
||||||
// Saves the string tuples
|
// Saves the string tuples
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveTuple").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveTuple").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, "String");
|
statement.setString(2, "String");
|
||||||
statement.setString(3, entry.getKey());
|
statement.setString(3, entry.getKey());
|
||||||
|
@ -186,7 +186,7 @@ public class HistoryManager {
|
||||||
if (state.getFileTuples().size() > 0) {
|
if (state.getFileTuples().size() > 0) {
|
||||||
for (Entry<String, String> entry : state.getFileTuples().entrySet()) {
|
for (Entry<String, String> entry : state.getFileTuples().entrySet()) {
|
||||||
// Saves the file tuples
|
// Saves the file tuples
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("saveTuple").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("saveTuple").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, "File");
|
statement.setString(2, "File");
|
||||||
statement.setString(3, entry.getKey());
|
statement.setString(3, entry.getKey());
|
||||||
|
@ -214,7 +214,7 @@ public class HistoryManager {
|
||||||
List<DashboardState> history = new ArrayList<>();
|
List<DashboardState> history = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
// Loads the requests from the last x number of days, x being stored in Settings.showHistoryRange
|
// Loads the requests from the last x number of days, x being stored in Settings.showHistoryRange
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectRecentRequests").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("selectRecentRequests").toString()));
|
||||||
String historyStartDate = LocalDate.now().minusDays(Settings.showHistoryRange).toString();
|
String historyStartDate = LocalDate.now().minusDays(Settings.showHistoryRange).toString();
|
||||||
statement.setString(1, historyStartDate);
|
statement.setString(1, historyStartDate);
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ public class HistoryManager {
|
||||||
|
|
||||||
if (!(state.getHttpMethod().equals("GET") || state.getHttpMethod().equals("DELETE"))) {
|
if (!(state.getHttpMethod().equals("GET") || state.getHttpMethod().equals("DELETE"))) {
|
||||||
// Retrieves request body ContentType for querying corresponding table
|
// Retrieves request body ContentType for querying corresponding table
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectRequestContentType").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("selectRequestContentType").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
|
|
||||||
ResultSet RS = statement.executeQuery();
|
ResultSet RS = statement.executeQuery();
|
||||||
|
@ -255,7 +255,7 @@ public class HistoryManager {
|
||||||
case MediaType.APPLICATION_XML:
|
case MediaType.APPLICATION_XML:
|
||||||
case MediaType.TEXT_HTML:
|
case MediaType.TEXT_HTML:
|
||||||
case MediaType.APPLICATION_OCTET_STREAM:
|
case MediaType.APPLICATION_OCTET_STREAM:
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectRequestBody").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("selectRequestBody").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
|
|
||||||
RS = statement.executeQuery();
|
RS = statement.executeQuery();
|
||||||
|
@ -286,7 +286,7 @@ public class HistoryManager {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement =
|
PreparedStatement statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectRequestHeaders").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("selectRequestHeaders").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
|
|
||||||
ResultSet RS = statement.executeQuery();
|
ResultSet RS = statement.executeQuery();
|
||||||
|
@ -316,7 +316,7 @@ public class HistoryManager {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
PreparedStatement statement =
|
PreparedStatement statement =
|
||||||
conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectTuples").toString()));
|
conn.prepareStatement(EverestUtilities.trimString(queries.get("selectTuples").toString()));
|
||||||
statement.setInt(1, requestID);
|
statement.setInt(1, requestID);
|
||||||
statement.setString(2, type);
|
statement.setString(2, type);
|
||||||
|
|
||||||
|
@ -342,7 +342,7 @@ public class HistoryManager {
|
||||||
*/
|
*/
|
||||||
private boolean isDuplicate(DashboardState newState) {
|
private boolean isDuplicate(DashboardState newState) {
|
||||||
try {
|
try {
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectMostRecentRequest").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("selectMostRecentRequest").toString()));
|
||||||
ResultSet RS = statement.executeQuery();
|
ResultSet RS = statement.executeQuery();
|
||||||
|
|
||||||
int lastRequestID = -1;
|
int lastRequestID = -1;
|
||||||
|
@ -378,7 +378,7 @@ public class HistoryManager {
|
||||||
case MediaType.APPLICATION_XML:
|
case MediaType.APPLICATION_XML:
|
||||||
case MediaType.TEXT_HTML:
|
case MediaType.TEXT_HTML:
|
||||||
case MediaType.APPLICATION_OCTET_STREAM:
|
case MediaType.APPLICATION_OCTET_STREAM:
|
||||||
statement = conn.prepareStatement(RestaurantUtilities.trimString(queries.get("selectRequestBody").toString()));
|
statement = conn.prepareStatement(EverestUtilities.trimString(queries.get("selectRequestBody").toString()));
|
||||||
statement.setInt(1, lastRequestID);
|
statement.setInt(1, lastRequestID);
|
||||||
|
|
||||||
RS = statement.executeQuery();
|
RS = statement.executeQuery();
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.logging;
|
package com.rohitawate.everest.util.logging;
|
||||||
|
|
||||||
public enum Level {
|
public enum Level {
|
||||||
SEVERE, WARNING, INFO;
|
SEVERE, WARNING, INFO;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.logging;
|
package com.rohitawate.everest.util.logging;
|
||||||
|
|
||||||
class Log {
|
class Log {
|
||||||
private Level level;
|
private Level level;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.logging;
|
package com.rohitawate.everest.util.logging;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
@ -24,7 +24,7 @@ import java.util.Scanner;
|
||||||
class Logger {
|
class Logger {
|
||||||
private Level writerLevel;
|
private Level writerLevel;
|
||||||
private String logEntryTemplate;
|
private String logEntryTemplate;
|
||||||
private String logFilePath = "RESTaurant/logs/" + LocalDate.now() + ".html";
|
private String logFilePath = "Everest/logs/" + LocalDate.now() + ".html";
|
||||||
|
|
||||||
Logger(Level writerLevel) {
|
Logger(Level writerLevel) {
|
||||||
this.writerLevel = writerLevel;
|
this.writerLevel = writerLevel;
|
||||||
|
@ -93,7 +93,7 @@ class Logger {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createLogsFile() {
|
private void createLogsFile() {
|
||||||
File logsDirectory = new File("RESTaurant/logs/");
|
File logsDirectory = new File("Everest/logs/");
|
||||||
if (!logsDirectory.exists())
|
if (!logsDirectory.exists())
|
||||||
logsDirectory.mkdirs();
|
logsDirectory.mkdirs();
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.logging;
|
package com.rohitawate.everest.util.logging;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.settings;
|
package com.rohitawate.everest.util.settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds default settings values which may
|
* Holds default settings values which may
|
|
@ -14,12 +14,12 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.settings;
|
package com.rohitawate.everest.util.settings;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.rohitawate.restaurant.util.RestaurantUtilities;
|
import com.rohitawate.everest.util.EverestUtilities;
|
||||||
import com.rohitawate.restaurant.util.Services;
|
import com.rohitawate.everest.util.Services;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
@ -60,7 +60,7 @@ public class SettingsLoader implements Runnable {
|
||||||
if (Settings.connectionReadTimeOutEnable)
|
if (Settings.connectionReadTimeOutEnable)
|
||||||
Settings.connectionReadTimeOut = nodes.get("connectionReadTimeOut").asInt();
|
Settings.connectionReadTimeOut = nodes.get("connectionReadTimeOut").asInt();
|
||||||
|
|
||||||
Settings.theme = RestaurantUtilities.trimString(nodes.get("theme").toString());
|
Settings.theme = EverestUtilities.trimString(nodes.get("theme").toString());
|
||||||
} catch (Exception E) {
|
} catch (Exception E) {
|
||||||
Services.loggingService.logInfo("Settings file not found. Defaults will be used.", LocalDateTime.now());
|
Services.loggingService.logInfo("Settings file not found. Defaults will be used.", LocalDateTime.now());
|
||||||
} finally {
|
} finally {
|
|
@ -14,9 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.rohitawate.restaurant.util.themes;
|
package com.rohitawate.everest.util.themes;
|
||||||
|
|
||||||
import com.rohitawate.restaurant.util.settings.Settings;
|
import com.rohitawate.everest.util.settings.Settings;
|
||||||
import javafx.scene.Parent;
|
import javafx.scene.Parent;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
|
@ -15,7 +15,7 @@
|
||||||
id="svg8"
|
id="svg8"
|
||||||
inkscape:version="0.92.1 r15371"
|
inkscape:version="0.92.1 r15371"
|
||||||
sodipodi:docname="Logo.svg"
|
sodipodi:docname="Logo.svg"
|
||||||
inkscape:export-filename="D:\IntelliJ Projects\RESTaurant\src\main\resources\assets\Logo.png"
|
inkscape:export-filename="D:\IntelliJ Projects\Everest\src\main\resources\assets\Logo.png"
|
||||||
inkscape:export-xdpi="6.3499999"
|
inkscape:export-xdpi="6.3499999"
|
||||||
inkscape:export-ydpi="6.3499999">
|
inkscape:export-ydpi="6.3499999">
|
||||||
<defs
|
<defs
|
||||||
|
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
@ -39,7 +39,7 @@
|
||||||
id="info" /><g
|
id="info" /><g
|
||||||
id="icons"
|
id="icons"
|
||||||
style="fill:#ffffff"
|
style="fill:#ffffff"
|
||||||
inkscape:export-filename="D:\IntelliJ Projects\RESTaurant\src\main\resources\assets\Send.png"
|
inkscape:export-filename="D:\IntelliJ Projects\Everest\src\main\resources\assets\Send.png"
|
||||||
inkscape:export-xdpi="230.22"
|
inkscape:export-xdpi="230.22"
|
||||||
inkscape:export-ydpi="230.22"><path
|
inkscape:export-ydpi="230.22"><path
|
||||||
d="M21.5,11.1l-17.9-9C2.7,1.7,1.7,2.5,2.1,3.4l2.5,6.7L16,12L4.6,13.9l-2.5,6.7c-0.3,0.9,0.6,1.7,1.5,1.2l17.9-9 C22.2,12.5,22.2,11.5,21.5,11.1z"
|
d="M21.5,11.1l-17.9-9C2.7,1.7,1.7,2.5,2.1,3.4l2.5,6.7L16,12L4.6,13.9l-2.5,6.7c-0.3,0.9,0.6,1.7,1.5,1.2l17.9-9 C22.2,12.5,22.2,11.5,21.5,11.1z"
|
||||||
|
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
@ -22,7 +22,7 @@
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<TabPane fx:id="bodyTabPane" prefHeight="100.0" prefWidth="1280.0" stylesheets="@../../css/Adreana.css"
|
<TabPane fx:id="bodyTabPane" prefHeight="100.0" prefWidth="1280.0" stylesheets="@../../css/Adreana.css"
|
||||||
tabClosingPolicy="UNAVAILABLE" tabMinWidth="150.0" xmlns="http://javafx.com/javafx/8.0.141"
|
tabClosingPolicy="UNAVAILABLE" tabMinWidth="150.0" xmlns="http://javafx.com/javafx/8.0.141"
|
||||||
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.restaurant.homewindow.BodyTabController">
|
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.everest.homewindow.BodyTabController">
|
||||||
<tabs>
|
<tabs>
|
||||||
<Tab fx:id="formTab" text="FORM"/>
|
<Tab fx:id="formTab" text="FORM"/>
|
||||||
<Tab fx:id="urlTab" text="URL ENCODED"/>
|
<Tab fx:id="urlTab" text="URL ENCODED"/>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<?import javafx.scene.text.*?>
|
<?import javafx.scene.text.*?>
|
||||||
<StackPane fx:id="dashboard" prefHeight="720.0" prefWidth="1280.0" stylesheets="@../../css/Adreana.css"
|
<StackPane fx:id="dashboard" prefHeight="720.0" prefWidth="1280.0" stylesheets="@../../css/Adreana.css"
|
||||||
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.rohitawate.restaurant.homewindow.DashboardController">
|
fx:controller="com.rohitawate.everest.homewindow.DashboardController">
|
||||||
<children>
|
<children>
|
||||||
<VBox prefHeight="200.0" prefWidth="100.0">
|
<VBox prefHeight="200.0" prefWidth="100.0">
|
||||||
<children>
|
<children>
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<?import javafx.scene.layout.HBox?>
|
<?import javafx.scene.layout.HBox?>
|
||||||
<HBox fx:id="headerField" alignment="CENTER" spacing="10.0" stylesheets="@../../css/Adreana.css"
|
<HBox fx:id="headerField" alignment="CENTER" spacing="10.0" stylesheets="@../../css/Adreana.css"
|
||||||
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.rohitawate.restaurant.homewindow.FileKeyValueFieldController">
|
fx:controller="com.rohitawate.everest.homewindow.FileKeyValueFieldController">
|
||||||
<children>
|
<children>
|
||||||
<JFXCheckBox fx:id="checkBox" checkedColor="ORANGERED" unCheckedColor="#7a7a7a" HBox.hgrow="ALWAYS"/>
|
<JFXCheckBox fx:id="checkBox" checkedColor="ORANGERED" unCheckedColor="#7a7a7a" HBox.hgrow="ALWAYS"/>
|
||||||
<TextField fx:id="fileKeyField" prefWidth="400.0" promptText="KEY" HBox.hgrow="ALWAYS"/>
|
<TextField fx:id="fileKeyField" prefWidth="400.0" promptText="KEY" HBox.hgrow="ALWAYS"/>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<VBox fx:id="headerTabContent" alignment="CENTER" stylesheets="@../../css/Adreana.css"
|
<VBox fx:id="headerTabContent" alignment="CENTER" stylesheets="@../../css/Adreana.css"
|
||||||
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.rohitawate.restaurant.homewindow.FormDataTabController">
|
fx:controller="com.rohitawate.everest.homewindow.FormDataTabController">
|
||||||
<children>
|
<children>
|
||||||
<HBox alignment="CENTER" VBox.vgrow="NEVER">
|
<HBox alignment="CENTER" VBox.vgrow="NEVER">
|
||||||
<VBox.margin>
|
<VBox.margin>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<VBox fx:id="headerTabContent" alignment="CENTER" stylesheets="@../../css/Adreana.css"
|
<VBox fx:id="headerTabContent" alignment="CENTER" stylesheets="@../../css/Adreana.css"
|
||||||
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.rohitawate.restaurant.homewindow.HeaderTabController">
|
fx:controller="com.rohitawate.everest.homewindow.HeaderTabController">
|
||||||
<children>
|
<children>
|
||||||
<HBox alignment="CENTER" VBox.vgrow="NEVER">
|
<HBox alignment="CENTER" VBox.vgrow="NEVER">
|
||||||
<VBox.margin>
|
<VBox.margin>
|
||||||
|
|
|
@ -6,7 +6,25 @@
|
||||||
<?import javafx.scene.layout.HBox?>
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.StackPane?>
|
<?import javafx.scene.layout.StackPane?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<HBox fx:id="historyItemBox" alignment="CENTER_LEFT" maxHeight="40.0" minHeight="40.0" minWidth="300.0" spacing="20.0" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.restaurant.homewindow.HistoryItemController">
|
<!--
|
||||||
|
~ Copyright 2018 Rohit Awate.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<HBox fx:id="historyItemBox" alignment="CENTER_LEFT" maxHeight="40.0" minHeight="40.0" minWidth="300.0" spacing="20.0"
|
||||||
|
stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
|
fx:controller="com.rohitawate.everest.homewindow.HistoryItemController">
|
||||||
<children>
|
<children>
|
||||||
<StackPane maxWidth="80.0" minWidth="80.0" HBox.hgrow="ALWAYS">
|
<StackPane maxWidth="80.0" minWidth="80.0" HBox.hgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
<?import javafx.scene.image.*?>
|
<?import javafx.scene.image.*?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
<SplitPane dividerPositions="0.3" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.restaurant.homewindow.HomeWindowController">
|
<SplitPane dividerPositions="0.3" stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.141"
|
||||||
|
xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.rohitawate.everest.homewindow.HomeWindowController">
|
||||||
<items>
|
<items>
|
||||||
<VBox fx:id="historyPane" alignment="TOP_CENTER" maxWidth="500.0" prefWidth="400.0"
|
<VBox fx:id="historyPane" alignment="TOP_CENTER" maxWidth="500.0" prefWidth="400.0"
|
||||||
SplitPane.resizableWithParent="false">
|
SplitPane.resizableWithParent="false">
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<HBox fx:id="headerField" alignment="CENTER" spacing="10.0" stylesheets="@../../css/Adreana.css"
|
<HBox fx:id="headerField" alignment="CENTER" spacing="10.0" stylesheets="@../../css/Adreana.css"
|
||||||
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.rohitawate.restaurant.homewindow.StringKeyValueFieldController">
|
fx:controller="com.rohitawate.everest.homewindow.StringKeyValueFieldController">
|
||||||
<children>
|
<children>
|
||||||
<JFXCheckBox fx:id="checkBox" checkedColor="ORANGERED" unCheckedColor="#7a7a7a" HBox.hgrow="ALWAYS"/>
|
<JFXCheckBox fx:id="checkBox" checkedColor="ORANGERED" unCheckedColor="#7a7a7a" HBox.hgrow="ALWAYS"/>
|
||||||
<TextField fx:id="keyField" prefWidth="400.0" promptText="KEY" HBox.hgrow="ALWAYS"/>
|
<TextField fx:id="keyField" prefWidth="400.0" promptText="KEY" HBox.hgrow="ALWAYS"/>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<?import javafx.scene.image.ImageView?>
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.*?>
|
<?import javafx.scene.layout.*?>
|
||||||
<VBox stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
<VBox stylesheets="@../../css/Adreana.css" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1"
|
||||||
fx:controller="com.rohitawate.restaurant.homewindow.URLTabController">
|
fx:controller="com.rohitawate.everest.homewindow.URLTabController">
|
||||||
<children>
|
<children>
|
||||||
<HBox alignment="CENTER" VBox.vgrow="NEVER">
|
<HBox alignment="CENTER" VBox.vgrow="NEVER">
|
||||||
<VBox.margin>
|
<VBox.margin>
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<!--
|
||||||
|
~ Copyright 2018 Rohit Awate.
|
||||||
|
~
|
||||||
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
~ you may not use this file except in compliance with the License.
|
||||||
|
~ You may obtain a copy of the License at
|
||||||
|
~
|
||||||
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
~
|
||||||
|
~ Unless required by applicable law or agreed to in writing, software
|
||||||
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
~ See the License for the specific language governing permissions and
|
||||||
|
~ limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
|
@ -38,7 +54,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>RESTaurant Log: %% Date %%</h1>
|
<h1>Everest Log: %% Date %%</h1>
|
||||||
<!-- Placeholder for new log -->
|
<!-- Placeholder for new log -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in a new issue