Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
</dependency>

<!-- external dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.17</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions remote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@


<!-- external dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
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.
* 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 {
}
public interface VitruvClient extends ViewTypeProvider, ViewProvider {}
Original file line number Diff line number Diff line change
@@ -1,54 +1,55 @@
package tools.vitruv.framework.remote.client;

import java.nio.file.Path;
import tools.vitruv.framework.remote.client.impl.VitruvRemoteConnection;
import tools.vitruv.framework.remote.common.DefaultConnectionSettings;

import java.nio.file.Path;

public class VitruvClientFactory {

/**
* Private constructor to prevent instantiation of this utility class.
*
* @throws UnsupportedOperationException if an appempt is made to instantiate this class.
*/
private VitruvClientFactory() {
throw new UnsupportedOperationException("VitruvClientFactory is a utility class and cannot be instantiated.");
}
/**
* Private constructor to prevent instantiation of this utility class.
*
* @throws UnsupportedOperationException if an appempt is made to instantiate this class.
*/
private VitruvClientFactory() {
throw new UnsupportedOperationException(
"VitruvClientFactory is a utility class and cannot be instantiated.");
}

/**
* 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 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 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);
}
/**
* 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
@@ -1,19 +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);
}
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
@@ -1,34 +1,34 @@
package tools.vitruv.framework.remote.client.exception;

public class BadServerResponseException extends RuntimeException {
private final int statusCode;
public BadServerResponseException() {
super();
private final int statusCode;

public BadServerResponseException() {
super();
this.statusCode = -1;
}
public BadServerResponseException(String msg) {
super(msg);
}

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

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

public BadServerResponseException(String msg, Throwable cause) {
super(msg, cause);
this.statusCode = -1;
}
public BadServerResponseException(Throwable cause) {
super(cause);
}

public BadServerResponseException(Throwable cause) {
super(cause);
this.statusCode = -1;
}
public int getStatusCode() {
return statusCode;
}
}

public int getStatusCode() {
return statusCode;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
/**
* This package defines exceptions for the Vitruvius client.
*/
/** This package defines exceptions for the Vitruvius client. */
package tools.vitruv.framework.remote.client.exception;
Loading