From 180420d0081f2307b73119f38263b6cde67fbde5 Mon Sep 17 00:00:00 2001 From: amvanbaren Date: Thu, 15 Dec 2022 12:36:19 +0200 Subject: [PATCH] Web extension resources return incorrect MIME type Use [Content_Types].xml to set FileResource contentType Add test case for default content type: application/octet-stream Add migration to set FileResource.contentType Set contentType for RESOURCE type Prepend dot ('.') if extension doesn't start with a dot --- .../eclipse/openvsx/ExtensionProcessor.java | 72 +- .../openvsx/adapter/LocalVSCodeService.java | 4 +- .../openvsx/entities/FileResource.java | 12 +- .../ExtractResourcesJobRequestHandler.java | 11 +- .../migration/ExtractResourcesJobService.java | 31 - .../openvsx/migration/MigrationRunner.java | 7 + .../openvsx/migration/MigrationService.java | 54 +- .../RenameDownloadsJobRequestHandler.java | 14 +- .../migration/RenameDownloadsService.java | 10 - .../SetContentTypeJobRequestHandler.java | 63 ++ .../migration/SetContentTypeJobService.java | 35 + .../SetPreReleaseJobRequestHandler.java | 11 +- .../migration/SetPreReleaseJobService.java | 72 -- .../FileResourceJooqRepository.java | 17 +- .../repositories/RepositoryService.java | 4 + .../storage/AzureBlobStorageService.java | 20 +- .../storage/GoogleCloudStorageService.java | 20 +- .../eclipse/openvsx/storage/StorageUtil.java | 13 - .../openvsx/storage/StorageUtilService.java | 12 +- .../org/eclipse/openvsx/jooq/Indexes.java | 13 + .../org/eclipse/openvsx/jooq/Keys.java | 30 + .../org/eclipse/openvsx/jooq/Public.java | 77 +++ .../org/eclipse/openvsx/jooq/Tables.java | 66 ++ .../AdminStatisticsExtensionsByRating.java | 7 +- ...isticsPublishersByExtensionsPublished.java | 7 +- ...tatisticsTopMostActivePublishingUsers.java | 149 +++++ ...StatisticsTopMostDownloadedExtensions.java | 149 +++++ ...atisticsTopNamespaceExtensionVersions.java | 149 +++++ ...AdminStatisticsTopNamespaceExtensions.java | 149 +++++ .../eclipse/openvsx/jooq/tables/Download.java | 7 + .../openvsx/jooq/tables/Extension.java | 7 +- .../openvsx/jooq/tables/ExtensionReview.java | 13 +- .../openvsx/jooq/tables/ExtensionVersion.java | 13 +- .../openvsx/jooq/tables/FileResource.java | 22 +- .../tables/JobrunrBackgroundjobservers.java | 215 ++++++ .../openvsx/jooq/tables/JobrunrJobs.java | 184 +++++ .../openvsx/jooq/tables/JobrunrJobsStats.java | 171 +++++ .../openvsx/jooq/tables/JobrunrMetadata.java | 162 +++++ .../jooq/tables/JobrunrMigrations.java | 146 ++++ .../jooq/tables/JobrunrRecurringJobs.java | 146 ++++ .../openvsx/jooq/tables/MigrationItem.java | 151 +++++ .../jooq/tables/NamespaceMembership.java | 13 +- .../openvsx/jooq/tables/PersistedLog.java | 7 +- .../jooq/tables/PersonalAccessToken.java | 7 +- .../jooq/tables/SpringSessionAttributes.java | 7 +- ...icsTopMostActivePublishingUsersRecord.java | 170 +++++ ...ticsTopMostDownloadedExtensionsRecord.java | 170 +++++ ...csTopNamespaceExtensionVersionsRecord.java | 170 +++++ ...tatisticsTopNamespaceExtensionsRecord.java | 170 +++++ .../tables/records/FileResourceRecord.java | 57 +- .../JobrunrBackgroundjobserversRecord.java | 627 ++++++++++++++++++ .../tables/records/JobrunrJobsRecord.java | 404 +++++++++++ .../records/JobrunrJobsStatsRecord.java | 466 +++++++++++++ .../tables/records/JobrunrMetadataRecord.java | 293 ++++++++ .../records/JobrunrMigrationsRecord.java | 180 +++++ .../records/JobrunrRecurringJobsRecord.java | 180 +++++ .../tables/records/MigrationItemRecord.java | 217 ++++++ .../V1_29__FileResource_ContentType.sql | 7 + .../org/eclipse/openvsx/RegistryAPITest.java | 3 + .../openvsx/adapter/VSCodeAPITest.java | 187 +++++- .../RepositoryServiceSmokeTest.java | 1 + 61 files changed, 5598 insertions(+), 253 deletions(-) create mode 100644 server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobRequestHandler.java create mode 100644 server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobService.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java create mode 100644 server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java create mode 100644 server/src/main/resources/db/migration/V1_29__FileResource_ContentType.sql diff --git a/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java b/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java index 912affd60..e3dcbfe8d 100644 --- a/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java +++ b/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java @@ -9,6 +9,7 @@ ********************************************************************************/ package org.eclipse.openvsx; +import java.io.ByteArrayInputStream; import java.io.EOFException; import java.io.IOException; import java.nio.file.Path; @@ -26,6 +27,7 @@ import com.fasterxml.jackson.databind.node.MissingNode; import com.fasterxml.jackson.dataformat.xml.XmlMapper; +import org.apache.commons.io.FilenameUtils; import org.eclipse.openvsx.entities.ExtensionVersion; import org.eclipse.openvsx.entities.FileResource; import org.eclipse.openvsx.util.ArchiveUtil; @@ -36,6 +38,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.util.Pair; +import org.springframework.http.MediaType; +import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; /** * Processes uploaded extension files and extracts their metadata. @@ -282,17 +289,22 @@ private List getEngines(JsonNode node) { } public List getFileResources(ExtensionVersion extVersion) { - var resources = new ArrayList(); + readInputStream(); + var contentTypes = loadContentTypes(); var mappers = List.>of( this::getManifest, this::getReadme, this::getChangelog, this::getLicense, this::getIcon ); - mappers.forEach(mapper -> Optional.of(extVersion).map(mapper).ifPresent(resources::add)); - return resources; + return mappers.stream() + .map(mapper -> mapper.apply(extVersion)) + .filter(Objects::nonNull) + .map(resource -> setContentType(resource, contentTypes)) + .collect(Collectors.toList()); } public void processEachResource(ExtensionVersion extVersion, Consumer processor) { readInputStream(); + var contentTypes = loadContentTypes(); zipFile.stream() .filter(zipEntry -> !zipEntry.isDirectory()) .map(zipEntry -> { @@ -311,6 +323,7 @@ public void processEachResource(ExtensionVersion extVersion, Consumer loadContentTypes() { + var bytes = ArchiveUtil.readEntry(zipFile, "[Content_Types].xml"); + var contentTypes = parseContentTypesXml(bytes); + contentTypes.putIfAbsent(".vsix", "application/zip"); + return contentTypes; + } + + private Map parseContentTypesXml(byte[] content) { + var contentTypes = new HashMap(); + try (var input = new ByteArrayInputStream(content)) { + var document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(input); + var elements = document.getDocumentElement().getElementsByTagName("Default"); + for(var i = 0; i < elements.getLength(); i++) { + var element = elements.item(i); + var attributes = element.getAttributes(); + var extension = attributes.getNamedItem("Extension").getTextContent(); + if(!extension.startsWith(".")) { + extension = "." + extension; + } + + var contentType = attributes.getNamedItem("ContentType").getTextContent(); + contentTypes.put(extension, contentType); + } + } catch (IOException | ParserConfigurationException | SAXException e) { + logger.error("failed to read content types", e); + contentTypes.clear(); + } + + return contentTypes; + } + + private FileResource setContentType(FileResource resource, Map contentTypes) { + var fileExtension = FilenameUtils.getExtension(resource.getName()); + var contentType = contentTypes.getOrDefault(fileExtension, MediaType.APPLICATION_OCTET_STREAM_VALUE); + resource.setContentType(contentType); + return resource; + } + private void detectLicense(byte[] content, ExtensionVersion extVersion) { if (Strings.isNullOrEmpty(extVersion.getLicense())) { var detection = new LicenseDetection(); @@ -425,9 +474,7 @@ private Pair readFromAlternateNames(String[] names) { var entry = ArchiveUtil.getEntryIgnoreCase(zipFile, name); if (entry != null) { var bytes = ArchiveUtil.readEntry(zipFile, entry); - var lastSegmentIndex = entry.getName().lastIndexOf('/'); - var lastSegment = entry.getName().substring(lastSegmentIndex + 1); - return Pair.of(bytes, lastSegment); + return Pair.of(bytes, FilenameUtils.getName(entry.getName())); } } return null; @@ -442,13 +489,10 @@ protected FileResource getIcon(ExtensionVersion extVersion) { var bytes = ArchiveUtil.readEntry(zipFile, "extension/" + iconPathStr); if (bytes == null) return null; + var icon = new FileResource(); icon.setExtension(extVersion); - var fileNameIndex = iconPathStr.lastIndexOf('/'); - if (fileNameIndex >= 0) - icon.setName(iconPathStr.substring(fileNameIndex + 1)); - else - icon.setName(iconPathStr); + icon.setName(FilenameUtils.getName(iconPathStr)); icon.setType(FileResource.ICON); icon.setContent(bytes); return icon; diff --git a/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java b/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java index c68ccdb96..a0ff54479 100644 --- a/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java +++ b/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java @@ -31,8 +31,6 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import javax.transaction.Transactional; - import static org.eclipse.openvsx.adapter.ExtensionQueryParam.Criterion.*; import static org.eclipse.openvsx.adapter.ExtensionQueryParam.*; import static org.eclipse.openvsx.adapter.ExtensionQueryResult.Extension.FLAG_PREVIEW; @@ -404,7 +402,7 @@ private ResponseEntity browseFile( String version ) { if (resource.getStorageType().equals(FileResource.STORAGE_DB)) { - var headers = storageUtil.getFileResponseHeaders(resource.getName()); + var headers = storageUtil.getFileResponseHeaders(resource); return new ResponseEntity<>(resource.getContent(), headers, HttpStatus.OK); } else { var namespace = new Namespace(); diff --git a/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java b/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java index 4b87db181..2c077f5aa 100644 --- a/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java +++ b/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java @@ -9,8 +9,6 @@ ********************************************************************************/ package org.eclipse.openvsx.entities; -import org.hibernate.annotations.Fetch; - import javax.persistence.*; @Entity @@ -45,6 +43,8 @@ public class FileResource { @Basic(fetch = FetchType.LAZY) byte[] content; + String contentType; + @Column(length = 32) String storageType; @@ -88,6 +88,14 @@ public void setContent(byte[] content) { this.content = content; } + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + public String getStorageType() { return storageType; } diff --git a/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobRequestHandler.java index da3d0619f..209f08896 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobRequestHandler.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobRequestHandler.java @@ -10,8 +10,8 @@ package org.eclipse.openvsx.migration; import org.eclipse.openvsx.ExtensionProcessor; +import org.eclipse.openvsx.entities.ExtensionVersion; import org.jobrunr.jobs.annotations.Job; -import org.jobrunr.jobs.context.JobRunrDashboardLogger; import org.jobrunr.jobs.lambdas.JobRequestHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,7 +21,7 @@ @Component public class ExtractResourcesJobRequestHandler implements JobRequestHandler { - protected final Logger logger = new JobRunrDashboardLogger(LoggerFactory.getLogger(ExtractResourcesJobRequestHandler.class)); + protected final Logger logger = LoggerFactory.getLogger(ExtractResourcesJobRequestHandler.class); @Autowired ExtractResourcesJobService service; @@ -32,12 +32,12 @@ public class ExtractResourcesJobRequestHandler implements JobRequestHandler { @@ -48,5 +48,6 @@ public void run(MigrationJobRequest jobRequest) throws Exception { } service.deleteWebResources(extVersion); + migrations.deleteFile(extensionFile); } } diff --git a/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobService.java b/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobService.java index 1473c03e7..1a234a6ee 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobService.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/ExtractResourcesJobService.java @@ -12,22 +12,11 @@ import org.eclipse.openvsx.entities.ExtensionVersion; import org.eclipse.openvsx.entities.FileResource; import org.eclipse.openvsx.repositories.RepositoryService; -import org.eclipse.openvsx.storage.AzureBlobStorageService; -import org.eclipse.openvsx.storage.GoogleCloudStorageService; -import org.eclipse.openvsx.storage.IStorageService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpMethod; -import org.springframework.retry.annotation.Retryable; import org.springframework.stereotype.Component; -import org.springframework.web.client.RestTemplate; import javax.persistence.EntityManager; import javax.transaction.Transactional; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.AbstractMap; -import java.util.Map; @Component public class ExtractResourcesJobService { @@ -35,22 +24,9 @@ public class ExtractResourcesJobService { @Autowired RepositoryService repositories; - @Autowired - RestTemplate restTemplate; - @Autowired EntityManager entityManager; - @Autowired - AzureBlobStorageService azureStorage; - - @Autowired - GoogleCloudStorageService googleStorage; - - public ExtensionVersion getExtension(long entityId) { - return entityManager.find(ExtensionVersion.class, entityId); - } - @Transactional public void deleteResources(ExtensionVersion extVersion) { repositories.deleteFileResources(extVersion, "resource"); @@ -61,13 +37,6 @@ public void deleteWebResources(ExtensionVersion extVersion) { repositories.deleteFileResources(extVersion, "web-resource"); } - @Transactional - public Map.Entry getDownload(ExtensionVersion extVersion) { - var download = repositories.findFileByType(extVersion, FileResource.DOWNLOAD); - var content = download.getStorageType().equals(FileResource.STORAGE_DB) ? download.getContent() : null; - return new AbstractMap.SimpleEntry<>(download, content); - } - @Transactional public void persistResource(FileResource resource) { entityManager.persist(resource); diff --git a/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java b/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java index 3b3128294..0d45d3bf4 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java @@ -41,6 +41,7 @@ public void runMigrations(ApplicationStartedEvent event) { extractResourcesMigration(); setPreReleaseMigration(); renameDownloadsMigration(); + setContentTypeMigration(); } private void extractResourcesMigration() { @@ -61,6 +62,12 @@ private void renameDownloadsMigration() { repositories.findNotMigratedRenamedDownloads().forEach(item -> enqueueJob(jobName, handler, item)); } + private void setContentTypeMigration() { + var jobName = "SetContentTypeMigration"; + var handler = SetContentTypeJobRequestHandler.class; + repositories.findNotMigratedContentTypes().forEach(item -> enqueueJob(jobName, handler, item)); + } + private void enqueueJob(String jobName, Class> handler, MigrationItem item) { var jobIdText = jobName + "::itemId=" + item.getId(); var jobId = UUID.nameUUIDFromBytes(jobIdText.getBytes(StandardCharsets.UTF_8)); diff --git a/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java b/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java index b71e75ebb..4f32bf383 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java @@ -9,7 +9,10 @@ * ****************************************************************************** */ package org.eclipse.openvsx.migration; +import org.apache.commons.io.FilenameUtils; +import org.eclipse.openvsx.entities.ExtensionVersion; import org.eclipse.openvsx.entities.FileResource; +import org.eclipse.openvsx.repositories.RepositoryService; import org.eclipse.openvsx.storage.AzureBlobStorageService; import org.eclipse.openvsx.storage.GoogleCloudStorageService; import org.eclipse.openvsx.storage.IStorageService; @@ -19,14 +22,23 @@ import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; +import javax.persistence.EntityManager; +import javax.transaction.Transactional; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.AbstractMap; import java.util.Map; @Component public class MigrationService { + @Autowired + EntityManager entityManager; + + @Autowired + RepositoryService repositories; + @Autowired RestTemplate restTemplate; @@ -36,20 +48,38 @@ public class MigrationService { @Autowired GoogleCloudStorageService googleStorage; + public T find(MigrationJobRequest jobRequest, Class clazz) { + return entityManager.find(clazz, jobRequest.getEntityId()); + } + + @Transactional + public Map.Entry getDownload(ExtensionVersion extVersion) { + var download = repositories.findFileByType(extVersion, FileResource.DOWNLOAD); + var content = download.getStorageType().equals(FileResource.STORAGE_DB) ? download.getContent() : null; + return new AbstractMap.SimpleEntry<>(download, content); + } + + @Transactional + public byte[] getContent(FileResource download) { + download = entityManager.merge(download); + return download.getStorageType().equals(FileResource.STORAGE_DB) ? download.getContent() : null; + } + @Retryable - public Path getExtensionFile(Map.Entry entry) { + public Path getFile(Map.Entry entry) { Path extensionFile; + var resource = entry.getKey(); try { - extensionFile = Files.createTempFile("extension_", ".vsix"); + var suffix = FilenameUtils.getExtension(resource.getName()); + extensionFile = Files.createTempFile("file_", suffix); } catch (IOException e) { - throw new RuntimeException("Failed to create extension file", e); + throw new RuntimeException("Failed to create file", e); } var content = entry.getValue(); if(content == null) { - var download = entry.getKey(); - var storage = getStorage(download); - var uri = storage.getLocation(download); + var storage = getStorage(resource); + var uri = storage.getLocation(resource); restTemplate.execute(uri, HttpMethod.GET, null, response -> { try(var out = Files.newOutputStream(extensionFile)) { response.getBody().transferTo(out); @@ -61,19 +91,29 @@ public Path getExtensionFile(Map.Entry entry) { try { Files.write(extensionFile, content); } catch (IOException e) { - throw new RuntimeException("Failed to write to extension file", e); + throw new RuntimeException("Failed to write to file", e); } } return extensionFile; } + public void deleteFile(Path filePath) { + try { + Files.delete(filePath); + } catch (IOException e) { + throw new RuntimeException("Failed to delete file"); + } + } + @Retryable + @Transactional public void uploadResource(FileResource resource) { if(resource.getStorageType().equals(FileResource.STORAGE_DB)) { return; } + resource = entityManager.merge(resource); var storage = getStorage(resource); storage.uploadFile(resource); resource.setContent(null); diff --git a/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsJobRequestHandler.java index 08a48d142..dd9bcf678 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsJobRequestHandler.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsJobRequestHandler.java @@ -9,6 +9,7 @@ * ****************************************************************************** */ package org.eclipse.openvsx.migration; +import org.eclipse.openvsx.entities.FileResource; import org.jobrunr.jobs.lambdas.JobRequestHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +21,7 @@ @Component public class RenameDownloadsJobRequestHandler implements JobRequestHandler { - private static final Logger LOGGER = LoggerFactory.getLogger(RenameDownloadsJobRequestHandler.class); + protected final Logger logger = LoggerFactory.getLogger(RenameDownloadsJobRequestHandler.class); @Autowired MigrationService migrations; @@ -30,22 +31,23 @@ public class RenameDownloadsJobRequestHandler implements JobRequestHandler(download, content)); + logger.info("Renaming download {}", download.getName()); + var content = migrations.getContent(download); + var extensionFile = migrations.getFile(new AbstractMap.SimpleEntry<>(download, content)); var newDownload = service.cloneResource(download, name); migrations.uploadResource(newDownload, extensionFile); migrations.deleteResource(download); download.setName(name); service.updateResource(download); - LOGGER.info("Updated download name to: {}", name); + migrations.deleteFile(extensionFile); + logger.info("Updated download name to: {}", name); } } diff --git a/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsService.java b/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsService.java index 4ea580051..e9d2fc7ea 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsService.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/RenameDownloadsService.java @@ -36,12 +36,6 @@ public String getNewBinaryName(FileResource resource) { return resourceName; } - @Transactional - public byte[] getContent(FileResource download) { - download = entityManager.merge(download); - return download.getStorageType().equals(FileResource.STORAGE_DB) ? download.getContent() : null; - } - @Transactional public FileResource cloneResource(FileResource resource, String name) { resource = entityManager.merge(resource); @@ -54,10 +48,6 @@ public FileResource cloneResource(FileResource resource, String name) { return clone; } - public FileResource getResource(MigrationJobRequest jobRequest) { - return entityManager.find(FileResource.class, jobRequest.getEntityId()); - } - @Transactional public void updateResource(FileResource resource) { entityManager.merge(resource); diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobRequestHandler.java new file mode 100644 index 000000000..abfab7a65 --- /dev/null +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobRequestHandler.java @@ -0,0 +1,63 @@ +/** ****************************************************************************** + * Copyright (c) 2022 Precies. Software Ltd and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * ****************************************************************************** */ +package org.eclipse.openvsx.migration; + +import org.eclipse.openvsx.ExtensionProcessor; +import org.eclipse.openvsx.entities.ExtensionVersion; +import org.eclipse.openvsx.entities.FileResource; +import org.jobrunr.jobs.annotations.Job; +import org.jobrunr.jobs.lambdas.JobRequestHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.AbstractMap; +import java.util.function.Consumer; + +@Component +public class SetContentTypeJobRequestHandler implements JobRequestHandler { + + protected final Logger logger = LoggerFactory.getLogger(SetContentTypeJobRequestHandler.class); + + @Autowired + MigrationService migrations; + + @Autowired + SetContentTypeJobService service; + + @Override + @Job(name = "Set content type for published file resources", retries = 3) + public void run(MigrationJobRequest jobRequest) throws Exception { + var extVersion = migrations.find(jobRequest, ExtensionVersion.class); + logger.info("Set content type for: {}.{}-{}@{}", extVersion.getExtension().getNamespace().getName(), extVersion.getExtension().getName(), extVersion.getVersion(), extVersion.getTargetPlatform()); + + var entry = migrations.getDownload(extVersion); + var extensionFile = migrations.getFile(entry); + try (var processor = new ExtensionProcessor(extensionFile)) { + Consumer consumer = resource -> { + var existingResource = service.getExistingResource(extVersion, resource); + if(existingResource == null) { + return; + } + + var resourceFile = migrations.getFile(new AbstractMap.SimpleEntry<>(existingResource, resource.getContent())); + migrations.deleteResource(existingResource); + migrations.uploadResource(existingResource, resourceFile); + migrations.deleteFile(resourceFile); + }; + + processor.getFileResources(extVersion).forEach(consumer); + processor.processEachResource(extVersion, consumer); + } + + migrations.deleteFile(extensionFile); + } +} diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobService.java b/server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobService.java new file mode 100644 index 000000000..f063d2a4b --- /dev/null +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetContentTypeJobService.java @@ -0,0 +1,35 @@ +/** ****************************************************************************** + * Copyright (c) 2022 Precies. Software Ltd and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * ****************************************************************************** */ +package org.eclipse.openvsx.migration; + +import org.eclipse.openvsx.entities.ExtensionVersion; +import org.eclipse.openvsx.entities.FileResource; +import org.eclipse.openvsx.repositories.RepositoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.transaction.Transactional; + +@Component +public class SetContentTypeJobService { + + @Autowired + RepositoryService repositories; + + @Transactional + public FileResource getExistingResource(ExtensionVersion extVersion, FileResource resource) { + var existingResource = repositories.findFileByTypeAndName(extVersion, resource.getType(), resource.getName()); + if(existingResource != null) { + existingResource.setContentType(resource.getContentType()); + } + + return existingResource; + } +} diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java index ac1227808..95ae47317 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java @@ -10,7 +10,6 @@ package org.eclipse.openvsx.migration; import org.jobrunr.jobs.annotations.Job; -import org.jobrunr.jobs.context.JobRunrDashboardLogger; import org.jobrunr.jobs.lambdas.JobRequestHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,7 +19,10 @@ @Component public class SetPreReleaseJobRequestHandler implements JobRequestHandler { - protected final Logger logger = new JobRunrDashboardLogger(LoggerFactory.getLogger(ExtractResourcesJobRequestHandler.class)); + protected final Logger logger = LoggerFactory.getLogger(SetPreReleaseJobRequestHandler.class); + + @Autowired + MigrationService migrations; @Autowired SetPreReleaseJobService service; @@ -30,9 +32,10 @@ public class SetPreReleaseJobRequestHandler implements JobRequestHandler getExtensionVersions(MigrationJobRequest jobRequest, Logger logger) { var extension = entityManager.find(Extension.class, jobRequest.getEntityId()); @@ -58,45 +34,6 @@ public List getExtensionVersions(MigrationJobRequest jobReques return extension.getVersions(); } - @Transactional - public Map.Entry getDownload(ExtensionVersion extVersion) { - var download = repositories.findFileByType(extVersion, FileResource.DOWNLOAD); - var content = download.getStorageType().equals(FileResource.STORAGE_DB) ? download.getContent() : null; - return new AbstractMap.SimpleEntry<>(download, content); - } - - @Retryable - public Path getExtensionFile(Map.Entry entry) { - Path extensionFile; - try { - extensionFile = Files.createTempFile("extension_", ".vsix"); - } catch (IOException e) { - throw new RuntimeException("Failed to create extension file", e); - } - - var content = entry.getValue(); - if(content == null) { - var download = entry.getKey(); - var storage = getStorage(download); - var uri = storage.getLocation(download); - restTemplate.execute(uri, HttpMethod.GET, null, response -> { - try(var out = Files.newOutputStream(extensionFile)) { - response.getBody().transferTo(out); - } - - return extensionFile; - }); - } else { - try { - Files.write(extensionFile, content); - } catch (IOException e) { - throw new RuntimeException("Failed to write to extension file", e); - } - } - - return extensionFile; - } - @Transactional public void updatePreviewAndPreRelease(ExtensionVersion extVersion, Path extensionFile) { try(var extProcessor = new ExtensionProcessor(extensionFile)) { @@ -106,13 +43,4 @@ public void updatePreviewAndPreRelease(ExtensionVersion extVersion, Path extensi entityManager.merge(extVersion); } - - private IStorageService getStorage(FileResource resource) { - var storages = Map.of( - FileResource.STORAGE_AZURE, azureStorage, - FileResource.STORAGE_GOOGLE, googleStorage - ); - - return storages.get(resource.getStorageType()); - } } diff --git a/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java b/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java index 7f7cd7dc6..dcfc42946 100644 --- a/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java +++ b/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java @@ -28,7 +28,12 @@ public class FileResourceJooqRepository { DSLContext dsl; public List findAll(Collection extensionIds, Collection types) { - return dsl.select(FILE_RESOURCE.ID, FILE_RESOURCE.EXTENSION_ID, FILE_RESOURCE.NAME, FILE_RESOURCE.TYPE) + return dsl.select( + FILE_RESOURCE.ID, + FILE_RESOURCE.EXTENSION_ID, + FILE_RESOURCE.NAME, + FILE_RESOURCE.TYPE + ) .from(FILE_RESOURCE) .where(FILE_RESOURCE.EXTENSION_ID.in(extensionIds)) .and(FILE_RESOURCE.TYPE.in(types)) @@ -37,7 +42,15 @@ public List findAll(Collection extensionIds, Collection findAllResources(long extVersionId, String prefix) { - return dsl.select(FILE_RESOURCE.ID, FILE_RESOURCE.EXTENSION_ID, FILE_RESOURCE.NAME, FILE_RESOURCE.TYPE, FILE_RESOURCE.STORAGE_TYPE, FILE_RESOURCE.CONTENT) + return dsl.select( + FILE_RESOURCE.ID, + FILE_RESOURCE.EXTENSION_ID, + FILE_RESOURCE.NAME, + FILE_RESOURCE.TYPE, + FILE_RESOURCE.STORAGE_TYPE, + FILE_RESOURCE.CONTENT, + FILE_RESOURCE.CONTENT_TYPE + ) .from(FILE_RESOURCE) .where(FILE_RESOURCE.TYPE.eq(FileResource.RESOURCE)) .and(FILE_RESOURCE.EXTENSION_ID.eq(extVersionId)) diff --git a/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java b/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java index ddcc08b76..079a160ed 100644 --- a/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java +++ b/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java @@ -402,6 +402,10 @@ public Streamable findNotMigratedRenamedDownloads() { return findNotMigratedItems("V1_28__MigrationItem.sql"); } + public Streamable findNotMigratedContentTypes() { + return findNotMigratedItems("V1_29__FileResource_ContentType.sql"); + } + private Streamable findNotMigratedItems(String migrationScript) { return migrationItemRepo.findByMigrationScriptAndMigrationScheduledFalseOrderById(migrationScript); } diff --git a/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java b/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java index e69270923..b70a3b1ec 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java @@ -65,19 +65,21 @@ public void uploadFile(FileResource resource) { + blobName + ": missing Azure blob service endpoint"); } - uploadFile(resource.getContent(), resource.getName(), blobName); + uploadFile(resource, blobName); } - protected void uploadFile(byte[] content, String fileName, String blobName) { + protected void uploadFile(FileResource resource, String blobName) { var blobClient = getContainerClient().getBlobClient(blobName); var headers = new BlobHttpHeaders(); - headers.setContentType(StorageUtil.getFileType(fileName).toString()); - if (fileName.endsWith(".vsix")) { - headers.setContentDisposition("attachment; filename=\"" + fileName + "\""); + headers.setContentType(resource.getContentType()); + if (resource.getName().endsWith(".vsix")) { + headers.setContentDisposition("attachment; filename=\"" + resource.getName() + "\""); } else { - var cacheControl = StorageUtil.getCacheControl(fileName); + var cacheControl = StorageUtil.getCacheControl(resource.getName()); headers.setCacheControl(cacheControl.getHeaderValue()); } + + var content = resource.getContent(); try (var dataStream = new ByteArrayInputStream(content)) { blobClient.upload(dataStream, content.length, true); blobClient.setHttpHeaders(headers); @@ -94,13 +96,13 @@ public void uploadFile(FileResource resource, Path filePath) { + blobName + ": missing Azure blob service endpoint"); } - uploadFile(filePath, resource.getName(), blobName); + uploadFile(filePath, resource.getName(), blobName, resource.getContentType()); } - protected void uploadFile(Path filePath, String fileName, String blobName) { + protected void uploadFile(Path filePath, String fileName, String blobName, String contentType) { var blobClient = getContainerClient().getBlobClient(blobName); var headers = new BlobHttpHeaders(); - headers.setContentType(StorageUtil.getFileType(fileName).toString()); + headers.setContentType(contentType); if (fileName.endsWith(".vsix")) { headers.setContentDisposition("attachment; filename=\"" + fileName + "\""); } else { diff --git a/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java b/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java index 48fe33bcd..55bc772ab 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java @@ -68,19 +68,19 @@ public void uploadFile(FileResource resource) { + objectId + ": missing Google bucket id"); } - uploadFile(resource.getContent(), resource.getName(), objectId); + uploadFile(resource, objectId); } - protected void uploadFile(byte[] content, String fileName, String objectId) { + protected void uploadFile(FileResource resource, String objectId) { var blobInfoBuilder = BlobInfo.newBuilder(BlobId.of(bucketId, objectId)) - .setContentType(StorageUtil.getFileType(fileName).toString()); - if (fileName.endsWith(".vsix")) { - blobInfoBuilder.setContentDisposition("attachment; filename=\"" + fileName + "\""); + .setContentType(resource.getContentType()); + if (resource.getName().endsWith(".vsix")) { + blobInfoBuilder.setContentDisposition("attachment; filename=\"" + resource.getName() + "\""); } else { - var cacheControl = StorageUtil.getCacheControl(fileName); + var cacheControl = StorageUtil.getCacheControl(resource.getName()); blobInfoBuilder.setCacheControl(cacheControl.getHeaderValue()); } - getStorage().create(blobInfoBuilder.build(), content); + getStorage().create(blobInfoBuilder.build(), resource.getContent()); } @Override @@ -91,12 +91,12 @@ public void uploadFile(FileResource resource, Path filePath) { + objectId + ": missing Google bucket id"); } - uploadFile(filePath, resource.getName(), objectId); + uploadFile(filePath, resource.getName(), objectId, resource.getContentType()); } - protected void uploadFile(Path filePath, String fileName, String objectId) { + protected void uploadFile(Path filePath, String fileName, String objectId, String contentType) { var blobInfoBuilder = BlobInfo.newBuilder(BlobId.of(bucketId, objectId)) - .setContentType(StorageUtil.getFileType(fileName).toString()); + .setContentType(contentType); if (fileName.endsWith(".vsix")) { blobInfoBuilder.setContentDisposition("attachment; filename=\"" + fileName + "\""); } else { diff --git a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java index 63e897fc4..a5b83c804 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java @@ -11,26 +11,13 @@ package org.eclipse.openvsx.storage; import org.springframework.http.CacheControl; -import org.springframework.http.MediaType; -import java.net.URLConnection; import java.util.concurrent.TimeUnit; class StorageUtil { private StorageUtil(){} - static MediaType getFileType(String fileName) { - if (fileName.endsWith(".vsix")) - return MediaType.APPLICATION_OCTET_STREAM; - if (fileName.endsWith(".json")) - return MediaType.APPLICATION_JSON; - var contentType = URLConnection.guessContentTypeFromName(fileName); - if (contentType != null) - return MediaType.parseMediaType(contentType); - return MediaType.TEXT_PLAIN; - } - static CacheControl getCacheControl(String fileName) { // Files are requested with a version string in the URL, so their content cannot change return CacheControl.maxAge(30, TimeUnit.DAYS).cachePublic(); diff --git a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java index bb5f5fbd8..d1f075255 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java @@ -10,6 +10,7 @@ package org.eclipse.openvsx.storage; import com.google.common.base.Strings; + import com.google.common.collect.Maps; import org.eclipse.openvsx.cache.CacheService; import org.eclipse.openvsx.entities.Download; @@ -24,6 +25,7 @@ import org.springframework.http.CacheControl; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; @@ -215,9 +217,13 @@ public void increaseDownloadCount(FileResource resource) { } } - public HttpHeaders getFileResponseHeaders(String fileName) { + public HttpHeaders getFileResponseHeaders(FileResource resource) { + return getFileResponseHeaders(resource.getName(), resource.getContentType()); + } + + private HttpHeaders getFileResponseHeaders(String fileName, String contentType) { var headers = new HttpHeaders(); - headers.setContentType(StorageUtil.getFileType(fileName)); + headers.setContentType(MediaType.parseMediaType(contentType)); if (fileName.endsWith(".vsix")) { headers.add("Content-Disposition", "attachment; filename=\"" + fileName + "\""); } else { @@ -230,7 +236,7 @@ public HttpHeaders getFileResponseHeaders(String fileName) { public ResponseEntity getFileResponse(FileResource resource) { resource = entityManager.merge(resource); if (resource.getStorageType().equals(FileResource.STORAGE_DB)) { - var headers = getFileResponseHeaders(resource.getName()); + var headers = getFileResponseHeaders(resource); return new ResponseEntity<>(resource.getContent(), headers, HttpStatus.OK); } else { return ResponseEntity.status(HttpStatus.FOUND) diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java index a0f80e314..ab4d6926c 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java @@ -4,11 +4,14 @@ package org.eclipse.openvsx.jooq; +import org.eclipse.openvsx.jooq.tables.Download; import org.eclipse.openvsx.jooq.tables.Extension; import org.eclipse.openvsx.jooq.tables.ExtensionReview; import org.eclipse.openvsx.jooq.tables.ExtensionVersion; import org.eclipse.openvsx.jooq.tables.FileResource; import org.eclipse.openvsx.jooq.tables.FlywaySchemaHistory; +import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; +import org.eclipse.openvsx.jooq.tables.JobrunrJobs; import org.eclipse.openvsx.jooq.tables.NamespaceMembership; import org.eclipse.openvsx.jooq.tables.PersistedLog; import org.eclipse.openvsx.jooq.tables.SpringSession; @@ -28,13 +31,23 @@ public class Indexes { // INDEX definitions // ------------------------------------------------------------------------- + public static final Index DOWNLOAD_TIMESTAMP_BRIN_IDX = Internal.createIndex(DSL.name("download_timestamp_brin_idx"), Download.DOWNLOAD, new OrderField[] { Download.DOWNLOAD.TIMESTAMP }, false); public static final Index EXTENSION__NAMESPACE_ID__IDX = Internal.createIndex(DSL.name("extension__namespace_id__idx"), Extension.EXTENSION, new OrderField[] { Extension.EXTENSION.NAMESPACE_ID }, false); public static final Index EXTENSION_REVIEW__EXTENSION_ID__IDX = Internal.createIndex(DSL.name("extension_review__extension_id__idx"), ExtensionReview.EXTENSION_REVIEW, new OrderField[] { ExtensionReview.EXTENSION_REVIEW.EXTENSION_ID }, false); public static final Index EXTENSION_REVIEW__USER_ID__IDX = Internal.createIndex(DSL.name("extension_review__user_id__idx"), ExtensionReview.EXTENSION_REVIEW, new OrderField[] { ExtensionReview.EXTENSION_REVIEW.USER_ID }, false); public static final Index EXTENSION_VERSION__EXTENSION_ID__IDX = Internal.createIndex(DSL.name("extension_version__extension_id__idx"), ExtensionVersion.EXTENSION_VERSION, new OrderField[] { ExtensionVersion.EXTENSION_VERSION.EXTENSION_ID }, false); public static final Index EXTENSION_VERSION__PUBLISHED_WITH_ID__IDX = Internal.createIndex(DSL.name("extension_version__published_with_id__idx"), ExtensionVersion.EXTENSION_VERSION, new OrderField[] { ExtensionVersion.EXTENSION_VERSION.PUBLISHED_WITH_ID }, false); public static final Index FILE_RESOURCE_EXTENSION_IDX = Internal.createIndex(DSL.name("file_resource_extension_idx"), FileResource.FILE_RESOURCE, new OrderField[] { FileResource.FILE_RESOURCE.EXTENSION_ID }, false); + public static final Index FILE_RESOURCE_TYPE_IDX = Internal.createIndex(DSL.name("file_resource_type_idx"), FileResource.FILE_RESOURCE, new OrderField[] { FileResource.FILE_RESOURCE.TYPE }, false); public static final Index FLYWAY_SCHEMA_HISTORY_S_IDX = Internal.createIndex(DSL.name("flyway_schema_history_s_idx"), FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, new OrderField[] { FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.SUCCESS }, false); + public static final Index JOBRUNR_BGJOBSRVRS_FSTHB_IDX = Internal.createIndex(DSL.name("jobrunr_bgjobsrvrs_fsthb_idx"), JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS, new OrderField[] { JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.FIRSTHEARTBEAT }, false); + public static final Index JOBRUNR_BGJOBSRVRS_LSTHB_IDX = Internal.createIndex(DSL.name("jobrunr_bgjobsrvrs_lsthb_idx"), JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS, new OrderField[] { JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.LASTHEARTBEAT }, false); + public static final Index JOBRUNR_JOB_CREATED_AT_IDX = Internal.createIndex(DSL.name("jobrunr_job_created_at_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.CREATEDAT }, false); + public static final Index JOBRUNR_JOB_RCI_IDX = Internal.createIndex(DSL.name("jobrunr_job_rci_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.RECURRINGJOBID }, false); + public static final Index JOBRUNR_JOB_SCHEDULED_AT_IDX = Internal.createIndex(DSL.name("jobrunr_job_scheduled_at_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.SCHEDULEDAT }, false); + public static final Index JOBRUNR_JOB_SIGNATURE_IDX = Internal.createIndex(DSL.name("jobrunr_job_signature_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.JOBSIGNATURE }, false); + public static final Index JOBRUNR_JOB_UPDATED_AT_IDX = Internal.createIndex(DSL.name("jobrunr_job_updated_at_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.UPDATEDAT }, false); + public static final Index JOBRUNR_STATE_IDX = Internal.createIndex(DSL.name("jobrunr_state_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.STATE }, false); public static final Index NAMESPACE_MEMBERSHIP__NAMESPACE__IDX = Internal.createIndex(DSL.name("namespace_membership__namespace__idx"), NamespaceMembership.NAMESPACE_MEMBERSHIP, new OrderField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.NAMESPACE }, false); public static final Index NAMESPACE_MEMBERSHIP__USER_DATA__IDX = Internal.createIndex(DSL.name("namespace_membership__user_data__idx"), NamespaceMembership.NAMESPACE_MEMBERSHIP, new OrderField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.USER_DATA }, false); public static final Index PERSISTED_LOG__USER_DATA__IDX = Internal.createIndex(DSL.name("persisted_log__user_data__idx"), PersistedLog.PERSISTED_LOG, new OrderField[] { PersistedLog.PERSISTED_LOG.USER_DATA }, false); diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java index cc0544e41..804742353 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java @@ -7,6 +7,10 @@ import org.eclipse.openvsx.jooq.tables.AdminStatistics; import org.eclipse.openvsx.jooq.tables.AdminStatisticsExtensionsByRating; import org.eclipse.openvsx.jooq.tables.AdminStatisticsPublishersByExtensionsPublished; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostActivePublishingUsers; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostDownloadedExtensions; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensionVersions; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensions; import org.eclipse.openvsx.jooq.tables.AzureDownloadCountProcessedItem; import org.eclipse.openvsx.jooq.tables.Download; import org.eclipse.openvsx.jooq.tables.EntityActiveState; @@ -15,6 +19,12 @@ import org.eclipse.openvsx.jooq.tables.ExtensionVersion; import org.eclipse.openvsx.jooq.tables.FileResource; import org.eclipse.openvsx.jooq.tables.FlywaySchemaHistory; +import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; +import org.eclipse.openvsx.jooq.tables.JobrunrJobs; +import org.eclipse.openvsx.jooq.tables.JobrunrMetadata; +import org.eclipse.openvsx.jooq.tables.JobrunrMigrations; +import org.eclipse.openvsx.jooq.tables.JobrunrRecurringJobs; +import org.eclipse.openvsx.jooq.tables.MigrationItem; import org.eclipse.openvsx.jooq.tables.Namespace; import org.eclipse.openvsx.jooq.tables.NamespaceMembership; import org.eclipse.openvsx.jooq.tables.PersistedLog; @@ -26,6 +36,10 @@ import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsExtensionsByRatingRecord; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsPublishersByExtensionsPublishedRecord; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsRecord; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopMostActivePublishingUsersRecord; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopMostDownloadedExtensionsRecord; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopNamespaceExtensionVersionsRecord; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopNamespaceExtensionsRecord; import org.eclipse.openvsx.jooq.tables.records.AzureDownloadCountProcessedItemRecord; import org.eclipse.openvsx.jooq.tables.records.DownloadRecord; import org.eclipse.openvsx.jooq.tables.records.EntityActiveStateRecord; @@ -34,6 +48,12 @@ import org.eclipse.openvsx.jooq.tables.records.ExtensionVersionRecord; import org.eclipse.openvsx.jooq.tables.records.FileResourceRecord; import org.eclipse.openvsx.jooq.tables.records.FlywaySchemaHistoryRecord; +import org.eclipse.openvsx.jooq.tables.records.JobrunrBackgroundjobserversRecord; +import org.eclipse.openvsx.jooq.tables.records.JobrunrJobsRecord; +import org.eclipse.openvsx.jooq.tables.records.JobrunrMetadataRecord; +import org.eclipse.openvsx.jooq.tables.records.JobrunrMigrationsRecord; +import org.eclipse.openvsx.jooq.tables.records.JobrunrRecurringJobsRecord; +import org.eclipse.openvsx.jooq.tables.records.MigrationItemRecord; import org.eclipse.openvsx.jooq.tables.records.NamespaceMembershipRecord; import org.eclipse.openvsx.jooq.tables.records.NamespaceRecord; import org.eclipse.openvsx.jooq.tables.records.PersistedLogRecord; @@ -71,6 +91,12 @@ public class Keys { public static final UniqueKey UNIQUE_EXTENSION_VERSION = Internal.createUniqueKey(ExtensionVersion.EXTENSION_VERSION, DSL.name("unique_extension_version"), new TableField[] { ExtensionVersion.EXTENSION_VERSION.EXTENSION_ID, ExtensionVersion.EXTENSION_VERSION.TARGET_PLATFORM, ExtensionVersion.EXTENSION_VERSION.VERSION }, true); public static final UniqueKey FILE_RESOURCE_PKEY = Internal.createUniqueKey(FileResource.FILE_RESOURCE, DSL.name("file_resource_pkey"), new TableField[] { FileResource.FILE_RESOURCE.ID }, true); public static final UniqueKey FLYWAY_SCHEMA_HISTORY_PK = Internal.createUniqueKey(FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, DSL.name("flyway_schema_history_pk"), new TableField[] { FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY.INSTALLED_RANK }, true); + public static final UniqueKey JOBRUNR_BACKGROUNDJOBSERVERS_PKEY = Internal.createUniqueKey(JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS, DSL.name("jobrunr_backgroundjobservers_pkey"), new TableField[] { JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.ID }, true); + public static final UniqueKey JOBRUNR_JOBS_PKEY = Internal.createUniqueKey(JobrunrJobs.JOBRUNR_JOBS, DSL.name("jobrunr_jobs_pkey"), new TableField[] { JobrunrJobs.JOBRUNR_JOBS.ID }, true); + public static final UniqueKey JOBRUNR_METADATA_PKEY = Internal.createUniqueKey(JobrunrMetadata.JOBRUNR_METADATA, DSL.name("jobrunr_metadata_pkey"), new TableField[] { JobrunrMetadata.JOBRUNR_METADATA.ID }, true); + public static final UniqueKey JOBRUNR_MIGRATIONS_PKEY = Internal.createUniqueKey(JobrunrMigrations.JOBRUNR_MIGRATIONS, DSL.name("jobrunr_migrations_pkey"), new TableField[] { JobrunrMigrations.JOBRUNR_MIGRATIONS.ID }, true); + public static final UniqueKey JOBRUNR_RECURRING_JOBS_PKEY = Internal.createUniqueKey(JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS, DSL.name("jobrunr_recurring_jobs_pkey"), new TableField[] { JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.ID }, true); + public static final UniqueKey MIGRATION_ITEM_PKEY = Internal.createUniqueKey(MigrationItem.MIGRATION_ITEM, DSL.name("migration_item_pkey"), new TableField[] { MigrationItem.MIGRATION_ITEM.ID }, true); public static final UniqueKey NAMESPACE_PKEY = Internal.createUniqueKey(Namespace.NAMESPACE, DSL.name("namespace_pkey"), new TableField[] { Namespace.NAMESPACE.ID }, true); public static final UniqueKey UNIQUE_NAMESPACE_PUBLIC_ID = Internal.createUniqueKey(Namespace.NAMESPACE, DSL.name("unique_namespace_public_id"), new TableField[] { Namespace.NAMESPACE.PUBLIC_ID }, true); public static final UniqueKey NAMESPACE_MEMBERSHIP_PKEY = Internal.createUniqueKey(NamespaceMembership.NAMESPACE_MEMBERSHIP, DSL.name("namespace_membership_pkey"), new TableField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.ID }, true); @@ -88,6 +114,10 @@ public class Keys { public static final ForeignKey ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY = Internal.createForeignKey(AdminStatisticsExtensionsByRating.ADMIN_STATISTICS_EXTENSIONS_BY_RATING, DSL.name("admin_statistics_extensions_by_rating_fkey"), new TableField[] { AdminStatisticsExtensionsByRating.ADMIN_STATISTICS_EXTENSIONS_BY_RATING.ADMIN_STATISTICS_ID }, Keys.ADMIN_STATISTICS_PKEY, new TableField[] { AdminStatistics.ADMIN_STATISTICS.ID }, true); public static final ForeignKey ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY = Internal.createForeignKey(AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED, DSL.name("admin_statistics_publishers_by_extensions_published_fkey"), new TableField[] { AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED.ADMIN_STATISTICS_ID }, Keys.ADMIN_STATISTICS_PKEY, new TableField[] { AdminStatistics.ADMIN_STATISTICS.ID }, true); + public static final ForeignKey ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS__ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS_FKEY = Internal.createForeignKey(AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS, DSL.name("admin_statistics_top_most_active_publishing_users_fkey"), new TableField[] { AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS.ADMIN_STATISTICS_ID }, Keys.ADMIN_STATISTICS_PKEY, new TableField[] { AdminStatistics.ADMIN_STATISTICS.ID }, true); + public static final ForeignKey ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS__ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS_FKEY = Internal.createForeignKey(AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS, DSL.name("admin_statistics_top_most_downloaded_extensions_fkey"), new TableField[] { AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS.ADMIN_STATISTICS_ID }, Keys.ADMIN_STATISTICS_PKEY, new TableField[] { AdminStatistics.ADMIN_STATISTICS.ID }, true); + public static final ForeignKey ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS_FKEY = Internal.createForeignKey(AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS, DSL.name("admin_statistics_top_namespace_extension_versions_fkey"), new TableField[] { AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS.ADMIN_STATISTICS_ID }, Keys.ADMIN_STATISTICS_PKEY, new TableField[] { AdminStatistics.ADMIN_STATISTICS.ID }, true); + public static final ForeignKey ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS_FKEY = Internal.createForeignKey(AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS, DSL.name("admin_statistics_top_namespace_extensions_fkey"), new TableField[] { AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS.ADMIN_STATISTICS_ID }, Keys.ADMIN_STATISTICS_PKEY, new TableField[] { AdminStatistics.ADMIN_STATISTICS.ID }, true); public static final ForeignKey EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN = Internal.createForeignKey(Extension.EXTENSION, DSL.name("fk64imd3nrj67d50tpkjs94ngmn"), new TableField[] { Extension.EXTENSION.NAMESPACE_ID }, Keys.NAMESPACE_PKEY, new TableField[] { Namespace.NAMESPACE.ID }, true); public static final ForeignKey EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP = Internal.createForeignKey(ExtensionReview.EXTENSION_REVIEW, DSL.name("fkgd2dqdc23ogbnobx8afjfpnkp"), new TableField[] { ExtensionReview.EXTENSION_REVIEW.EXTENSION_ID }, Keys.EXTENSION_PKEY, new TableField[] { Extension.EXTENSION.ID }, true); public static final ForeignKey EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W = Internal.createForeignKey(ExtensionReview.EXTENSION_REVIEW, DSL.name("fkinjbn9grk135y6ik0ut4ujp0w"), new TableField[] { ExtensionReview.EXTENSION_REVIEW.USER_ID }, Keys.USER_DATA_PKEY, new TableField[] { UserData.USER_DATA.ID }, true); diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java index ed50f6e32..5bc0992b7 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java @@ -10,6 +10,10 @@ import org.eclipse.openvsx.jooq.tables.AdminStatistics; import org.eclipse.openvsx.jooq.tables.AdminStatisticsExtensionsByRating; import org.eclipse.openvsx.jooq.tables.AdminStatisticsPublishersByExtensionsPublished; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostActivePublishingUsers; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostDownloadedExtensions; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensionVersions; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensions; import org.eclipse.openvsx.jooq.tables.AzureDownloadCountProcessedItem; import org.eclipse.openvsx.jooq.tables.Download; import org.eclipse.openvsx.jooq.tables.EntityActiveState; @@ -18,6 +22,13 @@ import org.eclipse.openvsx.jooq.tables.ExtensionVersion; import org.eclipse.openvsx.jooq.tables.FileResource; import org.eclipse.openvsx.jooq.tables.FlywaySchemaHistory; +import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; +import org.eclipse.openvsx.jooq.tables.JobrunrJobs; +import org.eclipse.openvsx.jooq.tables.JobrunrJobsStats; +import org.eclipse.openvsx.jooq.tables.JobrunrMetadata; +import org.eclipse.openvsx.jooq.tables.JobrunrMigrations; +import org.eclipse.openvsx.jooq.tables.JobrunrRecurringJobs; +import org.eclipse.openvsx.jooq.tables.MigrationItem; import org.eclipse.openvsx.jooq.tables.Namespace; import org.eclipse.openvsx.jooq.tables.NamespaceMembership; import org.eclipse.openvsx.jooq.tables.PersistedLog; @@ -60,6 +71,26 @@ public class Public extends SchemaImpl { */ public final AdminStatisticsPublishersByExtensionsPublished ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED = AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED; + /** + * The table public.admin_statistics_top_most_active_publishing_users. + */ + public final AdminStatisticsTopMostActivePublishingUsers ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS = AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS; + + /** + * The table public.admin_statistics_top_most_downloaded_extensions. + */ + public final AdminStatisticsTopMostDownloadedExtensions ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS = AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS; + + /** + * The table public.admin_statistics_top_namespace_extension_versions. + */ + public final AdminStatisticsTopNamespaceExtensionVersions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS = AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS; + + /** + * The table public.admin_statistics_top_namespace_extensions. + */ + public final AdminStatisticsTopNamespaceExtensions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS = AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS; + /** * The table public.azure_download_count_processed_item. */ @@ -100,6 +131,41 @@ public class Public extends SchemaImpl { */ public final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY; + /** + * The table public.jobrunr_backgroundjobservers. + */ + public final JobrunrBackgroundjobservers JOBRUNR_BACKGROUNDJOBSERVERS = JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS; + + /** + * The table public.jobrunr_jobs. + */ + public final JobrunrJobs JOBRUNR_JOBS = JobrunrJobs.JOBRUNR_JOBS; + + /** + * The table public.jobrunr_jobs_stats. + */ + public final JobrunrJobsStats JOBRUNR_JOBS_STATS = JobrunrJobsStats.JOBRUNR_JOBS_STATS; + + /** + * The table public.jobrunr_metadata. + */ + public final JobrunrMetadata JOBRUNR_METADATA = JobrunrMetadata.JOBRUNR_METADATA; + + /** + * The table public.jobrunr_migrations. + */ + public final JobrunrMigrations JOBRUNR_MIGRATIONS = JobrunrMigrations.JOBRUNR_MIGRATIONS; + + /** + * The table public.jobrunr_recurring_jobs. + */ + public final JobrunrRecurringJobs JOBRUNR_RECURRING_JOBS = JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS; + + /** + * The table public.migration_item. + */ + public final MigrationItem MIGRATION_ITEM = MigrationItem.MIGRATION_ITEM; + /** * The table public.namespace. */ @@ -168,6 +234,10 @@ public final List> getTables() { AdminStatistics.ADMIN_STATISTICS, AdminStatisticsExtensionsByRating.ADMIN_STATISTICS_EXTENSIONS_BY_RATING, AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED, + AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS, + AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS, + AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS, + AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS, AzureDownloadCountProcessedItem.AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM, Download.DOWNLOAD, EntityActiveState.ENTITY_ACTIVE_STATE, @@ -176,6 +246,13 @@ public final List> getTables() { ExtensionVersion.EXTENSION_VERSION, FileResource.FILE_RESOURCE, FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY, + JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS, + JobrunrJobs.JOBRUNR_JOBS, + JobrunrJobsStats.JOBRUNR_JOBS_STATS, + JobrunrMetadata.JOBRUNR_METADATA, + JobrunrMigrations.JOBRUNR_MIGRATIONS, + JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS, + MigrationItem.MIGRATION_ITEM, Namespace.NAMESPACE, NamespaceMembership.NAMESPACE_MEMBERSHIP, PersistedLog.PERSISTED_LOG, diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java index 4334e9223..c29acf163 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java @@ -7,6 +7,10 @@ import org.eclipse.openvsx.jooq.tables.AdminStatistics; import org.eclipse.openvsx.jooq.tables.AdminStatisticsExtensionsByRating; import org.eclipse.openvsx.jooq.tables.AdminStatisticsPublishersByExtensionsPublished; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostActivePublishingUsers; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostDownloadedExtensions; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensionVersions; +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensions; import org.eclipse.openvsx.jooq.tables.AzureDownloadCountProcessedItem; import org.eclipse.openvsx.jooq.tables.Download; import org.eclipse.openvsx.jooq.tables.EntityActiveState; @@ -15,6 +19,13 @@ import org.eclipse.openvsx.jooq.tables.ExtensionVersion; import org.eclipse.openvsx.jooq.tables.FileResource; import org.eclipse.openvsx.jooq.tables.FlywaySchemaHistory; +import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; +import org.eclipse.openvsx.jooq.tables.JobrunrJobs; +import org.eclipse.openvsx.jooq.tables.JobrunrJobsStats; +import org.eclipse.openvsx.jooq.tables.JobrunrMetadata; +import org.eclipse.openvsx.jooq.tables.JobrunrMigrations; +import org.eclipse.openvsx.jooq.tables.JobrunrRecurringJobs; +import org.eclipse.openvsx.jooq.tables.MigrationItem; import org.eclipse.openvsx.jooq.tables.Namespace; import org.eclipse.openvsx.jooq.tables.NamespaceMembership; import org.eclipse.openvsx.jooq.tables.PersistedLog; @@ -46,6 +57,26 @@ public class Tables { */ public static final AdminStatisticsPublishersByExtensionsPublished ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED = AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED; + /** + * The table public.admin_statistics_top_most_active_publishing_users. + */ + public static final AdminStatisticsTopMostActivePublishingUsers ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS = AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS; + + /** + * The table public.admin_statistics_top_most_downloaded_extensions. + */ + public static final AdminStatisticsTopMostDownloadedExtensions ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS = AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS; + + /** + * The table public.admin_statistics_top_namespace_extension_versions. + */ + public static final AdminStatisticsTopNamespaceExtensionVersions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS = AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS; + + /** + * The table public.admin_statistics_top_namespace_extensions. + */ + public static final AdminStatisticsTopNamespaceExtensions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS = AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS; + /** * The table public.azure_download_count_processed_item. */ @@ -86,6 +117,41 @@ public class Tables { */ public static final FlywaySchemaHistory FLYWAY_SCHEMA_HISTORY = FlywaySchemaHistory.FLYWAY_SCHEMA_HISTORY; + /** + * The table public.jobrunr_backgroundjobservers. + */ + public static final JobrunrBackgroundjobservers JOBRUNR_BACKGROUNDJOBSERVERS = JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS; + + /** + * The table public.jobrunr_jobs. + */ + public static final JobrunrJobs JOBRUNR_JOBS = JobrunrJobs.JOBRUNR_JOBS; + + /** + * The table public.jobrunr_jobs_stats. + */ + public static final JobrunrJobsStats JOBRUNR_JOBS_STATS = JobrunrJobsStats.JOBRUNR_JOBS_STATS; + + /** + * The table public.jobrunr_metadata. + */ + public static final JobrunrMetadata JOBRUNR_METADATA = JobrunrMetadata.JOBRUNR_METADATA; + + /** + * The table public.jobrunr_migrations. + */ + public static final JobrunrMigrations JOBRUNR_MIGRATIONS = JobrunrMigrations.JOBRUNR_MIGRATIONS; + + /** + * The table public.jobrunr_recurring_jobs. + */ + public static final JobrunrRecurringJobs JOBRUNR_RECURRING_JOBS = JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS; + + /** + * The table public.migration_item. + */ + public static final MigrationItem MIGRATION_ITEM = MigrationItem.MIGRATION_ITEM; + /** * The table public.namespace. */ diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java index 04d3cb840..ea408cbea 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java @@ -103,8 +103,13 @@ public Schema getSchema() { return Arrays.>asList(Keys.ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY); } + private transient AdminStatistics _adminStatistics; + public AdminStatistics adminStatistics() { - return new AdminStatistics(this, Keys.ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY); + if (_adminStatistics == null) + _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY); + + return _adminStatistics; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java index 57592196f..46e554e11 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java @@ -103,8 +103,13 @@ public Schema getSchema() { return Arrays.>asList(Keys.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY); } + private transient AdminStatistics _adminStatistics; + public AdminStatistics adminStatistics() { - return new AdminStatistics(this, Keys.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY); + if (_adminStatistics == null) + _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY); + + return _adminStatistics; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java new file mode 100644 index 000000000..21dfd2c12 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java @@ -0,0 +1,149 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopMostActivePublishingUsersRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopMostActivePublishingUsers extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.admin_statistics_top_most_active_publishing_users + */ + public static final AdminStatisticsTopMostActivePublishingUsers ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS = new AdminStatisticsTopMostActivePublishingUsers(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminStatisticsTopMostActivePublishingUsersRecord.class; + } + + /** + * The column public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. + */ + public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_most_active_publishing_users.login_name. + */ + public final TableField LOGIN_NAME = createField(DSL.name("login_name"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_most_active_publishing_users.extension_version_count. + */ + public final TableField EXTENSION_VERSION_COUNT = createField(DSL.name("extension_version_count"), SQLDataType.INTEGER.nullable(false), this, ""); + + private AdminStatisticsTopMostActivePublishingUsers(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AdminStatisticsTopMostActivePublishingUsers(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.admin_statistics_top_most_active_publishing_users table reference + */ + public AdminStatisticsTopMostActivePublishingUsers(String alias) { + this(DSL.name(alias), ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); + } + + /** + * Create an aliased public.admin_statistics_top_most_active_publishing_users table reference + */ + public AdminStatisticsTopMostActivePublishingUsers(Name alias) { + this(alias, ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); + } + + /** + * Create a public.admin_statistics_top_most_active_publishing_users table reference + */ + public AdminStatisticsTopMostActivePublishingUsers() { + this(DSL.name("admin_statistics_top_most_active_publishing_users"), null); + } + + public AdminStatisticsTopMostActivePublishingUsers(Table child, ForeignKey key) { + super(child, key, ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS__ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS_FKEY); + } + + private transient AdminStatistics _adminStatistics; + + public AdminStatistics adminStatistics() { + if (_adminStatistics == null) + _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS__ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS_FKEY); + + return _adminStatistics; + } + + @Override + public AdminStatisticsTopMostActivePublishingUsers as(String alias) { + return new AdminStatisticsTopMostActivePublishingUsers(DSL.name(alias), this); + } + + @Override + public AdminStatisticsTopMostActivePublishingUsers as(Name alias) { + return new AdminStatisticsTopMostActivePublishingUsers(alias, this); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopMostActivePublishingUsers rename(String name) { + return new AdminStatisticsTopMostActivePublishingUsers(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopMostActivePublishingUsers rename(Name name) { + return new AdminStatisticsTopMostActivePublishingUsers(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java new file mode 100644 index 000000000..d90be33a0 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java @@ -0,0 +1,149 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopMostDownloadedExtensionsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopMostDownloadedExtensions extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.admin_statistics_top_most_downloaded_extensions + */ + public static final AdminStatisticsTopMostDownloadedExtensions ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS = new AdminStatisticsTopMostDownloadedExtensions(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminStatisticsTopMostDownloadedExtensionsRecord.class; + } + + /** + * The column public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. + */ + public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_most_downloaded_extensions.extension_identifier. + */ + public final TableField EXTENSION_IDENTIFIER = createField(DSL.name("extension_identifier"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_most_downloaded_extensions.downloads. + */ + public final TableField DOWNLOADS = createField(DSL.name("downloads"), SQLDataType.BIGINT.nullable(false), this, ""); + + private AdminStatisticsTopMostDownloadedExtensions(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AdminStatisticsTopMostDownloadedExtensions(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.admin_statistics_top_most_downloaded_extensions table reference + */ + public AdminStatisticsTopMostDownloadedExtensions(String alias) { + this(DSL.name(alias), ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); + } + + /** + * Create an aliased public.admin_statistics_top_most_downloaded_extensions table reference + */ + public AdminStatisticsTopMostDownloadedExtensions(Name alias) { + this(alias, ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); + } + + /** + * Create a public.admin_statistics_top_most_downloaded_extensions table reference + */ + public AdminStatisticsTopMostDownloadedExtensions() { + this(DSL.name("admin_statistics_top_most_downloaded_extensions"), null); + } + + public AdminStatisticsTopMostDownloadedExtensions(Table child, ForeignKey key) { + super(child, key, ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS__ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS_FKEY); + } + + private transient AdminStatistics _adminStatistics; + + public AdminStatistics adminStatistics() { + if (_adminStatistics == null) + _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS__ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS_FKEY); + + return _adminStatistics; + } + + @Override + public AdminStatisticsTopMostDownloadedExtensions as(String alias) { + return new AdminStatisticsTopMostDownloadedExtensions(DSL.name(alias), this); + } + + @Override + public AdminStatisticsTopMostDownloadedExtensions as(Name alias) { + return new AdminStatisticsTopMostDownloadedExtensions(alias, this); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopMostDownloadedExtensions rename(String name) { + return new AdminStatisticsTopMostDownloadedExtensions(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopMostDownloadedExtensions rename(Name name) { + return new AdminStatisticsTopMostDownloadedExtensions(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java new file mode 100644 index 000000000..222e90b57 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java @@ -0,0 +1,149 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopNamespaceExtensionVersionsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopNamespaceExtensionVersions extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.admin_statistics_top_namespace_extension_versions + */ + public static final AdminStatisticsTopNamespaceExtensionVersions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS = new AdminStatisticsTopNamespaceExtensionVersions(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminStatisticsTopNamespaceExtensionVersionsRecord.class; + } + + /** + * The column public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. + */ + public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_namespace_extension_versions.namespace. + */ + public final TableField NAMESPACE = createField(DSL.name("namespace"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_namespace_extension_versions.extension_version_count. + */ + public final TableField EXTENSION_VERSION_COUNT = createField(DSL.name("extension_version_count"), SQLDataType.INTEGER.nullable(false), this, ""); + + private AdminStatisticsTopNamespaceExtensionVersions(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AdminStatisticsTopNamespaceExtensionVersions(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.admin_statistics_top_namespace_extension_versions table reference + */ + public AdminStatisticsTopNamespaceExtensionVersions(String alias) { + this(DSL.name(alias), ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); + } + + /** + * Create an aliased public.admin_statistics_top_namespace_extension_versions table reference + */ + public AdminStatisticsTopNamespaceExtensionVersions(Name alias) { + this(alias, ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); + } + + /** + * Create a public.admin_statistics_top_namespace_extension_versions table reference + */ + public AdminStatisticsTopNamespaceExtensionVersions() { + this(DSL.name("admin_statistics_top_namespace_extension_versions"), null); + } + + public AdminStatisticsTopNamespaceExtensionVersions(Table child, ForeignKey key) { + super(child, key, ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS_FKEY); + } + + private transient AdminStatistics _adminStatistics; + + public AdminStatistics adminStatistics() { + if (_adminStatistics == null) + _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS_FKEY); + + return _adminStatistics; + } + + @Override + public AdminStatisticsTopNamespaceExtensionVersions as(String alias) { + return new AdminStatisticsTopNamespaceExtensionVersions(DSL.name(alias), this); + } + + @Override + public AdminStatisticsTopNamespaceExtensionVersions as(Name alias) { + return new AdminStatisticsTopNamespaceExtensionVersions(alias, this); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopNamespaceExtensionVersions rename(String name) { + return new AdminStatisticsTopNamespaceExtensionVersions(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopNamespaceExtensionVersions rename(Name name) { + return new AdminStatisticsTopNamespaceExtensionVersions(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java new file mode 100644 index 000000000..ec13bd4ab --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java @@ -0,0 +1,149 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopNamespaceExtensionsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopNamespaceExtensions extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.admin_statistics_top_namespace_extensions + */ + public static final AdminStatisticsTopNamespaceExtensions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS = new AdminStatisticsTopNamespaceExtensions(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return AdminStatisticsTopNamespaceExtensionsRecord.class; + } + + /** + * The column public.admin_statistics_top_namespace_extensions.admin_statistics_id. + */ + public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_namespace_extensions.namespace. + */ + public final TableField NAMESPACE = createField(DSL.name("namespace"), SQLDataType.VARCHAR(255).nullable(false), this, ""); + + /** + * The column public.admin_statistics_top_namespace_extensions.extension_count. + */ + public final TableField EXTENSION_COUNT = createField(DSL.name("extension_count"), SQLDataType.INTEGER.nullable(false), this, ""); + + private AdminStatisticsTopNamespaceExtensions(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private AdminStatisticsTopNamespaceExtensions(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.admin_statistics_top_namespace_extensions table reference + */ + public AdminStatisticsTopNamespaceExtensions(String alias) { + this(DSL.name(alias), ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); + } + + /** + * Create an aliased public.admin_statistics_top_namespace_extensions table reference + */ + public AdminStatisticsTopNamespaceExtensions(Name alias) { + this(alias, ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); + } + + /** + * Create a public.admin_statistics_top_namespace_extensions table reference + */ + public AdminStatisticsTopNamespaceExtensions() { + this(DSL.name("admin_statistics_top_namespace_extensions"), null); + } + + public AdminStatisticsTopNamespaceExtensions(Table child, ForeignKey key) { + super(child, key, ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public List> getReferences() { + return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS_FKEY); + } + + private transient AdminStatistics _adminStatistics; + + public AdminStatistics adminStatistics() { + if (_adminStatistics == null) + _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS_FKEY); + + return _adminStatistics; + } + + @Override + public AdminStatisticsTopNamespaceExtensions as(String alias) { + return new AdminStatisticsTopNamespaceExtensions(DSL.name(alias), this); + } + + @Override + public AdminStatisticsTopNamespaceExtensions as(Name alias) { + return new AdminStatisticsTopNamespaceExtensions(alias, this); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopNamespaceExtensions rename(String name) { + return new AdminStatisticsTopNamespaceExtensions(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public AdminStatisticsTopNamespaceExtensions rename(Name name) { + return new AdminStatisticsTopNamespaceExtensions(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java index bef8680f3..55b29733e 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java @@ -8,11 +8,13 @@ import java.util.Arrays; import java.util.List; +import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.DownloadRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; import org.jooq.Row4; @@ -105,6 +107,11 @@ public Schema getSchema() { return Public.PUBLIC; } + @Override + public List getIndexes() { + return Arrays.asList(Indexes.DOWNLOAD_TIMESTAMP_BRIN_IDX); + } + @Override public UniqueKey getPrimaryKey() { return Keys.DOWNLOAD_PKEY; diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java index 8d6f25542..1b1a6b0a5 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java @@ -152,8 +152,13 @@ public List> getKeys() { return Arrays.>asList(Keys.EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN); } + private transient Namespace _namespace; + public Namespace namespace() { - return new Namespace(this, Keys.EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN); + if (_namespace == null) + _namespace = new Namespace(this, Keys.EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN); + + return _namespace; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java index 957d3806d..b2d4304a8 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java @@ -147,12 +147,21 @@ public List> getKeys() { return Arrays.>asList(Keys.EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP, Keys.EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W); } + private transient Extension _extension; + private transient UserData _userData; + public Extension extension() { - return new Extension(this, Keys.EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP); + if (_extension == null) + _extension = new Extension(this, Keys.EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP); + + return _extension; } public UserData userData() { - return new UserData(this, Keys.EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W); + if (_userData == null) + _userData = new UserData(this, Keys.EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W); + + return _userData; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java index 274e23d0e..ce81ecad4 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java @@ -231,12 +231,21 @@ public List> getKeys() { return Arrays.>asList(Keys.EXTENSION_VERSION__FKKHS1EC9S9J08FGICQ9PMWU6BT, Keys.EXTENSION_VERSION__FK70KHJ8PM0VACASUIIAQ0W0R80); } + private transient Extension _extension; + private transient PersonalAccessToken _personalAccessToken; + public Extension extension() { - return new Extension(this, Keys.EXTENSION_VERSION__FKKHS1EC9S9J08FGICQ9PMWU6BT); + if (_extension == null) + _extension = new Extension(this, Keys.EXTENSION_VERSION__FKKHS1EC9S9J08FGICQ9PMWU6BT); + + return _extension; } public PersonalAccessToken personalAccessToken() { - return new PersonalAccessToken(this, Keys.EXTENSION_VERSION__FK70KHJ8PM0VACASUIIAQ0W0R80); + if (_personalAccessToken == null) + _personalAccessToken = new PersonalAccessToken(this, Keys.EXTENSION_VERSION__FK70KHJ8PM0VACASUIIAQ0W0R80); + + return _personalAccessToken; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java index 13ac0947f..44341d510 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java @@ -16,7 +16,7 @@ import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row6; +import org.jooq.Row7; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -78,6 +78,11 @@ public Class getRecordType() { */ public final TableField STORAGE_TYPE = createField(DSL.name("storage_type"), SQLDataType.VARCHAR(32), this, ""); + /** + * The column public.file_resource.content_type. + */ + public final TableField CONTENT_TYPE = createField(DSL.name("content_type"), SQLDataType.VARCHAR(255), this, ""); + private FileResource(Name alias, Table aliased) { this(alias, aliased, null); } @@ -118,7 +123,7 @@ public Schema getSchema() { @Override public List getIndexes() { - return Arrays.asList(Indexes.FILE_RESOURCE_EXTENSION_IDX); + return Arrays.asList(Indexes.FILE_RESOURCE_EXTENSION_IDX, Indexes.FILE_RESOURCE_TYPE_IDX); } @Override @@ -136,8 +141,13 @@ public List> getKeys() { return Arrays.>asList(Keys.FILE_RESOURCE__FILE_RESOURCE_EXTENSION_FKEY); } + private transient ExtensionVersion _extensionVersion; + public ExtensionVersion extensionVersion() { - return new ExtensionVersion(this, Keys.FILE_RESOURCE__FILE_RESOURCE_EXTENSION_FKEY); + if (_extensionVersion == null) + _extensionVersion = new ExtensionVersion(this, Keys.FILE_RESOURCE__FILE_RESOURCE_EXTENSION_FKEY); + + return _extensionVersion; } @Override @@ -167,11 +177,11 @@ public FileResource rename(Name name) { } // ------------------------------------------------------------------------- - // Row6 type methods + // Row7 type methods // ------------------------------------------------------------------------- @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java new file mode 100644 index 000000000..da060d814 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java @@ -0,0 +1,215 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Indexes; +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.JobrunrBackgroundjobserversRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row15; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrBackgroundjobservers extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.jobrunr_backgroundjobservers + */ + public static final JobrunrBackgroundjobservers JOBRUNR_BACKGROUNDJOBSERVERS = new JobrunrBackgroundjobservers(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JobrunrBackgroundjobserversRecord.class; + } + + /** + * The column public.jobrunr_backgroundjobservers.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.CHAR(36).nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.workerpoolsize. + */ + public final TableField WORKERPOOLSIZE = createField(DSL.name("workerpoolsize"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.pollintervalinseconds. + */ + public final TableField POLLINTERVALINSECONDS = createField(DSL.name("pollintervalinseconds"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.firstheartbeat. + */ + public final TableField FIRSTHEARTBEAT = createField(DSL.name("firstheartbeat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.lastheartbeat. + */ + public final TableField LASTHEARTBEAT = createField(DSL.name("lastheartbeat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.running. + */ + public final TableField RUNNING = createField(DSL.name("running"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.systemtotalmemory. + */ + public final TableField SYSTEMTOTALMEMORY = createField(DSL.name("systemtotalmemory"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.systemfreememory. + */ + public final TableField SYSTEMFREEMEMORY = createField(DSL.name("systemfreememory"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.systemcpuload. + */ + public final TableField SYSTEMCPULOAD = createField(DSL.name("systemcpuload"), SQLDataType.NUMERIC(3, 2).nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.processmaxmemory. + */ + public final TableField PROCESSMAXMEMORY = createField(DSL.name("processmaxmemory"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.processfreememory. + */ + public final TableField PROCESSFREEMEMORY = createField(DSL.name("processfreememory"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.processallocatedmemory. + */ + public final TableField PROCESSALLOCATEDMEMORY = createField(DSL.name("processallocatedmemory"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.processcpuload. + */ + public final TableField PROCESSCPULOAD = createField(DSL.name("processcpuload"), SQLDataType.NUMERIC(3, 2).nullable(false), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.deletesucceededjobsafter. + */ + public final TableField DELETESUCCEEDEDJOBSAFTER = createField(DSL.name("deletesucceededjobsafter"), SQLDataType.VARCHAR(32), this, ""); + + /** + * The column public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. + */ + public final TableField PERMANENTLYDELETEJOBSAFTER = createField(DSL.name("permanentlydeletejobsafter"), SQLDataType.VARCHAR(32), this, ""); + + private JobrunrBackgroundjobservers(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JobrunrBackgroundjobservers(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.jobrunr_backgroundjobservers table reference + */ + public JobrunrBackgroundjobservers(String alias) { + this(DSL.name(alias), JOBRUNR_BACKGROUNDJOBSERVERS); + } + + /** + * Create an aliased public.jobrunr_backgroundjobservers table reference + */ + public JobrunrBackgroundjobservers(Name alias) { + this(alias, JOBRUNR_BACKGROUNDJOBSERVERS); + } + + /** + * Create a public.jobrunr_backgroundjobservers table reference + */ + public JobrunrBackgroundjobservers() { + this(DSL.name("jobrunr_backgroundjobservers"), null); + } + + public JobrunrBackgroundjobservers(Table child, ForeignKey key) { + super(child, key, JOBRUNR_BACKGROUNDJOBSERVERS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.JOBRUNR_BGJOBSRVRS_FSTHB_IDX, Indexes.JOBRUNR_BGJOBSRVRS_LSTHB_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.JOBRUNR_BACKGROUNDJOBSERVERS_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.JOBRUNR_BACKGROUNDJOBSERVERS_PKEY); + } + + @Override + public JobrunrBackgroundjobservers as(String alias) { + return new JobrunrBackgroundjobservers(DSL.name(alias), this); + } + + @Override + public JobrunrBackgroundjobservers as(Name alias) { + return new JobrunrBackgroundjobservers(alias, this); + } + + /** + * Rename this table + */ + @Override + public JobrunrBackgroundjobservers rename(String name) { + return new JobrunrBackgroundjobservers(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JobrunrBackgroundjobservers rename(Name name) { + return new JobrunrBackgroundjobservers(name, null); + } + + // ------------------------------------------------------------------------- + // Row15 type methods + // ------------------------------------------------------------------------- + + @Override + public Row15 fieldsRow() { + return (Row15) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java new file mode 100644 index 000000000..058b41270 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java @@ -0,0 +1,184 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Indexes; +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.JobrunrJobsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Index; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row9; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrJobs extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.jobrunr_jobs + */ + public static final JobrunrJobs JOBRUNR_JOBS = new JobrunrJobs(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JobrunrJobsRecord.class; + } + + /** + * The column public.jobrunr_jobs.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.CHAR(36).nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.version. + */ + public final TableField VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.jobasjson. + */ + public final TableField JOBASJSON = createField(DSL.name("jobasjson"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.jobsignature. + */ + public final TableField JOBSIGNATURE = createField(DSL.name("jobsignature"), SQLDataType.VARCHAR(512).nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.state. + */ + public final TableField STATE = createField(DSL.name("state"), SQLDataType.VARCHAR(36).nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.createdat. + */ + public final TableField CREATEDAT = createField(DSL.name("createdat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.updatedat. + */ + public final TableField UPDATEDAT = createField(DSL.name("updatedat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + /** + * The column public.jobrunr_jobs.scheduledat. + */ + public final TableField SCHEDULEDAT = createField(DSL.name("scheduledat"), SQLDataType.LOCALDATETIME(6), this, ""); + + /** + * The column public.jobrunr_jobs.recurringjobid. + */ + public final TableField RECURRINGJOBID = createField(DSL.name("recurringjobid"), SQLDataType.VARCHAR(128), this, ""); + + private JobrunrJobs(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JobrunrJobs(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.jobrunr_jobs table reference + */ + public JobrunrJobs(String alias) { + this(DSL.name(alias), JOBRUNR_JOBS); + } + + /** + * Create an aliased public.jobrunr_jobs table reference + */ + public JobrunrJobs(Name alias) { + this(alias, JOBRUNR_JOBS); + } + + /** + * Create a public.jobrunr_jobs table reference + */ + public JobrunrJobs() { + this(DSL.name("jobrunr_jobs"), null); + } + + public JobrunrJobs(Table child, ForeignKey key) { + super(child, key, JOBRUNR_JOBS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public List getIndexes() { + return Arrays.asList(Indexes.JOBRUNR_JOB_CREATED_AT_IDX, Indexes.JOBRUNR_JOB_RCI_IDX, Indexes.JOBRUNR_JOB_SCHEDULED_AT_IDX, Indexes.JOBRUNR_JOB_SIGNATURE_IDX, Indexes.JOBRUNR_JOB_UPDATED_AT_IDX, Indexes.JOBRUNR_STATE_IDX); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.JOBRUNR_JOBS_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.JOBRUNR_JOBS_PKEY); + } + + @Override + public JobrunrJobs as(String alias) { + return new JobrunrJobs(DSL.name(alias), this); + } + + @Override + public JobrunrJobs as(Name alias) { + return new JobrunrJobs(alias, this); + } + + /** + * Rename this table + */ + @Override + public JobrunrJobs rename(String name) { + return new JobrunrJobs(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JobrunrJobs rename(Name name) { + return new JobrunrJobs(name, null); + } + + // ------------------------------------------------------------------------- + // Row9 type methods + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java new file mode 100644 index 000000000..fa6c85e0b --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java @@ -0,0 +1,171 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.JobrunrJobsStatsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row11; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrJobsStats extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.jobrunr_jobs_stats + */ + public static final JobrunrJobsStats JOBRUNR_JOBS_STATS = new JobrunrJobsStats(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JobrunrJobsStatsRecord.class; + } + + /** + * The column public.jobrunr_jobs_stats.total. + */ + public final TableField TOTAL = createField(DSL.name("total"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.awaiting. + */ + public final TableField AWAITING = createField(DSL.name("awaiting"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.scheduled. + */ + public final TableField SCHEDULED = createField(DSL.name("scheduled"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.enqueued. + */ + public final TableField ENQUEUED = createField(DSL.name("enqueued"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.processing. + */ + public final TableField PROCESSING = createField(DSL.name("processing"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.failed. + */ + public final TableField FAILED = createField(DSL.name("failed"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.succeeded. + */ + public final TableField SUCCEEDED = createField(DSL.name("succeeded"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.alltimesucceeded. + */ + public final TableField ALLTIMESUCCEEDED = createField(DSL.name("alltimesucceeded"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.deleted. + */ + public final TableField DELETED = createField(DSL.name("deleted"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.nbrofbackgroundjobservers. + */ + public final TableField NBROFBACKGROUNDJOBSERVERS = createField(DSL.name("nbrofbackgroundjobservers"), SQLDataType.BIGINT, this, ""); + + /** + * The column public.jobrunr_jobs_stats.nbrofrecurringjobs. + */ + public final TableField NBROFRECURRINGJOBS = createField(DSL.name("nbrofrecurringjobs"), SQLDataType.BIGINT, this, ""); + + private JobrunrJobsStats(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JobrunrJobsStats(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("create view \"jobrunr_jobs_stats\" as SELECT count(*) AS total,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'AWAITING'::text)) AS awaiting,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'SCHEDULED'::text)) AS scheduled,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'ENQUEUED'::text)) AS enqueued,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'PROCESSING'::text)) AS processing,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'FAILED'::text)) AS failed,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'SUCCEEDED'::text)) AS succeeded,\n ( SELECT ((jm.value)::character(10))::numeric(10,0) AS value\n FROM jobrunr_metadata jm\n WHERE ((jm.id)::text = 'succeeded-jobs-counter-cluster'::text)) AS alltimesucceeded,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'DELETED'::text)) AS deleted,\n ( SELECT count(*) AS count\n FROM jobrunr_backgroundjobservers) AS nbrofbackgroundjobservers,\n ( SELECT count(*) AS count\n FROM jobrunr_recurring_jobs) AS nbrofrecurringjobs\n FROM jobrunr_jobs j;")); + } + + /** + * Create an aliased public.jobrunr_jobs_stats table reference + */ + public JobrunrJobsStats(String alias) { + this(DSL.name(alias), JOBRUNR_JOBS_STATS); + } + + /** + * Create an aliased public.jobrunr_jobs_stats table reference + */ + public JobrunrJobsStats(Name alias) { + this(alias, JOBRUNR_JOBS_STATS); + } + + /** + * Create a public.jobrunr_jobs_stats table reference + */ + public JobrunrJobsStats() { + this(DSL.name("jobrunr_jobs_stats"), null); + } + + public JobrunrJobsStats(Table child, ForeignKey key) { + super(child, key, JOBRUNR_JOBS_STATS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public JobrunrJobsStats as(String alias) { + return new JobrunrJobsStats(DSL.name(alias), this); + } + + @Override + public JobrunrJobsStats as(Name alias) { + return new JobrunrJobsStats(alias, this); + } + + /** + * Rename this table + */ + @Override + public JobrunrJobsStats rename(String name) { + return new JobrunrJobsStats(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JobrunrJobsStats rename(Name name) { + return new JobrunrJobsStats(name, null); + } + + // ------------------------------------------------------------------------- + // Row11 type methods + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java new file mode 100644 index 000000000..71f325d35 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java @@ -0,0 +1,162 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.JobrunrMetadataRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrMetadata extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.jobrunr_metadata + */ + public static final JobrunrMetadata JOBRUNR_METADATA = new JobrunrMetadata(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JobrunrMetadataRecord.class; + } + + /** + * The column public.jobrunr_metadata.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.VARCHAR(156).nullable(false), this, ""); + + /** + * The column public.jobrunr_metadata.name. + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(92).nullable(false), this, ""); + + /** + * The column public.jobrunr_metadata.owner. + */ + public final TableField OWNER = createField(DSL.name("owner"), SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.jobrunr_metadata.value. + */ + public final TableField VALUE = createField(DSL.name("value"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column public.jobrunr_metadata.createdat. + */ + public final TableField CREATEDAT = createField(DSL.name("createdat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + /** + * The column public.jobrunr_metadata.updatedat. + */ + public final TableField UPDATEDAT = createField(DSL.name("updatedat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); + + private JobrunrMetadata(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JobrunrMetadata(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.jobrunr_metadata table reference + */ + public JobrunrMetadata(String alias) { + this(DSL.name(alias), JOBRUNR_METADATA); + } + + /** + * Create an aliased public.jobrunr_metadata table reference + */ + public JobrunrMetadata(Name alias) { + this(alias, JOBRUNR_METADATA); + } + + /** + * Create a public.jobrunr_metadata table reference + */ + public JobrunrMetadata() { + this(DSL.name("jobrunr_metadata"), null); + } + + public JobrunrMetadata(Table child, ForeignKey key) { + super(child, key, JOBRUNR_METADATA); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.JOBRUNR_METADATA_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.JOBRUNR_METADATA_PKEY); + } + + @Override + public JobrunrMetadata as(String alias) { + return new JobrunrMetadata(DSL.name(alias), this); + } + + @Override + public JobrunrMetadata as(Name alias) { + return new JobrunrMetadata(alias, this); + } + + /** + * Rename this table + */ + @Override + public JobrunrMetadata rename(String name) { + return new JobrunrMetadata(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JobrunrMetadata rename(Name name) { + return new JobrunrMetadata(name, null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java new file mode 100644 index 000000000..ca0fcee43 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java @@ -0,0 +1,146 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.JobrunrMigrationsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrMigrations extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.jobrunr_migrations + */ + public static final JobrunrMigrations JOBRUNR_MIGRATIONS = new JobrunrMigrations(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JobrunrMigrationsRecord.class; + } + + /** + * The column public.jobrunr_migrations.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.CHAR(36).nullable(false), this, ""); + + /** + * The column public.jobrunr_migrations.script. + */ + public final TableField SCRIPT = createField(DSL.name("script"), SQLDataType.VARCHAR(64).nullable(false), this, ""); + + /** + * The column public.jobrunr_migrations.installedon. + */ + public final TableField INSTALLEDON = createField(DSL.name("installedon"), SQLDataType.VARCHAR(29).nullable(false), this, ""); + + private JobrunrMigrations(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JobrunrMigrations(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.jobrunr_migrations table reference + */ + public JobrunrMigrations(String alias) { + this(DSL.name(alias), JOBRUNR_MIGRATIONS); + } + + /** + * Create an aliased public.jobrunr_migrations table reference + */ + public JobrunrMigrations(Name alias) { + this(alias, JOBRUNR_MIGRATIONS); + } + + /** + * Create a public.jobrunr_migrations table reference + */ + public JobrunrMigrations() { + this(DSL.name("jobrunr_migrations"), null); + } + + public JobrunrMigrations(Table child, ForeignKey key) { + super(child, key, JOBRUNR_MIGRATIONS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.JOBRUNR_MIGRATIONS_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.JOBRUNR_MIGRATIONS_PKEY); + } + + @Override + public JobrunrMigrations as(String alias) { + return new JobrunrMigrations(DSL.name(alias), this); + } + + @Override + public JobrunrMigrations as(Name alias) { + return new JobrunrMigrations(alias, this); + } + + /** + * Rename this table + */ + @Override + public JobrunrMigrations rename(String name) { + return new JobrunrMigrations(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JobrunrMigrations rename(Name name) { + return new JobrunrMigrations(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java new file mode 100644 index 000000000..0298c040a --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java @@ -0,0 +1,146 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.JobrunrRecurringJobsRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrRecurringJobs extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.jobrunr_recurring_jobs + */ + public static final JobrunrRecurringJobs JOBRUNR_RECURRING_JOBS = new JobrunrRecurringJobs(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return JobrunrRecurringJobsRecord.class; + } + + /** + * The column public.jobrunr_recurring_jobs.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.CHAR(128).nullable(false), this, ""); + + /** + * The column public.jobrunr_recurring_jobs.version. + */ + public final TableField VERSION = createField(DSL.name("version"), SQLDataType.INTEGER.nullable(false), this, ""); + + /** + * The column public.jobrunr_recurring_jobs.jobasjson. + */ + public final TableField JOBASJSON = createField(DSL.name("jobasjson"), SQLDataType.CLOB.nullable(false), this, ""); + + private JobrunrRecurringJobs(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private JobrunrRecurringJobs(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.jobrunr_recurring_jobs table reference + */ + public JobrunrRecurringJobs(String alias) { + this(DSL.name(alias), JOBRUNR_RECURRING_JOBS); + } + + /** + * Create an aliased public.jobrunr_recurring_jobs table reference + */ + public JobrunrRecurringJobs(Name alias) { + this(alias, JOBRUNR_RECURRING_JOBS); + } + + /** + * Create a public.jobrunr_recurring_jobs table reference + */ + public JobrunrRecurringJobs() { + this(DSL.name("jobrunr_recurring_jobs"), null); + } + + public JobrunrRecurringJobs(Table child, ForeignKey key) { + super(child, key, JOBRUNR_RECURRING_JOBS); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.JOBRUNR_RECURRING_JOBS_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.JOBRUNR_RECURRING_JOBS_PKEY); + } + + @Override + public JobrunrRecurringJobs as(String alias) { + return new JobrunrRecurringJobs(DSL.name(alias), this); + } + + @Override + public JobrunrRecurringJobs as(Name alias) { + return new JobrunrRecurringJobs(alias, this); + } + + /** + * Rename this table + */ + @Override + public JobrunrRecurringJobs rename(String name) { + return new JobrunrRecurringJobs(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public JobrunrRecurringJobs rename(Name name) { + return new JobrunrRecurringJobs(name, null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java new file mode 100644 index 000000000..e8f4bd6c1 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java @@ -0,0 +1,151 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables; + + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.openvsx.jooq.Keys; +import org.eclipse.openvsx.jooq.Public; +import org.eclipse.openvsx.jooq.tables.records.MigrationItemRecord; +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row4; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class MigrationItem extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of public.migration_item + */ + public static final MigrationItem MIGRATION_ITEM = new MigrationItem(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return MigrationItemRecord.class; + } + + /** + * The column public.migration_item.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.migration_item.migration_script. + */ + public final TableField MIGRATION_SCRIPT = createField(DSL.name("migration_script"), SQLDataType.VARCHAR(1000).nullable(false), this, ""); + + /** + * The column public.migration_item.entity_id. + */ + public final TableField ENTITY_ID = createField(DSL.name("entity_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column public.migration_item.migration_scheduled. + */ + public final TableField MIGRATION_SCHEDULED = createField(DSL.name("migration_scheduled"), SQLDataType.BOOLEAN.nullable(false), this, ""); + + private MigrationItem(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private MigrationItem(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased public.migration_item table reference + */ + public MigrationItem(String alias) { + this(DSL.name(alias), MIGRATION_ITEM); + } + + /** + * Create an aliased public.migration_item table reference + */ + public MigrationItem(Name alias) { + this(alias, MIGRATION_ITEM); + } + + /** + * Create a public.migration_item table reference + */ + public MigrationItem() { + this(DSL.name("migration_item"), null); + } + + public MigrationItem(Table child, ForeignKey key) { + super(child, key, MIGRATION_ITEM); + } + + @Override + public Schema getSchema() { + return Public.PUBLIC; + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.MIGRATION_ITEM_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.MIGRATION_ITEM_PKEY); + } + + @Override + public MigrationItem as(String alias) { + return new MigrationItem(DSL.name(alias), this); + } + + @Override + public MigrationItem as(Name alias) { + return new MigrationItem(alias, this); + } + + /** + * Rename this table + */ + @Override + public MigrationItem rename(String name) { + return new MigrationItem(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public MigrationItem rename(Name name) { + return new MigrationItem(name, null); + } + + // ------------------------------------------------------------------------- + // Row4 type methods + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java index 6e4b9e00a..af323e774 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java @@ -126,12 +126,21 @@ public List> getKeys() { return Arrays.>asList(Keys.NAMESPACE_MEMBERSHIP__FKGFHWHKNULA6DO2N6WYVQETM3N, Keys.NAMESPACE_MEMBERSHIP__FKNSAMEKUTXYWVSB3S1MJDCJKYP); } + private transient Namespace _namespace; + private transient UserData _userData; + public Namespace namespace() { - return new Namespace(this, Keys.NAMESPACE_MEMBERSHIP__FKGFHWHKNULA6DO2N6WYVQETM3N); + if (_namespace == null) + _namespace = new Namespace(this, Keys.NAMESPACE_MEMBERSHIP__FKGFHWHKNULA6DO2N6WYVQETM3N); + + return _namespace; } public UserData userData() { - return new UserData(this, Keys.NAMESPACE_MEMBERSHIP__FKNSAMEKUTXYWVSB3S1MJDCJKYP); + if (_userData == null) + _userData = new UserData(this, Keys.NAMESPACE_MEMBERSHIP__FKNSAMEKUTXYWVSB3S1MJDCJKYP); + + return _userData; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java index 40cae9057..015e4f6d5 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java @@ -127,8 +127,13 @@ public List> getKeys() { return Arrays.>asList(Keys.PERSISTED_LOG__PERSISTED_LOG_USER_DATA_FKEY); } + private transient UserData _userData; + public UserData userData() { - return new UserData(this, Keys.PERSISTED_LOG__PERSISTED_LOG_USER_DATA_FKEY); + if (_userData == null) + _userData = new UserData(this, Keys.PERSISTED_LOG__PERSISTED_LOG_USER_DATA_FKEY); + + return _userData; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java index de5c8a5aa..5f91c0acc 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java @@ -135,8 +135,13 @@ public List> getKeys() { return Arrays.>asList(Keys.PERSONAL_ACCESS_TOKEN__FKTQJVMHOIG3WTTJ6DL1IBCAJ3L); } + private transient UserData _userData; + public UserData userData() { - return new UserData(this, Keys.PERSONAL_ACCESS_TOKEN__FKTQJVMHOIG3WTTJ6DL1IBCAJ3L); + if (_userData == null) + _userData = new UserData(this, Keys.PERSONAL_ACCESS_TOKEN__FKTQJVMHOIG3WTTJ6DL1IBCAJ3L); + + return _userData; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java index cdd3a8799..fdae9bd6a 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java @@ -114,8 +114,13 @@ public List> getKeys() { return Arrays.>asList(Keys.SPRING_SESSION_ATTRIBUTES__SPRING_SESSION_ATTRIBUTES_FK); } + private transient SpringSession _springSession; + public SpringSession springSession() { - return new SpringSession(this, Keys.SPRING_SESSION_ATTRIBUTES__SPRING_SESSION_ATTRIBUTES_FK); + if (_springSession == null) + _springSession = new SpringSession(this, Keys.SPRING_SESSION_ATTRIBUTES__SPRING_SESSION_ATTRIBUTES_FK); + + return _springSession; } @Override diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java new file mode 100644 index 000000000..136d12297 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java @@ -0,0 +1,170 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostActivePublishingUsers; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopMostActivePublishingUsersRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. + */ + public void setAdminStatisticsId(Long value) { + set(0, value); + } + + /** + * Getter for public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. + */ + public Long getAdminStatisticsId() { + return (Long) get(0); + } + + /** + * Setter for public.admin_statistics_top_most_active_publishing_users.login_name. + */ + public void setLoginName(String value) { + set(1, value); + } + + /** + * Getter for public.admin_statistics_top_most_active_publishing_users.login_name. + */ + public String getLoginName() { + return (String) get(1); + } + + /** + * Setter for public.admin_statistics_top_most_active_publishing_users.extension_version_count. + */ + public void setExtensionVersionCount(Integer value) { + set(2, value); + } + + /** + * Getter for public.admin_statistics_top_most_active_publishing_users.extension_version_count. + */ + public Integer getExtensionVersionCount() { + return (Integer) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS.ADMIN_STATISTICS_ID; + } + + @Override + public Field field2() { + return AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS.LOGIN_NAME; + } + + @Override + public Field field3() { + return AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS.EXTENSION_VERSION_COUNT; + } + + @Override + public Long component1() { + return getAdminStatisticsId(); + } + + @Override + public String component2() { + return getLoginName(); + } + + @Override + public Integer component3() { + return getExtensionVersionCount(); + } + + @Override + public Long value1() { + return getAdminStatisticsId(); + } + + @Override + public String value2() { + return getLoginName(); + } + + @Override + public Integer value3() { + return getExtensionVersionCount(); + } + + @Override + public AdminStatisticsTopMostActivePublishingUsersRecord value1(Long value) { + setAdminStatisticsId(value); + return this; + } + + @Override + public AdminStatisticsTopMostActivePublishingUsersRecord value2(String value) { + setLoginName(value); + return this; + } + + @Override + public AdminStatisticsTopMostActivePublishingUsersRecord value3(Integer value) { + setExtensionVersionCount(value); + return this; + } + + @Override + public AdminStatisticsTopMostActivePublishingUsersRecord values(Long value1, String value2, Integer value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminStatisticsTopMostActivePublishingUsersRecord + */ + public AdminStatisticsTopMostActivePublishingUsersRecord() { + super(AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); + } + + /** + * Create a detached, initialised AdminStatisticsTopMostActivePublishingUsersRecord + */ + public AdminStatisticsTopMostActivePublishingUsersRecord(Long adminStatisticsId, String loginName, Integer extensionVersionCount) { + super(AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); + + setAdminStatisticsId(adminStatisticsId); + setLoginName(loginName); + setExtensionVersionCount(extensionVersionCount); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java new file mode 100644 index 000000000..055f36550 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java @@ -0,0 +1,170 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopMostDownloadedExtensions; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopMostDownloadedExtensionsRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. + */ + public void setAdminStatisticsId(Long value) { + set(0, value); + } + + /** + * Getter for public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. + */ + public Long getAdminStatisticsId() { + return (Long) get(0); + } + + /** + * Setter for public.admin_statistics_top_most_downloaded_extensions.extension_identifier. + */ + public void setExtensionIdentifier(String value) { + set(1, value); + } + + /** + * Getter for public.admin_statistics_top_most_downloaded_extensions.extension_identifier. + */ + public String getExtensionIdentifier() { + return (String) get(1); + } + + /** + * Setter for public.admin_statistics_top_most_downloaded_extensions.downloads. + */ + public void setDownloads(Long value) { + set(2, value); + } + + /** + * Getter for public.admin_statistics_top_most_downloaded_extensions.downloads. + */ + public Long getDownloads() { + return (Long) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS.ADMIN_STATISTICS_ID; + } + + @Override + public Field field2() { + return AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS.EXTENSION_IDENTIFIER; + } + + @Override + public Field field3() { + return AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS.DOWNLOADS; + } + + @Override + public Long component1() { + return getAdminStatisticsId(); + } + + @Override + public String component2() { + return getExtensionIdentifier(); + } + + @Override + public Long component3() { + return getDownloads(); + } + + @Override + public Long value1() { + return getAdminStatisticsId(); + } + + @Override + public String value2() { + return getExtensionIdentifier(); + } + + @Override + public Long value3() { + return getDownloads(); + } + + @Override + public AdminStatisticsTopMostDownloadedExtensionsRecord value1(Long value) { + setAdminStatisticsId(value); + return this; + } + + @Override + public AdminStatisticsTopMostDownloadedExtensionsRecord value2(String value) { + setExtensionIdentifier(value); + return this; + } + + @Override + public AdminStatisticsTopMostDownloadedExtensionsRecord value3(Long value) { + setDownloads(value); + return this; + } + + @Override + public AdminStatisticsTopMostDownloadedExtensionsRecord values(Long value1, String value2, Long value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminStatisticsTopMostDownloadedExtensionsRecord + */ + public AdminStatisticsTopMostDownloadedExtensionsRecord() { + super(AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); + } + + /** + * Create a detached, initialised AdminStatisticsTopMostDownloadedExtensionsRecord + */ + public AdminStatisticsTopMostDownloadedExtensionsRecord(Long adminStatisticsId, String extensionIdentifier, Long downloads) { + super(AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); + + setAdminStatisticsId(adminStatisticsId); + setExtensionIdentifier(extensionIdentifier); + setDownloads(downloads); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java new file mode 100644 index 000000000..09ca331ad --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java @@ -0,0 +1,170 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensionVersions; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopNamespaceExtensionVersionsRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. + */ + public void setAdminStatisticsId(Long value) { + set(0, value); + } + + /** + * Getter for public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. + */ + public Long getAdminStatisticsId() { + return (Long) get(0); + } + + /** + * Setter for public.admin_statistics_top_namespace_extension_versions.namespace. + */ + public void setNamespace(String value) { + set(1, value); + } + + /** + * Getter for public.admin_statistics_top_namespace_extension_versions.namespace. + */ + public String getNamespace() { + return (String) get(1); + } + + /** + * Setter for public.admin_statistics_top_namespace_extension_versions.extension_version_count. + */ + public void setExtensionVersionCount(Integer value) { + set(2, value); + } + + /** + * Getter for public.admin_statistics_top_namespace_extension_versions.extension_version_count. + */ + public Integer getExtensionVersionCount() { + return (Integer) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS.ADMIN_STATISTICS_ID; + } + + @Override + public Field field2() { + return AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS.NAMESPACE; + } + + @Override + public Field field3() { + return AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS.EXTENSION_VERSION_COUNT; + } + + @Override + public Long component1() { + return getAdminStatisticsId(); + } + + @Override + public String component2() { + return getNamespace(); + } + + @Override + public Integer component3() { + return getExtensionVersionCount(); + } + + @Override + public Long value1() { + return getAdminStatisticsId(); + } + + @Override + public String value2() { + return getNamespace(); + } + + @Override + public Integer value3() { + return getExtensionVersionCount(); + } + + @Override + public AdminStatisticsTopNamespaceExtensionVersionsRecord value1(Long value) { + setAdminStatisticsId(value); + return this; + } + + @Override + public AdminStatisticsTopNamespaceExtensionVersionsRecord value2(String value) { + setNamespace(value); + return this; + } + + @Override + public AdminStatisticsTopNamespaceExtensionVersionsRecord value3(Integer value) { + setExtensionVersionCount(value); + return this; + } + + @Override + public AdminStatisticsTopNamespaceExtensionVersionsRecord values(Long value1, String value2, Integer value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminStatisticsTopNamespaceExtensionVersionsRecord + */ + public AdminStatisticsTopNamespaceExtensionVersionsRecord() { + super(AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); + } + + /** + * Create a detached, initialised AdminStatisticsTopNamespaceExtensionVersionsRecord + */ + public AdminStatisticsTopNamespaceExtensionVersionsRecord(Long adminStatisticsId, String namespace, Integer extensionVersionCount) { + super(AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); + + setAdminStatisticsId(adminStatisticsId); + setNamespace(namespace); + setExtensionVersionCount(extensionVersionCount); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java new file mode 100644 index 000000000..59afe09ea --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java @@ -0,0 +1,170 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.AdminStatisticsTopNamespaceExtensions; +import org.jooq.Field; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.TableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class AdminStatisticsTopNamespaceExtensionsRecord extends TableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.admin_statistics_top_namespace_extensions.admin_statistics_id. + */ + public void setAdminStatisticsId(Long value) { + set(0, value); + } + + /** + * Getter for public.admin_statistics_top_namespace_extensions.admin_statistics_id. + */ + public Long getAdminStatisticsId() { + return (Long) get(0); + } + + /** + * Setter for public.admin_statistics_top_namespace_extensions.namespace. + */ + public void setNamespace(String value) { + set(1, value); + } + + /** + * Getter for public.admin_statistics_top_namespace_extensions.namespace. + */ + public String getNamespace() { + return (String) get(1); + } + + /** + * Setter for public.admin_statistics_top_namespace_extensions.extension_count. + */ + public void setExtensionCount(Integer value) { + set(2, value); + } + + /** + * Getter for public.admin_statistics_top_namespace_extensions.extension_count. + */ + public Integer getExtensionCount() { + return (Integer) get(2); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS.ADMIN_STATISTICS_ID; + } + + @Override + public Field field2() { + return AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS.NAMESPACE; + } + + @Override + public Field field3() { + return AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS.EXTENSION_COUNT; + } + + @Override + public Long component1() { + return getAdminStatisticsId(); + } + + @Override + public String component2() { + return getNamespace(); + } + + @Override + public Integer component3() { + return getExtensionCount(); + } + + @Override + public Long value1() { + return getAdminStatisticsId(); + } + + @Override + public String value2() { + return getNamespace(); + } + + @Override + public Integer value3() { + return getExtensionCount(); + } + + @Override + public AdminStatisticsTopNamespaceExtensionsRecord value1(Long value) { + setAdminStatisticsId(value); + return this; + } + + @Override + public AdminStatisticsTopNamespaceExtensionsRecord value2(String value) { + setNamespace(value); + return this; + } + + @Override + public AdminStatisticsTopNamespaceExtensionsRecord value3(Integer value) { + setExtensionCount(value); + return this; + } + + @Override + public AdminStatisticsTopNamespaceExtensionsRecord values(Long value1, String value2, Integer value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached AdminStatisticsTopNamespaceExtensionsRecord + */ + public AdminStatisticsTopNamespaceExtensionsRecord() { + super(AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); + } + + /** + * Create a detached, initialised AdminStatisticsTopNamespaceExtensionsRecord + */ + public AdminStatisticsTopNamespaceExtensionsRecord(Long adminStatisticsId, String namespace, Integer extensionCount) { + super(AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); + + setAdminStatisticsId(adminStatisticsId); + setNamespace(namespace); + setExtensionCount(extensionCount); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java index 8203f55f1..8fa2ce38c 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java @@ -7,8 +7,8 @@ import org.eclipse.openvsx.jooq.tables.FileResource; import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record6; -import org.jooq.Row6; +import org.jooq.Record7; +import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; @@ -16,7 +16,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FileResourceRecord extends UpdatableRecordImpl implements Record6 { +public class FileResourceRecord extends UpdatableRecordImpl implements Record7 { private static final long serialVersionUID = 1L; @@ -104,6 +104,20 @@ public String getStorageType() { return (String) get(5); } + /** + * Setter for public.file_resource.content_type. + */ + public void setContentType(String value) { + set(6, value); + } + + /** + * Getter for public.file_resource.content_type. + */ + public String getContentType() { + return (String) get(6); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -114,17 +128,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record6 type implementation + // Record7 type implementation // ------------------------------------------------------------------------- @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); } @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); + public Row7 valuesRow() { + return (Row7) super.valuesRow(); } @Override @@ -157,6 +171,11 @@ public Field field6() { return FileResource.FILE_RESOURCE.STORAGE_TYPE; } + @Override + public Field field7() { + return FileResource.FILE_RESOURCE.CONTENT_TYPE; + } + @Override public Long component1() { return getId(); @@ -187,6 +206,11 @@ public String component6() { return getStorageType(); } + @Override + public String component7() { + return getContentType(); + } + @Override public Long value1() { return getId(); @@ -217,6 +241,11 @@ public String value6() { return getStorageType(); } + @Override + public String value7() { + return getContentType(); + } + @Override public FileResourceRecord value1(Long value) { setId(value); @@ -254,13 +283,20 @@ public FileResourceRecord value6(String value) { } @Override - public FileResourceRecord values(Long value1, String value2, byte[] value3, Long value4, String value5, String value6) { + public FileResourceRecord value7(String value) { + setContentType(value); + return this; + } + + @Override + public FileResourceRecord values(Long value1, String value2, byte[] value3, Long value4, String value5, String value6, String value7) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); value6(value6); + value7(value7); return this; } @@ -278,7 +314,7 @@ public FileResourceRecord() { /** * Create a detached, initialised FileResourceRecord */ - public FileResourceRecord(Long id, String type, byte[] content, Long extensionId, String name, String storageType) { + public FileResourceRecord(Long id, String type, byte[] content, Long extensionId, String name, String storageType, String contentType) { super(FileResource.FILE_RESOURCE); setId(id); @@ -287,5 +323,6 @@ public FileResourceRecord(Long id, String type, byte[] content, Long extensionId setExtensionId(extensionId); setName(name); setStorageType(storageType); + setContentType(contentType); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java new file mode 100644 index 000000000..0acb48250 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java @@ -0,0 +1,627 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record15; +import org.jooq.Row15; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrBackgroundjobserversRecord extends UpdatableRecordImpl implements Record15 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.jobrunr_backgroundjobservers.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.workerpoolsize. + */ + public void setWorkerpoolsize(Integer value) { + set(1, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.workerpoolsize. + */ + public Integer getWorkerpoolsize() { + return (Integer) get(1); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.pollintervalinseconds. + */ + public void setPollintervalinseconds(Integer value) { + set(2, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.pollintervalinseconds. + */ + public Integer getPollintervalinseconds() { + return (Integer) get(2); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.firstheartbeat. + */ + public void setFirstheartbeat(LocalDateTime value) { + set(3, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.firstheartbeat. + */ + public LocalDateTime getFirstheartbeat() { + return (LocalDateTime) get(3); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.lastheartbeat. + */ + public void setLastheartbeat(LocalDateTime value) { + set(4, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.lastheartbeat. + */ + public LocalDateTime getLastheartbeat() { + return (LocalDateTime) get(4); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.running. + */ + public void setRunning(Integer value) { + set(5, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.running. + */ + public Integer getRunning() { + return (Integer) get(5); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.systemtotalmemory. + */ + public void setSystemtotalmemory(Long value) { + set(6, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.systemtotalmemory. + */ + public Long getSystemtotalmemory() { + return (Long) get(6); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.systemfreememory. + */ + public void setSystemfreememory(Long value) { + set(7, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.systemfreememory. + */ + public Long getSystemfreememory() { + return (Long) get(7); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.systemcpuload. + */ + public void setSystemcpuload(BigDecimal value) { + set(8, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.systemcpuload. + */ + public BigDecimal getSystemcpuload() { + return (BigDecimal) get(8); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.processmaxmemory. + */ + public void setProcessmaxmemory(Long value) { + set(9, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.processmaxmemory. + */ + public Long getProcessmaxmemory() { + return (Long) get(9); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.processfreememory. + */ + public void setProcessfreememory(Long value) { + set(10, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.processfreememory. + */ + public Long getProcessfreememory() { + return (Long) get(10); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.processallocatedmemory. + */ + public void setProcessallocatedmemory(Long value) { + set(11, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.processallocatedmemory. + */ + public Long getProcessallocatedmemory() { + return (Long) get(11); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.processcpuload. + */ + public void setProcesscpuload(BigDecimal value) { + set(12, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.processcpuload. + */ + public BigDecimal getProcesscpuload() { + return (BigDecimal) get(12); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.deletesucceededjobsafter. + */ + public void setDeletesucceededjobsafter(String value) { + set(13, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.deletesucceededjobsafter. + */ + public String getDeletesucceededjobsafter() { + return (String) get(13); + } + + /** + * Setter for public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. + */ + public void setPermanentlydeletejobsafter(String value) { + set(14, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. + */ + public String getPermanentlydeletejobsafter() { + return (String) get(14); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record15 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row15 fieldsRow() { + return (Row15) super.fieldsRow(); + } + + @Override + public Row15 valuesRow() { + return (Row15) super.valuesRow(); + } + + @Override + public Field field1() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.ID; + } + + @Override + public Field field2() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.WORKERPOOLSIZE; + } + + @Override + public Field field3() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.POLLINTERVALINSECONDS; + } + + @Override + public Field field4() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.FIRSTHEARTBEAT; + } + + @Override + public Field field5() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.LASTHEARTBEAT; + } + + @Override + public Field field6() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.RUNNING; + } + + @Override + public Field field7() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.SYSTEMTOTALMEMORY; + } + + @Override + public Field field8() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.SYSTEMFREEMEMORY; + } + + @Override + public Field field9() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.SYSTEMCPULOAD; + } + + @Override + public Field field10() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.PROCESSMAXMEMORY; + } + + @Override + public Field field11() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.PROCESSFREEMEMORY; + } + + @Override + public Field field12() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.PROCESSALLOCATEDMEMORY; + } + + @Override + public Field field13() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.PROCESSCPULOAD; + } + + @Override + public Field field14() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.DELETESUCCEEDEDJOBSAFTER; + } + + @Override + public Field field15() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.PERMANENTLYDELETEJOBSAFTER; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public Integer component2() { + return getWorkerpoolsize(); + } + + @Override + public Integer component3() { + return getPollintervalinseconds(); + } + + @Override + public LocalDateTime component4() { + return getFirstheartbeat(); + } + + @Override + public LocalDateTime component5() { + return getLastheartbeat(); + } + + @Override + public Integer component6() { + return getRunning(); + } + + @Override + public Long component7() { + return getSystemtotalmemory(); + } + + @Override + public Long component8() { + return getSystemfreememory(); + } + + @Override + public BigDecimal component9() { + return getSystemcpuload(); + } + + @Override + public Long component10() { + return getProcessmaxmemory(); + } + + @Override + public Long component11() { + return getProcessfreememory(); + } + + @Override + public Long component12() { + return getProcessallocatedmemory(); + } + + @Override + public BigDecimal component13() { + return getProcesscpuload(); + } + + @Override + public String component14() { + return getDeletesucceededjobsafter(); + } + + @Override + public String component15() { + return getPermanentlydeletejobsafter(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public Integer value2() { + return getWorkerpoolsize(); + } + + @Override + public Integer value3() { + return getPollintervalinseconds(); + } + + @Override + public LocalDateTime value4() { + return getFirstheartbeat(); + } + + @Override + public LocalDateTime value5() { + return getLastheartbeat(); + } + + @Override + public Integer value6() { + return getRunning(); + } + + @Override + public Long value7() { + return getSystemtotalmemory(); + } + + @Override + public Long value8() { + return getSystemfreememory(); + } + + @Override + public BigDecimal value9() { + return getSystemcpuload(); + } + + @Override + public Long value10() { + return getProcessmaxmemory(); + } + + @Override + public Long value11() { + return getProcessfreememory(); + } + + @Override + public Long value12() { + return getProcessallocatedmemory(); + } + + @Override + public BigDecimal value13() { + return getProcesscpuload(); + } + + @Override + public String value14() { + return getDeletesucceededjobsafter(); + } + + @Override + public String value15() { + return getPermanentlydeletejobsafter(); + } + + @Override + public JobrunrBackgroundjobserversRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value2(Integer value) { + setWorkerpoolsize(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value3(Integer value) { + setPollintervalinseconds(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value4(LocalDateTime value) { + setFirstheartbeat(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value5(LocalDateTime value) { + setLastheartbeat(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value6(Integer value) { + setRunning(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value7(Long value) { + setSystemtotalmemory(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value8(Long value) { + setSystemfreememory(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value9(BigDecimal value) { + setSystemcpuload(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value10(Long value) { + setProcessmaxmemory(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value11(Long value) { + setProcessfreememory(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value12(Long value) { + setProcessallocatedmemory(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value13(BigDecimal value) { + setProcesscpuload(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value14(String value) { + setDeletesucceededjobsafter(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord value15(String value) { + setPermanentlydeletejobsafter(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord values(String value1, Integer value2, Integer value3, LocalDateTime value4, LocalDateTime value5, Integer value6, Long value7, Long value8, BigDecimal value9, Long value10, Long value11, Long value12, BigDecimal value13, String value14, String value15) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + value12(value12); + value13(value13); + value14(value14); + value15(value15); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JobrunrBackgroundjobserversRecord + */ + public JobrunrBackgroundjobserversRecord() { + super(JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS); + } + + /** + * Create a detached, initialised JobrunrBackgroundjobserversRecord + */ + public JobrunrBackgroundjobserversRecord(String id, Integer workerpoolsize, Integer pollintervalinseconds, LocalDateTime firstheartbeat, LocalDateTime lastheartbeat, Integer running, Long systemtotalmemory, Long systemfreememory, BigDecimal systemcpuload, Long processmaxmemory, Long processfreememory, Long processallocatedmemory, BigDecimal processcpuload, String deletesucceededjobsafter, String permanentlydeletejobsafter) { + super(JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS); + + setId(id); + setWorkerpoolsize(workerpoolsize); + setPollintervalinseconds(pollintervalinseconds); + setFirstheartbeat(firstheartbeat); + setLastheartbeat(lastheartbeat); + setRunning(running); + setSystemtotalmemory(systemtotalmemory); + setSystemfreememory(systemfreememory); + setSystemcpuload(systemcpuload); + setProcessmaxmemory(processmaxmemory); + setProcessfreememory(processfreememory); + setProcessallocatedmemory(processallocatedmemory); + setProcesscpuload(processcpuload); + setDeletesucceededjobsafter(deletesucceededjobsafter); + setPermanentlydeletejobsafter(permanentlydeletejobsafter); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java new file mode 100644 index 000000000..b2bfa0a57 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java @@ -0,0 +1,404 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import java.time.LocalDateTime; + +import org.eclipse.openvsx.jooq.tables.JobrunrJobs; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record9; +import org.jooq.Row9; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrJobsRecord extends UpdatableRecordImpl implements Record9 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.jobrunr_jobs.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.jobrunr_jobs.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.jobrunr_jobs.version. + */ + public void setVersion(Integer value) { + set(1, value); + } + + /** + * Getter for public.jobrunr_jobs.version. + */ + public Integer getVersion() { + return (Integer) get(1); + } + + /** + * Setter for public.jobrunr_jobs.jobasjson. + */ + public void setJobasjson(String value) { + set(2, value); + } + + /** + * Getter for public.jobrunr_jobs.jobasjson. + */ + public String getJobasjson() { + return (String) get(2); + } + + /** + * Setter for public.jobrunr_jobs.jobsignature. + */ + public void setJobsignature(String value) { + set(3, value); + } + + /** + * Getter for public.jobrunr_jobs.jobsignature. + */ + public String getJobsignature() { + return (String) get(3); + } + + /** + * Setter for public.jobrunr_jobs.state. + */ + public void setState(String value) { + set(4, value); + } + + /** + * Getter for public.jobrunr_jobs.state. + */ + public String getState() { + return (String) get(4); + } + + /** + * Setter for public.jobrunr_jobs.createdat. + */ + public void setCreatedat(LocalDateTime value) { + set(5, value); + } + + /** + * Getter for public.jobrunr_jobs.createdat. + */ + public LocalDateTime getCreatedat() { + return (LocalDateTime) get(5); + } + + /** + * Setter for public.jobrunr_jobs.updatedat. + */ + public void setUpdatedat(LocalDateTime value) { + set(6, value); + } + + /** + * Getter for public.jobrunr_jobs.updatedat. + */ + public LocalDateTime getUpdatedat() { + return (LocalDateTime) get(6); + } + + /** + * Setter for public.jobrunr_jobs.scheduledat. + */ + public void setScheduledat(LocalDateTime value) { + set(7, value); + } + + /** + * Getter for public.jobrunr_jobs.scheduledat. + */ + public LocalDateTime getScheduledat() { + return (LocalDateTime) get(7); + } + + /** + * Setter for public.jobrunr_jobs.recurringjobid. + */ + public void setRecurringjobid(String value) { + set(8, value); + } + + /** + * Getter for public.jobrunr_jobs.recurringjobid. + */ + public String getRecurringjobid() { + return (String) get(8); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record9 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); + } + + @Override + public Row9 valuesRow() { + return (Row9) super.valuesRow(); + } + + @Override + public Field field1() { + return JobrunrJobs.JOBRUNR_JOBS.ID; + } + + @Override + public Field field2() { + return JobrunrJobs.JOBRUNR_JOBS.VERSION; + } + + @Override + public Field field3() { + return JobrunrJobs.JOBRUNR_JOBS.JOBASJSON; + } + + @Override + public Field field4() { + return JobrunrJobs.JOBRUNR_JOBS.JOBSIGNATURE; + } + + @Override + public Field field5() { + return JobrunrJobs.JOBRUNR_JOBS.STATE; + } + + @Override + public Field field6() { + return JobrunrJobs.JOBRUNR_JOBS.CREATEDAT; + } + + @Override + public Field field7() { + return JobrunrJobs.JOBRUNR_JOBS.UPDATEDAT; + } + + @Override + public Field field8() { + return JobrunrJobs.JOBRUNR_JOBS.SCHEDULEDAT; + } + + @Override + public Field field9() { + return JobrunrJobs.JOBRUNR_JOBS.RECURRINGJOBID; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public Integer component2() { + return getVersion(); + } + + @Override + public String component3() { + return getJobasjson(); + } + + @Override + public String component4() { + return getJobsignature(); + } + + @Override + public String component5() { + return getState(); + } + + @Override + public LocalDateTime component6() { + return getCreatedat(); + } + + @Override + public LocalDateTime component7() { + return getUpdatedat(); + } + + @Override + public LocalDateTime component8() { + return getScheduledat(); + } + + @Override + public String component9() { + return getRecurringjobid(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public Integer value2() { + return getVersion(); + } + + @Override + public String value3() { + return getJobasjson(); + } + + @Override + public String value4() { + return getJobsignature(); + } + + @Override + public String value5() { + return getState(); + } + + @Override + public LocalDateTime value6() { + return getCreatedat(); + } + + @Override + public LocalDateTime value7() { + return getUpdatedat(); + } + + @Override + public LocalDateTime value8() { + return getScheduledat(); + } + + @Override + public String value9() { + return getRecurringjobid(); + } + + @Override + public JobrunrJobsRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JobrunrJobsRecord value2(Integer value) { + setVersion(value); + return this; + } + + @Override + public JobrunrJobsRecord value3(String value) { + setJobasjson(value); + return this; + } + + @Override + public JobrunrJobsRecord value4(String value) { + setJobsignature(value); + return this; + } + + @Override + public JobrunrJobsRecord value5(String value) { + setState(value); + return this; + } + + @Override + public JobrunrJobsRecord value6(LocalDateTime value) { + setCreatedat(value); + return this; + } + + @Override + public JobrunrJobsRecord value7(LocalDateTime value) { + setUpdatedat(value); + return this; + } + + @Override + public JobrunrJobsRecord value8(LocalDateTime value) { + setScheduledat(value); + return this; + } + + @Override + public JobrunrJobsRecord value9(String value) { + setRecurringjobid(value); + return this; + } + + @Override + public JobrunrJobsRecord values(String value1, Integer value2, String value3, String value4, String value5, LocalDateTime value6, LocalDateTime value7, LocalDateTime value8, String value9) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JobrunrJobsRecord + */ + public JobrunrJobsRecord() { + super(JobrunrJobs.JOBRUNR_JOBS); + } + + /** + * Create a detached, initialised JobrunrJobsRecord + */ + public JobrunrJobsRecord(String id, Integer version, String jobasjson, String jobsignature, String state, LocalDateTime createdat, LocalDateTime updatedat, LocalDateTime scheduledat, String recurringjobid) { + super(JobrunrJobs.JOBRUNR_JOBS); + + setId(id); + setVersion(version); + setJobasjson(jobasjson); + setJobsignature(jobsignature); + setState(state); + setCreatedat(createdat); + setUpdatedat(updatedat); + setScheduledat(scheduledat); + setRecurringjobid(recurringjobid); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java new file mode 100644 index 000000000..40cadbd0b --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java @@ -0,0 +1,466 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.JobrunrJobsStats; +import org.jooq.Field; +import org.jooq.Record11; +import org.jooq.Row11; +import org.jooq.impl.TableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrJobsStatsRecord extends TableRecordImpl implements Record11 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.jobrunr_jobs_stats.total. + */ + public void setTotal(Long value) { + set(0, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.total. + */ + public Long getTotal() { + return (Long) get(0); + } + + /** + * Setter for public.jobrunr_jobs_stats.awaiting. + */ + public void setAwaiting(Long value) { + set(1, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.awaiting. + */ + public Long getAwaiting() { + return (Long) get(1); + } + + /** + * Setter for public.jobrunr_jobs_stats.scheduled. + */ + public void setScheduled(Long value) { + set(2, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.scheduled. + */ + public Long getScheduled() { + return (Long) get(2); + } + + /** + * Setter for public.jobrunr_jobs_stats.enqueued. + */ + public void setEnqueued(Long value) { + set(3, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.enqueued. + */ + public Long getEnqueued() { + return (Long) get(3); + } + + /** + * Setter for public.jobrunr_jobs_stats.processing. + */ + public void setProcessing(Long value) { + set(4, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.processing. + */ + public Long getProcessing() { + return (Long) get(4); + } + + /** + * Setter for public.jobrunr_jobs_stats.failed. + */ + public void setFailed(Long value) { + set(5, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.failed. + */ + public Long getFailed() { + return (Long) get(5); + } + + /** + * Setter for public.jobrunr_jobs_stats.succeeded. + */ + public void setSucceeded(Long value) { + set(6, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.succeeded. + */ + public Long getSucceeded() { + return (Long) get(6); + } + + /** + * Setter for public.jobrunr_jobs_stats.alltimesucceeded. + */ + public void setAlltimesucceeded(Long value) { + set(7, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.alltimesucceeded. + */ + public Long getAlltimesucceeded() { + return (Long) get(7); + } + + /** + * Setter for public.jobrunr_jobs_stats.deleted. + */ + public void setDeleted(Long value) { + set(8, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.deleted. + */ + public Long getDeleted() { + return (Long) get(8); + } + + /** + * Setter for public.jobrunr_jobs_stats.nbrofbackgroundjobservers. + */ + public void setNbrofbackgroundjobservers(Long value) { + set(9, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.nbrofbackgroundjobservers. + */ + public Long getNbrofbackgroundjobservers() { + return (Long) get(9); + } + + /** + * Setter for public.jobrunr_jobs_stats.nbrofrecurringjobs. + */ + public void setNbrofrecurringjobs(Long value) { + set(10, value); + } + + /** + * Getter for public.jobrunr_jobs_stats.nbrofrecurringjobs. + */ + public Long getNbrofrecurringjobs() { + return (Long) get(10); + } + + // ------------------------------------------------------------------------- + // Record11 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + @Override + public Row11 valuesRow() { + return (Row11) super.valuesRow(); + } + + @Override + public Field field1() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.TOTAL; + } + + @Override + public Field field2() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.AWAITING; + } + + @Override + public Field field3() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.SCHEDULED; + } + + @Override + public Field field4() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.ENQUEUED; + } + + @Override + public Field field5() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.PROCESSING; + } + + @Override + public Field field6() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.FAILED; + } + + @Override + public Field field7() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.SUCCEEDED; + } + + @Override + public Field field8() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.ALLTIMESUCCEEDED; + } + + @Override + public Field field9() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.DELETED; + } + + @Override + public Field field10() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.NBROFBACKGROUNDJOBSERVERS; + } + + @Override + public Field field11() { + return JobrunrJobsStats.JOBRUNR_JOBS_STATS.NBROFRECURRINGJOBS; + } + + @Override + public Long component1() { + return getTotal(); + } + + @Override + public Long component2() { + return getAwaiting(); + } + + @Override + public Long component3() { + return getScheduled(); + } + + @Override + public Long component4() { + return getEnqueued(); + } + + @Override + public Long component5() { + return getProcessing(); + } + + @Override + public Long component6() { + return getFailed(); + } + + @Override + public Long component7() { + return getSucceeded(); + } + + @Override + public Long component8() { + return getAlltimesucceeded(); + } + + @Override + public Long component9() { + return getDeleted(); + } + + @Override + public Long component10() { + return getNbrofbackgroundjobservers(); + } + + @Override + public Long component11() { + return getNbrofrecurringjobs(); + } + + @Override + public Long value1() { + return getTotal(); + } + + @Override + public Long value2() { + return getAwaiting(); + } + + @Override + public Long value3() { + return getScheduled(); + } + + @Override + public Long value4() { + return getEnqueued(); + } + + @Override + public Long value5() { + return getProcessing(); + } + + @Override + public Long value6() { + return getFailed(); + } + + @Override + public Long value7() { + return getSucceeded(); + } + + @Override + public Long value8() { + return getAlltimesucceeded(); + } + + @Override + public Long value9() { + return getDeleted(); + } + + @Override + public Long value10() { + return getNbrofbackgroundjobservers(); + } + + @Override + public Long value11() { + return getNbrofrecurringjobs(); + } + + @Override + public JobrunrJobsStatsRecord value1(Long value) { + setTotal(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value2(Long value) { + setAwaiting(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value3(Long value) { + setScheduled(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value4(Long value) { + setEnqueued(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value5(Long value) { + setProcessing(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value6(Long value) { + setFailed(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value7(Long value) { + setSucceeded(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value8(Long value) { + setAlltimesucceeded(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value9(Long value) { + setDeleted(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value10(Long value) { + setNbrofbackgroundjobservers(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord value11(Long value) { + setNbrofrecurringjobs(value); + return this; + } + + @Override + public JobrunrJobsStatsRecord values(Long value1, Long value2, Long value3, Long value4, Long value5, Long value6, Long value7, Long value8, Long value9, Long value10, Long value11) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + value7(value7); + value8(value8); + value9(value9); + value10(value10); + value11(value11); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JobrunrJobsStatsRecord + */ + public JobrunrJobsStatsRecord() { + super(JobrunrJobsStats.JOBRUNR_JOBS_STATS); + } + + /** + * Create a detached, initialised JobrunrJobsStatsRecord + */ + public JobrunrJobsStatsRecord(Long total, Long awaiting, Long scheduled, Long enqueued, Long processing, Long failed, Long succeeded, Long alltimesucceeded, Long deleted, Long nbrofbackgroundjobservers, Long nbrofrecurringjobs) { + super(JobrunrJobsStats.JOBRUNR_JOBS_STATS); + + setTotal(total); + setAwaiting(awaiting); + setScheduled(scheduled); + setEnqueued(enqueued); + setProcessing(processing); + setFailed(failed); + setSucceeded(succeeded); + setAlltimesucceeded(alltimesucceeded); + setDeleted(deleted); + setNbrofbackgroundjobservers(nbrofbackgroundjobservers); + setNbrofrecurringjobs(nbrofrecurringjobs); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java new file mode 100644 index 000000000..ea28532dc --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java @@ -0,0 +1,293 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import java.time.LocalDateTime; + +import org.eclipse.openvsx.jooq.tables.JobrunrMetadata; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrMetadataRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.jobrunr_metadata.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.jobrunr_metadata.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.jobrunr_metadata.name. + */ + public void setName(String value) { + set(1, value); + } + + /** + * Getter for public.jobrunr_metadata.name. + */ + public String getName() { + return (String) get(1); + } + + /** + * Setter for public.jobrunr_metadata.owner. + */ + public void setOwner(String value) { + set(2, value); + } + + /** + * Getter for public.jobrunr_metadata.owner. + */ + public String getOwner() { + return (String) get(2); + } + + /** + * Setter for public.jobrunr_metadata.value. + */ + public void setValue(String value) { + set(3, value); + } + + /** + * Getter for public.jobrunr_metadata.value. + */ + public String getValue() { + return (String) get(3); + } + + /** + * Setter for public.jobrunr_metadata.createdat. + */ + public void setCreatedat(LocalDateTime value) { + set(4, value); + } + + /** + * Getter for public.jobrunr_metadata.createdat. + */ + public LocalDateTime getCreatedat() { + return (LocalDateTime) get(4); + } + + /** + * Setter for public.jobrunr_metadata.updatedat. + */ + public void setUpdatedat(LocalDateTime value) { + set(5, value); + } + + /** + * Getter for public.jobrunr_metadata.updatedat. + */ + public LocalDateTime getUpdatedat() { + return (LocalDateTime) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return JobrunrMetadata.JOBRUNR_METADATA.ID; + } + + @Override + public Field field2() { + return JobrunrMetadata.JOBRUNR_METADATA.NAME; + } + + @Override + public Field field3() { + return JobrunrMetadata.JOBRUNR_METADATA.OWNER; + } + + @Override + public Field field4() { + return JobrunrMetadata.JOBRUNR_METADATA.VALUE; + } + + @Override + public Field field5() { + return JobrunrMetadata.JOBRUNR_METADATA.CREATEDAT; + } + + @Override + public Field field6() { + return JobrunrMetadata.JOBRUNR_METADATA.UPDATEDAT; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public String component2() { + return getName(); + } + + @Override + public String component3() { + return getOwner(); + } + + @Override + public String component4() { + return getValue(); + } + + @Override + public LocalDateTime component5() { + return getCreatedat(); + } + + @Override + public LocalDateTime component6() { + return getUpdatedat(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public String value2() { + return getName(); + } + + @Override + public String value3() { + return getOwner(); + } + + @Override + public String value4() { + return getValue(); + } + + @Override + public LocalDateTime value5() { + return getCreatedat(); + } + + @Override + public LocalDateTime value6() { + return getUpdatedat(); + } + + @Override + public JobrunrMetadataRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JobrunrMetadataRecord value2(String value) { + setName(value); + return this; + } + + @Override + public JobrunrMetadataRecord value3(String value) { + setOwner(value); + return this; + } + + @Override + public JobrunrMetadataRecord value4(String value) { + setValue(value); + return this; + } + + @Override + public JobrunrMetadataRecord value5(LocalDateTime value) { + setCreatedat(value); + return this; + } + + @Override + public JobrunrMetadataRecord value6(LocalDateTime value) { + setUpdatedat(value); + return this; + } + + @Override + public JobrunrMetadataRecord values(String value1, String value2, String value3, String value4, LocalDateTime value5, LocalDateTime value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JobrunrMetadataRecord + */ + public JobrunrMetadataRecord() { + super(JobrunrMetadata.JOBRUNR_METADATA); + } + + /** + * Create a detached, initialised JobrunrMetadataRecord + */ + public JobrunrMetadataRecord(String id, String name, String owner, String value, LocalDateTime createdat, LocalDateTime updatedat) { + super(JobrunrMetadata.JOBRUNR_METADATA); + + setId(id); + setName(name); + setOwner(owner); + setValue(value); + setCreatedat(createdat); + setUpdatedat(updatedat); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java new file mode 100644 index 000000000..e6ca4038b --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java @@ -0,0 +1,180 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.JobrunrMigrations; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrMigrationsRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.jobrunr_migrations.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.jobrunr_migrations.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.jobrunr_migrations.script. + */ + public void setScript(String value) { + set(1, value); + } + + /** + * Getter for public.jobrunr_migrations.script. + */ + public String getScript() { + return (String) get(1); + } + + /** + * Setter for public.jobrunr_migrations.installedon. + */ + public void setInstalledon(String value) { + set(2, value); + } + + /** + * Getter for public.jobrunr_migrations.installedon. + */ + public String getInstalledon() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JobrunrMigrations.JOBRUNR_MIGRATIONS.ID; + } + + @Override + public Field field2() { + return JobrunrMigrations.JOBRUNR_MIGRATIONS.SCRIPT; + } + + @Override + public Field field3() { + return JobrunrMigrations.JOBRUNR_MIGRATIONS.INSTALLEDON; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public String component2() { + return getScript(); + } + + @Override + public String component3() { + return getInstalledon(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public String value2() { + return getScript(); + } + + @Override + public String value3() { + return getInstalledon(); + } + + @Override + public JobrunrMigrationsRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JobrunrMigrationsRecord value2(String value) { + setScript(value); + return this; + } + + @Override + public JobrunrMigrationsRecord value3(String value) { + setInstalledon(value); + return this; + } + + @Override + public JobrunrMigrationsRecord values(String value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JobrunrMigrationsRecord + */ + public JobrunrMigrationsRecord() { + super(JobrunrMigrations.JOBRUNR_MIGRATIONS); + } + + /** + * Create a detached, initialised JobrunrMigrationsRecord + */ + public JobrunrMigrationsRecord(String id, String script, String installedon) { + super(JobrunrMigrations.JOBRUNR_MIGRATIONS); + + setId(id); + setScript(script); + setInstalledon(installedon); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java new file mode 100644 index 000000000..a7b29a751 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java @@ -0,0 +1,180 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.JobrunrRecurringJobs; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class JobrunrRecurringJobsRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.jobrunr_recurring_jobs.id. + */ + public void setId(String value) { + set(0, value); + } + + /** + * Getter for public.jobrunr_recurring_jobs.id. + */ + public String getId() { + return (String) get(0); + } + + /** + * Setter for public.jobrunr_recurring_jobs.version. + */ + public void setVersion(Integer value) { + set(1, value); + } + + /** + * Getter for public.jobrunr_recurring_jobs.version. + */ + public Integer getVersion() { + return (Integer) get(1); + } + + /** + * Setter for public.jobrunr_recurring_jobs.jobasjson. + */ + public void setJobasjson(String value) { + set(2, value); + } + + /** + * Getter for public.jobrunr_recurring_jobs.jobasjson. + */ + public String getJobasjson() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.ID; + } + + @Override + public Field field2() { + return JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.VERSION; + } + + @Override + public Field field3() { + return JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.JOBASJSON; + } + + @Override + public String component1() { + return getId(); + } + + @Override + public Integer component2() { + return getVersion(); + } + + @Override + public String component3() { + return getJobasjson(); + } + + @Override + public String value1() { + return getId(); + } + + @Override + public Integer value2() { + return getVersion(); + } + + @Override + public String value3() { + return getJobasjson(); + } + + @Override + public JobrunrRecurringJobsRecord value1(String value) { + setId(value); + return this; + } + + @Override + public JobrunrRecurringJobsRecord value2(Integer value) { + setVersion(value); + return this; + } + + @Override + public JobrunrRecurringJobsRecord value3(String value) { + setJobasjson(value); + return this; + } + + @Override + public JobrunrRecurringJobsRecord values(String value1, Integer value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached JobrunrRecurringJobsRecord + */ + public JobrunrRecurringJobsRecord() { + super(JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS); + } + + /** + * Create a detached, initialised JobrunrRecurringJobsRecord + */ + public JobrunrRecurringJobsRecord(String id, Integer version, String jobasjson) { + super(JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS); + + setId(id); + setVersion(version); + setJobasjson(jobasjson); + } +} diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java new file mode 100644 index 000000000..67a0b5a23 --- /dev/null +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java @@ -0,0 +1,217 @@ +/* + * This file is generated by jOOQ. + */ +package org.eclipse.openvsx.jooq.tables.records; + + +import org.eclipse.openvsx.jooq.tables.MigrationItem; +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record4; +import org.jooq.Row4; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class MigrationItemRecord extends UpdatableRecordImpl implements Record4 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for public.migration_item.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for public.migration_item.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for public.migration_item.migration_script. + */ + public void setMigrationScript(String value) { + set(1, value); + } + + /** + * Getter for public.migration_item.migration_script. + */ + public String getMigrationScript() { + return (String) get(1); + } + + /** + * Setter for public.migration_item.entity_id. + */ + public void setEntityId(Long value) { + set(2, value); + } + + /** + * Getter for public.migration_item.entity_id. + */ + public Long getEntityId() { + return (Long) get(2); + } + + /** + * Setter for public.migration_item.migration_scheduled. + */ + public void setMigrationScheduled(Boolean value) { + set(3, value); + } + + /** + * Getter for public.migration_item.migration_scheduled. + */ + public Boolean getMigrationScheduled() { + return (Boolean) get(3); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record4 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + @Override + public Row4 valuesRow() { + return (Row4) super.valuesRow(); + } + + @Override + public Field field1() { + return MigrationItem.MIGRATION_ITEM.ID; + } + + @Override + public Field field2() { + return MigrationItem.MIGRATION_ITEM.MIGRATION_SCRIPT; + } + + @Override + public Field field3() { + return MigrationItem.MIGRATION_ITEM.ENTITY_ID; + } + + @Override + public Field field4() { + return MigrationItem.MIGRATION_ITEM.MIGRATION_SCHEDULED; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getMigrationScript(); + } + + @Override + public Long component3() { + return getEntityId(); + } + + @Override + public Boolean component4() { + return getMigrationScheduled(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getMigrationScript(); + } + + @Override + public Long value3() { + return getEntityId(); + } + + @Override + public Boolean value4() { + return getMigrationScheduled(); + } + + @Override + public MigrationItemRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public MigrationItemRecord value2(String value) { + setMigrationScript(value); + return this; + } + + @Override + public MigrationItemRecord value3(Long value) { + setEntityId(value); + return this; + } + + @Override + public MigrationItemRecord value4(Boolean value) { + setMigrationScheduled(value); + return this; + } + + @Override + public MigrationItemRecord values(Long value1, String value2, Long value3, Boolean value4) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached MigrationItemRecord + */ + public MigrationItemRecord() { + super(MigrationItem.MIGRATION_ITEM); + } + + /** + * Create a detached, initialised MigrationItemRecord + */ + public MigrationItemRecord(Long id, String migrationScript, Long entityId, Boolean migrationScheduled) { + super(MigrationItem.MIGRATION_ITEM); + + setId(id); + setMigrationScript(migrationScript); + setEntityId(entityId); + setMigrationScheduled(migrationScheduled); + } +} diff --git a/server/src/main/resources/db/migration/V1_29__FileResource_ContentType.sql b/server/src/main/resources/db/migration/V1_29__FileResource_ContentType.sql new file mode 100644 index 000000000..99c938250 --- /dev/null +++ b/server/src/main/resources/db/migration/V1_29__FileResource_ContentType.sql @@ -0,0 +1,7 @@ +ALTER TABLE file_resource ADD COLUMN content_type CHARACTER VARYING(255); + +INSERT INTO migration_item(id, migration_script, entity_id, migration_scheduled) +SELECT nextval('hibernate_sequence'), 'V1_29__FileResource_ContentType.sql', ev.id, FALSE +FROM extension_version ev +JOIN extension e ON e.id = ev.extension_id +ORDER BY e.download_count DESC; \ No newline at end of file diff --git a/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java b/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java index a007ff656..f2d244291 100644 --- a/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java +++ b/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java @@ -1882,6 +1882,7 @@ private FileResource mockReadme(String targetPlatform) { resource.setName("README"); resource.setType(FileResource.README); resource.setContent("Please read me".getBytes()); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByName(extVersion, "README")) @@ -1896,6 +1897,7 @@ private FileResource mockChangelog() { resource.setName("CHANGELOG"); resource.setType(FileResource.CHANGELOG); resource.setContent("All notable changes is documented here".getBytes()); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByName(extVersion, "CHANGELOG")) @@ -1910,6 +1912,7 @@ private FileResource mockLicense() { resource.setName("LICENSE"); resource.setType(FileResource.LICENSE); resource.setContent("I never broke the Law! I am the law!".getBytes()); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByName(extVersion, "LICENSE")) diff --git a/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java b/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java index 6d49d0a4d..8192b40cf 100644 --- a/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java +++ b/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java @@ -17,7 +17,6 @@ import java.io.IOException; import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; import java.util.*; @@ -55,6 +54,7 @@ import org.springframework.data.elasticsearch.core.SearchHitsImpl; import org.springframework.data.elasticsearch.core.TotalHitsRelation; import org.springframework.data.util.Streamable; +import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.test.web.servlet.MockMvc; @@ -222,6 +222,7 @@ public void testAsset() throws Exception { mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.Manifest")) .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().string("{\"foo\":\"bar\"}")); } @@ -232,6 +233,7 @@ public void testAssetMacOSX() throws Exception { mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}?targetPlatform={target}", "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.Manifest", target)) .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().string("{\"foo\":\"bar\",\"target\":\"darwin-arm64\"}")); } @@ -245,6 +247,15 @@ public void testAssetNotFound() throws Exception { .andExpect(status().isNotFound()); } + @Test + public void testAssetVsixPackage() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Services.VSIXPackage")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/zip")); + } + @Test public void testGetItem() throws Exception { var extension = mockExtension(); @@ -256,14 +267,65 @@ public void testGetItem() throws Exception { } @Test - public void testWebResourceAsset() throws Exception { + public void testDefaultWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/resources/data.bin")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE)) + .andExpect(content().string("data.bin")); + } + + @Test + public void testPngWebResourceAsset() throws Exception { mockExtensionVersion(); mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/img/logo.png")) .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.IMAGE_PNG_VALUE)) .andExpect(content().string("logo.png")); } + @Test + public void testCssWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/css/main.css")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "text/css")) + .andExpect(content().string(".main { margin: 0 auto; }")); + } + + @Test + public void testChunkCssWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/css/main.9cab4879.chunk.css")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "text/css")) + .andExpect(content().string(".root { margin: 0 auto; }")); + } + + @Test + public void testJsWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/js/main.js")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/javascript")) + .andExpect(content().string("() => { console.log('main'); }")); + } + + @Test + public void testChunkJsWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/js/main.34d01954.chunk.js")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/javascript")) + .andExpect(content().string("() => { console.log('js'); }")); + } + @Test public void testNotWebResourceAsset() throws Exception { mockExtensionVersion(); @@ -348,12 +410,12 @@ public void testBrowseTopDir() throws Exception { Mockito.when(repositories.findActiveExtensionVersionsByVersion(version, extensionName, namespaceName)) .thenReturn(List.of(extVersion)); - var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, "".getBytes(StandardCharsets.UTF_8)); - var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8)); - var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8)); - var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8)); - var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8)); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8)); + var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, "".getBytes(StandardCharsets.UTF_8), "application/xml"); + var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8), "application/json"); + var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8), "text/plain"); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8), "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "")) .thenReturn(List.of(vsixResource, manifestResource, readmeResource, changelogResource, licenseResource, iconResource)); @@ -385,7 +447,7 @@ public void testBrowseVsixManifest() throws Exception { .thenReturn(List.of(extVersion)); var content = "".getBytes(StandardCharsets.UTF_8); - var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, content); + var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, content, "application/xml"); Mockito.when(repositories.findResourceFileResources(1L, "extension.vsixmanifest")) .thenReturn(List.of(vsixResource)); @@ -420,7 +482,7 @@ public void testBrowseVsixManifestUniversal() throws Exception { .thenReturn(extVersions); var content = "".getBytes(StandardCharsets.UTF_8); - var vsixResource = mockFileResource(15, extVersions.get(0), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content); + var vsixResource = mockFileResource(15, extVersions.get(0), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content, "application/xml"); Mockito.when(repositories.findResourceFileResources(1L, "extension.vsixmanifest")) .thenReturn(List.of(vsixResource)); @@ -455,7 +517,7 @@ public void testBrowseVsixManifestWindows() throws Exception { .thenReturn(extVersions); var content = "".getBytes(StandardCharsets.UTF_8); - var vsixResource = mockFileResource(15, extVersions.get(2), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content); + var vsixResource = mockFileResource(15, extVersions.get(2), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content, "application/xml"); Mockito.when(repositories.findResourceFileResources(4L, "extension.vsixmanifest")) .thenReturn(List.of(vsixResource)); @@ -484,11 +546,11 @@ public void testBrowseExtensionDir() throws Exception { Mockito.when(repositories.findActiveExtensionVersionsByVersion(version, extensionName, namespaceName)) .thenReturn(List.of(extVersion)); - var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8)); - var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8)); - var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8)); - var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8)); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8)); + var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8), "application/json"); + var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8), "text/plain"); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8), "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "extension")) .thenReturn(List.of(manifestResource, readmeResource, changelogResource, licenseResource, iconResource)); @@ -524,7 +586,7 @@ public void testBrowsePackageJson() throws Exception { .thenReturn(List.of(extVersion)); var content = "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8); - var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, content); + var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, content, "application/json"); Mockito.when(repositories.findResourceFileResources(1L, "extension/package.json")) .thenReturn(List.of(manifestResource)); @@ -553,7 +615,7 @@ public void testBrowseImagesDir() throws Exception { .thenReturn(List.of(extVersion)); var content = "ICON128".getBytes(StandardCharsets.UTF_8); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content, "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "extension/images")) .thenReturn(List.of(iconResource)); @@ -583,7 +645,7 @@ public void testBrowseIcon() throws Exception { .thenReturn(List.of(extVersion)); var content = "ICON128".getBytes(StandardCharsets.UTF_8); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content, "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "extension/images/icon128.png")) .thenReturn(List.of(iconResource)); @@ -745,10 +807,11 @@ private FileResource mockFileResource(long id, ExtensionVersion extVersion, Stri return resource; } - private FileResource mockFileResource(long id, ExtensionVersion extVersion, String name, String type, String storageType, byte[] content) { + private FileResource mockFileResource(long id, ExtensionVersion extVersion, String name, String type, String storageType, byte[] content, String contentType) { var resource = mockFileResource(id, extVersion, name, type); resource.setStorageType(storageType); resource.setContent(content); + resource.setContentType(contentType); return resource; } @@ -771,6 +834,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json extension.setAverageRating(3.0); extension.setNamespace(namespace); var extVersion = new ExtensionVersion(); + extVersion.setExtension(extension); extension.getVersions().add(extVersion); extVersion.setTargetPlatform(targetPlatform); extVersion.setVersion("0.5.2"); @@ -792,13 +856,14 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json Mockito.when(repositories.findVersions(extension)) .thenReturn(Streamable.of(extVersion)); Mockito.when(repositories.countMemberships(namespace, NamespaceMembership.ROLE_OWNER)) - .thenReturn(0l); + .thenReturn(0L); Mockito.when(repositories.countActiveReviews(extension)) - .thenReturn(10l); + .thenReturn(10L); var extensionFile = new FileResource(); extensionFile.setExtension(extVersion); extensionFile.setName("redhat.vscode-yaml-0.5.2.vsix"); extensionFile.setType(FileResource.DOWNLOAD); + extensionFile.setContentType("application/zip"); extensionFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(extensionFile)).thenReturn(extensionFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.DOWNLOAD)) @@ -812,6 +877,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json if(!targetPlatform.equals(TargetPlatform.NAME_UNIVERSAL)) manifestContent.put("target", targetPlatform); manifestFile.setContent(new ObjectMapper().writeValueAsBytes(manifestContent)); + manifestFile.setContentType(MediaType.APPLICATION_JSON_VALUE); manifestFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(manifestFile)).thenReturn(manifestFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.MANIFEST)) @@ -820,6 +886,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json readmeFile.setExtension(extVersion); readmeFile.setName("README.md"); readmeFile.setType(FileResource.README); + readmeFile.setContentType("text/markdown"); readmeFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(readmeFile)).thenReturn(readmeFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.README)) @@ -828,6 +895,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json changelogFile.setExtension(extVersion); changelogFile.setName("CHANGELOG.md"); changelogFile.setType(FileResource.CHANGELOG); + changelogFile.setContentType("text/markdown"); changelogFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(changelogFile)).thenReturn(changelogFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.CHANGELOG)) @@ -836,6 +904,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json licenseFile.setExtension(extVersion); licenseFile.setName("LICENSE.txt"); licenseFile.setType(FileResource.LICENSE); + licenseFile.setContentType(MediaType.TEXT_PLAIN_VALUE); licenseFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(licenseFile)).thenReturn(licenseFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.LICENSE)) @@ -844,19 +913,71 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json iconFile.setExtension(extVersion); iconFile.setName("icon128.png"); iconFile.setType(FileResource.ICON); + iconFile.setContentType(MediaType.IMAGE_PNG_VALUE); iconFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(iconFile)).thenReturn(iconFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.ICON)) .thenReturn(iconFile); - var webResourceFile = new FileResource(); - webResourceFile.setExtension(extVersion); - webResourceFile.setName("extension/img/logo.png"); - webResourceFile.setType(FileResource.RESOURCE); - webResourceFile.setStorageType(STORAGE_DB); - webResourceFile.setContent("logo.png".getBytes()); - Mockito.when(entityManager.merge(webResourceFile)).thenReturn(webResourceFile); + var binWebResourceFile = new FileResource(); + binWebResourceFile.setExtension(extVersion); + binWebResourceFile.setName("extension/resources/data.bin"); + binWebResourceFile.setType(FileResource.RESOURCE); + binWebResourceFile.setStorageType(STORAGE_DB); + binWebResourceFile.setContent("data.bin".getBytes()); + binWebResourceFile.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + Mockito.when(entityManager.merge(binWebResourceFile)).thenReturn(binWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/resources/data.bin")) + .thenReturn(binWebResourceFile); + var pngWebResourceFile = new FileResource(); + pngWebResourceFile.setExtension(extVersion); + pngWebResourceFile.setName("extension/img/logo.png"); + pngWebResourceFile.setType(FileResource.RESOURCE); + pngWebResourceFile.setStorageType(STORAGE_DB); + pngWebResourceFile.setContent("logo.png".getBytes()); + pngWebResourceFile.setContentType(MediaType.IMAGE_PNG_VALUE); + Mockito.when(entityManager.merge(pngWebResourceFile)).thenReturn(pngWebResourceFile); Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/img/logo.png")) - .thenReturn(webResourceFile); + .thenReturn(pngWebResourceFile); + var jsWebResourceFile = new FileResource(); + jsWebResourceFile.setExtension(extVersion); + jsWebResourceFile.setName("extension/public/static/js/main.js"); + jsWebResourceFile.setType(FileResource.RESOURCE); + jsWebResourceFile.setStorageType(STORAGE_DB); + jsWebResourceFile.setContent("() => { console.log('main'); }".getBytes()); + jsWebResourceFile.setContentType("application/javascript"); + Mockito.when(entityManager.merge(jsWebResourceFile)).thenReturn(jsWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/js/main.js")) + .thenReturn(jsWebResourceFile); + var jsChunkWebResourceFile = new FileResource(); + jsChunkWebResourceFile.setExtension(extVersion); + jsChunkWebResourceFile.setName("extension/public/static/js/main.34d01954.chunk.js"); + jsChunkWebResourceFile.setType(FileResource.RESOURCE); + jsChunkWebResourceFile.setStorageType(STORAGE_DB); + jsChunkWebResourceFile.setContent("() => { console.log('js'); }".getBytes()); + jsChunkWebResourceFile.setContentType("application/javascript"); + Mockito.when(entityManager.merge(jsChunkWebResourceFile)).thenReturn(jsChunkWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/js/main.34d01954.chunk.js")) + .thenReturn(jsChunkWebResourceFile); + var cssWebResourceFile = new FileResource(); + cssWebResourceFile.setExtension(extVersion); + cssWebResourceFile.setName("extension/public/static/css/main.css"); + cssWebResourceFile.setType(FileResource.RESOURCE); + cssWebResourceFile.setStorageType(STORAGE_DB); + cssWebResourceFile.setContent(".main { margin: 0 auto; }".getBytes()); + cssWebResourceFile.setContentType("text/css"); + Mockito.when(entityManager.merge(cssWebResourceFile)).thenReturn(cssWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/css/main.css")) + .thenReturn(cssWebResourceFile); + var cssChunkWebResourceFile = new FileResource(); + cssChunkWebResourceFile.setExtension(extVersion); + cssChunkWebResourceFile.setName("extension/public/static/css/main.9cab4879.chunk.css"); + cssChunkWebResourceFile.setType(FileResource.RESOURCE); + cssChunkWebResourceFile.setStorageType(STORAGE_DB); + cssChunkWebResourceFile.setContent(".root { margin: 0 auto; }".getBytes()); + cssChunkWebResourceFile.setContentType("text/css"); + Mockito.when(entityManager.merge(cssChunkWebResourceFile)).thenReturn(cssChunkWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/css/main.9cab4879.chunk.css")) + .thenReturn(cssChunkWebResourceFile); Mockito.when(repositories.findFilesByType(anyCollection(), anyCollection())).thenAnswer(invocation -> { Collection extVersions = invocation.getArgument(0); var types = invocation.getArgument(1); @@ -869,10 +990,8 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json return extVersion; } - private String file(String name) throws UnsupportedEncodingException, IOException { - try ( - var stream = getClass().getResourceAsStream(name); - ) { + private String file(String name) throws IOException { + try (var stream = getClass().getResourceAsStream(name)) { return CharStreams.toString(new InputStreamReader(stream, "UTF-8")); } } diff --git a/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java b/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java index 84c693f2e..82808c2b5 100644 --- a/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java +++ b/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java @@ -146,6 +146,7 @@ void testExecuteQueries() { () -> repositories.findNotMigratedResources(), () -> repositories.findNotMigratedPreReleases(), () -> repositories.findNotMigratedRenamedDownloads(), + () -> repositories.findNotMigratedContentTypes(), () -> repositories.topMostActivePublishingUsers(NOW, 1), () -> repositories.topNamespaceExtensions(NOW, 1), () -> repositories.topNamespaceExtensionVersions(NOW, 1),