diff --git a/LTS-CHANGELOG.adoc b/LTS-CHANGELOG.adoc index cac15c7d5a..147189d4fc 100644 --- a/LTS-CHANGELOG.adoc +++ b/LTS-CHANGELOG.adoc @@ -17,6 +17,14 @@ include::content/docs/variables.adoc-include[] The LTS changelog lists releases which are only accessible via a commercial subscription. All fixes and changes in LTS releases will be released the next minor release. Changes from LTS 1.4.x will be included in release 1.5.0. +[[v1.9.14]] +== 1.9.14 (TBD) + +icon:check[] Monitoring: Calling the `/health/ready` endpoint while restoring an OrientDB backup would block the request. If too many requests were blocked in this way, Mesh would +be considered not live any more. This has been fixed now, during a restore, the endpoint `/health/ready` will now fail immediately while the liveness status will be maintained. + +icon:check[] Monitoring: Failing calls to any `/health/...` endpoints will no longer log the whole stacktrace, since this does not contain useful information. + [[v1.9.13]] == 1.9.13 (22.03.2023) @@ -46,6 +54,14 @@ icon:check[] Core: The node migration process has been improved to reduce resour icon:check[] Core: Corner case of updating the webroot info might throw a false conflict exception, when the segment field value is reset for a schema. This has been fixed. +[[v1.8.21]] +== 1.8.21 (TBD) + +icon:check[] Monitoring: Calling the `/health/ready` endpoint while restoring an OrientDB backup would block the request. If too many requests were blocked in this way, Mesh would +be considered not live any more. This has been fixed now, during a restore, the endpoint `/health/ready` will now fail immediately while the liveness status will be maintained. + +icon:check[] Monitoring: Failing calls to any `/health/...` endpoints will no longer log the whole stacktrace, since this does not contain useful information. + [[v1.8.20]] == 1.8.20 (22.03.2023) diff --git a/common/src/main/java/com/gentics/mesh/router/route/AbstractInternalEndpoint.java b/common/src/main/java/com/gentics/mesh/router/route/AbstractInternalEndpoint.java index a9a84ce1db..2d814de470 100644 --- a/common/src/main/java/com/gentics/mesh/router/route/AbstractInternalEndpoint.java +++ b/common/src/main/java/com/gentics/mesh/router/route/AbstractInternalEndpoint.java @@ -3,8 +3,6 @@ import java.util.ArrayList; import java.util.List; -import javax.inject.Inject; - import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.core.db.Database; import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; @@ -32,15 +30,15 @@ public abstract class AbstractInternalEndpoint implements InternalEndpoint { protected RouterStorage routerStorage; - @Inject - public LocalConfigApi localConfigApi; + protected final LocalConfigApi localConfigApi; - @Inject - public Database db; + protected final Database db; - protected AbstractInternalEndpoint(String basePath, MeshAuthChainImpl chain) { + protected AbstractInternalEndpoint(String basePath, MeshAuthChainImpl chain, LocalConfigApi localConfigApi, Database db) { this.basePath = basePath; this.chain = chain; + this.localConfigApi = localConfigApi; + this.db = db; } @Override diff --git a/common/src/main/java/com/gentics/mesh/router/route/AbstractProjectEndpoint.java b/common/src/main/java/com/gentics/mesh/router/route/AbstractProjectEndpoint.java index dff286449a..b8e3341d1f 100644 --- a/common/src/main/java/com/gentics/mesh/router/route/AbstractProjectEndpoint.java +++ b/common/src/main/java/com/gentics/mesh/router/route/AbstractProjectEndpoint.java @@ -2,6 +2,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.router.RouterStorage; import io.vertx.core.Vertx; @@ -14,8 +16,8 @@ public abstract class AbstractProjectEndpoint extends AbstractInternalEndpoint { protected BootstrapInitializer boot; - protected AbstractProjectEndpoint(String basePath, MeshAuthChainImpl chain, BootstrapInitializer boot) { - super(basePath, chain); + protected AbstractProjectEndpoint(String basePath, MeshAuthChainImpl chain, BootstrapInitializer boot, LocalConfigApi localConfigApi, Database db) { + super(basePath, chain, localConfigApi, db); this.boot = boot; } diff --git a/core/src/main/java/com/gentics/mesh/cli/CoreVerticleLoader.java b/core/src/main/java/com/gentics/mesh/cli/CoreVerticleLoader.java index 8f23bbc7e4..32f49aef0e 100644 --- a/core/src/main/java/com/gentics/mesh/cli/CoreVerticleLoader.java +++ b/core/src/main/java/com/gentics/mesh/cli/CoreVerticleLoader.java @@ -29,28 +29,30 @@ public class CoreVerticleLoader { private static Logger log = LoggerFactory.getLogger(CoreVerticleLoader.class); - @Inject - public Provider restVerticle; + protected final Provider restVerticle; - @Inject - public Provider monitoringServerVerticle; + protected final Provider monitoringServerVerticle; - @Inject - public JobWorkerVerticleImpl jobWorkerVerticle; + protected final JobWorkerVerticleImpl jobWorkerVerticle; - @Inject - public Provider elasticsearchProcessVerticleProvider; + protected final Provider elasticsearchProcessVerticleProvider; private ElasticsearchProcessVerticle elasticsearchProcessVerticle; - @Inject - public MeshOptions meshOptions; + protected final MeshOptions meshOptions; private final Vertx rxVertx; private String searchVerticleId; @Inject - public CoreVerticleLoader(Vertx rxVertx) { + public CoreVerticleLoader(Vertx rxVertx, Provider restVerticle, + Provider monitoringServerVerticle, JobWorkerVerticleImpl jobWorkerVerticle, + Provider elasticsearchProcessVerticleProvider, MeshOptions meshOptions) { this.rxVertx = rxVertx; + this.restVerticle = restVerticle; + this.monitoringServerVerticle = monitoringServerVerticle; + this.jobWorkerVerticle = jobWorkerVerticle; + this.elasticsearchProcessVerticleProvider = elasticsearchProcessVerticleProvider; + this.meshOptions = meshOptions; } private JsonObject defaultConfig; diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/admin/AdminEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/admin/AdminEndpoint.java index e7a171104e..8ef82e7c75 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/admin/AdminEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/admin/AdminEndpoint.java @@ -30,6 +30,7 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; import com.gentics.mesh.context.impl.InternalRoutingActionContextImpl; +import com.gentics.mesh.core.db.Database; import com.gentics.mesh.core.endpoint.admin.consistency.ConsistencyCheckHandler; import com.gentics.mesh.core.endpoint.admin.debuginfo.DebugInfoHandler; import com.gentics.mesh.core.endpoint.admin.plugin.PluginHandler; @@ -66,8 +67,8 @@ public class AdminEndpoint extends AbstractInternalEndpoint { @Inject public AdminEndpoint(MeshAuthChainImpl chain, AdminHandler adminHandler, JobHandler jobHandler, ConsistencyCheckHandler consistencyHandler, PluginHandler pluginHandler, DebugInfoHandler debugInfoHandler, LocalConfigHandler localConfigHandler, ShutdownHandler shutdownHandler, - HandlerUtilities handlerUtilities) { - super("admin", chain); + HandlerUtilities handlerUtilities, LocalConfigApi localConfigApi, Database db) { + super("admin", chain, localConfigApi, db); this.adminHandler = adminHandler; this.jobHandler = jobHandler; this.consistencyHandler = consistencyHandler; @@ -79,7 +80,7 @@ public AdminEndpoint(MeshAuthChainImpl chain, AdminHandler adminHandler, JobHand } public AdminEndpoint() { - super("admin", null); + super("admin", null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/admin/HealthEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/admin/HealthEndpoint.java index b5ce414126..5dee09fa2d 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/admin/HealthEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/admin/HealthEndpoint.java @@ -5,6 +5,7 @@ import javax.inject.Inject; import com.gentics.mesh.auth.MeshAuthChainImpl; +import com.gentics.mesh.core.db.Database; import com.gentics.mesh.core.endpoint.handler.MonitoringCrudHandler; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractInternalEndpoint; @@ -17,13 +18,13 @@ public class HealthEndpoint extends AbstractInternalEndpoint { private MonitoringCrudHandler monitoringCrudHandler; @Inject - public HealthEndpoint(MeshAuthChainImpl chain, MonitoringCrudHandler monitoringCrudHandler) { - super("health", chain); + public HealthEndpoint(MeshAuthChainImpl chain, MonitoringCrudHandler monitoringCrudHandler, LocalConfigApi localConfigApi, Database db) { + super("health", chain, localConfigApi, db); this.monitoringCrudHandler = monitoringCrudHandler; } public HealthEndpoint() { - super("health", null); + super("health", null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/admin/RestInfoEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/admin/RestInfoEndpoint.java index 6ad3f0045f..c4ffca79db 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/admin/RestInfoEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/admin/RestInfoEndpoint.java @@ -9,6 +9,7 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; import com.gentics.mesh.example.RestInfoExamples; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.RouterStorage; @@ -29,13 +30,13 @@ public class RestInfoEndpoint extends AbstractInternalEndpoint { private RouterStorage routerStorage; @Inject - public RestInfoEndpoint(MeshAuthChainImpl chain, AdminHandler adminHandler) { - super(null, chain); + public RestInfoEndpoint(MeshAuthChainImpl chain, AdminHandler adminHandler, LocalConfigApi localConfigApi, Database db) { + super(null, chain, localConfigApi, db); this.adminHandler = adminHandler; } public RestInfoEndpoint(String path) { - super(path, null); + super(path, null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/auth/AuthenticationEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/auth/AuthenticationEndpoint.java index 790970ef12..f9371e8198 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/auth/AuthenticationEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/auth/AuthenticationEndpoint.java @@ -9,6 +9,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.auth.MeshBasicAuthLoginHandler; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractInternalEndpoint; @@ -22,14 +24,14 @@ public class AuthenticationEndpoint extends AbstractInternalEndpoint { private MeshBasicAuthLoginHandler basicAuthLoginHandler; @Inject - public AuthenticationEndpoint(MeshAuthChainImpl chain, AuthenticationRestHandler authRestHandler, MeshBasicAuthLoginHandler basicAuthHandler) { - super("auth", chain); + public AuthenticationEndpoint(MeshAuthChainImpl chain, AuthenticationRestHandler authRestHandler, MeshBasicAuthLoginHandler basicAuthHandler, LocalConfigApi localConfigApi, Database db) { + super("auth", chain, localConfigApi, db); this.authRestHandler = authRestHandler; this.basicAuthLoginHandler = basicAuthHandler; } public AuthenticationEndpoint() { - super("auth", null); + super("auth", null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/branch/BranchEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/branch/BranchEndpoint.java index 73a57520c2..65936163be 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/branch/BranchEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/branch/BranchEndpoint.java @@ -28,6 +28,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.GenericParametersImpl; import com.gentics.mesh.parameter.impl.PagingParametersImpl; import com.gentics.mesh.rest.InternalEndpointRoute; @@ -41,12 +43,12 @@ public class BranchEndpoint extends AbstractProjectEndpoint { private BranchCrudHandler crudHandler; public BranchEndpoint() { - super("branches", null, null); + super("branches", null, null, null, null); } @Inject - public BranchEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, BranchCrudHandler crudHandler) { - super("branches", chain, boot); + public BranchEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, BranchCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super("branches", chain, boot, localConfigApi, db); this.crudHandler = crudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/eventbus/EventbusEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/eventbus/EventbusEndpoint.java index 307cb00997..93429b9f01 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/eventbus/EventbusEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/eventbus/EventbusEndpoint.java @@ -3,6 +3,8 @@ import javax.inject.Inject; import com.gentics.mesh.auth.MeshAuthChainImpl; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.core.rest.MeshEvent; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractInternalEndpoint; @@ -27,13 +29,13 @@ public class EventbusEndpoint extends AbstractInternalEndpoint { private final Vertx vertx; public EventbusEndpoint() { - super("eventbus", null); + super("eventbus", null, null, null); this.vertx = null; } @Inject - public EventbusEndpoint(Vertx vertx, MeshAuthChainImpl chain) { - super("eventbus", chain); + public EventbusEndpoint(Vertx vertx, MeshAuthChainImpl chain, LocalConfigApi localConfigApi, Database db) { + super("eventbus", chain, localConfigApi, db); this.vertx = vertx; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/group/GroupEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/group/GroupEndpoint.java index 7928b8d4ff..a87ea9550e 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/group/GroupEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/group/GroupEndpoint.java @@ -24,6 +24,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.GenericParametersImpl; import com.gentics.mesh.parameter.impl.PagingParametersImpl; import com.gentics.mesh.parameter.impl.RolePermissionParametersImpl; @@ -38,12 +40,12 @@ public class GroupEndpoint extends AbstractInternalEndpoint { private GroupCrudHandler crudHandler; public GroupEndpoint() { - super("groups", null); + super("groups", null, null, null); } @Inject - public GroupEndpoint(MeshAuthChainImpl chain, GroupCrudHandler crudHandler) { - super("groups", chain); + public GroupEndpoint(MeshAuthChainImpl chain, GroupCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super("groups", chain, localConfigApi, db); this.crudHandler = crudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/handler/MonitoringCrudHandler.java b/core/src/main/java/com/gentics/mesh/core/endpoint/handler/MonitoringCrudHandler.java index f04dcd319f..17725d8236 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/handler/MonitoringCrudHandler.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/handler/MonitoringCrudHandler.java @@ -6,6 +6,7 @@ import javax.inject.Inject; import javax.inject.Singleton; +import com.gentics.mesh.Mesh; import com.gentics.mesh.MeshStatus; import com.gentics.mesh.cli.BootstrapInitializer; import com.gentics.mesh.core.db.Database; @@ -59,15 +60,21 @@ public void handleLive(RoutingContext rc) { PluginStatus status = pluginManager.getStatus(id); if (status == PluginStatus.FAILED) { log.warn("Plugin {" + id + "} is in status failed."); - throw error(SERVICE_UNAVAILABLE, "error_internal"); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); } } - if (!liveness.isLive()) { - log.warn("Liveness was set to false due to {}", liveness.getError()); - throw error(SERVICE_UNAVAILABLE, "error_internal"); + Mesh mesh = boot.mesh(); + switch (mesh.getStatus()) { + case BACKUP: + case RESTORE: + log.info("Mesh is temporary unavailable due to {}, but is still alive", mesh.getStatus()); + break; + default: + log.warn("Liveness was set to false due to {}", liveness.getError()); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); + } } - rc.response().setStatusCode(200).end(); } @@ -77,39 +84,35 @@ public void handleLive(RoutingContext rc) { * @param rc */ public void handleReady(RoutingContext rc) { + MeshStatus status = boot.mesh().getStatus(); + if (!status.equals(MeshStatus.READY)) { + log.warn("Status is {" + status.name() + "} - Failing readiness probe"); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); + } for (String id : pluginManager.getPluginIds()) { - PluginStatus status = pluginManager.getStatus(id); + PluginStatus pluginStatus = pluginManager.getStatus(id); // TODO We need can't check for plugin registered since plugins will only be // registered once the write quorum has been reached. // Thus we can only check for failed. Otherwise we would interrupt the // K8S deployment process and prevent additional nodes from being added // to the cluster. Without additional nodes the write quorum would never // be reached. - if (status == PluginStatus.FAILED) { + if (pluginStatus == PluginStatus.FAILED) { log.error("Plugin {" + id + "} is in status failed."); - throw error(SERVICE_UNAVAILABLE, "error_internal"); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); } } - if (!liveness.isLive()) { log.warn("Liveness was set to false due to {}", liveness.getError()); - throw error(SERVICE_UNAVAILABLE, "error_internal"); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); } - if (clusterManager != null && !clusterManager.isLocalNodeOnline()) { log.warn("Local node is not online - Failing readiness probe"); - throw error(SERVICE_UNAVAILABLE, "error_internal"); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); } - if (!db.isHealthy()) { log.warn("Failing DB health check"); - throw error(SERVICE_UNAVAILABLE, "error_internal"); - } - - MeshStatus status = boot.mesh().getStatus(); - if (!status.equals(MeshStatus.READY)) { - log.warn("Status is {" + status.name() + "} - Failing readiness probe"); - throw error(SERVICE_UNAVAILABLE, "error_internal"); + throw error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false); } rc.response().end(); } @@ -129,15 +132,15 @@ public void handleWritable(RoutingContext rc) { .subscribe(isReadOnly -> { if (isReadOnly) { log.warn("Local node cannot write - read only mode set"); - rc.fail(error(SERVICE_UNAVAILABLE, "error_internal")); + rc.fail(error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false)); } else if (db.isReadOnly(false)) { - rc.fail(error(SERVICE_UNAVAILABLE, "error_internal")); + rc.fail(error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false)); } else if (clusterManager.isClusterTopologyLocked()) { log.warn("Local node cannot write - cluster topology locked"); - rc.fail(error(SERVICE_UNAVAILABLE, "error_internal")); + rc.fail(error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false)); } else if (!clusterManager.isWriteQuorumReached()) { log.warn("Local node cannot write - write quorum not reached"); - rc.fail(error(SERVICE_UNAVAILABLE, "error_internal")); + rc.fail(error(SERVICE_UNAVAILABLE, "error_internal").setLogStackTrace(false)); } else { rc.response().setStatusCode(200).end(); } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/MicroschemaEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/MicroschemaEndpoint.java index 088ba30f92..d46aa03f4d 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/MicroschemaEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/MicroschemaEndpoint.java @@ -21,6 +21,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.PagingParametersImpl; import com.gentics.mesh.parameter.impl.VersioningParametersImpl; import com.gentics.mesh.rest.InternalEndpointRoute; @@ -34,12 +36,12 @@ public class MicroschemaEndpoint extends AbstractInternalEndpoint { private MicroschemaCrudHandler crudHandler; public MicroschemaEndpoint() { - super("microschemas", null); + super("microschemas", null, null, null); } @Inject - public MicroschemaEndpoint(MeshAuthChainImpl chain, MicroschemaCrudHandler crudHandler) { - super("microschemas", chain); + public MicroschemaEndpoint(MeshAuthChainImpl chain, MicroschemaCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super("microschemas", chain, localConfigApi, db); this.crudHandler = crudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/ProjectMicroschemaEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/ProjectMicroschemaEndpoint.java index 4e110e0ed8..8429b336eb 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/ProjectMicroschemaEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/microschema/ProjectMicroschemaEndpoint.java @@ -15,6 +15,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractProjectEndpoint; @@ -26,12 +28,12 @@ public class ProjectMicroschemaEndpoint extends AbstractProjectEndpoint { private MicroschemaCrudHandler crudHandler; public ProjectMicroschemaEndpoint() { - super("microschemas", null, null); + super("microschemas", null, null, null, null); } @Inject - public ProjectMicroschemaEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, MicroschemaCrudHandler crudHandler) { - super("microschemas", chain, boot); + public ProjectMicroschemaEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, MicroschemaCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super("microschemas", chain, boot, localConfigApi, db); this.crudHandler = crudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/navroot/NavRootEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/navroot/NavRootEndpoint.java index 4a2dbc4f90..2b32c85513 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/navroot/NavRootEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/navroot/NavRootEndpoint.java @@ -8,6 +8,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.NavigationParametersImpl; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractProjectEndpoint; @@ -20,12 +22,12 @@ public class NavRootEndpoint extends AbstractProjectEndpoint { private NavRootHandler handler; public NavRootEndpoint() { - super("navroot", null, null); + super("navroot", null, null, null, null); } @Inject - public NavRootEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, NavRootHandler handler) { - super("navroot", chain, boot); + public NavRootEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, NavRootHandler handler, LocalConfigApi localConfigApi, Database db) { + super("navroot", chain, boot, localConfigApi, db); this.handler = handler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/node/NodeEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/node/NodeEndpoint.java index 3543361d4a..99967eddb2 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/node/NodeEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/node/NodeEndpoint.java @@ -3,6 +3,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.core.rest.navigation.NavigationResponse; import com.gentics.mesh.parameter.impl.DeleteParametersImpl; import com.gentics.mesh.parameter.impl.GenericParametersImpl; @@ -55,14 +57,14 @@ public class NodeEndpoint extends AbstractProjectEndpoint { private S3BinaryMetadataExtractionHandlerImpl s3BinaryMetadataExtractionHandler; public NodeEndpoint() { - super("nodes", null, null); + super("nodes", null, null, null, null); } @Inject public NodeEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, NodeCrudHandler crudHandler, BinaryUploadHandlerImpl binaryUploadHandler, BinaryTransformHandler binaryTransformHandler, BinaryDownloadHandler binaryDownloadHandler, S3BinaryUploadHandlerImpl s3binaryUploadHandler, - S3BinaryMetadataExtractionHandlerImpl s3BinaryMetadataExtractionHandler) { - super("nodes", chain, boot); + S3BinaryMetadataExtractionHandlerImpl s3BinaryMetadataExtractionHandler, LocalConfigApi localConfigApi, Database db) { + super("nodes", chain, boot, localConfigApi, db); this.crudHandler = crudHandler; this.binaryUploadHandler = binaryUploadHandler; this.binaryTransformHandler = binaryTransformHandler; diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/project/LanguageEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/project/LanguageEndpoint.java index 17c4d5b09c..e6d4648e9c 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/project/LanguageEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/project/LanguageEndpoint.java @@ -11,6 +11,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.router.route.AbstractProjectEndpoint; import io.vertx.ext.web.Route; @@ -23,8 +25,8 @@ public class LanguageEndpoint extends AbstractProjectEndpoint { @Inject - public LanguageEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot) { - super("languages", chain, boot); + public LanguageEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, LocalConfigApi localConfigApi, Database db) { + super("languages", chain, boot, localConfigApi, db); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectEndpoint.java index 32e88b9fe7..f49fd663e9 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectEndpoint.java @@ -20,6 +20,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.PagingParametersImpl; import com.gentics.mesh.parameter.impl.ProjectPurgeParametersImpl; import com.gentics.mesh.parameter.impl.RolePermissionParametersImpl; @@ -34,13 +36,13 @@ public class ProjectEndpoint extends AbstractInternalEndpoint { private ProjectCrudHandler crudHandler; @Inject - public ProjectEndpoint(MeshAuthChainImpl chain, ProjectCrudHandler crudHandler) { - super("projects", chain); + public ProjectEndpoint(MeshAuthChainImpl chain, ProjectCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super("projects", chain, localConfigApi, db); this.crudHandler = crudHandler; } public ProjectEndpoint() { - super("projects", null); + super("projects", null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectInfoEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectInfoEndpoint.java index 49b4bceb23..652e01d75a 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectInfoEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/project/ProjectInfoEndpoint.java @@ -7,6 +7,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.RouterStorage; import com.gentics.mesh.router.route.AbstractInternalEndpoint; @@ -23,13 +25,13 @@ public class ProjectInfoEndpoint extends AbstractInternalEndpoint { private ProjectCrudHandler crudHandler; @Inject - public ProjectInfoEndpoint(MeshAuthChainImpl chain, ProjectCrudHandler crudHandler) { - super(null, chain); + public ProjectInfoEndpoint(MeshAuthChainImpl chain, ProjectCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super(null, chain, localConfigApi, db); this.crudHandler = crudHandler; } public ProjectInfoEndpoint() { - super("", null); + super("", null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/role/RoleEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/role/RoleEndpoint.java index 9c41e0fa0a..33dbb61619 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/role/RoleEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/role/RoleEndpoint.java @@ -19,6 +19,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.GenericParametersImpl; import com.gentics.mesh.parameter.impl.PagingParametersImpl; import com.gentics.mesh.rest.InternalEndpointRoute; @@ -32,12 +34,12 @@ public class RoleEndpoint extends AbstractInternalEndpoint { private RoleCrudHandlerImpl crudHandler; public RoleEndpoint() { - super("roles", null); + super("roles", null, null, null); } @Inject - public RoleEndpoint(MeshAuthChainImpl chain, RoleCrudHandlerImpl crudHandler) { - super("roles", chain); + public RoleEndpoint(MeshAuthChainImpl chain, RoleCrudHandlerImpl crudHandler, LocalConfigApi localConfigApi, Database db) { + super("roles", chain, localConfigApi, db); this.crudHandler = crudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/schema/ProjectSchemaEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/schema/ProjectSchemaEndpoint.java index 34d4c235fb..7de785ab68 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/schema/ProjectSchemaEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/schema/ProjectSchemaEndpoint.java @@ -17,6 +17,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractProjectEndpoint; @@ -28,12 +30,12 @@ public class ProjectSchemaEndpoint extends AbstractProjectEndpoint { private SchemaCrudHandler crudHandler; public ProjectSchemaEndpoint() { - super("schemas", null, null); + super("schemas", null, null, null, null); } @Inject - public ProjectSchemaEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, SchemaCrudHandler crudHandler) { - super("schemas", chain, boot); + public ProjectSchemaEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, SchemaCrudHandler crudHandler, LocalConfigApi localConfigApi, Database db) { + super("schemas", chain, boot, localConfigApi, db); this.crudHandler = crudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/schema/SchemaEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/schema/SchemaEndpoint.java index 33d3f60ad2..8fe90bb5d8 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/schema/SchemaEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/schema/SchemaEndpoint.java @@ -21,6 +21,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.GenericParametersImpl; import com.gentics.mesh.parameter.impl.PagingParametersImpl; import com.gentics.mesh.parameter.impl.SchemaUpdateParametersImpl; @@ -38,12 +40,12 @@ public class SchemaEndpoint extends AbstractInternalEndpoint { private SchemaLock schemaLock; public SchemaEndpoint() { - super("schemas", null); + super("schemas", null, null, null); } @Inject - public SchemaEndpoint(MeshAuthChainImpl chain, SchemaCrudHandler crudHandler, SchemaLock schemaLock) { - super("schemas", chain); + public SchemaEndpoint(MeshAuthChainImpl chain, SchemaCrudHandler crudHandler, SchemaLock schemaLock, LocalConfigApi localConfigApi, Database db) { + super("schemas", chain, localConfigApi, db); this.crudHandler = crudHandler; this.schemaLock = schemaLock; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/tagfamily/TagFamilyEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/tagfamily/TagFamilyEndpoint.java index 465a4e9bf7..a8096236ae 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/tagfamily/TagFamilyEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/tagfamily/TagFamilyEndpoint.java @@ -22,7 +22,9 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; import com.gentics.mesh.core.endpoint.PathParameters; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.core.endpoint.tag.TagCrudHandler; import com.gentics.mesh.parameter.impl.GenericParametersImpl; import com.gentics.mesh.parameter.impl.PagingParametersImpl; @@ -49,13 +51,13 @@ public String getDescription() { private TagCrudHandler tagCrudHandler; public TagFamilyEndpoint() { - super("tagFamilies", null, null); + super("tagFamilies", null, null, null, null); } @Inject public TagFamilyEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, TagCrudHandler tagCrudHandler, - TagFamilyCrudHandler tagFamilyCrudHandler) { - super("tagFamilies", chain, boot); + TagFamilyCrudHandler tagFamilyCrudHandler, LocalConfigApi localConfigApi, Database db) { + super("tagFamilies", chain, boot, localConfigApi, db); this.tagCrudHandler = tagCrudHandler; this.tagFamilyCrudHandler = tagFamilyCrudHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/user/UserEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/user/UserEndpoint.java index 1f72e5d4ad..2ee79cc8c7 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/user/UserEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/user/UserEndpoint.java @@ -16,6 +16,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.GenericParametersImpl; import com.gentics.mesh.parameter.impl.NodeParametersImpl; import com.gentics.mesh.parameter.impl.PagingParametersImpl; @@ -37,12 +39,12 @@ public class UserEndpoint extends AbstractInternalEndpoint { private UserTokenAuthHandler userTokenHandler; public UserEndpoint() { - super("users", null); + super("users", null, null, null); } @Inject - public UserEndpoint(MeshAuthChainImpl chain, UserCrudHandler userCrudHandler, UserTokenAuthHandler userTokenHandler) { - super("users", chain); + public UserEndpoint(MeshAuthChainImpl chain, UserCrudHandler userCrudHandler, UserTokenAuthHandler userTokenHandler, LocalConfigApi localConfigApi, Database db) { + super("users", chain, localConfigApi, db); this.crudHandler = userCrudHandler; this.userTokenHandler = userTokenHandler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/utility/UtilityEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/utility/UtilityEndpoint.java index a206d7a020..171bf484ac 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/utility/UtilityEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/utility/UtilityEndpoint.java @@ -9,6 +9,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.context.InternalActionContext; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.parameter.impl.NodeParametersImpl; import com.gentics.mesh.rest.InternalEndpointRoute; import com.gentics.mesh.router.route.AbstractInternalEndpoint; @@ -21,13 +23,13 @@ public class UtilityEndpoint extends AbstractInternalEndpoint { private UtilityHandler utilityHandler; @Inject - public UtilityEndpoint(MeshAuthChainImpl chain, UtilityHandler utilityHandler) { - super("utilities", chain); + public UtilityEndpoint(MeshAuthChainImpl chain, UtilityHandler utilityHandler, LocalConfigApi localConfigApi, Database db) { + super("utilities", chain, localConfigApi, db); this.utilityHandler = utilityHandler; } public UtilityEndpoint() { - super("utilities", null); + super("utilities", null, null, null); } @Override diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/webroot/WebRootEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/webroot/WebRootEndpoint.java index b39a8dea4c..a9b78fd0ae 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/webroot/WebRootEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/webroot/WebRootEndpoint.java @@ -11,6 +11,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.http.MeshHeaders; import com.gentics.mesh.parameter.impl.ImageManipulationParametersImpl; import com.gentics.mesh.rest.InternalEndpointRoute; @@ -24,12 +26,12 @@ public class WebRootEndpoint extends AbstractProjectEndpoint { private WebRootHandler handler; public WebRootEndpoint() { - super("webroot", null, null); + super("webroot", null, null, null, null); } @Inject - public WebRootEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, WebRootHandler handler) { - super("webroot", chain, boot); + public WebRootEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, WebRootHandler handler, LocalConfigApi localConfigApi, Database db) { + super("webroot", chain, boot, localConfigApi, db); this.handler = handler; } diff --git a/core/src/main/java/com/gentics/mesh/core/endpoint/webrootfield/WebRootFieldEndpoint.java b/core/src/main/java/com/gentics/mesh/core/endpoint/webrootfield/WebRootFieldEndpoint.java index 573d877aec..a8fbef317f 100644 --- a/core/src/main/java/com/gentics/mesh/core/endpoint/webrootfield/WebRootFieldEndpoint.java +++ b/core/src/main/java/com/gentics/mesh/core/endpoint/webrootfield/WebRootFieldEndpoint.java @@ -7,6 +7,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.http.MeshHeaders; import com.gentics.mesh.parameter.impl.ImageManipulationParametersImpl; import com.gentics.mesh.parameter.impl.VersioningParametersImpl; @@ -24,12 +26,12 @@ public class WebRootFieldEndpoint extends AbstractProjectEndpoint { private WebRootFieldHandler handler; public WebRootFieldEndpoint() { - super("webrootfield", null, null); + super("webrootfield", null, null, null, null); } @Inject - public WebRootFieldEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, WebRootFieldHandler handler) { - super("webrootfield", chain, boot); + public WebRootFieldEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, WebRootFieldHandler handler, LocalConfigApi localConfigApi, Database db) { + super("webrootfield", chain, boot, localConfigApi, db); this.handler = handler; } diff --git a/core/src/main/java/com/gentics/mesh/rest/MeshLocalClientImpl.java b/core/src/main/java/com/gentics/mesh/rest/MeshLocalClientImpl.java index 412fcc78f7..06bd71d9c8 100644 --- a/core/src/main/java/com/gentics/mesh/rest/MeshLocalClientImpl.java +++ b/core/src/main/java/com/gentics/mesh/rest/MeshLocalClientImpl.java @@ -147,75 +147,83 @@ public class MeshLocalClientImpl implements MeshLocalClient { public MeshAuthUser user; - @Inject - public UserCrudHandler userCrudHandler; + protected final UserCrudHandler userCrudHandler; - @Inject - public RoleCrudHandlerImpl roleCrudHandler; + protected final RoleCrudHandlerImpl roleCrudHandler; - @Inject - public GroupCrudHandler groupCrudHandler; + protected final GroupCrudHandler groupCrudHandler; - @Inject - public SchemaCrudHandler schemaCrudHandler; + protected final SchemaCrudHandler schemaCrudHandler; - @Inject - public MicroschemaCrudHandler microschemaCrudHandler; + protected final MicroschemaCrudHandler microschemaCrudHandler; - @Inject - public TagCrudHandler tagCrudHandler; + protected final TagCrudHandler tagCrudHandler; - @Inject - public TagFamilyCrudHandler tagFamilyCrudHandler; + protected final TagFamilyCrudHandler tagFamilyCrudHandler; - @Inject - public ProjectCrudHandler projectCrudHandler; + protected final ProjectCrudHandler projectCrudHandler; - @Inject - public NodeCrudHandler nodeCrudHandler; + protected final NodeCrudHandler nodeCrudHandler; - @Inject - public BinaryUploadHandlerImpl fieldAPIHandler; + protected final BinaryUploadHandlerImpl fieldAPIHandler; - @Inject - public S3BinaryUploadHandlerImpl s3fieldAPIHandler; + protected final S3BinaryUploadHandlerImpl s3fieldAPIHandler; - @Inject - public S3BinaryMetadataExtractionHandlerImpl s3BinaryMetadataExtractionHandler; + protected final S3BinaryMetadataExtractionHandlerImpl s3BinaryMetadataExtractionHandler; - @Inject - public WebRootHandler webrootHandler; + protected final WebRootHandler webrootHandler; - @Inject - public WebRootFieldHandler webrootFieldHandler; + protected final WebRootFieldHandler webrootFieldHandler; - @Inject - public AdminHandler adminHandler; + protected final AdminHandler adminHandler; - @Inject - public AdminIndexHandler adminIndexHandler; + protected final AdminIndexHandler adminIndexHandler; - @Inject - public AuthenticationRestHandler authRestHandler; + protected final AuthenticationRestHandler authRestHandler; - @Inject - public UtilityHandler utilityHandler; + protected final UtilityHandler utilityHandler; - @Inject - public BranchCrudHandler branchCrudHandler; + protected final BranchCrudHandler branchCrudHandler; - @Inject - public PluginHandler pluginHandler; + protected final PluginHandler pluginHandler; - @Inject - public Vertx vertx; + protected final Vertx vertx; - @Inject - public BootstrapInitializer boot; + protected final BootstrapInitializer boot; @Inject - public MeshLocalClientImpl() { - + public MeshLocalClientImpl(UserCrudHandler userCrudHandler, RoleCrudHandlerImpl roleCrudHandler, + GroupCrudHandler groupCrudHandler, SchemaCrudHandler schemaCrudHandler, + MicroschemaCrudHandler microschemaCrudHandler, TagCrudHandler tagCrudHandler, + TagFamilyCrudHandler tagFamilyCrudHandler, ProjectCrudHandler projectCrudHandler, + NodeCrudHandler nodeCrudHandler, BinaryUploadHandlerImpl fieldAPIHandler, + S3BinaryUploadHandlerImpl s3fieldAPIHandler, + S3BinaryMetadataExtractionHandlerImpl s3BinaryMetadataExtractionHandler, WebRootHandler webrootHandler, + WebRootFieldHandler webrootFieldHandler, AdminHandler adminHandler, AdminIndexHandler adminIndexHandler, + AuthenticationRestHandler authRestHandler, UtilityHandler utilityHandler, + BranchCrudHandler branchCrudHandler, PluginHandler pluginHandler, Vertx vertx, BootstrapInitializer boot) { + this.userCrudHandler = userCrudHandler; + this.roleCrudHandler = roleCrudHandler; + this.groupCrudHandler = groupCrudHandler; + this.schemaCrudHandler = schemaCrudHandler; + this.microschemaCrudHandler = microschemaCrudHandler; + this.tagCrudHandler = tagCrudHandler; + this.tagFamilyCrudHandler = tagFamilyCrudHandler; + this.projectCrudHandler = projectCrudHandler; + this.nodeCrudHandler = nodeCrudHandler; + this.fieldAPIHandler = fieldAPIHandler; + this.s3fieldAPIHandler = s3fieldAPIHandler; + this.s3BinaryMetadataExtractionHandler = s3BinaryMetadataExtractionHandler; + this.webrootHandler = webrootHandler; + this.webrootFieldHandler = webrootFieldHandler; + this.adminHandler = adminHandler; + this.adminIndexHandler = adminIndexHandler; + this.authRestHandler = authRestHandler; + this.utilityHandler = utilityHandler; + this.branchCrudHandler = branchCrudHandler; + this.pluginHandler = pluginHandler; + this.vertx = vertx; + this.boot = boot; } private Map projects = new HashMap<>(); diff --git a/core/src/main/java/com/gentics/mesh/rest/RestAPIVerticle.java b/core/src/main/java/com/gentics/mesh/rest/RestAPIVerticle.java index e7a406134c..4c09bd0f4c 100644 --- a/core/src/main/java/com/gentics/mesh/rest/RestAPIVerticle.java +++ b/core/src/main/java/com/gentics/mesh/rest/RestAPIVerticle.java @@ -67,101 +67,116 @@ public class RestAPIVerticle extends AbstractVerticle { private HttpServer httpServer; - @Inject - public Provider routerStorage; + protected final Provider routerStorage; - @Inject - public Provider userEndpoint; + protected final Provider userEndpoint; - @Inject - public Provider roleEndpoint; + protected final Provider roleEndpoint; - @Inject - public Provider groupEndpoint; + protected final Provider groupEndpoint; - @Inject - public Provider projectEndpoint; + protected final Provider projectEndpoint; - @Inject - public Provider nodeEndpoint; + protected final Provider nodeEndpoint; - @Inject - public Provider tagFamilyEndpoint; + protected final Provider tagFamilyEndpoint; - @Inject - public Provider branchEndpoint; + protected final Provider branchEndpoint; - @Inject - public Provider schemaEndpoint; + protected final Provider schemaEndpoint; - @Inject - public Provider projectSearchEndpoint; + protected final Provider projectSearchEndpoint; - @Inject - public Provider projectRawSearchEndpoint; + protected final Provider projectRawSearchEndpoint; - @Inject - public Provider projectSchemaEndpoint; + protected final Provider projectSchemaEndpoint; - @Inject - public Provider projectInfoEndpoint; + protected final Provider projectInfoEndpoint; - @Inject - public Provider projectMicroschemaEndpoint; + protected final Provider projectMicroschemaEndpoint; - @Inject - public Provider webrootEndpoint; + protected final Provider webrootEndpoint; - @Inject - public Provider webrootFieldEndpoint; + protected final Provider webrootFieldEndpoint; - @Inject - public Provider restInfoEndpoint; + protected final Provider restInfoEndpoint; - @Inject - public Provider utilityEndpoint; + protected final Provider utilityEndpoint; - @Inject - public Provider microschemaEndpoint; + protected final Provider microschemaEndpoint; - @Inject - public Provider eventbusEndpoint; + protected final Provider eventbusEndpoint; - @Inject - public Provider navrootEndpoint; + protected final Provider navrootEndpoint; - @Inject - public Provider authenticationEndpoint; + protected final Provider authenticationEndpoint; - @Inject - public Provider searchEndpoint; + protected final Provider searchEndpoint; - @Inject - public Provider rawSearchEndpoint; + protected final Provider rawSearchEndpoint; - @Inject - public Provider graphqlEndpoint; + protected final Provider graphqlEndpoint; - @Inject - public Provider adminEndpoint; + protected final Provider adminEndpoint; - @Inject - public Provider healthEndpoint; + protected final Provider healthEndpoint; - @Inject - public RouterStorageRegistryImpl routerStorageRegistry; + protected final RouterStorageRegistryImpl routerStorageRegistry; - @Inject - public io.vertx.reactivex.core.Vertx rxVertx; + protected final io.vertx.reactivex.core.Vertx rxVertx; - @Inject - public Vertx vertx; + protected final Vertx vertx; - @Inject - public MeshOptions meshOptions; + protected final MeshOptions meshOptions; @Inject - public RestAPIVerticle() { + public RestAPIVerticle(Provider routerStorage, Provider userEndpoint, + Provider roleEndpoint, Provider groupEndpoint, + Provider projectEndpoint, Provider nodeEndpoint, + Provider tagFamilyEndpoint, Provider branchEndpoint, + Provider schemaEndpoint, Provider projectSearchEndpoint, + Provider projectRawSearchEndpoint, + Provider projectSchemaEndpoint, Provider projectInfoEndpoint, + Provider projectMicroschemaEndpoint, Provider webrootEndpoint, + Provider webrootFieldEndpoint, Provider restInfoEndpoint, + Provider utilityEndpoint, Provider microschemaEndpoint, + Provider eventbusEndpoint, Provider navrootEndpoint, + Provider authenticationEndpoint, Provider searchEndpoint, + Provider rawSearchEndpoint, Provider graphqlEndpoint, + Provider adminEndpoint, Provider healthEndpoint, + RouterStorageRegistryImpl routerStorageRegistry, io.vertx.reactivex.core.Vertx rxVertx, Vertx vertx, + MeshOptions meshOptions) { + this.routerStorage = routerStorage; + this.userEndpoint = userEndpoint; + this.roleEndpoint = roleEndpoint; + this.groupEndpoint = groupEndpoint; + this.projectEndpoint = projectEndpoint; + this.nodeEndpoint = nodeEndpoint; + this.tagFamilyEndpoint = tagFamilyEndpoint; + this.branchEndpoint = branchEndpoint; + this.schemaEndpoint = schemaEndpoint; + this.projectSearchEndpoint = projectSearchEndpoint; + this.projectRawSearchEndpoint = projectRawSearchEndpoint; + this.projectSchemaEndpoint = projectSchemaEndpoint; + this.projectInfoEndpoint = projectInfoEndpoint; + this.projectMicroschemaEndpoint = projectMicroschemaEndpoint; + this.webrootEndpoint = webrootEndpoint; + this.webrootFieldEndpoint = webrootFieldEndpoint; + this.restInfoEndpoint = restInfoEndpoint; + this.utilityEndpoint = utilityEndpoint; + this.microschemaEndpoint = microschemaEndpoint; + this.eventbusEndpoint = eventbusEndpoint; + this.navrootEndpoint = navrootEndpoint; + this.authenticationEndpoint = authenticationEndpoint; + this.searchEndpoint = searchEndpoint; + this.rawSearchEndpoint = rawSearchEndpoint; + this.graphqlEndpoint = graphqlEndpoint; + this.adminEndpoint = adminEndpoint; + this.healthEndpoint = healthEndpoint; + this.routerStorageRegistry = routerStorageRegistry; + this.rxVertx = rxVertx; + this.vertx = vertx; + this.meshOptions = meshOptions; } @Override diff --git a/core/src/main/java/com/gentics/mesh/search/ProjectRawSearchEndpointImpl.java b/core/src/main/java/com/gentics/mesh/search/ProjectRawSearchEndpointImpl.java index 507ed59098..676e105323 100644 --- a/core/src/main/java/com/gentics/mesh/search/ProjectRawSearchEndpointImpl.java +++ b/core/src/main/java/com/gentics/mesh/search/ProjectRawSearchEndpointImpl.java @@ -4,6 +4,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.router.route.AbstractProjectEndpoint; import com.gentics.mesh.search.index.node.NodeSearchHandler; import com.gentics.mesh.search.index.tag.TagSearchHandler; @@ -14,22 +16,27 @@ */ public class ProjectRawSearchEndpointImpl extends AbstractProjectEndpoint implements SearchEndpoint { - @Inject - public NodeSearchHandler nodeSearchHandler; + protected final NodeSearchHandler nodeSearchHandler; - @Inject - public TagSearchHandler tagSearchHandler; + protected final TagSearchHandler tagSearchHandler; - @Inject - public TagFamilySearchHandler tagFamilySearchHandler; + protected final TagFamilySearchHandler tagFamilySearchHandler; public ProjectRawSearchEndpointImpl() { - super("rawSearch", null, null); + super("rawSearch", null, null, null, null); + this.nodeSearchHandler = null; + this.tagSearchHandler = null; + this.tagFamilySearchHandler = null; } @Inject - public ProjectRawSearchEndpointImpl(MeshAuthChainImpl chain, BootstrapInitializer boot) { - super("rawSearch", chain, boot); + public ProjectRawSearchEndpointImpl(MeshAuthChainImpl chain, BootstrapInitializer boot, + NodeSearchHandler nodeSearchHandler, TagSearchHandler tagSearchHandler, + TagFamilySearchHandler tagFamilySearchHandler, LocalConfigApi localConfigApi, Database db) { + super("rawSearch", chain, boot, localConfigApi, db); + this.nodeSearchHandler = nodeSearchHandler; + this.tagSearchHandler = tagSearchHandler; + this.tagFamilySearchHandler = tagFamilySearchHandler; } @Override diff --git a/core/src/main/java/com/gentics/mesh/search/ProjectSearchEndpointImpl.java b/core/src/main/java/com/gentics/mesh/search/ProjectSearchEndpointImpl.java index 05873fcd4f..5be633a15a 100644 --- a/core/src/main/java/com/gentics/mesh/search/ProjectSearchEndpointImpl.java +++ b/core/src/main/java/com/gentics/mesh/search/ProjectSearchEndpointImpl.java @@ -16,6 +16,7 @@ import com.gentics.mesh.core.data.tag.HibTag; import com.gentics.mesh.core.db.Database; import com.gentics.mesh.core.db.Tx; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.core.rest.common.ListResponse; import com.gentics.mesh.core.rest.common.RestModel; import com.gentics.mesh.core.rest.node.NodeListResponse; @@ -41,7 +42,7 @@ public class ProjectSearchEndpointImpl extends AbstractProjectEndpoint implement public final TagFamilySearchHandler tagFamilySearchHandler; public ProjectSearchEndpointImpl() { - super("search", null, null); + super("search", null, null, null, null); this.db = null; this.nodeSearchHandler = null; this.tagSearchHandler = null; @@ -50,8 +51,8 @@ public ProjectSearchEndpointImpl() { @Inject public ProjectSearchEndpointImpl(MeshAuthChainImpl chain, BootstrapInitializer boot, Database db, TagFamilySearchHandler tagFamilySearchHandler, - TagSearchHandler tagSearchHandler, NodeSearchHandler nodeSearchHandler) { - super("search", chain, boot); + TagSearchHandler tagSearchHandler, NodeSearchHandler nodeSearchHandler, LocalConfigApi localConfigApi) { + super("search", chain, boot, localConfigApi, db); this.db = db; this.nodeSearchHandler = nodeSearchHandler; this.tagSearchHandler = tagSearchHandler; diff --git a/core/src/main/java/com/gentics/mesh/search/RawSearchEndpointImpl.java b/core/src/main/java/com/gentics/mesh/search/RawSearchEndpointImpl.java index 276f1ebb91..bc48df19e8 100644 --- a/core/src/main/java/com/gentics/mesh/search/RawSearchEndpointImpl.java +++ b/core/src/main/java/com/gentics/mesh/search/RawSearchEndpointImpl.java @@ -3,6 +3,8 @@ import javax.inject.Inject; import com.gentics.mesh.auth.MeshAuthChainImpl; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.router.route.AbstractInternalEndpoint; import com.gentics.mesh.search.index.AdminIndexHandler; import com.gentics.mesh.search.index.group.GroupSearchHandler; @@ -23,43 +25,61 @@ */ public class RawSearchEndpointImpl extends AbstractInternalEndpoint implements SearchEndpoint { - @Inject - AdminIndexHandler adminHandler; + protected final AdminIndexHandler adminHandler; - @Inject - UserSearchHandler userSearchHandler; + protected final UserSearchHandler userSearchHandler; - @Inject - GroupSearchHandler groupSearchHandler; + protected final GroupSearchHandler groupSearchHandler; - @Inject - RoleSearchHandler roleSearchHandler; + protected final RoleSearchHandler roleSearchHandler; - @Inject - NodeSearchHandler nodeSearchHandler; + protected final NodeSearchHandler nodeSearchHandler; - @Inject - TagSearchHandler tagSearchHandler; + protected final TagSearchHandler tagSearchHandler; - @Inject - TagFamilySearchHandler tagFamilySearchHandler; + protected final TagFamilySearchHandler tagFamilySearchHandler; - @Inject - ProjectSearchHandler projectSearchHandler; + protected final ProjectSearchHandler projectSearchHandler; - @Inject - SchemaSearchHandler schemaContainerSearchHandler; + protected final SchemaSearchHandler schemaContainerSearchHandler; - @Inject - MicroschemaSearchHandler microschemaContainerSearchHandler; + protected final MicroschemaSearchHandler microschemaContainerSearchHandler; @Inject - public RawSearchEndpointImpl(MeshAuthChainImpl chain, NodeSearchHandler searchHandler) { - super("rawSearch", chain); + public RawSearchEndpointImpl(MeshAuthChainImpl chain, NodeSearchHandler searchHandler, + AdminIndexHandler adminHandler, UserSearchHandler userSearchHandler, GroupSearchHandler groupSearchHandler, + RoleSearchHandler roleSearchHandler, + NodeSearchHandler nodeSearchHandler, + TagSearchHandler tagSearchHandler, + TagFamilySearchHandler tagFamilySearchHandler, + ProjectSearchHandler projectSearchHandler, + SchemaSearchHandler schemaContainerSearchHandler, + MicroschemaSearchHandler microschemaContainerSearchHandler, LocalConfigApi localConfigApi, Database db) { + super("rawSearch", chain, localConfigApi, db); + this.adminHandler = adminHandler; + this.userSearchHandler = userSearchHandler; + this.groupSearchHandler = groupSearchHandler; + this.roleSearchHandler = roleSearchHandler; + this.nodeSearchHandler = nodeSearchHandler; + this.tagSearchHandler = tagSearchHandler; + this.tagFamilySearchHandler = tagFamilySearchHandler; + this.projectSearchHandler = projectSearchHandler; + this.schemaContainerSearchHandler = schemaContainerSearchHandler; + this.microschemaContainerSearchHandler = microschemaContainerSearchHandler; } public RawSearchEndpointImpl() { - super("rawSearch", null); + super("rawSearch", null, null, null); + this.adminHandler = null; + this.userSearchHandler = null; + this.groupSearchHandler = null; + this.roleSearchHandler = null; + this.nodeSearchHandler = null; + this.tagSearchHandler = null; + this.tagFamilySearchHandler = null; + this.projectSearchHandler = null; + this.schemaContainerSearchHandler = null; + this.microschemaContainerSearchHandler = null; } @Override diff --git a/core/src/main/java/com/gentics/mesh/search/SearchEndpointImpl.java b/core/src/main/java/com/gentics/mesh/search/SearchEndpointImpl.java index 49425a2c57..c0888bc0b1 100644 --- a/core/src/main/java/com/gentics/mesh/search/SearchEndpointImpl.java +++ b/core/src/main/java/com/gentics/mesh/search/SearchEndpointImpl.java @@ -15,6 +15,7 @@ import com.gentics.mesh.core.data.node.HibNode; import com.gentics.mesh.core.db.Database; import com.gentics.mesh.core.db.Tx; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.core.rest.common.ListResponse; import com.gentics.mesh.core.rest.common.RestModel; import com.gentics.mesh.core.rest.group.GroupListResponse; @@ -47,46 +48,58 @@ */ public class SearchEndpointImpl extends AbstractInternalEndpoint implements SearchEndpoint { - @Inject - AdminIndexHandler adminHandler; - - @Inject - UserSearchHandler userSearchHandler; + protected final AdminIndexHandler adminHandler; - @Inject - GroupSearchHandler groupSearchHandler; + protected final UserSearchHandler userSearchHandler; - @Inject - RoleSearchHandler roleSearchHandler; + protected final GroupSearchHandler groupSearchHandler; - @Inject - NodeSearchHandler nodeSearchHandler; + protected final RoleSearchHandler roleSearchHandler; - @Inject - TagSearchHandler tagSearchHandler; + protected final NodeSearchHandler nodeSearchHandler; - @Inject - TagFamilySearchHandler tagFamilySearchHandler; + protected final TagSearchHandler tagSearchHandler; - @Inject - ProjectSearchHandler projectSearchHandler; + protected final TagFamilySearchHandler tagFamilySearchHandler; - @Inject - SchemaSearchHandler schemaContainerSearchHandler; + protected final ProjectSearchHandler projectSearchHandler; - @Inject - MicroschemaSearchHandler microschemaContainerSearchHandler; + protected final SchemaSearchHandler schemaContainerSearchHandler; - @Inject - Database db; + protected final MicroschemaSearchHandler microschemaContainerSearchHandler; @Inject - public SearchEndpointImpl(MeshAuthChainImpl chain, NodeSearchHandler searchHandler) { - super("search", chain); + public SearchEndpointImpl(MeshAuthChainImpl chain, NodeSearchHandler searchHandler, AdminIndexHandler adminHandler, + UserSearchHandler userSearchHandler, GroupSearchHandler groupSearchHandler, + RoleSearchHandler roleSearchHandler, NodeSearchHandler nodeSearchHandler, TagSearchHandler tagSearchHandler, + TagFamilySearchHandler tagFamilySearchHandler, ProjectSearchHandler projectSearchHandler, + SchemaSearchHandler schemaContainerSearchHandler, + MicroschemaSearchHandler microschemaContainerSearchHandler, LocalConfigApi localConfigApi, Database db) { + super("search", chain, localConfigApi, db); + this.adminHandler = adminHandler; + this.userSearchHandler = userSearchHandler; + this.groupSearchHandler = groupSearchHandler; + this.roleSearchHandler = roleSearchHandler; + this.nodeSearchHandler = nodeSearchHandler; + this.tagSearchHandler = tagSearchHandler; + this.tagFamilySearchHandler = tagFamilySearchHandler; + this.projectSearchHandler = projectSearchHandler; + this.schemaContainerSearchHandler = schemaContainerSearchHandler; + this.microschemaContainerSearchHandler = microschemaContainerSearchHandler; } public SearchEndpointImpl() { - super("search", null); + super("search", null, null, null); + this.adminHandler = null; + this.userSearchHandler = null; + this.groupSearchHandler = null; + this.roleSearchHandler = null; + this.nodeSearchHandler = null; + this.tagSearchHandler = null; + this.tagFamilySearchHandler = null; + this.projectSearchHandler = null; + this.schemaContainerSearchHandler = null; + this.microschemaContainerSearchHandler = null; } @Override diff --git a/demo/common/src/main/java/com/gentics/mesh/demo/verticle/DemoAppEndpoint.java b/demo/common/src/main/java/com/gentics/mesh/demo/verticle/DemoAppEndpoint.java index 1051d83d21..628749231c 100644 --- a/demo/common/src/main/java/com/gentics/mesh/demo/verticle/DemoAppEndpoint.java +++ b/demo/common/src/main/java/com/gentics/mesh/demo/verticle/DemoAppEndpoint.java @@ -16,7 +16,7 @@ public class DemoAppEndpoint extends AbstractInternalEndpoint { public DemoAppEndpoint(MeshOptions options) { - super("demo", null); + super("demo", null, null, null); } @Override diff --git a/elasticsearch/src/main/java/com/gentics/mesh/search/index/group/GroupIndexHandlerImpl.java b/elasticsearch/src/main/java/com/gentics/mesh/search/index/group/GroupIndexHandlerImpl.java index 60c615accc..728a03b4bc 100644 --- a/elasticsearch/src/main/java/com/gentics/mesh/search/index/group/GroupIndexHandlerImpl.java +++ b/elasticsearch/src/main/java/com/gentics/mesh/search/index/group/GroupIndexHandlerImpl.java @@ -32,16 +32,16 @@ @Singleton public class GroupIndexHandlerImpl extends AbstractIndexHandler implements GroupIndexHandler { - @Inject - GroupTransformer transformer; + protected final GroupTransformer transformer; - @Inject - GroupMappingProvider mappingProvider; + protected final GroupMappingProvider mappingProvider; @Inject public GroupIndexHandlerImpl(SearchProvider searchProvider, Database db, MeshHelper helper, MeshOptions options, - SyncMetersFactory syncMetersFactory, BucketManager bucketManager) { + SyncMetersFactory syncMetersFactory, BucketManager bucketManager, GroupTransformer transformer, GroupMappingProvider mappingProvider) { super(searchProvider, db, helper, options, syncMetersFactory, bucketManager); + this.transformer = transformer; + this.mappingProvider = mappingProvider; } @Override diff --git a/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/cli/OrientDBBootstrapInitializerImpl.java b/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/cli/OrientDBBootstrapInitializerImpl.java index 984f815284..2f7c4940aa 100644 --- a/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/cli/OrientDBBootstrapInitializerImpl.java +++ b/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/cli/OrientDBBootstrapInitializerImpl.java @@ -42,7 +42,6 @@ import com.tinkerpop.blueprints.util.wrappers.wrapped.WrappedVertex; import io.reactivex.Completable; -import io.vertx.core.Vertx; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; @@ -51,11 +50,9 @@ public class OrientDBBootstrapInitializerImpl extends AbstractBootstrapInitializ private static Logger log = LoggerFactory.getLogger(OrientDBBootstrapInitializerImpl.class); - @Inject - public ChangelogSystem changelogSystem; + protected final ChangelogSystem changelogSystem; - @Inject - public OrientDBDatabase db; + protected OrientDBDatabase db; private MeshRoot meshRoot; @@ -79,10 +76,12 @@ public class OrientDBBootstrapInitializerImpl extends AbstractBootstrapInitializ }); @Inject - public OrientDBBootstrapInitializerImpl() { + public OrientDBBootstrapInitializerImpl(ChangelogSystem changelogSystem, OrientDBDatabase db) { super(); + this.changelogSystem = changelogSystem; + this.db = db; } - + @Override public void initDatabaseTypes() { // Update graph indices and vertex types (This may take some time) diff --git a/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/core/endpoint/admin/OrientDBAdminHandler.java b/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/core/endpoint/admin/OrientDBAdminHandler.java index 5efc70ec34..2e6ff390b4 100644 --- a/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/core/endpoint/admin/OrientDBAdminHandler.java +++ b/mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/core/endpoint/admin/OrientDBAdminHandler.java @@ -144,11 +144,15 @@ public void handleExport(InternalActionContext ac) { if (!ac.getUser().isAdmin()) { throw error(FORBIDDEN, "error_admin_permission_required"); } + Mesh mesh = boot.mesh(); + MeshStatus oldStatus = mesh.getStatus(); + mesh.setStatus(MeshStatus.BACKUP); String exportDir = ((OrientDBMeshOptions)options).getStorageOptions().getExportDirectory(); log.debug("Exporting graph to {" + exportDir + "}"); vertx.eventBus().publish(GRAPH_EXPORT_START.address, null); db.exportDatabase(exportDir); vertx.eventBus().publish(GRAPH_EXPORT_FINISHED.address, null); + mesh.setStatus(oldStatus); return message(ac, "export_finished"); }, model -> ac.send(model, OK)); } @@ -166,14 +170,16 @@ public void handleImport(InternalActionContext ac) { File latestFile = Arrays.asList(importsDir.listFiles()).stream().filter(file -> file.getName().endsWith(".gz")) .sorted(comparing(File::lastModified)).reduce((first, second) -> second).orElseGet(() -> null); try { - + Mesh mesh = boot.mesh(); + MeshStatus oldStatus = mesh.getStatus(); + mesh.setStatus(MeshStatus.RESTORE); vertx.eventBus().publish(GRAPH_IMPORT_START.address, null); db.importDatabase(latestFile.getAbsolutePath()); boot.globalCacheClear(); // TODO apply changelog after import // TODO flush references, clear & init project routers vertx.eventBus().publish(GRAPH_IMPORT_FINISHED.address, null); - + mesh.setStatus(oldStatus); Single.just(message(ac, "import_finished")).subscribe(model -> ac.send(model, OK), ac::fail); } catch (IOException e) { ac.fail(e); diff --git a/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUI2Endpoint.java b/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUI2Endpoint.java index ba11d12122..ea21bb2aa2 100644 --- a/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUI2Endpoint.java +++ b/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUI2Endpoint.java @@ -43,7 +43,7 @@ public class AdminGUI2Endpoint extends AbstractInternalEndpoint { private final MeshOptions options; public AdminGUI2Endpoint(MeshOptions options) { - super("mesh-ui", null); + super("mesh-ui", null, null, null); this.options = options; } diff --git a/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUIEndpoint.java b/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUIEndpoint.java index e82d63f102..ffa2c9ce9c 100644 --- a/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUIEndpoint.java +++ b/verticles/admin-gui/src/main/java/com/gentics/mesh/verticle/admin/AdminGUIEndpoint.java @@ -43,7 +43,7 @@ public class AdminGUIEndpoint extends AbstractInternalEndpoint { private final MeshOptions options; public AdminGUIEndpoint(MeshOptions options) { - super("mesh-ui-v1", null); + super("mesh-ui-v1", null, null, null); this.options = options; } diff --git a/verticles/graphql/src/main/java/com/gentics/mesh/graphql/GraphQLEndpoint.java b/verticles/graphql/src/main/java/com/gentics/mesh/graphql/GraphQLEndpoint.java index ebc459fe6d..5de0aa6e1b 100644 --- a/verticles/graphql/src/main/java/com/gentics/mesh/graphql/GraphQLEndpoint.java +++ b/verticles/graphql/src/main/java/com/gentics/mesh/graphql/GraphQLEndpoint.java @@ -8,6 +8,8 @@ import com.gentics.mesh.auth.MeshAuthChainImpl; import com.gentics.mesh.cli.BootstrapInitializer; +import com.gentics.mesh.core.db.Database; +import com.gentics.mesh.core.endpoint.admin.LocalConfigApi; import com.gentics.mesh.graphql.context.GraphQLContext; import com.gentics.mesh.graphql.context.impl.GraphQLContextImpl; import com.gentics.mesh.parameter.impl.SearchParametersImpl; @@ -25,12 +27,12 @@ public class GraphQLEndpoint extends AbstractProjectEndpoint { private GraphQLHandler queryHandler; public GraphQLEndpoint() { - super("graphql", null, null); + super("graphql", null, null, null, null); } @Inject - public GraphQLEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, GraphQLHandler queryHandler) { - super("graphql", chain, boot); + public GraphQLEndpoint(MeshAuthChainImpl chain, BootstrapInitializer boot, GraphQLHandler queryHandler, LocalConfigApi localConfigApi, Database db) { + super("graphql", chain, boot, localConfigApi, db); this.queryHandler = queryHandler; }