Skip to content

Commit 415d39c

Browse files
author
Rakesh Venkatesh
committed
changes
1 parent 2e88a8a commit 415d39c

File tree

51 files changed

+3324
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3324
-0
lines changed
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<html>
2+
<head>
3+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
4+
<link rel="stylesheet" href="http://neo4j-contrib.github.io/developer-resources/language-guides/assets/css/main.css">
5+
<title>Network Diagrams</title>
6+
</head>
7+
8+
<body>
9+
<div id="graph">
10+
</div>
11+
<div role="navigation" class="navbar navbar-default navbar-static-top">
12+
<div class="container">
13+
<div class="row">
14+
<div class="col-sm-6 col-md-6">
15+
<ul class="nav navbar-nav">
16+
<li>
17+
<form role="search" class="navbar-form" id="search">
18+
<div class="form-group">
19+
<input type="text" value="" placeholder="Search for equipments" class="form-control" name="search">
20+
</div>
21+
<button class="btn btn-default" type="submit">Search</button>
22+
</form>
23+
</li>
24+
</ul>
25+
</div>
26+
<div class="navbar-header col-sm-6 col-md-6">
27+
<div class="logo-well">
28+
<a href="https://neo4j.com/developer">
29+
<img src="http://neo4j-contrib.github.io/developer-resources/language-guides/assets/img/logo-white.svg" alt="Neo4j World's Leading Graph Database" id="logo">
30+
</a>
31+
</div>
32+
<div class="navbar-brand">
33+
<div class="brand">Network details</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
38+
</div>
39+
40+
<div class="row">
41+
<div class="col-md-5">
42+
<div class="panel panel-default">
43+
<div class="panel-heading">Search Results</div>
44+
<table id="results" class="table table-striped table-hover">
45+
<thead>
46+
<tr>
47+
<th>Name</th>
48+
<th>IP address</th>
49+
<th>Model</th>
50+
<th>Type</th>
51+
</tr>
52+
</thead>
53+
<tbody>
54+
</tbody>
55+
</table>
56+
</div>
57+
</div>
58+
<div class="col-md-7">
59+
<div class="panel panel-default">
60+
<div class="panel-heading" id="title">Details</div>
61+
<div class="row">
62+
<div class="col-md-7 col-sm-7">
63+
<h4>Interfaces</h4>
64+
<ul id="interface">
65+
</ul>
66+
</div>
67+
</div>
68+
</div>
69+
</div>
70+
</div>
71+
<style type="text/css">
72+
.node { stroke: #222; stroke-width: 1.5px; }
73+
.node.equipment { fill: #888; }
74+
.node.interface { fill: #BBB; }
75+
.link { stroke: #999; stroke-opacity: .6; stroke-width: 1px; }
76+
</style>
77+
78+
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
79+
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
80+
<script type="text/javascript">
81+
$(function () {
82+
function showEquipment(title) {
83+
$.get("http://localhost:9090/api/equipment/equipment/" + encodeURIComponent(title), // todo fix paramter in SDN
84+
function (data) {
85+
if (!data) return;
86+
var equipment = data;
87+
$("#title").text(equipment.name);
88+
var $list = $("#interface").empty();
89+
equipment.links.forEach(function (link) {
90+
$list.append($("<li>" + "Name: " + JSON.parse(link).name + " " +
91+
"IP address: " + JSON.parse(link).ipAddress + " " +
92+
"MAC address: " + JSON.parse(link).macAddress + " " +
93+
"Vlans: " + JSON.parse(link).vlanList + "</li>"))
94+
});
95+
}, "json");
96+
return false;
97+
}
98+
function search() {
99+
var query=$("#search").find("input[name=search]").val();
100+
$.get("http://localhost:9090/api/equipment/listall" + encodeURIComponent(query),
101+
function (data) {
102+
var t = $("table#results tbody").empty();
103+
if (!data) return;
104+
data.forEach(function (equipment) {
105+
$("<tr><td class='equipment'>" + equipment.name + "</td><td>" + equipment.ipaddress + "</td><td>" + equipment.model + "</td><td>" + equipment.type + "</td></tr>").appendTo(t)
106+
.click(function() { showEquipment($(this).find("td.equipment").text());})
107+
});
108+
showEquipment(data[0].name);
109+
}, "json");
110+
return false;
111+
}
112+
113+
$("#search").submit(search);
114+
search();
115+
})
116+
</script>
117+
118+
<script type="text/javascript">
119+
var width = 800, height = 800;
120+
121+
var force = d3.layout.force()
122+
.charge(-200).linkDistance(30).size([width, height]);
123+
124+
var svg = d3.select("#graph").append("svg")
125+
.attr("width", "100%").attr("height", "100%")
126+
.attr("pointer-events", "all");
127+
128+
d3.json("http://localhost:9090/graph", function(error, graph) {
129+
if (error) return;
130+
131+
force.nodes(graph.nodes).links(graph.links).start();
132+
133+
var link = svg.selectAll(".link")
134+
.data(graph.links).enter()
135+
.append("line").attr("class", "link");
136+
137+
var node = svg.selectAll(".node")
138+
.data(graph.nodes).enter()
139+
.append("circle")
140+
.attr("class", function (d) { return "node "+d.name })
141+
.attr("r", 10)
142+
.call(force.drag);
143+
144+
// html title attribute
145+
node.append("title")
146+
.text(function (d) { return d.name; })
147+
148+
// force feed algo ticks
149+
force.on("tick", function() {
150+
link.attr("x1", function(d) { return d.source.x; })
151+
.attr("y1", function(d) { return d.source.y; })
152+
.attr("x2", function(d) { return d.target.x; })
153+
.attr("y2", function(d) { return d.target.y; });
154+
155+
node.attr("cx", function(d) { return d.x; })
156+
.attr("cy", function(d) { return d.y; });
157+
});
158+
});
159+
</script>
160+
</body>
161+
</html>

spring-boot-graalvm/.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
HELP.md
2+
target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**
5+
!**/src/test/**
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
30+
### VS Code ###
31+
.vscode/
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Copyright 2007-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import java.net.*;
17+
import java.io.*;
18+
import java.nio.channels.*;
19+
import java.util.Properties;
20+
21+
public class MavenWrapperDownloader {
22+
23+
private static final String WRAPPER_VERSION = "0.5.6";
24+
/**
25+
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26+
*/
27+
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28+
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29+
30+
/**
31+
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32+
* use instead of the default one.
33+
*/
34+
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35+
".mvn/wrapper/maven-wrapper.properties";
36+
37+
/**
38+
* Path where the maven-wrapper.jar will be saved to.
39+
*/
40+
private static final String MAVEN_WRAPPER_JAR_PATH =
41+
".mvn/wrapper/maven-wrapper.jar";
42+
43+
/**
44+
* Name of the property which should be used to override the default download url for the wrapper.
45+
*/
46+
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47+
48+
public static void main(String args[]) {
49+
System.out.println("- Downloader started");
50+
File baseDirectory = new File(args[0]);
51+
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52+
53+
// If the maven-wrapper.properties exists, read it and check if it contains a custom
54+
// wrapperUrl parameter.
55+
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56+
String url = DEFAULT_DOWNLOAD_URL;
57+
if(mavenWrapperPropertyFile.exists()) {
58+
FileInputStream mavenWrapperPropertyFileInputStream = null;
59+
try {
60+
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61+
Properties mavenWrapperProperties = new Properties();
62+
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63+
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64+
} catch (IOException e) {
65+
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66+
} finally {
67+
try {
68+
if(mavenWrapperPropertyFileInputStream != null) {
69+
mavenWrapperPropertyFileInputStream.close();
70+
}
71+
} catch (IOException e) {
72+
// Ignore ...
73+
}
74+
}
75+
}
76+
System.out.println("- Downloading from: " + url);
77+
78+
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79+
if(!outputFile.getParentFile().exists()) {
80+
if(!outputFile.getParentFile().mkdirs()) {
81+
System.out.println(
82+
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83+
}
84+
}
85+
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86+
try {
87+
downloadFileFromURL(url, outputFile);
88+
System.out.println("Done");
89+
System.exit(0);
90+
} catch (Throwable e) {
91+
System.out.println("- Error downloading");
92+
e.printStackTrace();
93+
System.exit(1);
94+
}
95+
}
96+
97+
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98+
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99+
String username = System.getenv("MVNW_USERNAME");
100+
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101+
Authenticator.setDefault(new Authenticator() {
102+
@Override
103+
protected PasswordAuthentication getPasswordAuthentication() {
104+
return new PasswordAuthentication(username, password);
105+
}
106+
});
107+
}
108+
URL website = new URL(urlString);
109+
ReadableByteChannel rbc;
110+
rbc = Channels.newChannel(website.openStream());
111+
FileOutputStream fos = new FileOutputStream(destination);
112+
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113+
fos.close();
114+
rbc.close();
115+
}
116+
117+
}
49.5 KB
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2+
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
HELP.md
2+
target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**
5+
!**/src/test/**
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
30+
### VS Code ###
31+
.vscode/

0 commit comments

Comments
 (0)