Created
December 18, 2018 04:05
-
-
Save abhirockzz/89ebae09893c12a425d4d665ca84c29e to your computer and use it in GitHub Desktop.
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
@Path("tweets/producer") | |
public class ServiceManagerResource { | |
@GET | |
public Response start() { | |
Response r = null; | |
try { | |
ServiceLifecycleManager.getInstance().start(); | |
r = Response.ok("Tweets Producer started. Tracking - "+ ServiceLifecycleManager.TRACKED_TERMS) | |
.build(); | |
} catch (Exception ex) { | |
Logger.getLogger(ServiceManagerResource.class.getName()).log(Level.SEVERE, null, ex); | |
r = Response.serverError().build(); | |
} | |
return r; | |
} | |
@DELETE | |
public Response stop() { | |
Response r = null; | |
try { | |
ServiceLifecycleManager.getInstance().stop(); | |
r = Response.ok("Tweets Producer stopped") | |
.build(); | |
} catch (Exception ex) { | |
Logger.getLogger(ServiceManagerResource.class.getName()).log(Level.SEVERE, null, ex); | |
r = Response.serverError().build(); | |
} | |
return r; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment