Checkstyle fixes

pull/55/head
Richard Körber 2017-07-30 23:48:49 +02:00
parent 06985c4404
commit 27bd913891
5 changed files with 53 additions and 11 deletions

View File

@ -39,7 +39,8 @@ public abstract class AbstractResponder implements UriResponder {
* @param session
* {@link IHTTPSession} containing the decoding body parameters
*/
public abstract void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception;
public abstract void handle(Map<String, String> urlParams, IHTTPSession session)
throws Exception; //NOSONAR: the request fails on any exception
@Override
public Response post(UriResource uriResource, Map<String, String> urlParams, IHTTPSession session) {

View File

@ -47,13 +47,6 @@ public class BammBamm {
private final HttpServer httpServer;
private final TlsSniServer tlsSniServer;
/**
* Retrieves the singleton instance of {@link BammBamm}.
*/
public static BammBamm instance() {
return INSTANCE;
}
private BammBamm() {
ResourceBundle bundle = ResourceBundle.getBundle("bammbamm");
appPort = Integer.parseInt(bundle.getString("app.port"));
@ -67,6 +60,15 @@ public class BammBamm {
appServer = new AppServer(appPort);
}
/**
* Retrieves the singleton instance of {@link BammBamm}.
*
* @return {@link BammBamm} singleton instance
*/
public static BammBamm instance() {
return INSTANCE;
}
/**
* Returns the {@link DnsServer} instance.
*/
@ -140,6 +142,9 @@ public class BammBamm {
/**
* Start bammbamm. It runs until the Java process is stopped.
*
* @param args
* Command line arguments
*/
public static void main(String[] args) {
BammBamm.instance().start();

View File

@ -23,13 +23,20 @@ import fi.iki.elonen.NanoHTTPD.IHTTPSession;
/**
* Request handler for all {@code dns-01} related requests.
*/
public class DnsHandler {
public final class DnsHandler {
public static final String ADD_A_RECORD = "/dns/add/a/:domain";
public static final String REMOVE_A_RECORD = "/dns/remove/a/:domain";
public static final String ADD_TXT_RECORD = "/dns/add/txt/:domain";
public static final String REMOVE_TXT_RECORD = "/dns/remove/txt/:domain";
private DnsHandler() {
// this class cannot be instanciated.
}
/**
* Adds an A Record.
*/
public static class AddARecord extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {
@ -41,6 +48,9 @@ public class DnsHandler {
}
}
/**
* Removes an A Record.
*/
public static class RemoveARecord extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {
@ -51,6 +61,9 @@ public class DnsHandler {
}
}
/**
* Adds a TXT Record.
*/
public static class AddTxtRecord extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {
@ -62,6 +75,9 @@ public class DnsHandler {
}
}
/**
* Removes a TXT Record.
*/
public static class RemoveTxtRecord extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {

View File

@ -22,11 +22,18 @@ import fi.iki.elonen.NanoHTTPD.IHTTPSession;
/**
* Request handler for all {@code http-01} related requests.
*/
public class HttpHandler {
public final class HttpHandler {
public static final String ADD = "/http/add/:token";
public static final String REMOVE = "/http/remove/:token";
private HttpHandler() {
// this class cannot be instanciated.
}
/**
* Adds a HTTP challenge.
*/
public static class Add extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {
@ -38,6 +45,9 @@ public class HttpHandler {
}
}
/**
* Removes a HTTP challenge.
*/
public static class Remove extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {

View File

@ -30,11 +30,18 @@ import fi.iki.elonen.NanoHTTPD.IHTTPSession;
/**
* Request handler for all {@code tls-sni-02} related requests.
*/
public class TlsSniHandler {
public final class TlsSniHandler {
public static final String ADD = "/tlssni/add/:alias";
public static final String REMOVE = "/tlssni/remove/:alias";
private TlsSniHandler() {
// this class cannot be instanciated.
}
/**
* Adds an TLS-SNI certificate.
*/
public static class Add extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {
@ -57,6 +64,9 @@ public class TlsSniHandler {
}
}
/**
* Removes an TLS-SNI certificate.
*/
public static class Remove extends AbstractResponder {
@Override
public void handle(Map<String, String> urlParams, IHTTPSession session) throws Exception {