package nl.jpoint.vertx.mod.cluster.request;

import java.util.UUID;

public class ModuleRequest {

    private final UUID id = UUID.randomUUID();
    private final String groupId;
    private final String artifactId;
    private final String version;
    private final String classifier;
    private final boolean restart;

    private String snapshotVersion = null;

    ModuleRequest(final String groupId, final String artifactId, final String version, final String classifier, final boolean restart) {
        this.groupId = groupId;
        this.artifactId = artifactId;
        this.version = version;
        this.classifier = classifier;
        this.restart = restart;
    }

    ModuleRequest(final String groupId, final String artifactId, final String version) {
        this(groupId, artifactId, version, null, false);
    }

    public String getGroupId() {
        return groupId;
    }

    public String getArtifactId() {
        return artifactId;
    }

    public String getVersion() {
        return version;
    }

    public UUID getId() {
        return id;
    }

    public String getModuleId() {
        return this.groupId + "~" + this.artifactId + "~" + this.version;
    }

    public String getMavenArtifactId() {
        return this.groupId + ":" + this.artifactId + ":" + this.version;
    }

    public String getRemoteLocation() {
        StringBuilder builder = new StringBuilder()
                .append(getGroupId().replaceAll("\\.", "/"))
                .append("/")
                .append(getArtifactId())
                .append("/")
                .append(getVersion())
                .append("/")
                .append(getArtifactId()).append("-");

        if (snapshotVersion != null) {
            builder.append(getSnapshotVersion());
        } else {
            builder.append(getVersion());
        }
        if (classifier != null && !classifier.isEmpty()) {
            builder.append("-")
                    .append(classifier);
        }
        builder.append(".zip");
        return builder.toString();
    }

    public String getSnapshotVersion() {
        return (snapshotVersion != null) ? snapshotVersion : version;
    }

    public void setSnapshotVersion(String snapshotVersion) {
        this.snapshotVersion = snapshotVersion;
    }

    public boolean isAsync() {
        return false;
    }

    public boolean isSnapshot() {
        return version.endsWith("-SNAPSHOT");
    }

    public String getMetadataLocation() {
        return getGroupId().replaceAll("\\.", "/") + "/" + getArtifactId() + "/" + getVersion() + "/" + "maven-metadata.xml";

    }


}

@@ -285,43 +285,8 @@
 ier;
-%0A    private final boolean restart;
 %0A%0A  
@@ -441,31 +441,8 @@
 fier
-, final boolean restart
 ) %7B%0A
@@ -585,40 +585,8 @@
 er;%0A
-        this.restart = restart;%0A
     
@@ -669,32 +669,32 @@
 ring version) %7B%0A
+
         this(gro
@@ -728,15 +728,8 @@
 null
-, false
 );%0A 

Add restart option during install