This repository has been archived by the owner on Jun 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from rndsolutions/HTTPEndpoints-74
Http endpoints 74
- Loading branch information
Showing
33 changed files
with
3,623 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ public static void disconnect() { | |
redisEmbeddedDb.stop(); | ||
jedisPool.destroy(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
Server/src/main/java/net/hawkengine/http/JobController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package net.hawkengine.http; | ||
|
||
import net.hawkengine.model.ServiceResult; | ||
import net.hawkengine.services.JobService; | ||
import net.hawkengine.services.interfaces.IJobService; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.core.Response.Status; | ||
|
||
@Path("/jobs") | ||
public class JobController { | ||
private IJobService jobService; | ||
|
||
public JobController() { | ||
this.jobService = new JobService(); | ||
} | ||
|
||
public JobController(IJobService jobService) { | ||
this.jobService = jobService; | ||
} | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public Response getAllJobs() { | ||
ServiceResult response = this.jobService.getAll(); | ||
return Response.status(Status.OK).entity(response.getObject()).build(); | ||
} | ||
|
||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Path("/{jobId}") | ||
public Response getJobById(@PathParam("jobId") String stageId) { | ||
ServiceResult response = this.jobService.getById(stageId); | ||
if (response.hasError()) { | ||
return Response.status(Status.NOT_FOUND).entity(response.getMessage()).build(); | ||
} | ||
return Response.status(Status.OK).entity(response.getObject()).build(); | ||
} | ||
/* | ||
@GET | ||
@Produces(MediaType.APPLICATION_JSON) | ||
@Path("/{jobId}/latest") | ||
public Response getLatest(@PathParam("jobId") String stageId) { | ||
// TODO: service to be implemented. | ||
return Response.noContent().build(); | ||
} | ||
*/ | ||
} |
Oops, something went wrong.