2017-12-12 13:05:48 +01:00
|
|
|
/*
|
2018-10-28 09:10:56 +01:00
|
|
|
* This file is part of Player Analytics (Plan).
|
|
|
|
*
|
|
|
|
* Plan is free software: you can redistribute it and/or modify
|
2018-11-11 19:55:11 +01:00
|
|
|
* it under the terms of the GNU Lesser General Public License v3 as published by
|
2018-10-28 09:10:56 +01:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Plan is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2018-11-11 19:55:11 +01:00
|
|
|
* GNU Lesser General Public License for more details.
|
2018-10-28 09:10:56 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
2017-12-12 13:05:48 +01:00
|
|
|
*/
|
2019-08-30 22:14:54 +02:00
|
|
|
package com.djrapitops.plan.delivery.webserver;
|
2017-12-12 13:05:48 +01:00
|
|
|
|
2019-08-30 22:14:54 +02:00
|
|
|
import com.djrapitops.plan.SubSystem;
|
2019-08-30 22:48:36 +02:00
|
|
|
import com.djrapitops.plan.delivery.webserver.cache.JSONCache;
|
2017-12-12 13:05:48 +01:00
|
|
|
|
2018-08-22 09:19:52 +02:00
|
|
|
import javax.inject.Inject;
|
2018-08-29 09:13:37 +02:00
|
|
|
import javax.inject.Singleton;
|
2018-07-28 23:16:42 +02:00
|
|
|
|
2017-12-12 13:05:48 +01:00
|
|
|
/**
|
2018-01-15 19:15:44 +01:00
|
|
|
* WebServer subsystem for managing WebServer initialization.
|
2017-12-12 13:05:48 +01:00
|
|
|
*
|
|
|
|
* @author Rsl1122
|
|
|
|
*/
|
2018-08-29 09:13:37 +02:00
|
|
|
@Singleton
|
2017-12-12 13:05:48 +01:00
|
|
|
public class WebServerSystem implements SubSystem {
|
|
|
|
|
2018-08-22 09:19:52 +02:00
|
|
|
private final WebServer webServer;
|
2017-12-12 13:05:48 +01:00
|
|
|
|
2018-08-22 09:19:52 +02:00
|
|
|
@Inject
|
2019-08-30 22:48:36 +02:00
|
|
|
public WebServerSystem(
|
|
|
|
WebServer webServer
|
|
|
|
) {
|
2018-08-22 09:19:52 +02:00
|
|
|
this.webServer = webServer;
|
2017-12-12 13:05:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-11-02 15:28:43 +01:00
|
|
|
public void enable() {
|
2018-01-24 20:59:53 +01:00
|
|
|
webServer.enable();
|
2017-12-12 13:05:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-01-11 15:19:30 +01:00
|
|
|
public void disable() {
|
2018-07-28 17:31:07 +02:00
|
|
|
webServer.disable();
|
2019-08-31 09:25:46 +02:00
|
|
|
JSONCache.invalidateAll();
|
|
|
|
JSONCache.cleanUp();
|
2017-12-12 13:05:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public WebServer getWebServer() {
|
|
|
|
return webServer;
|
|
|
|
}
|
2019-07-27 09:26:24 +02:00
|
|
|
|
2018-06-12 20:28:40 +02:00
|
|
|
}
|