Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import jakarta.ws.rs.*;
import org.eclipse.datagrid.cluster.nodelibrary.exceptions.HttpResponseException;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRequestController;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations;
import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody;

import static org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.*;
import static org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.*;


@ApplicationScoped
@Path(ClusterRestRouteConfigurations.ROOT_PATH)
@Path(StorageNodeRestRouteConfigurations.ROOT_PATH)
public class HelidonClusterController
{
private final ClusterRestRequestController requestController;
Expand All @@ -36,112 +36,112 @@ public HelidonClusterController(final ClusterRestRequestController requestContro
}

@GET
@Path(GetMicrostreamDistributor.PATH)
@Produces(GetMicrostreamDistributor.PRODUCES)
public boolean getMicrostreamDistributor() throws HttpResponseException
@Path(GetDistributor.PATH)
@Produces(GetDistributor.PRODUCES)
public boolean getDistributor() throws HttpResponseException
{
return this.requestController.getMicrostreamDistributor();
return this.requestController.getDistributor();
}

@POST
@Path(PostMicrostreamActivateDistributorStart.PATH)
@Consumes(PostMicrostreamActivateDistributorStart.CONSUMES)
@Produces(PostMicrostreamActivateDistributorStart.PRODUCES)
public void postMicrostreamActivateDistributorStart() throws HttpResponseException
@Path(PostActivateDistributorStart.PATH)
@Consumes(PostActivateDistributorStart.CONSUMES)
@Produces(PostActivateDistributorStart.PRODUCES)
public void postActivateDistributorStart() throws HttpResponseException
{
this.requestController.postMicrostreamActivateDistributorStart();
this.requestController.postActivateDistributorStart();
}

@POST
@Path(PostMicrostreamActivateDistributorFinish.PATH)
@Consumes(PostMicrostreamActivateDistributorFinish.CONSUMES)
@Produces(PostMicrostreamActivateDistributorFinish.PRODUCES)
public boolean postMicrostreamActivateDistributorFinish() throws HttpResponseException
@Path(PostActivateDistributorFinish.PATH)
@Consumes(PostActivateDistributorFinish.CONSUMES)
@Produces(PostActivateDistributorFinish.PRODUCES)
public boolean postActivateDistributorFinish() throws HttpResponseException
{
return this.requestController.postMicrostreamActivateDistributorFinish();
return this.requestController.postActivateDistributorFinish();
}

@GET
@Path(GetMicrostreamHealth.PATH)
@Produces(GetMicrostreamHealth.PRODUCES)
public void getMicrostreamHealth() throws HttpResponseException
@Path(GetHealth.PATH)
@Produces(GetHealth.PRODUCES)
public void getHealth() throws HttpResponseException
{
this.requestController.getMicrostreamHealth();
this.requestController.getHealth();
}

@GET
@Path(GetMicrostreamHealthReady.PATH)
@Produces(GetMicrostreamHealthReady.PRODUCES)
public void getMicrostreamHealthReady() throws HttpResponseException
@Path(GetHealthReady.PATH)
@Produces(GetHealthReady.PRODUCES)
public void getHealthReady() throws HttpResponseException
{
this.requestController.getMicrostreamHealthReady();
this.requestController.getHealthReady();
}

@GET
@Path(GetMicrostreamStorageBytes.PATH)
@Produces(GetMicrostreamStorageBytes.PRODUCES)
public String getMicrostreamStorageBytes() throws HttpResponseException
@Path(GetStorageBytes.PATH)
@Produces(GetStorageBytes.PRODUCES)
public String getStorageBytes() throws HttpResponseException
{
return this.requestController.getMicrostreamStorageBytes();
return this.requestController.getStorageBytes();
}

@POST
@Path(PostMicrostreamBackup.PATH)
@Consumes(PostMicrostreamBackup.CONSUMES)
@Produces(PostMicrostreamBackup.PRODUCES)
public void postMicrostreamBackup(@RequestBody final PostMicrostreamBackup.Body body) throws HttpResponseException
@Path(PostBackup.PATH)
@Consumes(PostBackup.CONSUMES)
@Produces(PostBackup.PRODUCES)
public void postBackup(@RequestBody final PostBackup.Body body) throws HttpResponseException
{
this.requestController.postMicrostreamBackup(body);
this.requestController.postBackup(body);
}

@GET
@Path(GetMicrostreamBackup.PATH)
@Produces(GetMicrostreamBackup.PRODUCES)
public boolean getMicrostreamBackup() throws HttpResponseException
@Path(GetBackup.PATH)
@Produces(GetBackup.PRODUCES)
public boolean getBackup() throws HttpResponseException
{
return this.requestController.getMicrostreamBackup();
return this.requestController.getBackup();
}

@POST
@Path(PostMicrostreamUpdates.PATH)
@Consumes(PostMicrostreamUpdates.CONSUMES)
@Produces(PostMicrostreamUpdates.PRODUCES)
public void postMicrostreamUpdates() throws HttpResponseException
@Path(PostUpdates.PATH)
@Consumes(PostUpdates.CONSUMES)
@Produces(PostUpdates.PRODUCES)
public void postUpdates() throws HttpResponseException
{
this.requestController.postMicrostreamUpdates();
this.requestController.postUpdates();
}

@GET
@Path(GetMicrostreamUpdates.PATH)
@Produces(GetMicrostreamUpdates.PRODUCES)
public boolean getMicrostreamUpdates() throws HttpResponseException
@Path(GetUpdates.PATH)
@Produces(GetUpdates.PRODUCES)
public boolean getUpdates() throws HttpResponseException
{
return this.requestController.getMicrostreamUpdates();
return this.requestController.getUpdates();
}

@POST
@Path(PostMicrostreamResumeUpdates.PATH)
@Consumes(PostMicrostreamResumeUpdates.CONSUMES)
@Produces(PostMicrostreamResumeUpdates.PRODUCES)
public void postMicrostreamResumeUpdates() throws HttpResponseException
@Path(PostResumeUpdates.PATH)
@Consumes(PostResumeUpdates.CONSUMES)
@Produces(PostResumeUpdates.PRODUCES)
public void postResumeUpdates() throws HttpResponseException
{
this.requestController.postMicrostreamResumeUpdates();
this.requestController.postResumeUpdates();
}

@POST
@Path(PostMicrostreamGc.PATH)
@Consumes(PostMicrostreamGc.CONSUMES)
@Produces(PostMicrostreamGc.PRODUCES)
public void postMicrostreamGc() throws HttpResponseException
@Path(PostGc.PATH)
@Consumes(PostGc.CONSUMES)
@Produces(PostGc.PRODUCES)
public void postGc() throws HttpResponseException
{
this.requestController.postMicrostreamGc();
this.requestController.postGc();
}

@GET
@Path(GetMicrostreamGc.PATH)
@Produces(GetMicrostreamGc.PRODUCES)
public boolean getMicrostreamGc() throws HttpResponseException
@Path(GetGc.PATH)
@Produces(GetGc.PRODUCES)
public boolean getGc() throws HttpResponseException
{
return this.requestController.getMicrostreamGc();
return this.requestController.getGc();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@

import org.eclipse.datagrid.cluster.nodelibrary.exceptions.HttpResponseException;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRequestController;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamBackup;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamDistributor;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamGc;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamHealth;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamHealthReady;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamStorageBytes;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.GetMicrostreamUpdates;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.PostMicrostreamActivateDistributorFinish;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.PostMicrostreamActivateDistributorStart;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.PostMicrostreamBackup;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.PostMicrostreamGc;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.PostMicrostreamResumeUpdates;
import org.eclipse.datagrid.cluster.nodelibrary.types.ClusterRestRouteConfigurations.PostMicrostreamUpdates;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetBackup;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetDistributor;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetGc;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetHealth;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetHealthReady;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetStorageBytes;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.GetUpdates;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.PostActivateDistributorFinish;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.PostActivateDistributorStart;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.PostBackup;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.PostGc;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.PostResumeUpdates;
import org.eclipse.datagrid.cluster.nodelibrary.types.StorageNodeRestRouteConfigurations.PostUpdates;

import io.micronaut.core.annotation.Introspected;
import io.micronaut.http.HttpResponse;
Expand All @@ -43,9 +43,9 @@
import io.micronaut.scheduling.annotation.ExecuteOn;
import io.micronaut.serde.annotation.SerdeImport;

@Controller(ClusterRestRouteConfigurations.ROOT_PATH)
@Introspected(classes = PostMicrostreamBackup.Body.class)
@SerdeImport(PostMicrostreamBackup.Body.class)
@Controller(StorageNodeRestRouteConfigurations.ROOT_PATH)
@Introspected(classes = PostBackup.Body.class)
@SerdeImport(PostBackup.Body.class)
public class MicronautClusterController
{
private final ClusterRestRequestController controller;
Expand All @@ -66,103 +66,103 @@ public HttpResponse<Void> handleNodelibraryException(final HttpResponseException
return response;
}

@Get(value = GetMicrostreamDistributor.PATH, produces = GetMicrostreamDistributor.PRODUCES)
public boolean getMicrostreamDistributor() throws HttpResponseException
@Get(value = GetDistributor.PATH, produces = GetDistributor.PRODUCES)
public boolean getDistributor() throws HttpResponseException
{
return this.controller.getMicrostreamDistributor();
return this.controller.getDistributor();
}

@Post(
value = PostMicrostreamActivateDistributorStart.PATH,
consumes = PostMicrostreamActivateDistributorStart.CONSUMES,
produces = PostMicrostreamActivateDistributorStart.PRODUCES
value = PostActivateDistributorStart.PATH,
consumes = PostActivateDistributorStart.CONSUMES,
produces = PostActivateDistributorStart.PRODUCES
)
public void postMicrostreamActivateDistributorStart() throws HttpResponseException
public void postActivateDistributorStart() throws HttpResponseException
{
this.controller.postMicrostreamActivateDistributorStart();
this.controller.postActivateDistributorStart();
}

@Post(
value = PostMicrostreamActivateDistributorFinish.PATH,
consumes = PostMicrostreamActivateDistributorFinish.CONSUMES,
produces = PostMicrostreamActivateDistributorFinish.PRODUCES
value = PostActivateDistributorFinish.PATH,
consumes = PostActivateDistributorFinish.CONSUMES,
produces = PostActivateDistributorFinish.PRODUCES
)
public boolean postMicrostreamActivateDistributorFinish() throws HttpResponseException
public boolean postActivateDistributorFinish() throws HttpResponseException
{
return this.controller.postMicrostreamActivateDistributorFinish();
return this.controller.postActivateDistributorFinish();
}

@Get(value = GetMicrostreamHealth.PATH, produces = GetMicrostreamHealth.PRODUCES)
public void getMicrostreamHealth() throws HttpResponseException
@Get(value = GetHealth.PATH, produces = GetHealth.PRODUCES)
public void getHealth() throws HttpResponseException
{
this.controller.getMicrostreamHealth();
this.controller.getHealth();
}

@Get(value = GetMicrostreamHealthReady.PATH, produces = GetMicrostreamHealthReady.PRODUCES)
@Get(value = GetHealthReady.PATH, produces = GetHealthReady.PRODUCES)
@ExecuteOn(TaskExecutors.IO)
public void getMicrostreamHealthReady() throws HttpResponseException
public void getHealthReady() throws HttpResponseException
{
this.controller.getMicrostreamHealthReady();
this.controller.getHealthReady();
}

@Get(value = GetMicrostreamStorageBytes.PATH, produces = GetMicrostreamStorageBytes.PRODUCES)
@Get(value = GetStorageBytes.PATH, produces = GetStorageBytes.PRODUCES)
@ExecuteOn(TaskExecutors.IO)
public String getMicrostreamStorageBytes() throws HttpResponseException
public String getStorageBytes() throws HttpResponseException
{
return this.controller.getMicrostreamStorageBytes();
return this.controller.getStorageBytes();
}

@Post(
value = PostMicrostreamBackup.PATH,
consumes = PostMicrostreamBackup.CONSUMES,
produces = PostMicrostreamBackup.PRODUCES
value = PostBackup.PATH,
consumes = PostBackup.CONSUMES,
produces = PostBackup.PRODUCES
)
public void postMicrostreamBackup(@Body final PostMicrostreamBackup.Body body) throws HttpResponseException
public void postBackup(@Body final PostBackup.Body body) throws HttpResponseException
{
this.controller.postMicrostreamBackup(body);
this.controller.postBackup(body);
}

@Get(value = GetMicrostreamBackup.PATH, produces = GetMicrostreamBackup.PRODUCES)
public boolean getMicrostreamBackup() throws HttpResponseException
@Get(value = GetBackup.PATH, produces = GetBackup.PRODUCES)
public boolean getBackup() throws HttpResponseException
{
return this.controller.getMicrostreamBackup();
return this.controller.getBackup();
}

@Post(
value = PostMicrostreamUpdates.PATH,
consumes = PostMicrostreamUpdates.CONSUMES,
produces = PostMicrostreamUpdates.PRODUCES
value = PostUpdates.PATH,
consumes = PostUpdates.CONSUMES,
produces = PostUpdates.PRODUCES
)
public void postMicrostreamUpdates() throws HttpResponseException
public void postUpdates() throws HttpResponseException
{
this.controller.postMicrostreamUpdates();
this.controller.postUpdates();
}

@Get(value = GetMicrostreamUpdates.PATH, produces = GetMicrostreamUpdates.PRODUCES)
public boolean getMicrostreamUpdates() throws HttpResponseException
@Get(value = GetUpdates.PATH, produces = GetUpdates.PRODUCES)
public boolean getUpdates() throws HttpResponseException
{
return this.controller.getMicrostreamUpdates();
return this.controller.getUpdates();
}

@Post(
value = PostMicrostreamResumeUpdates.PATH,
consumes = PostMicrostreamResumeUpdates.CONSUMES,
produces = PostMicrostreamResumeUpdates.PRODUCES
value = PostResumeUpdates.PATH,
consumes = PostResumeUpdates.CONSUMES,
produces = PostResumeUpdates.PRODUCES
)
public void postMicrostreamResumeUpdates() throws HttpResponseException
public void postResumeUpdates() throws HttpResponseException
{
this.controller.postMicrostreamResumeUpdates();
this.controller.postResumeUpdates();
}

@Post(value = PostMicrostreamGc.PATH, consumes = PostMicrostreamGc.CONSUMES, produces = PostMicrostreamGc.PRODUCES)
public void postMicrostreamGc() throws HttpResponseException
@Post(value = PostGc.PATH, consumes = PostGc.CONSUMES, produces = PostGc.PRODUCES)
public void postGc() throws HttpResponseException
{
this.controller.postMicrostreamGc();
this.controller.postGc();
}

@Get(value = GetMicrostreamGc.PATH, produces = GetMicrostreamGc.PRODUCES)
public boolean getMicrostreamGc() throws HttpResponseException
@Get(value = GetGc.PATH, produces = GetGc.PRODUCES)
public boolean getGc() throws HttpResponseException
{
return this.controller.getMicrostreamGc();
return this.controller.getGc();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class NotADistributorException extends BadRequestException
{
public static final String NAD_HEADER_KEY = "Microstream-NAD";
public static final String NAD_HEADER_KEY = "StorageNode-NAD";
public static final String NAD_HEADER_VALUE = Boolean.TRUE.toString();

public NotADistributorException()
Expand Down
Loading