Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vitruv Remote with Server/Client #610

Draft
wants to merge 66 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
138bd24
Add project files
TomWerm Mar 29, 2023
c58e067
Adapt naming
TomWerm Mar 29, 2023
df58277
Add dependencies and maven plugin
TomWerm Mar 29, 2023
4fb8d19
Change exception type to a better fit
TomWerm Mar 29, 2023
ae9a665
Update MANIFEST.MF
TomWerm Mar 29, 2023
56c25e0
Merge branch 'main' into vitruv-remote
TomWerm Mar 29, 2023
9b9c9c7
Change spark dependency to jar
TomWerm Mar 30, 2023
66854fa
Implement code suggestion
TomWerm Apr 5, 2023
11d7000
Add project files
TomWerm Mar 29, 2023
9899672
Adapt naming
TomWerm Mar 29, 2023
90a4a31
Add dependencies and maven plugin
TomWerm Mar 29, 2023
750392f
Change exception type to a better fit
TomWerm Mar 29, 2023
0883273
Update MANIFEST.MF
TomWerm Mar 29, 2023
a58b134
Change spark dependency to jar
TomWerm Mar 30, 2023
7ffd43f
Implement code suggestion
TomWerm Apr 5, 2023
457f249
Merge branch 'vitruv-remote' of https://github.com/vitruv-tools/Vitru…
TomWerm Apr 5, 2023
d82b0e3
Merge branch 'main' into vitruv-remote
thomyxx May 15, 2023
91b3695
refactors vitruv remote code regarding the annotations of the PR's re…
thomyxx May 15, 2023
abe3e01
Merge pull request #591 from thomyxx/vitruv-remote
HansMartinA May 19, 2023
f43e52d
changes http server from spark to javas embedded server + fixes remot…
thomyxx Jun 1, 2023
3014e85
adds the mechanism to use view selectors on the client side
thomyxx Jun 6, 2023
41a54cd
implement very small code refactoring
thomyxx Jun 19, 2023
4279675
adds out foulder to gitignore
thomyxx Jun 19, 2023
f98171c
makes VitruvClient compatible with framework interfaces (ViewTypeProv…
thomyxx Jun 19, 2023
36d9d7c
injects client/server scenario into tests
thomyxx Jun 19, 2023
876452a
Merge branch 'main' into vitruv-remote
thomyxx Jul 11, 2023
a06e7ad
staged stuff
thomyxx Jul 27, 2023
bb1108a
Merge branch 'main' into vitruv-remote
thomyxx Jul 27, 2023
6d592d0
changed serializer to EMFJson instead of XMI
thomyxx Aug 3, 2023
a824fef
Merge branch 'main' into vitruv-remote
thomyxx Aug 8, 2023
f31b384
added the possibility to run tests locally/remotely via jvm args
thomyxx Aug 25, 2023
e877f76
workaround for dangling reference bug
thomyxx Aug 25, 2023
073c2b0
added remote plugin to expections to avoid showing warnings when usin…
thomyxx Aug 25, 2023
9a9c13b
added the possibility to commit a change recording view with user int…
thomyxx Aug 25, 2023
b22d4d4
fix an issue where it was not possible to transform local ids to glob…
thomyxx Aug 25, 2023
6090608
use URI instead of path objects to avoid conversion problems between …
thomyxx Aug 27, 2023
7c75ceb
reworked id transformation to be usable per server
thomyxx Aug 28, 2023
38ca880
fixed an issue where update view endpoint does not copy resources cor…
thomyxx Aug 28, 2023
8701b40
added a separate exception for errors occuring on the client side
thomyxx Aug 28, 2023
0bd5965
Revert "workaround for dangling reference bug"
thomyxx Aug 28, 2023
9fdeed9
added emf-jackson to p2 dependencies
thomyxx Aug 28, 2023
fc5ba82
Remove modifiers
TomWerm Sep 5, 2023
32de9eb
fix an issue where references did not get resolved correctly after de…
thomyxx Sep 8, 2023
fb6f31f
Merge branch 'vitruv-remote' of github:thomyxx/Vitruv into vitruv-remote
thomyxx Sep 8, 2023
7583727
Merge pull request #599 from thomyxx/vitruv-remote
HansMartinA Apr 10, 2024
7802981
Merge remote-tracking branch 'origin/main' into vitruv-remote
HansMartinA Apr 10, 2024
ca25572
Merge remote-tracking branch 'origin/main' into vitruv-remote
HansMartinA May 28, 2024
b16779f
Added the remote bundle to the features.
HansMartinA May 28, 2024
e654535
Changes within a composite change are deserialized with their JsonNod…
HansMartinA Aug 1, 2024
74dd799
Refactored the package structure related to the server REST endpoints…
HansMartinA Aug 2, 2024
fd1c7f6
Added a general interface between the REST endpoints and the HTTP ser…
HansMartinA Aug 8, 2024
d3548d7
All endpoints are provided by one class, and the Java HTTP server cre…
HansMartinA Aug 8, 2024
8d64496
Replaced the InternalVirtualModel usage in the server with a VirtualM…
HansMartinA Aug 8, 2024
beeca6f
Re-organized the common packages.
HansMartinA Aug 8, 2024
769c062
The VitruvClient can be initialized with a protocol, host name or IP …
HansMartinA Aug 8, 2024
b72b9df
The server can be initialized with a host name or IP address.
HansMartinA Aug 8, 2024
8ad96ad
Improved the exception handling for the change propagation end point.
HansMartinA Aug 12, 2024
9a76c6f
The client also reports the status code of failed requests.
HansMartinA Aug 12, 2024
cbfcc8d
The client implementation package is exported for the correct test pa…
HansMartinA Aug 12, 2024
f2bfaf4
All RuntimeExceptions during change propagation are catched in the se…
HansMartinA Aug 12, 2024
c5b2253
Replaced libraries which are not needed with micrometer as Maven depe…
HansMartinA Aug 18, 2024
58f0215
Added micrometer to the remote bundle.
HansMartinA Aug 18, 2024
3de40fe
Instrumented parts of the client and server to measure execution times.
HansMartinA Aug 18, 2024
911c50c
Added a controller for micrometer.
HansMartinA Aug 18, 2024
45cab10
Added an implementation for a timer which records all single measurem…
HansMartinA Aug 19, 2024
83f987f
The client reports the HTTP method and endpoint for which requests ar…
HansMartinA Aug 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ xtend-gen/
target/
.polyglot.build.properties
.mvn/wrapper/maven-wrapper.jar
*.polyglot*

# Custom
EvaluationData

#IntelliJ
.idea/
*.iml
out/
19 changes: 19 additions & 0 deletions bundles/tools.vitruv.framework.remote/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="target/dependency/micrometer-commons.jar"/>
<classpathentry exported="true" kind="lib" path="target/dependency/micrometer-core.jar"/>
<classpathentry exported="true" kind="lib" path="target/dependency/micrometer-observation.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
<accessrules>
<accessrule kind="accessible" pattern="tools/vitruv/framework/vsum/internal/InternalVirtualModel"/>
<accessrule kind="accessible" pattern="org/eclipse/emf/edapt/internal/common/EcoreUtils"/>
</accessrules>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
28 changes: 28 additions & 0 deletions bundles/tools.vitruv.framework.remote/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tools.vitruv.framework.remote</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.annotationPath.allLocations=disabled
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotatedTypeArgumentToUnannotated=info
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=info
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
29 changes: 29 additions & 0 deletions bundles/tools.vitruv.framework.remote/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Vitruv Framework Remote
Bundle-SymbolicName: tools.vitruv.framework.remote;singleton:=true
Automatic-Module-Name: tools.vitruv.framework.remote
Bundle-ClassPath: .,
target/dependency/micrometer-commons.jar,
target/dependency/micrometer-core.jar,
target/dependency/micrometer-observation.jar
Bundle-Version: 3.0.1.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: tools.vitruv.framework.views,
tools.vitruv.change.composite,
tools.vitruv.framework.vsum,
org.eclipse.emf.ecore.xmi,
com.google.guava,
com.fasterxml.jackson.core.jackson-annotations,
com.fasterxml.jackson.core.jackson-core,
com.fasterxml.jackson.core.jackson-databind,
org.eclipse.emf.edapt.common,
edu.kit.ipd.sdq.commons.util.emf,
org.eclipse.emf.ecore,
org.eclipse.emfcloud.emfjson-jackson
Export-Package: tools.vitruv.framework.remote.client,
tools.vitruv.framework.remote.client.exception,
tools.vitruv.framework.remote.client.impl;x-friends:="tools.vitruv.applications.remote.tests",
tools.vitruv.framework.remote.common.apm,
tools.vitruv.framework.remote.server
Bundle-Vendor: vitruv.tools
8 changes: 8 additions & 0 deletions bundles/tools.vitruv.framework.remote/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
target/dependency/micrometer-commons.jar,\
target/dependency/micrometer-core.jar,\
target/dependency/micrometer-observation.jar

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package tools.vitruv.framework.remote.client;

import tools.vitruv.framework.views.ViewProvider;
import tools.vitruv.framework.views.ViewTypeProvider;

/**
* A Vitruvius client can remotely access the available {@link tools.vitruv.framework.views.ViewType}s of a Vitruvius instance and query
* {@link tools.vitruv.framework.views.ViewSelector}s in order to create remotely editable {@link tools.vitruv.framework.views.View}s.
*/
public interface VitruvClient extends ViewTypeProvider, ViewProvider {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package tools.vitruv.framework.remote.client;

import tools.vitruv.framework.remote.client.impl.VitruvRemoteConnection;
import tools.vitruv.framework.remote.common.DefaultConnectionSettings;

import java.nio.file.Path;

public class VitruvClientFactory {
/**
* Creates a new {@link VitruvClient} using the given host name or IP address and the standard port of 8080.
*
* @param url The host name or IP address of the Vitruvius server.
* @param temp A non-existing or empty directory for temporary files.
* @return A {@link VitruvClient}.
*/
public static VitruvClient create(String url, Path temp) {
return create(url, DefaultConnectionSettings.STD_PORT, temp);
}

/**
* Creates a new {@link VitruvClient} using the given host name or IP address and port.
*
* @param hostOrIp The host name or IP address of the Vitruvius server.
* @param port Port of the Vitruvius server.
* @param temp A non-existing or empty directory for temporary files.
* @return A {@link VitruvClient}.
*/
public static VitruvClient create(String hostOrIp, int port, Path temp) {
return create(DefaultConnectionSettings.STD_PROTOCOL, hostOrIp, port, temp);
}

/**
* Creates a new {@link VitruvClient} using the given protocol, host name or IP address, and port.
*
* @param protocol The protocol.
* @param hostOrIp The host name of IP address of the Vitruvius server.
* @param port Port of the Vitruvius server.
* @param temp A non-existing or empty directory for temporary files.
* @return A {@link VitruvClient}.
*/
public static VitruvClient create(String protocol, String hostOrIp, int port, Path temp) {
return new VitruvRemoteConnection(protocol, hostOrIp, port, temp);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package tools.vitruv.framework.remote.client.exception;

public class BadClientResponseException extends RuntimeException {
public BadClientResponseException() {
super();
}

public BadClientResponseException(String msg) {
super(msg);
}

public BadClientResponseException(String msg, Throwable cause) {
super(msg, cause);
}

public BadClientResponseException(Throwable cause) {
super(cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package tools.vitruv.framework.remote.client.exception;

public class BadServerResponseException extends RuntimeException {
private int statusCode = -1;

public BadServerResponseException() {
super();
}

public BadServerResponseException(String msg) {
super(msg);
}

public BadServerResponseException(String msg, int statusCode) {
super(msg);
this.statusCode = statusCode;
}

public BadServerResponseException(String msg, Throwable cause) {
super(msg, cause);
}

public BadServerResponseException(Throwable cause) {
super(cause);
}

public int getStatusCode() {
return statusCode;
}
}
Loading
Loading