-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The InfoServlet has been added as a lightweight alternative to InfoService without dependency on RESTEasy. All clients have been modified to call the InfoServlet instead.
- Loading branch information
Showing
4 changed files
with
40 additions
and
3 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
37 changes: 37 additions & 0 deletions
37
base/server-webapp/src/main/java/org/dogtagpki/server/v2/InfoServlet.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,37 @@ | ||
// | ||
// Copyright Red Hat, Inc. | ||
// | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
// | ||
package org.dogtagpki.server.v2; | ||
|
||
import java.io.PrintWriter; | ||
|
||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
import org.dogtagpki.common.Info; | ||
import org.dogtagpki.server.PKIEngine; | ||
import org.dogtagpki.server.PKIServlet; | ||
|
||
/** | ||
* @author Endi S. Dewata | ||
*/ | ||
@WebServlet("/v2/info") | ||
public class InfoServlet extends PKIServlet { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public void get(HttpServletRequest request, HttpServletResponse response) throws Exception { | ||
|
||
PKIEngine engine = getPKIEngine(); | ||
Info info = engine.getInfo(request); | ||
|
||
response.setContentType(MediaType.APPLICATION_JSON); | ||
|
||
PrintWriter out = response.getWriter(); | ||
out.println(info.toJSON()); | ||
} | ||
} |
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