parent
98b96d9906
commit
645f18a1f3
@ -1,5 +0,0 @@
|
|||||||
#### About
|
|
||||||
The `mirror` servlet. Prints the list of request it received.
|
|
||||||
* `./src` the code.
|
|
||||||
* `./war/wrapper` supplements needed for `.war`.
|
|
||||||
* `./war/<name>.war` copy this to `tomcat/webapps`.
|
|
@ -1,40 +0,0 @@
|
|||||||
<?xml version="1.0" ?>
|
|
||||||
<project name="mirror" basedir="." default="war">
|
|
||||||
|
|
||||||
<!-- DEFINE SOME VARS -->
|
|
||||||
<property name="appname" value="mirror" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<path id="compile.classpath">
|
|
||||||
<fileset dir="lib">
|
|
||||||
<include name="*.jar"/>
|
|
||||||
</fileset>
|
|
||||||
</path>
|
|
||||||
|
|
||||||
<!-- INIT -->
|
|
||||||
<target name="init">
|
|
||||||
<mkdir dir="build/classes"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- COMPILE -->
|
|
||||||
<target name="compile" depends="init" >
|
|
||||||
<javac destdir="build/classes" debug="true" srcdir="src">
|
|
||||||
<classpath refid="compile.classpath"/>
|
|
||||||
</javac>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- WAR -->
|
|
||||||
<target name="war" depends="compile">
|
|
||||||
<war destfile="${appname}A.war" webxml="web.xml">
|
|
||||||
<fileset dir="web"/>
|
|
||||||
<lib dir="lib"/>
|
|
||||||
<classes dir="build/classes"/>
|
|
||||||
</war>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="clean">
|
|
||||||
<delete dir="build" />
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,16 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<output url="file://$MODULE_DIR$/../out/production/mirror" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/../out/test/mirror" />
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016" level="project" />
|
|
||||||
<orderEntry type="library" name="org.json:json:20190722" level="project" />
|
|
||||||
<orderEntry type="library" name="commons-io:commons-io:2.6" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,86 +0,0 @@
|
|||||||
package com.olexyn.mirror;
|
|
||||||
|
|
||||||
import com.olexyn.misp.helper.Ride;
|
|
||||||
import com.olexyn.misp.helper.WebPrint;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServlet;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class Mirror extends HttpServlet {
|
|
||||||
|
|
||||||
protected static final String MISP_CLIENT_URL = "http://localhost:9090/mispclient/core";
|
|
||||||
|
|
||||||
|
|
||||||
private final List<String> list = new ArrayList<>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void addRequest(HttpServletRequest request){
|
|
||||||
synchronized (list) {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
sb.append(request.getRequestURL().toString());
|
|
||||||
sb.append(WebPrint.SPLIT);
|
|
||||||
sb.append(request.getMethod());
|
|
||||||
sb.append(WebPrint.SPLIT);
|
|
||||||
sb.append(request.getQueryString());
|
|
||||||
list.add(sb.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// #######
|
|
||||||
//
|
|
||||||
// #######
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
||||||
|
|
||||||
addRequest(request);
|
|
||||||
|
|
||||||
PrintWriter print = response.getWriter();
|
|
||||||
|
|
||||||
print.println("<!DOCTYPE html>");
|
|
||||||
|
|
||||||
print.println("<html lang=\"en\">");
|
|
||||||
print.println("<head>");
|
|
||||||
print.println("<meta charset=\"utf-8\">");
|
|
||||||
print.println("<title>title</title>");
|
|
||||||
print.println("<link rel=\"stylesheet\" href=\"style.css\">");
|
|
||||||
print.println("<script src=\"script.js\"></script>");
|
|
||||||
print.println("</head>");
|
|
||||||
print.println("<body>");
|
|
||||||
synchronized (list) {
|
|
||||||
|
|
||||||
print.println(WebPrint.requestList(list));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print.println(" </body></html>");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void doPost(HttpServletRequest request, HttpServletResponse response) {
|
|
||||||
|
|
||||||
addRequest(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void doPut(HttpServletRequest request, HttpServletResponse response){
|
|
||||||
addRequest(request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
||||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
|
||||||
version="2.4">
|
|
||||||
|
|
||||||
<display-name>Mirror</display-name>
|
|
||||||
<description>
|
|
||||||
This is a simple web application with a source code organization
|
|
||||||
based on the recommendations of the Application Developer's Guide.
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>Mirror</servlet-name>
|
|
||||||
<servlet-class>com.olexyn.mirror.Mirror</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>Mirror</servlet-name>
|
|
||||||
<url-pattern>/core</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
</web-app>
|
|
@ -1,23 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Sample Application JSP Page</title>
|
|
||||||
</head>
|
|
||||||
<body bgcolor=white>
|
|
||||||
|
|
||||||
<table border="0">
|
|
||||||
<tr>
|
|
||||||
<td align=center>
|
|
||||||
<img src="images/tomcat.gif">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<h1>Sample Application JSP Page</h1>
|
|
||||||
This is the output of a JSP page that is part of the Hello, World
|
|
||||||
application.
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<%= new String("Hello!") %>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Before Width: | Height: | Size: 1.4 KiB |
@ -1,25 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Mirror</title>
|
|
||||||
</head>
|
|
||||||
<body bgcolor=white>
|
|
||||||
|
|
||||||
<table border="0">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<img src="images/tomcat.gif">
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<h1>Mirror</h1>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<p>This Servlet currently provides the following features:
|
|
||||||
<!--<li>To a <a href="hello.jsp">JSP page</a>.-->
|
|
||||||
<li><a href="core">Mirror</a> of all requests.
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,5 +0,0 @@
|
|||||||
#### About
|
|
||||||
The `mispbridge` servlet.
|
|
||||||
* `./src` the code.
|
|
||||||
* `./war/wrapper` supplements needed for `.war`.
|
|
||||||
* `./war/<name>.war` copy this to `tomcat/webapps`.
|
|
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
version="0.1"
|
|
||||||
file="target/misp-fwd-${version}.war"
|
|
||||||
groupId="com.olexyn.misp.fwd"
|
|
||||||
artifactId="misp-fwd"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mvn package
|
|
||||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=war -DgeneratePom=true
|
|
@ -1,19 +0,0 @@
|
|||||||
<?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_11">
|
|
||||||
<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" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="jdk" jdkName="11" jdkType="JavaSDK" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
|
||||||
<orderEntry type="module" module-name="misp-helper" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.json:json:20190722" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,97 +0,0 @@
|
|||||||
<?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.olexyn.misp.fwd</groupId>
|
|
||||||
<artifactId>misp-fwd</artifactId>
|
|
||||||
<version>0.1</version>
|
|
||||||
<packaging>war</packaging>
|
|
||||||
|
|
||||||
<name>misp-fwd Maven Webapp</name>
|
|
||||||
<!-- FIXME change it to the project's website -->
|
|
||||||
<url>http://www.example.com</url>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.11</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.olexyn.misp.helper</groupId>
|
|
||||||
<artifactId>misp-helper</artifactId>
|
|
||||||
<version>0.1</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
|
||||||
<artifactId>javax.servlet</artifactId>
|
|
||||||
<version>3.0.0.v201112011016</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20190722</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
|
|
||||||
<build>
|
|
||||||
|
|
||||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.0.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
<configuration>
|
|
||||||
<!-- or whatever version you use -->
|
|
||||||
<source>11</source>
|
|
||||||
<target>11</target>
|
|
||||||
<verbose>true</verbose>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.22.1</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<version>3.2.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>2.5.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>2.8.2</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
@ -1,217 +0,0 @@
|
|||||||
package com.olexyn.misp.fwd;
|
|
||||||
|
|
||||||
import com.olexyn.misp.helper.JsonHelper;
|
|
||||||
import com.olexyn.misp.helper.Ride;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServlet;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.io.PrintWriter;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class FwdProxy extends HttpServlet {
|
|
||||||
|
|
||||||
protected static final String MISP_CLIENT_URL = "http://localhost:9090/mispclient/core";
|
|
||||||
|
|
||||||
public final Map<Long, Ride> available = new HashMap<>();
|
|
||||||
public final Map<Long, Ride> booked = new HashMap<>();
|
|
||||||
public final Map<Long, Ride> loaded = new HashMap<>();
|
|
||||||
|
|
||||||
// #######
|
|
||||||
//
|
|
||||||
// #######
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
||||||
|
|
||||||
|
|
||||||
final String payload = IOUtils.toString(request.getReader());
|
|
||||||
final boolean isJson = JsonHelper.isJson(payload);
|
|
||||||
boolean hasID = false;
|
|
||||||
boolean hasRequest = false;
|
|
||||||
boolean hasData = false;
|
|
||||||
|
|
||||||
if (isJson) {
|
|
||||||
final Ride ridePayload = new Ride(payload);
|
|
||||||
hasID = ridePayload.getID() != null;
|
|
||||||
hasRequest = ridePayload.getRequest() != null;
|
|
||||||
hasData = ridePayload.getData() != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (isJson && hasID && hasRequest && hasData) {
|
|
||||||
Thread handleGetRideRequestDataThread = new Thread(() -> {
|
|
||||||
try {
|
|
||||||
handleGetRideRequestData(request, response);
|
|
||||||
} catch (IOException | InterruptedException e) { e.printStackTrace(); }
|
|
||||||
});
|
|
||||||
handleGetRideRequestDataThread.setName("handleGetRideRequestDataThread");
|
|
||||||
handleGetRideRequestDataThread.start();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
Thread handleGetRequestThread = new Thread(() -> {
|
|
||||||
try {
|
|
||||||
handleGetRequest(request, response);
|
|
||||||
} catch (IOException | InterruptedException e) {e.printStackTrace(); }
|
|
||||||
});
|
|
||||||
handleGetRequestThread.setName("handleGetRequestThread");
|
|
||||||
handleGetRequestThread.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* handle GET (Link)
|
|
||||||
* remove Ride from AvailableRides
|
|
||||||
* add Ride to ReservedRides
|
|
||||||
* send OK (Ride) to mispclient
|
|
||||||
* send OK (Ride) to public
|
|
||||||
*/
|
|
||||||
protected void handleGetRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, InterruptedException {
|
|
||||||
final Ride ride;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//final ServletInputStream in = request.getInputStream();
|
|
||||||
final String parsedRequest = null; //new String(in.readAllBytes());
|
|
||||||
byte[] foo =null;
|
|
||||||
try{
|
|
||||||
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
|
|
||||||
ObjectOutputStream objOut = new ObjectOutputStream(byteOut);
|
|
||||||
objOut.writeObject(request);
|
|
||||||
int br =0;
|
|
||||||
foo = byteOut.toByteArray();
|
|
||||||
objOut.close();
|
|
||||||
byteOut.close();
|
|
||||||
br=1;
|
|
||||||
|
|
||||||
}catch (IOException e){
|
|
||||||
int br =0;
|
|
||||||
}
|
|
||||||
int br =0;
|
|
||||||
|
|
||||||
|
|
||||||
synchronized (available) {
|
|
||||||
|
|
||||||
while (available.size() < 1) {
|
|
||||||
available.notify();
|
|
||||||
available.wait();
|
|
||||||
}
|
|
||||||
// ride exists only locally, thus safe
|
|
||||||
ride = available.entrySet().iterator().next().getValue();
|
|
||||||
// ride exists only in "available", access through which is sync, thus safe
|
|
||||||
available.remove(ride.getID());
|
|
||||||
// needed because POST (Ride) wait()s
|
|
||||||
available.notify();
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (booked) {
|
|
||||||
// ride exists only locally, thus safe
|
|
||||||
booked.put(ride.getID(), ride);
|
|
||||||
// ride exists only in "booked", access through which is sync, thus safe
|
|
||||||
ride.setRequest(parsedRequest);
|
|
||||||
// POST (Ride) wait()s
|
|
||||||
booked.notify();
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (loaded) {
|
|
||||||
|
|
||||||
while (!loaded.containsKey(ride.getID())) {
|
|
||||||
loaded.notify();
|
|
||||||
loaded.wait();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CARE this is tricky
|
|
||||||
// what if ride exists in another map, e.g. "available'
|
|
||||||
// in that case illegal access is possible
|
|
||||||
// be carefull to removing ride from all other references, when adding it to "loaded".
|
|
||||||
ride.setData(loaded.remove(ride.getID()).getData());
|
|
||||||
}
|
|
||||||
|
|
||||||
response.setStatus(200);
|
|
||||||
final PrintWriter writer = response.getWriter();
|
|
||||||
writer.write(ride.getData());
|
|
||||||
writer.flush();
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* handle GET (Ride)(Data)
|
|
||||||
* if Ride in ForwardedRequest
|
|
||||||
* remove Ride from ForwardedRequest
|
|
||||||
* add Ride to NewData
|
|
||||||
* send OK (Ride)(Data)
|
|
||||||
* remove Ride from NewData
|
|
||||||
* add Ride to ForwardedData
|
|
||||||
* send OK (EOL)
|
|
||||||
* remove Ride from ForwardedData
|
|
||||||
* add Ride to EOL
|
|
||||||
*/
|
|
||||||
protected void handleGetRideRequestData(HttpServletRequest request, HttpServletResponse response) throws IOException, InterruptedException {
|
|
||||||
final String jsonPayload = IOUtils.toString(request.getReader());
|
|
||||||
final Ride ride = new Ride(jsonPayload);
|
|
||||||
|
|
||||||
synchronized (booked) {
|
|
||||||
booked.remove(ride.getID());
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (loaded) {
|
|
||||||
loaded.put(ride.getID(), ride);
|
|
||||||
loaded.notify();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// #######
|
|
||||||
//
|
|
||||||
// #######
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
|
||||||
Thread handlePostRideThread = new Thread(() -> {
|
|
||||||
try {handlePostRide(request, response); } catch (IOException | InterruptedException e) { e.printStackTrace(); }
|
|
||||||
});
|
|
||||||
handlePostRideThread.setName("handlePostRideThread");
|
|
||||||
handlePostRideThread.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* handle POST (Ride)
|
|
||||||
* add Ride to AvailableRides
|
|
||||||
*/
|
|
||||||
protected void handlePostRide(HttpServletRequest request, HttpServletResponse response) throws IOException, InterruptedException {
|
|
||||||
String jsonPayload = IOUtils.toString(request.getReader());
|
|
||||||
final Ride ride = new Ride(jsonPayload);
|
|
||||||
|
|
||||||
synchronized (available) {
|
|
||||||
available.put(ride.getID(), ride);
|
|
||||||
available.notify();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ID is final/threadsafe
|
|
||||||
while (!(booked.containsKey(ride.getID()))) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (booked) {
|
|
||||||
//booked.notify();
|
|
||||||
//booked.wait();
|
|
||||||
ride.setRequest(booked.get(ride.getID()).getRequest());
|
|
||||||
}
|
|
||||||
|
|
||||||
response.setStatus(200);
|
|
||||||
PrintWriter writer = response.getWriter();
|
|
||||||
writer.write(ride.json());
|
|
||||||
writer.flush();
|
|
||||||
writer.close();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
<!DOCTYPE web-app PUBLIC
|
|
||||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
|
||||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
|
||||||
|
|
||||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
|
||||||
version="2.4">
|
|
||||||
|
|
||||||
<display-name>misp-fwd</display-name>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>misp-fwd</servlet-name>
|
|
||||||
<servlet-class>com.olexyn.misp.fwd.FwdProxy</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>misp-fwd</servlet-name>
|
|
||||||
<url-pattern>/core</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
</web-app>
|
|
Before Width: | Height: | Size: 617 B |
@ -1,20 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>misp-fwd</title>
|
|
||||||
</head>
|
|
||||||
<body bgcolor=white>
|
|
||||||
|
|
||||||
<table border="0">
|
|
||||||
<tr>
|
|
||||||
<td align=center>
|
|
||||||
<img src="images/io42630.png">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<h1>misp-fwd</h1>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
#Created by Apache Maven 3.6.3
|
|
||||||
groupId=com.olexyn.misp.fwd
|
|
||||||
artifactId=misp-fwd
|
|
||||||
version=0.1
|
|
@ -1 +0,0 @@
|
|||||||
com/olexyn/misp/fwd/BridgeServlet.class
|
|
@ -1 +0,0 @@
|
|||||||
/home/user/ws/idea/misp/misp-fwd/src/main/java/com/olexyn/misp/fwd/BridgeServlet.java
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,7 +0,0 @@
|
|||||||
<!DOCTYPE web-app PUBLIC
|
|
||||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
|
||||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
|
||||||
|
|
||||||
<web-app>
|
|
||||||
<display-name>Archetype Created Web Application</display-name>
|
|
||||||
</web-app>
|
|
@ -1,5 +0,0 @@
|
|||||||
<html>
|
|
||||||
<body>
|
|
||||||
<h2>Hello World!</h2>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
version="0.1"
|
|
||||||
file="target/misp-helper-${version}.jar"
|
|
||||||
groupId="com.olexyn.misp.helper"
|
|
||||||
artifactId="misp-helper"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mvn package
|
|
||||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true
|
|
@ -1,17 +0,0 @@
|
|||||||
<?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_11">
|
|
||||||
<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/test/java" isTestSource="true" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="org.json:json:20190722" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: junit:junit:3.8.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.json:json:20190722" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,87 +0,0 @@
|
|||||||
<?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.olexyn.misp.helper</groupId>
|
|
||||||
<artifactId>misp-helper</artifactId>
|
|
||||||
<version>0.1</version>
|
|
||||||
|
|
||||||
<name>misp-helper</name>
|
|
||||||
<description>A simple misp-helper.</description>
|
|
||||||
<!-- FIXME change it to the project's website -->
|
|
||||||
<url>http://www.example.com</url>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
<maven.compiler.source>1.11</maven.compiler.source>
|
|
||||||
<maven.compiler.target>1.11</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>3.8.1</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20190722</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-site-plugin</artifactId>
|
|
||||||
<version>3.7.1</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
</plugin>
|
|
||||||
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.0.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.22.1</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
|
||||||
<version>3.0.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>2.5.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>2.8.2</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<reporting>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</reporting>
|
|
||||||
</project>
|
|
@ -1,21 +0,0 @@
|
|||||||
package com.olexyn.misp.helper;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
public class JsonHelper {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean isJson(String string){
|
|
||||||
|
|
||||||
try{
|
|
||||||
new JSONObject(string);
|
|
||||||
}catch (JSONException | NullPointerException e){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,139 +0,0 @@
|
|||||||
package com.olexyn.misp.helper;
|
|
||||||
|
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Ride {
|
|
||||||
|
|
||||||
private static long count = 0L;
|
|
||||||
|
|
||||||
final private Long id;
|
|
||||||
private String request;
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
// FUTURE it might be possible to use a ride for many requests.
|
|
||||||
// private List<String> requests = new ArrayList<>();
|
|
||||||
// private Map<String,String> data = new HashMap<>();
|
|
||||||
|
|
||||||
|
|
||||||
public Ride() {
|
|
||||||
id = count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Ride(String jsonString) {
|
|
||||||
|
|
||||||
JSONObject obj = new JSONObject();
|
|
||||||
try {
|
|
||||||
obj = new JSONObject(jsonString);
|
|
||||||
}catch (JSONException e){
|
|
||||||
int br = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
long _id;
|
|
||||||
|
|
||||||
try {
|
|
||||||
_id = obj.getLong("id");
|
|
||||||
}catch (JSONException e){
|
|
||||||
_id = count++;
|
|
||||||
}
|
|
||||||
id = _id;
|
|
||||||
try{
|
|
||||||
request = obj.getString("request");
|
|
||||||
} catch (JSONException e){
|
|
||||||
request = null;
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
data = obj.getString("data");
|
|
||||||
}catch (JSONException e){
|
|
||||||
data = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Ride(JSONObject obj){
|
|
||||||
long _id;
|
|
||||||
|
|
||||||
try {
|
|
||||||
_id = obj.getLong("id");
|
|
||||||
}catch (JSONException e){
|
|
||||||
_id = count++;
|
|
||||||
}
|
|
||||||
id = _id;
|
|
||||||
try{
|
|
||||||
request = obj.getString("request");
|
|
||||||
} catch (JSONException e){
|
|
||||||
request = null;
|
|
||||||
}
|
|
||||||
try{
|
|
||||||
data = obj.getString("data");
|
|
||||||
}catch (JSONException e){
|
|
||||||
data = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setRequest(String request) {
|
|
||||||
this.request = request;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setData(String data) {
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getRequest() {
|
|
||||||
return this.request;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getData() {
|
|
||||||
return this.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getID() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private String brace(String foo) {
|
|
||||||
return "\"" + foo + "\"";
|
|
||||||
}
|
|
||||||
|
|
||||||
private String unbrace(String foo) { return foo.replace("\"", ""); }
|
|
||||||
|
|
||||||
public String json() {
|
|
||||||
JSONObject obj = new JSONObject();
|
|
||||||
obj.put("id", id);
|
|
||||||
obj.put("request", request);
|
|
||||||
obj.put("data",data);
|
|
||||||
return obj.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) return true;
|
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
|
||||||
Ride ride = (Ride) o;
|
|
||||||
return Objects.equals(id, ride.id) && Objects.equals(request, ride.request) && Objects.equals(data, ride.data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(id, request, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
|||||||
package com.olexyn.misp.helper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class WebPrint {
|
|
||||||
|
|
||||||
final static public String SPLIT = "io32413445353";
|
|
||||||
|
|
||||||
public static String list(List<String> list, String type) {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("<table style=\"width:100%\">");
|
|
||||||
sb.append("<tr>");
|
|
||||||
sb.append("<th>");
|
|
||||||
sb.append("List: ");
|
|
||||||
sb.append(type);
|
|
||||||
sb.append("</th>");
|
|
||||||
sb.append("</tr>");
|
|
||||||
|
|
||||||
for (String entry : list) {
|
|
||||||
sb.append("<tr><td>");
|
|
||||||
sb.append(entry);
|
|
||||||
sb.append("</td></tr>");
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String requestList(List<String> list) {
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("<table style=\"width:100%\">");
|
|
||||||
sb.append("<tr>");
|
|
||||||
sb.append("<th>");
|
|
||||||
sb.append("URL");
|
|
||||||
sb.append("</th>");
|
|
||||||
sb.append("<th>");
|
|
||||||
sb.append("Method");
|
|
||||||
sb.append("</th>");
|
|
||||||
sb.append("<th>");
|
|
||||||
sb.append("Query");
|
|
||||||
sb.append("</th>");
|
|
||||||
sb.append("</tr>");
|
|
||||||
|
|
||||||
for (String entry : list) {
|
|
||||||
String[] split = entry.split(SPLIT);
|
|
||||||
sb.append("<tr>");
|
|
||||||
sb.append("<td>");
|
|
||||||
sb.append(split[0]);
|
|
||||||
sb.append("</td>");
|
|
||||||
sb.append("<td>");
|
|
||||||
sb.append(split[1]);
|
|
||||||
sb.append("</td>");
|
|
||||||
sb.append("<td>");
|
|
||||||
sb.append(split[2]);
|
|
||||||
sb.append("</td>");
|
|
||||||
sb.append("</tr>");
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,26 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<project name="misp-helper" xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd">
|
|
||||||
<bannerLeft>
|
|
||||||
<name>misp-helper</name>
|
|
||||||
<src>https://maven.apache.org/images/apache-maven-project.png</src>
|
|
||||||
<href>https://www.apache.org/</href>
|
|
||||||
</bannerLeft>
|
|
||||||
|
|
||||||
<bannerRight>
|
|
||||||
<src>https://maven.apache.org/images/maven-logo-black-on-white.png</src>
|
|
||||||
<href>https://maven.apache.org/</href>
|
|
||||||
</bannerRight>
|
|
||||||
|
|
||||||
<skin>
|
|
||||||
<groupId>org.apache.maven.skins</groupId>
|
|
||||||
<artifactId>maven-fluido-skin</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
</skin>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<menu ref="parent" />
|
|
||||||
<menu ref="reports" />
|
|
||||||
</body>
|
|
||||||
</project>
|
|
@ -1,38 +0,0 @@
|
|||||||
package com.olexyn.misp.helper;
|
|
||||||
|
|
||||||
import junit.framework.Test;
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
import junit.framework.TestSuite;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Unit test for simple App.
|
|
||||||
*/
|
|
||||||
public class AppTest
|
|
||||||
extends TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Create the test case
|
|
||||||
*
|
|
||||||
* @param testName name of the test case
|
|
||||||
*/
|
|
||||||
public AppTest( String testName )
|
|
||||||
{
|
|
||||||
super( testName );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the suite of tests being tested
|
|
||||||
*/
|
|
||||||
public static Test suite()
|
|
||||||
{
|
|
||||||
return new TestSuite( AppTest.class );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rigourous Test :-)
|
|
||||||
*/
|
|
||||||
public void testApp()
|
|
||||||
{
|
|
||||||
assertTrue( true );
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="true" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
#Created by Apache Maven 3.6.3
|
|
||||||
version=0.1
|
|
||||||
groupId=com.olexyn.misp.helper
|
|
||||||
artifactId=misp-helper
|
|
@ -1,3 +0,0 @@
|
|||||||
com/olexyn/misp/helper/JsonHelper.class
|
|
||||||
com/olexyn/misp/helper/Ride.class
|
|
||||||
com/olexyn/misp/helper/WebPrint.class
|
|
@ -1,3 +0,0 @@
|
|||||||
/home/user/ws/idea/misp/misp-helper/src/main/java/com/olexyn/misp/helper/Ride.java
|
|
||||||
/home/user/ws/idea/misp/misp-helper/src/main/java/com/olexyn/misp/helper/JsonHelper.java
|
|
||||||
/home/user/ws/idea/misp/misp-helper/src/main/java/com/olexyn/misp/helper/WebPrint.java
|
|
@ -1 +0,0 @@
|
|||||||
com/olexyn/misp/helper/AppTest.class
|
|
@ -1 +0,0 @@
|
|||||||
/home/user/ws/idea/misp/misp-helper/src/test/java/com/olexyn/misp/helper/AppTest.java
|
|
Binary file not shown.
@ -1,61 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" name="com.olexyn.misp.helper.AppTest" time="0.004" tests="1" errors="0" skipped="0" failures="0">
|
|
||||||
<properties>
|
|
||||||
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
|
|
||||||
<property name="file.encoding.pkg" value="sun.io"/>
|
|
||||||
<property name="java.specification.version" value="1.8"/>
|
|
||||||
<property name="sun.cpu.isalist" value=""/>
|
|
||||||
<property name="sun.jnu.encoding" value="UTF-8"/>
|
|
||||||
<property name="java.class.path" value="/home/user/ws/idea/misp/misp-helper/target/test-classes:/home/user/ws/idea/misp/misp-helper/target/classes:/home/user/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/home/user/.m2/repository/org/json/json/20190722/json-20190722.jar:"/>
|
|
||||||
<property name="java.vm.vendor" value="Oracle Corporation"/>
|
|
||||||
<property name="sun.arch.data.model" value="64"/>
|
|
||||||
<property name="java.vendor.url" value="http://java.oracle.com/"/>
|
|
||||||
<property name="user.timezone" value=""/>
|
|
||||||
<property name="java.vm.specification.version" value="1.8"/>
|
|
||||||
<property name="os.name" value="Linux"/>
|
|
||||||
<property name="user.country" value="US"/>
|
|
||||||
<property name="sun.java.launcher" value="SUN_STANDARD"/>
|
|
||||||
<property name="sun.boot.library.path" value="/usr/lib/jvm/jdk1.8.0_162/jre/lib/amd64"/>
|
|
||||||
<property name="sun.java.command" value="/home/user/ws/idea/misp/misp-helper/target/surefire/surefirebooter7699255088655101384.jar /home/user/ws/idea/misp/misp-helper/target/surefire 2020-04-24T15-12-27_079-jvmRun1 surefire7232622910076852984tmp surefire_06057149576369880631tmp"/>
|
|
||||||
<property name="surefire.test.class.path" value="/home/user/ws/idea/misp/misp-helper/target/test-classes:/home/user/ws/idea/misp/misp-helper/target/classes:/home/user/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/home/user/.m2/repository/org/json/json/20190722/json-20190722.jar:"/>
|
|
||||||
<property name="sun.cpu.endian" value="little"/>
|
|
||||||
<property name="user.home" value="/home/user"/>
|
|
||||||
<property name="user.language" value="en"/>
|
|
||||||
<property name="java.specification.vendor" value="Oracle Corporation"/>
|
|
||||||
<property name="java.home" value="/usr/lib/jvm/jdk1.8.0_162/jre"/>
|
|
||||||
<property name="basedir" value="/home/user/ws/idea/misp/misp-helper"/>
|
|
||||||
<property name="file.separator" value="/"/>
|
|
||||||
<property name="line.separator" value=" "/>
|
|
||||||
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
|
|
||||||
<property name="java.specification.name" value="Java Platform API Specification"/>
|
|
||||||
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
|
|
||||||
<property name="surefire.real.class.path" value="/home/user/ws/idea/misp/misp-helper/target/surefire/surefirebooter7699255088655101384.jar"/>
|
|
||||||
<property name="sun.boot.class.path" value="/usr/lib/jvm/jdk1.8.0_162/jre/lib/resources.jar:/usr/lib/jvm/jdk1.8.0_162/jre/lib/rt.jar:/usr/lib/jvm/jdk1.8.0_162/jre/lib/sunrsasign.jar:/usr/lib/jvm/jdk1.8.0_162/jre/lib/jsse.jar:/usr/lib/jvm/jdk1.8.0_162/jre/lib/jce.jar:/usr/lib/jvm/jdk1.8.0_162/jre/lib/charsets.jar:/usr/lib/jvm/jdk1.8.0_162/jre/lib/jfr.jar:/usr/lib/jvm/jdk1.8.0_162/jre/classes"/>
|
|
||||||
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
|
|
||||||
<property name="java.runtime.version" value="1.8.0_162-b12"/>
|
|
||||||
<property name="user.name" value="user"/>
|
|
||||||
<property name="path.separator" value=":"/>
|
|
||||||
<property name="os.version" value="4.19.0-4-amd64"/>
|
|
||||||
<property name="java.endorsed.dirs" value="/usr/lib/jvm/jdk1.8.0_162/jre/lib/endorsed"/>
|
|
||||||
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
|
|
||||||
<property name="file.encoding" value="UTF-8"/>
|
|
||||||
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
|
|
||||||
<property name="localRepository" value="/home/user/.m2/repository"/>
|
|
||||||
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
|
|
||||||
<property name="java.io.tmpdir" value="/tmp"/>
|
|
||||||
<property name="java.version" value="1.8.0_162"/>
|
|
||||||
<property name="user.dir" value="/home/user/ws/idea/misp/misp-helper"/>
|
|
||||||
<property name="os.arch" value="amd64"/>
|
|
||||||
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
|
|
||||||
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
|
|
||||||
<property name="sun.os.patch.level" value="unknown"/>
|
|
||||||
<property name="java.library.path" value="/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib"/>
|
|
||||||
<property name="java.vm.info" value="mixed mode"/>
|
|
||||||
<property name="java.vendor" value="Oracle Corporation"/>
|
|
||||||
<property name="java.vm.version" value="25.162-b12"/>
|
|
||||||
<property name="java.ext.dirs" value="/usr/lib/jvm/jdk1.8.0_162/jre/lib/ext:/usr/java/packages/lib/ext"/>
|
|
||||||
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
|
|
||||||
<property name="java.class.version" value="52.0"/>
|
|
||||||
</properties>
|
|
||||||
<testcase name="testApp" classname="com.olexyn.misp.helper.AppTest" time="0.001"/>
|
|
||||||
</testsuite>
|
|
@ -1,4 +0,0 @@
|
|||||||
-------------------------------------------------------------------------------
|
|
||||||
Test set: com.olexyn.misp.helper.AppTest
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 s - in com.olexyn.misp.helper.AppTest
|
|
Binary file not shown.
@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
version="0.1"
|
|
||||||
file="target/misp-rev-${version}.war"
|
|
||||||
groupId="com.olexyn.misp.rev"
|
|
||||||
artifactId="misp-rev"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mvn package
|
|
||||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=war -DgeneratePom=true
|
|
@ -1,19 +0,0 @@
|
|||||||
<?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_7">
|
|
||||||
<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" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
|
||||||
<orderEntry type="module" module-name="misp-helper" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.json:json:20190722" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,90 +0,0 @@
|
|||||||
<?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.olexyn.misp.rev</groupId>
|
|
||||||
<artifactId>misp-rev</artifactId>
|
|
||||||
<version>0.1</version>
|
|
||||||
<packaging>war</packaging>
|
|
||||||
|
|
||||||
<name>misp-rev Maven Webapp</name>
|
|
||||||
<!-- FIXME change it to the project's website -->
|
|
||||||
<url>http://www.example.com</url>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
<maven.compiler.source>1.7</maven.compiler.source>
|
|
||||||
<maven.compiler.target>1.7</maven.compiler.target>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<version>4.11</version>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.olexyn.misp.helper</groupId>
|
|
||||||
<artifactId>misp-helper</artifactId>
|
|
||||||
<version>0.1</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-io</groupId>
|
|
||||||
<artifactId>commons-io</artifactId>
|
|
||||||
<version>2.6</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
|
||||||
<artifactId>javax.servlet</artifactId>
|
|
||||||
<version>3.0.0.v201112011016</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.json</groupId>
|
|
||||||
<artifactId>json</artifactId>
|
|
||||||
<version>20190722</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
</plugin>
|
|
||||||
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-resources-plugin</artifactId>
|
|
||||||
<version>3.0.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.22.1</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-war-plugin</artifactId>
|
|
||||||
<version>3.2.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
|
||||||
<version>2.5.2</version>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<version>2.8.2</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
@ -1,16 +0,0 @@
|
|||||||
package com.olexyn.misp.rev;
|
|
||||||
|
|
||||||
import com.olexyn.misp.helper.Ride;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import org.json.JSONObject;
|
|
||||||
|
|
||||||
public class ConnectionHelper {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
package com.olexyn.misp.rev;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String... args){
|
|
||||||
new RevProxy();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,169 +0,0 @@
|
|||||||
package com.olexyn.misp.rev;
|
|
||||||
|
|
||||||
|
|
||||||
import com.olexyn.misp.helper.Ride;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
public class RevProxy {
|
|
||||||
|
|
||||||
protected static final String MISP_BRIDGE_URL = "http://localhost:9090/mispbridge/core";
|
|
||||||
protected static final String APP_URL = "http://localhost:9090/mirror/core";
|
|
||||||
|
|
||||||
public static final int AVAILABLE_RIDES_OVERHEAD_TRIGGER = 4;
|
|
||||||
public static final int AVAILABLE_RIDES_OVERHEAD = 8;
|
|
||||||
|
|
||||||
|
|
||||||
public final Map<Long, Ride> available = new HashMap<>();
|
|
||||||
public final Map<Long, Ride> booked = new HashMap<>();
|
|
||||||
public final Map<Long, Ride> loaded = new HashMap<>();
|
|
||||||
|
|
||||||
|
|
||||||
public RevProxy() {
|
|
||||||
|
|
||||||
Thread postRideThread = new Thread(new PostRideRunnable(this));
|
|
||||||
postRideThread.setName("postRideThread");
|
|
||||||
postRideThread.start();
|
|
||||||
|
|
||||||
Thread getRequestThread = new Thread(new GetRequestRunnable(this));
|
|
||||||
getRequestThread.setName("getRequestThread");
|
|
||||||
getRequestThread.start();
|
|
||||||
|
|
||||||
Thread getRideRequestDataThread = new Thread(new GetRideRequestDataRunnable(this));
|
|
||||||
getRideRequestDataThread.setName("getRideRequestDataThread");
|
|
||||||
getRideRequestDataThread.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void sendPostRide() throws IOException {
|
|
||||||
|
|
||||||
final Ride ride = new Ride();
|
|
||||||
|
|
||||||
synchronized (available) { available.put(ride.getID(), ride); }
|
|
||||||
|
|
||||||
final String result = send("POST", MISP_BRIDGE_URL, ride.json());
|
|
||||||
|
|
||||||
synchronized (available) {
|
|
||||||
available.remove(ride.getID());
|
|
||||||
ride.setRequest(new Ride(result).getRequest());
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (booked) { booked.put(ride.getID(), ride); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void sendGetRequest(Ride ride) throws IOException {
|
|
||||||
|
|
||||||
synchronized (booked) {booked.remove(ride.getID()); }
|
|
||||||
|
|
||||||
final String result = send("GET", APP_URL, ride.getRequest());
|
|
||||||
ride.setData(result);
|
|
||||||
|
|
||||||
synchronized (loaded) {loaded.put(ride.getID(), ride); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void sendGetRideRequestData(Ride ride) throws IOException {
|
|
||||||
|
|
||||||
send("GET", MISP_BRIDGE_URL, ride.json());
|
|
||||||
|
|
||||||
synchronized (loaded) {loaded.remove(ride.getID()); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static String send(String method, String urlString, String body) throws IOException {
|
|
||||||
|
|
||||||
URL url = new URL(urlString);
|
|
||||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
|
||||||
connection.setRequestMethod(method);
|
|
||||||
|
|
||||||
connection.setDoOutput(true);
|
|
||||||
DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());
|
|
||||||
outputStream.writeBytes(body);
|
|
||||||
outputStream.flush();
|
|
||||||
outputStream.close();
|
|
||||||
|
|
||||||
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
|
||||||
String out;
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
while ((out = in.readLine()) != null) { sb.append(out); }
|
|
||||||
in.close();
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class PostRideRunnable implements Runnable {
|
|
||||||
|
|
||||||
final private RevProxy adapter;
|
|
||||||
|
|
||||||
public PostRideRunnable(RevProxy adapter) {
|
|
||||||
this.adapter = adapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
while (true) {
|
|
||||||
synchronized (adapter.available) {
|
|
||||||
if (adapter.available.size() < RevProxy.AVAILABLE_RIDES_OVERHEAD_TRIGGER) {
|
|
||||||
for (int i = 0; i < RevProxy.AVAILABLE_RIDES_OVERHEAD; i++) {
|
|
||||||
try {adapter.sendPostRide();} catch (IOException ignored) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class GetRequestRunnable implements Runnable {
|
|
||||||
|
|
||||||
final private RevProxy adapter;
|
|
||||||
|
|
||||||
public GetRequestRunnable(RevProxy adapter) {
|
|
||||||
this.adapter = adapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
while (true) {
|
|
||||||
synchronized (adapter.booked) {
|
|
||||||
if (adapter.booked.size() > 0) {
|
|
||||||
final Ride ride = adapter.booked.entrySet().iterator().next().getValue();
|
|
||||||
try { adapter.sendGetRequest(ride); } catch (IOException ignored) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class GetRideRequestDataRunnable implements Runnable {
|
|
||||||
|
|
||||||
final private RevProxy adapter;
|
|
||||||
|
|
||||||
public GetRideRequestDataRunnable(RevProxy adapter) {
|
|
||||||
this.adapter = adapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
while (true) {
|
|
||||||
synchronized (adapter.loaded) {
|
|
||||||
if (adapter.loaded.size() > 0) {
|
|
||||||
final Ride ride = adapter.loaded.entrySet().iterator().next().getValue();
|
|
||||||
try { adapter.sendGetRideRequestData(ride); } catch (IOException ignored) {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
<!DOCTYPE web-app PUBLIC
|
|
||||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
|
||||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
|
||||||
|
|
||||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
|
||||||
version="2.4">
|
|
||||||
|
|
||||||
<display-name>misp-fwd</display-name>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>misp-rev</servlet-name>
|
|
||||||
<servlet-class>com.olexyn.misp.rev.RevProxy</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>misp-rev</servlet-name>
|
|
||||||
<url-pattern>/core</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
</web-app>
|
|
Before Width: | Height: | Size: 617 B |
@ -1,20 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>misp-rev</title>
|
|
||||||
</head>
|
|
||||||
<body bgcolor=white>
|
|
||||||
|
|
||||||
<table border="0">
|
|
||||||
<tr>
|
|
||||||
<td align=center>
|
|
||||||
<img src="images/io42630.png">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<h1>misp-rev</h1>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
#Created by Apache Maven 3.6.3
|
|
||||||
groupId=com.olexyn.misp.rev
|
|
||||||
artifactId=misp-rev
|
|
||||||
version=0.1
|
|
@ -1,6 +0,0 @@
|
|||||||
com/olexyn/misp/rev/PostRideRunnable.class
|
|
||||||
com/olexyn/misp/rev/GetRideRequestDataRunnable.class
|
|
||||||
com/olexyn/misp/rev/Main.class
|
|
||||||
com/olexyn/misp/rev/ConnectionHelper.class
|
|
||||||
com/olexyn/misp/rev/GetRequestRunnable.class
|
|
||||||
com/olexyn/misp/rev/RevProxy.class
|
|
@ -1,3 +0,0 @@
|
|||||||
/home/user/ws/idea/misp/misp-rev/src/main/java/com/olexyn/misp/rev/Main.java
|
|
||||||
/home/user/ws/idea/misp/misp-rev/src/main/java/com/olexyn/misp/rev/RevProxy.java
|
|
||||||
/home/user/ws/idea/misp/misp-rev/src/main/java/com/olexyn/misp/rev/ConnectionHelper.java
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,22 +0,0 @@
|
|||||||
<!DOCTYPE web-app PUBLIC
|
|
||||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
|
||||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
|
||||||
|
|
||||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
|
||||||
version="2.4">
|
|
||||||
|
|
||||||
<display-name>misp-fwd</display-name>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>misp-rev</servlet-name>
|
|
||||||
<servlet-class>com.olexyn.misp.rev.RevProxy</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>misp-rev</servlet-name>
|
|
||||||
<url-pattern>/core</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
</web-app>
|
|
Before Width: | Height: | Size: 617 B |
@ -1,20 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>misp-rev</title>
|
|
||||||
</head>
|
|
||||||
<body bgcolor=white>
|
|
||||||
|
|
||||||
<table border="0">
|
|
||||||
<tr>
|
|
||||||
<td align=center>
|
|
||||||
<img src="images/io42630.png">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<h1>misp-rev</h1>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016" level="project" />
|
|
||||||
<orderEntry type="library" name="org.json:json:20190722" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
Binary file not shown.
@ -1,4 +0,0 @@
|
|||||||
Manifest-Version: 1.0
|
|
||||||
Ant-Version: Apache Ant 1.6.5
|
|
||||||
Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue