Merge pull request #85 from Kingsrook/feature/backend-module-self-registration

Feature/backend module self registration
This commit is contained in:
2024-04-18 09:07:30 -05:00
committed by GitHub
17 changed files with 52 additions and 83 deletions

View File

@ -32,6 +32,7 @@ import com.kingsrook.qqq.backend.core.actions.interfaces.UpdateInterface;
import com.kingsrook.qqq.backend.core.logging.QLogger;
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableBackendDetails;
import com.kingsrook.qqq.backend.core.modules.backend.QBackendModuleDispatcher;
import com.kingsrook.qqq.backend.core.modules.backend.QBackendModuleInterface;
import com.kingsrook.qqq.backend.module.filesystem.base.FilesystemBackendModuleInterface;
import com.kingsrook.qqq.backend.module.filesystem.base.actions.AbstractBaseFilesystemAction;
@ -55,6 +56,10 @@ public class FilesystemBackendModule implements QBackendModuleInterface, Filesys
public static final String BACKEND_TYPE = "filesystem";
static
{
QBackendModuleDispatcher.registerBackendModule(new FilesystemBackendModule());
}
/*******************************************************************************
** For filesystem backends, get the module-specific action base-class, that helps

View File

@ -30,6 +30,7 @@ import com.kingsrook.qqq.backend.core.actions.interfaces.QueryInterface;
import com.kingsrook.qqq.backend.core.actions.interfaces.UpdateInterface;
import com.kingsrook.qqq.backend.core.model.metadata.QBackendMetaData;
import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableBackendDetails;
import com.kingsrook.qqq.backend.core.modules.backend.QBackendModuleDispatcher;
import com.kingsrook.qqq.backend.core.modules.backend.QBackendModuleInterface;
import com.kingsrook.qqq.backend.module.filesystem.base.FilesystemBackendModuleInterface;
import com.kingsrook.qqq.backend.module.filesystem.base.actions.AbstractBaseFilesystemAction;
@ -50,6 +51,10 @@ public class S3BackendModule implements QBackendModuleInterface, FilesystemBacke
{
public static final String BACKEND_TYPE = "s3";
static
{
QBackendModuleDispatcher.registerBackendModule(new S3BackendModule());
}
/*******************************************************************************
** For filesystem backends, get the module-specific action base-class, that helps

View File

@ -50,19 +50,6 @@ public class S3BackendMetaData extends AbstractFilesystemBackendMetaData
/*******************************************************************************
** Fluent setter for backendType
**
*******************************************************************************/
@Override
public S3BackendMetaData withBackendType(String backendType)
{
setBackendType(backendType);
return this;
}
/*******************************************************************************
** Getter for bucketName
**

View File

@ -40,6 +40,7 @@ import com.kingsrook.qqq.backend.core.model.metadata.tables.QTableMetaData;
import com.kingsrook.qqq.backend.core.model.session.QSession;
import com.kingsrook.qqq.backend.core.modules.authentication.implementations.MockAuthenticationModule;
import com.kingsrook.qqq.backend.core.modules.backend.implementations.memory.MemoryBackendModule;
import com.kingsrook.qqq.backend.core.modules.backend.implementations.mock.MockBackendModule;
import com.kingsrook.qqq.backend.core.processes.implementations.etl.streamed.StreamedETLProcess;
import com.kingsrook.qqq.backend.module.filesystem.base.model.metadata.Cardinality;
import com.kingsrook.qqq.backend.module.filesystem.base.model.metadata.RecordFormat;
@ -403,7 +404,7 @@ public class TestUtils
public static QBackendMetaData defineMockBackend()
{
return (new QBackendMetaData()
.withBackendType("mock")
.withBackendType(MockBackendModule.class)
.withName(BACKEND_NAME_MOCK));
}