From de4106d8d2bd8e88c7cc9b9e51f08aff754cca00 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 30 Jun 2025 08:23:43 -0400 Subject: [PATCH 01/41] Scaffolding --- .../vcell/restq/handlers/ExportResource.java | 58 +++++++++++++++++++ .../vcell/restq/services/ExportService.java | 29 ++++++++++ .../java/cbit/vcell/modeldb/DBTopLevel.java | 26 +++++++++ .../vcell/modeldb/DatabaseServerImpl.java | 8 +++ .../vcell/modeldb/ExportHistoryDBDriver.java | 41 +++++++++++++ .../vcell/modeldb/ExportHistoryTable.java | 22 +++++++ 6 files changed, 184 insertions(+) create mode 100644 vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java create mode 100644 vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java create mode 100644 vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java create mode 100644 vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java new file mode 100644 index 0000000000..d5b8ab44f2 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -0,0 +1,58 @@ +package org.vcell.restq.handlers; + +import io.quarkus.security.identity.SecurityIdentity; +import jakarta.annotation.security.RolesAllowed; +import jakarta.inject.Inject; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import org.eclipse.microprofile.openapi.annotations.Operation; +import org.vcell.restq.errors.exceptions.DataAccessWebException; +import org.vcell.restq.errors.exceptions.NotAuthenticatedWebException; +import org.vcell.restq.services.ExportService; +import org.vcell.restq.services.UserRestService; +import org.vcell.util.DataAccessException; +import org.vcell.util.document.User; + +@Path("/api/v1/exports") +public class ExportResource { + + @Inject + SecurityIdentity securityIdentity; + @Inject + UserRestService userRestService; + @Inject + ExportService exportService; + + @Path("/history") + @POST + @RolesAllowed("user") + @Operation(operationId = "addExportHistory", description = "Adds provided export information to a users export history.") + public void addExportHistory(ExportHistory history) throws DataAccessWebException, NotAuthenticatedWebException { + User user = userRestService.getUserFromIdentity(securityIdentity); + try{ + exportService.addExportHistory(user, history); + } catch (DataAccessException e) { + throw new DataAccessWebException(e.getMessage(), e); + } + } + + @Path("/history") + @GET + @RolesAllowed("user") + @Operation(operationId = "getExportHistory") + public ExportHistory getExportHistory() throws DataAccessWebException, NotAuthenticatedWebException { + User user = userRestService.getUserFromIdentity(securityIdentity); + try { + return exportService.getExportHistory(user); + } catch (DataAccessException e) { + throw new DataAccessWebException(e.getMessage(), e); + } + } + + + public record ExportHistory( + String exportHistory + ){ } + +} diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java new file mode 100644 index 0000000000..3aa5abfad2 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java @@ -0,0 +1,29 @@ +package org.vcell.restq.services; + +import cbit.vcell.modeldb.DatabaseServerImpl; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.vcell.restq.db.AgroalConnectionFactory; +import org.vcell.restq.handlers.ExportResource; +import org.vcell.util.DataAccessException; +import org.vcell.util.document.User; + +@ApplicationScoped +public class ExportService { + private final DatabaseServerImpl databaseServer; + + @Inject + public ExportService(AgroalConnectionFactory connectionFactory) throws DataAccessException { + this.databaseServer = new DatabaseServerImpl(connectionFactory, connectionFactory.getKeyFactory()); + } + + + public ExportResource.ExportHistory getExportHistory(User user) throws DataAccessException { + return new ExportResource.ExportHistory("Hello"); + } + + public void addExportHistory(User user, ExportResource.ExportHistory history) throws DataAccessException { + databaseServer.addExportHistory(user, history.exportHistory()); + } + +} diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java index 4b5b183172..a85ea9d438 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java @@ -53,6 +53,7 @@ public class DBTopLevel extends AbstractDBTopLevel{ private final BioModelDbDriver bioModelDB; private final MathModelDbDriver mathModelDB; private final UserDbDriver userDB; + private final ExportHistoryDBDriver exportHistoryDB; // private DBCacheTable dbCacheTable = null; private static final int SQL_ERROR_CODE_BADCONNECTION = 1010; //?????????????????????????????????????? @@ -75,6 +76,7 @@ public class DBTopLevel extends AbstractDBTopLevel{ this.userDB = new UserDbDriver(); this.bioModelDB = new BioModelDbDriver(databaseSyntax,keyFactory); this.mathModelDB = new MathModelDbDriver(databaseSyntax, keyFactory); + this.exportHistoryDB = new ExportHistoryDBDriver(databaseSyntax, keyFactory); } @@ -2254,4 +2256,28 @@ public SimulationRep getSimulationRep(KeyValue simKey, boolean bEnableRetry) thr conFactory.release(con,lock); } } + + public void insertExportHistory(User user, String exportHistoryValues, boolean bEnableRetry) throws SQLException, DataAccessException { + Object lock = new Object(); + Connection con = conFactory.getConnection(lock); + try { + exportHistoryDB.addExportHistory(con, user, exportHistoryValues); + } catch (Throwable e) { + lg.error(e.getMessage(),e); + try { + con.rollback(); + }catch (Throwable rbe){ + lg.error("exception during rollback, bEnableRetry = "+bEnableRetry, rbe); + } + if (bEnableRetry && isBadConnection(con)) { + conFactory.failed(con,lock); + insertExportHistory(user, exportHistoryValues, false); + }else{ + handle_DataAccessException_SQLException(e); + } + }finally{ + conFactory.release(con,lock); + } + } + } diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java index a131f8f40c..fcb2e0abca 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java @@ -1355,4 +1355,12 @@ public BigString saveVCImageAs(User user, BigString vcImageXML, java.lang.String } } +public void addExportHistory(User user, String exportHistory) throws DataAccessException { + try { + dbTop.insertExportHistory(user, exportHistory, true); + } catch (SQLException e) { + throw new DataAccessException(e); + } +} + } diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java b/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java new file mode 100644 index 0000000000..9e8e5a79d9 --- /dev/null +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java @@ -0,0 +1,41 @@ +package cbit.vcell.modeldb; + +import org.vcell.db.DatabaseSyntax; +import org.vcell.db.KeyFactory; +import org.vcell.util.DataAccessException; +import org.vcell.util.DependencyException; +import org.vcell.util.ObjectNotFoundException; +import org.vcell.util.PermissionException; +import org.vcell.util.document.KeyValue; +import org.vcell.util.document.User; +import org.vcell.util.document.VersionableType; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; + +public class ExportHistoryDBDriver{ + public static final ExportHistoryTable exportHistoryTable = ExportHistoryTable.table; + public static final BioModelTable bioModelTable = BioModelTable.table; + public static final PublicationTable publicationTable = PublicationTable.table; + public static final UserTable userTable = UserTable.table; + public static final BioModelSimulationLinkTable bioModelSimLinkTable = BioModelSimulationLinkTable.table; + public static final BioModelSimContextLinkTable bioModelSimContextLinkTable = BioModelSimContextLinkTable.table; + public static final SimulationTable simTable = SimulationTable.table; + public static final SimContextTable simContextTable = SimContextTable.table; + + /** + * LocalDBManager constructor comment. + */ + public ExportHistoryDBDriver(DatabaseSyntax dbSyntax, KeyFactory keyFactory) { + + } + + + public void addExportHistory(Connection con, User user, String values) + throws SQLException, DependencyException, PermissionException, DataAccessException, ObjectNotFoundException { + PreparedStatement statement = con.prepareStatement("INSERT INTO F VALUES (?, ?, ?, ?)"); + statement.setString(1, values); + statement.execute(); + } +} diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java b/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java new file mode 100644 index 0000000000..ea47e63b4e --- /dev/null +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java @@ -0,0 +1,22 @@ +package cbit.vcell.modeldb; + +import cbit.sql.Field; +import cbit.sql.Table; + +public class ExportHistoryTable extends Table{ + private static final String TABLE_NAME = "vc_exporthistory"; + + public final Field modelRef = new Field("modelRef", Field.SQLDataType.integer, "NOT NULL "+ModelTable.REF_TYPE); + public final Field childSummaryLarge = new Field("childSummaryLRG", Field.SQLDataType.clob_text, ""); + public final Field childSummarySmall = new Field("childSummarySML", Field.SQLDataType.varchar2_4000, ""); + + private final Field fields[] = {modelRef,childSummaryLarge,childSummarySmall}; + + public static final ExportHistoryTable table = new ExportHistoryTable(); + + private ExportHistoryTable() { + super(TABLE_NAME); + addFields(fields); + } + +} From 03205e2679fb67cde64798368f326855c4c9cae2 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 30 Jun 2025 08:26:55 -0400 Subject: [PATCH 02/41] Interface For Export Event Creation --- .../rmi/event/ExportStatusEventCreator.java | 20 +++++++++++++++++++ .../export/server/ExportServiceImpl.java | 15 +++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java diff --git a/vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java b/vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java new file mode 100644 index 0000000000..ce5ea1aa44 --- /dev/null +++ b/vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java @@ -0,0 +1,20 @@ +package cbit.rmi.event; + +import cbit.vcell.export.server.ExportSpecs; +import org.vcell.util.document.VCDataIdentifier; + +public interface ExportStatusEventCreator { + ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs); + + void addExportListener(ExportListener listener); + + void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format); + + void fireExportEvent(ExportEvent event); + + void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message); + + void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress); + + void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) ; +} diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java index cc42dcb1b7..26290c8633 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java @@ -23,6 +23,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import cbit.rmi.event.ExportStatusEventCreator; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.ClientTaskStatusSupport; @@ -46,7 +47,7 @@ /** * This type was created in VisualAge. */ -public class ExportServiceImpl implements ExportConstants, ExportService { +public class ExportServiceImpl implements ExportService, ExportStatusEventCreator { public static final Logger lg = LogManager.getLogger(ExportServiceImpl.class); private javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList(); @@ -79,7 +80,7 @@ public synchronized void addExportListener(ExportListener listener) { * Creation date: (4/1/2001 11:20:45 AM) * @deprecated */ -protected ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location,ExportSpecs exportSpecs) { +public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location,ExportSpecs exportSpecs) { User user = null; Object object = jobRequestIDs.get(new Long(jobID)); if (object != null) { @@ -104,7 +105,7 @@ protected ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, St } -protected void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { +public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { User user = null; Object object = jobRequestIDs.get(new Long(jobID)); if (object != null) { @@ -120,7 +121,7 @@ protected void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String f * Creation date: (11/17/2000 11:43:22 AM) * @param event cbit.rmi.event.ExportEvent */ -protected void fireExportEvent(ExportEvent event) { +public void fireExportEvent(ExportEvent event) { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Reset the source to allow proper wiring @@ -140,7 +141,7 @@ protected void fireExportEvent(ExportEvent event) { * Creation date: (4/1/2001 11:20:45 AM) * @deprecated */ -protected void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { +public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { User user = null; Object object = jobRequestIDs.get(new Long(jobID)); if (object != null) { @@ -157,7 +158,7 @@ protected void fireExportFailed(long jobID, VCDataIdentifier vcdID, String forma * @param exportSpecs cbit.vcell.export.server.ExportSpecs * @param progress double */ -protected void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { +public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { User user = null; Object object = jobRequestIDs.get(new Long(jobID)); if (object != null) { @@ -173,7 +174,7 @@ protected void fireExportProgress(long jobID, VCDataIdentifier vcdID, String for * Creation date: (4/1/2001 11:20:45 AM) * @deprecated */ -protected void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { +public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { User user = null; Object object = jobRequestIDs.get(new Long(jobID)); if (object != null) { From dd0be17c69b428f46e69c0e03d470cd77655f9e1 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 30 Jun 2025 08:45:38 -0400 Subject: [PATCH 03/41] Remove Export Constants --- .../org/vcell/api/types/utils/DTOOldAPI.java | 10 +- .../main/java/org/vcell/cli/run/RunUtils.java | 10 +- .../vcell/client/data/ExportSettings.java | 31 +--- .../vcell/client/data/PDEExportDataPanel.java | 20 +-- .../vcell/export/gui/ASCIISettingsPanel.java | 38 +++-- .../vcell/export/gui/MediaSettingsPanel.java | 15 +- .../vcell/export/gui/N5SettingsPanel.java | 7 +- .../vcell/export/gui/RasterSettingsPanel.java | 12 +- .../vcell/microscopy/gui/FRAPStudyPanel.java | 19 +-- .../vcell/export/server/ASCIIExporter.java | 17 +-- .../cbit/vcell/export/server/ASCIISpecs.java | 8 +- .../vcell/export/server/ExportConstants.java | 76 ---------- .../vcell/export/server/ExportSpecss.java | 133 ++++++++++++++++++ .../cbit/vcell/export/server/ExportUtils.java | 10 +- .../export/server/FormatSpecificSpecs.java | 7 +- .../vcell/export/server/GeometrySpecs.java | 47 +++---- .../cbit/vcell/export/server/IMGExporter.java | 25 ++-- .../cbit/vcell/export/server/ImageSpecs.java | 13 +- .../cbit/vcell/export/server/MovieSpecs.java | 6 +- .../cbit/vcell/export/server/N5Exporter.java | 7 +- .../cbit/vcell/export/server/N5Specs.java | 6 +- .../vcell/export/server/RasterExporter.java | 15 +- .../cbit/vcell/export/server/RasterSpecs.java | 6 +- .../cbit/vcell/export/server/TimeSpecs.java | 14 +- .../vcell/export/server/VariableSpecs.java | 24 ++-- .../cbit/vcell/export/N5ExporterTest.java | 8 +- 26 files changed, 301 insertions(+), 283 deletions(-) delete mode 100644 vcell-core/src/main/java/cbit/vcell/export/server/ExportConstants.java create mode 100644 vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java diff --git a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java index 80270a9908..7c7ebf9a1e 100644 --- a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java +++ b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java @@ -3,6 +3,7 @@ import cbit.rmi.event.DataJobEvent; import cbit.rmi.event.ExportEvent; import cbit.rmi.event.SimulationJobStatusEvent; +import cbit.vcell.export.server.ExportSpecss; import cbit.vcell.export.server.HumanReadableExportData; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; @@ -98,22 +99,23 @@ public static ExportEventRepresentation exportEventToJsonRep(ExportEvent event) public static ExportTimeSpecs exportTimeSpecsToJsonRep(TimeSpecs timeSpecs) { ExportTimeSpecs rep = new ExportTimeSpecs(timeSpecs.getBeginTimeIndex(), timeSpecs.getEndTimeIndex(), - timeSpecs.getAllTimes(), timeSpecs.getModeID()); + timeSpecs.getAllTimes(), timeSpecs.getMode().intValue); return rep; } public static TimeSpecs timeSpecsFromJsonRep(ExportTimeSpecs rep) { - TimeSpecs timeSpecs = new TimeSpecs(rep.beginTimeIndex, rep.endTimeIndex, rep.allTimes, rep.modeID); + TimeSpecs timeSpecs = new TimeSpecs(rep.beginTimeIndex, rep.endTimeIndex, rep.allTimes, + ExportSpecss.TimeMode.getTimeMode(rep.modeID)); return timeSpecs; } public static ExportVariableSpecs variableSpecsToJsonRep(VariableSpecs variableSpecs) { - ExportVariableSpecs rep = new ExportVariableSpecs(variableSpecs.getVariableNames(), variableSpecs.getModeID()); + ExportVariableSpecs rep = new ExportVariableSpecs(variableSpecs.getVariableNames(), variableSpecs.getMode().intValue); return rep; } public static VariableSpecs variableSpecsFromJsonRep(ExportVariableSpecs rep) { - VariableSpecs variableSpecs = new VariableSpecs(rep.variableNames, rep.modeID); + VariableSpecs variableSpecs = new VariableSpecs(rep.variableNames, ExportSpecss.VariableMode.getVariableMode(rep.modeID)); return variableSpecs; } diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java index 31171de00c..73539b5fc5 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java @@ -28,6 +28,8 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; +import static cbit.vcell.export.server.ExportSpecss.VariableMode.VARIABLE_MULTI; + /** * Static class with a series of runtime utilities. Needs to be properly docummented still */ @@ -438,18 +440,18 @@ private static ExportSpecs getExportSpecs(OutputContext outputContext, User user PDEDataContext pdeDataContext = new ServerPDEDataContext(outputContext, user, dataServerImpl, vcId); List variableNames = RunUtils.getListOfVariableNames(pdeDataContext.getDataIdentifiers()); - VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportConstants.VARIABLE_MULTI); + VariableSpecs variableSpecs = new VariableSpecs(variableNames, VARIABLE_MULTI); double[] dataSetTimes = dsControllerImpl.getDataSetTimes(vcId); - TimeSpecs timeSpecs = new TimeSpecs(0,dataSetTimes.length-1, dataSetTimes, ExportConstants.TIME_RANGE); - GeometrySpecs geometrySpecs = new GeometrySpecs(null, 2, 0, ExportConstants.GEOMETRY_FULL); + TimeSpecs timeSpecs = new TimeSpecs(0,dataSetTimes.length-1, dataSetTimes, ExportSpecss.TimeMode.TIME_RANGE); + GeometrySpecs geometrySpecs = new GeometrySpecs(null, 2, 0, ExportSpecss.GeometryMode.GEOMETRY_FULL); // String simulationName,VCSimulationIdentifier vcSimulationIdentifier,ExportParamScanInfo exportParamScanInfo ExportSpecs.ExportParamScanInfo exportParamScanInfo = ExportSpecs.getParamScanInfo(vcellSim,jobIndex); ExportSpecs.SimNameSimDataID snsdi= new ExportSpecs.SimNameSimDataID(vcellSim.getName(), vcSimID, exportParamScanInfo); ExportSpecs.SimNameSimDataID[] simNameSimDataIDs = { snsdi }; - FormatSpecificSpecs formatSpecificSpecs = new ASCIISpecs(simNameSimDataIDs, ExportConstants.DataType.PDE_VARIABLE_DATA, + FormatSpecificSpecs formatSpecificSpecs = new ASCIISpecs(simNameSimDataIDs, ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.CSV, ASCIISpecs.CsvRoiLayout.var_time_val, true, false); return new ExportSpecs(vcId, ExportFormat.HDF5, variableSpecs, timeSpecs, geometrySpecs, diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java b/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java index f8cb2fad20..9ab93ec29c 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java @@ -17,26 +17,23 @@ import javax.swing.JPanel; import cbit.vcell.export.gui.*; +import cbit.vcell.export.server.*; import org.vcell.client.logicalwindow.transition.LWJDialogDecorator; import org.vcell.util.gui.GeneralGuiUtils; import org.vcell.util.VCAssert; -import cbit.vcell.export.server.ExportConstants; -import cbit.vcell.export.server.ExportFormat; -import cbit.vcell.export.server.ExportSpecs; -import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.solvers.CartesianMesh; /** * Insert the type's description here. * Creation date: (1/18/00 12:04:07 PM) * @author: Ion I. Moraru */ -public class ExportSettings implements ASCIISettingsPanelListener, RasterSettingsPanelListener, ExportConstants, java.beans.PropertyChangeListener { +public class ExportSettings implements ASCIISettingsPanelListener, RasterSettingsPanelListener, java.beans.PropertyChangeListener { private ASCIISettingsPanel ivjASCIISettingsPanel1 = null; protected transient java.beans.PropertyChangeSupport propertyChange; private ExportFormat fieldSelectedFormat; private cbit.vcell.export.server.FormatSpecificSpecs fieldFormatSpecificSpecs = null; - private int fieldSimDataType = 0; + private ExportSpecss.SimulationDataType fieldSimDataType = null; private JPanel ivjJDialogContentPane = null; private JDialog ivjJDialogASCIISettings = null; private JDialog ivjJDialogMediaSettings = null; @@ -373,7 +370,7 @@ public ExportFormat getSelectedFormat() { * @return The simDataType property value. * @see #setSimDataType */ -public int getSimDataType() { +public ExportSpecss.SimulationDataType getSimDataType() { return fieldSimDataType; } @@ -576,8 +573,8 @@ public void setSelectedFormat(ExportFormat selectedFormat) { * @param simDataType The new value for the property. * @see #getSimDataType */ -public void setSimDataType(int simDataType) { - int oldValue = fieldSimDataType; +public void setSimDataType(ExportSpecss.SimulationDataType simDataType) { + ExportSpecss.SimulationDataType oldValue = fieldSimDataType; fieldSimDataType = simDataType; firePropertyChange("simDataType", oldValue, simDataType); } @@ -646,20 +643,4 @@ public boolean showFormatSpecificDialog(Frame reference,boolean selectionHasVolu return isClosedOK(); } -/** - * @param format should be FORMAT constant from {@link ExportConstants} - * @return true if selecting requires an options Dialog - */ -/* -public static boolean requiresFollowOnDialog(ExportFormat format) { - switch (format) { - case FORMAT_UCD: - case FORMAT_VTK_UNSTRUCT: - case FORMAT_VTK_IMAGE: - return false; - default: - return true; - } -} -*/ } diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java index 96e6adb51c..fdfe413ddd 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java @@ -52,7 +52,7 @@ * This type was created in VisualAge. */ @SuppressWarnings("serial") -public class PDEExportDataPanel extends JPanel implements ExportConstants { +public class PDEExportDataPanel extends JPanel { private JRadioButton bothVarRadioButton; private JLabel defineExportDataLabel; private JLabel selectVariablesLabel; @@ -502,11 +502,11 @@ private void connPtoP3SetTarget() { /** * Comment */ -public int dataType() { +public ExportSpecss.SimulationDataType dataType() { if (getPdeDataContext().hasParticleData()) { - return PDE_SIMULATION_WITH_PARTICLES; + return ExportSpecss.SimulationDataType.PDE_SIMULATION_WITH_PARTICLES; } else { - return PDE_SIMULATION_NO_PARTICLES; + return ExportSpecss.SimulationDataType.PDE_SIMULATION_NO_PARTICLES; } } @@ -634,13 +634,13 @@ private ExportSpecs getExportSpecs() { for (int i = 0; i < variableSelections.length; i++){ variableNames[i] = (String)variableSelections[i]; } - VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportConstants.VARIABLE_MULTI); - TimeSpecs timeSpecs = new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportConstants.TIME_RANGE); - int geoMode = ExportConstants.GEOMETRY_SELECTIONS; + VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportSpecss.VariableMode.VARIABLE_MULTI); + TimeSpecs timeSpecs = new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportSpecss.TimeMode.TIME_RANGE); + ExportSpecss.GeometryMode geoMode = ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS; if (getJRadioButtonSlice().isSelected()) { - geoMode = ExportConstants.GEOMETRY_SLICE; + geoMode = ExportSpecss.GeometryMode.GEOMETRY_SLICE; } else if (getJRadioButtonFull().isSelected()) { - geoMode = ExportConstants.GEOMETRY_FULL; + geoMode = ExportSpecss.GeometryMode.GEOMETRY_FULL; } Object[] selectionsArr = getROISelections().getSelectedValuesList().toArray(); SpatialSelection[] selections = new SpatialSelection[selectionsArr.length]; @@ -2077,7 +2077,7 @@ private void startExport() { PopupGenerator.showErrorDialog(this, "To export selections, you must select at least one item from the ROI selection list"); } - getExportSettings1().setTimeSpecs(new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportConstants.TIME_RANGE)); + getExportSettings1().setTimeSpecs(new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportSpecss.TimeMode.TIME_RANGE)); getExportSettings1().setDisplayPreferences(displayPreferences,Arrays.asList(variableSelections).toArray(new String[0]),viewZoom); getExportSettings1().setSliceCount(FormatSpecificSpecs.getSliceCount(getJRadioButtonFull().isSelected(), getNormalAxis(), getPdeDataContext().getCartesianMesh())); getExportSettings1().setImageSizeCalculationInfo(getPdeDataContext().getCartesianMesh(),getNormalAxis()); diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java index 9327abf9b1..cffa1039ea 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java @@ -19,16 +19,14 @@ import javax.swing.JButton; import javax.swing.JCheckBox; -import cbit.vcell.export.server.ASCIISpecs; -import cbit.vcell.export.server.ExportConstants; -import cbit.vcell.export.server.ExportFormat; -import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.export.server.*; + import javax.swing.JLabel; /** * This type was created in VisualAge. */ @SuppressWarnings("serial") -public class ASCIISettingsPanel extends javax.swing.JPanel implements ExportConstants, java.awt.event.ActionListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, javax.swing.event.ChangeListener { +public class ASCIISettingsPanel extends javax.swing.JPanel implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, javax.swing.event.ChangeListener { private javax.swing.JButton ivjJButtonOK = null; private javax.swing.ButtonGroup ivjButtonGroup1 = null; private javax.swing.JLabel ivjJLabelDataType = null; @@ -38,8 +36,8 @@ public class ASCIISettingsPanel extends javax.swing.JPanel implements ExportCons private javax.swing.JCheckBox ivjJCheckBoxSwitch = null; private javax.swing.JLabel ivjJLabelAdditional = null; private boolean fieldSwitchRowsColumns = false; - private int fieldSimDataType = 0; - private DataType fieldExportDataType; + private ExportSpecss.SimulationDataType fieldSimDataType = null; + private ExportSpecss.ExportableDataType fieldExportDataType; private javax.swing.JButton ivjCancelJButton = null; private javax.swing.JPanel ivjJPanel1 = null; /** @@ -295,7 +293,7 @@ private javax.swing.JButton getCancelJButton() { * @return The exportDataType property value. * @see #setExportDataType */ -private ExportConstants.DataType getExportDataType() { +private ExportSpecss.ExportableDataType getExportDataType() { return fieldExportDataType; } /** @@ -466,7 +464,7 @@ private javax.swing.JRadioButton getJRadioButtonVariables() { * @return The simDataType property value. * @see #setSimDataType */ -private int getSimDataType() { +private ExportSpecss.SimulationDataType getSimDataType() { return fieldSimDataType; } /** @@ -641,8 +639,8 @@ public void propertyChange(java.beans.PropertyChangeEvent evt) { * @param odeVariableData The new value for the property. * @see #getExportDataType */ -private void setExportDataType(DataType odeVariableData) { - DataType oldValue = fieldExportDataType; +private void setExportDataType(ExportSpecss.ExportableDataType odeVariableData) { + ExportSpecss.ExportableDataType oldValue = fieldExportDataType; fieldExportDataType = odeVariableData; firePropertyChange("exportDataType", oldValue, odeVariableData); } @@ -651,10 +649,10 @@ private void setExportDataType(DataType odeVariableData) { * @param simDataType The new value for the property. * @see #getSimDataType */ -public void setSimDataType(int simDataType) { - int oldValue = fieldSimDataType; +public void setSimDataType(ExportSpecss.SimulationDataType simDataType) { + ExportSpecss.SimulationDataType oldValue = fieldSimDataType; fieldSimDataType = simDataType; - firePropertyChange("simDataType", Integer.valueOf(oldValue), Integer.valueOf(simDataType)); + firePropertyChange("simDataType", oldValue, simDataType); } /** * Sets the switchRowsColumns property (boolean) value. @@ -688,22 +686,22 @@ public void stateChanged(javax.swing.event.ChangeEvent e) { /** * Comment */ -private void updateChoices(int dataType) { +private void updateChoices(ExportSpecss.SimulationDataType dataType) { switch (dataType) { case ODE_SIMULATION: getJRadioButtonParticles().setEnabled(false); getJRadioButtonVariables().setSelected(true); - setExportDataType(ExportConstants.DataType.ODE_VARIABLE_DATA); + setExportDataType(ExportSpecss.ExportableDataType.ODE_VARIABLE_DATA); break; case PDE_SIMULATION_NO_PARTICLES: getJRadioButtonParticles().setEnabled(false); getJRadioButtonVariables().setSelected(true); - setExportDataType(ExportConstants.DataType.PDE_VARIABLE_DATA); + setExportDataType(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA); break; case PDE_SIMULATION_WITH_PARTICLES: getJRadioButtonParticles().setEnabled(true); getJRadioButtonParticles().setSelected(true); - setExportDataType(ExportConstants.DataType.PDE_PARTICLE_DATA); + setExportDataType(ExportSpecss.ExportableDataType.PDE_PARTICLE_DATA); break; } return; @@ -712,8 +710,8 @@ private void updateChoices(int dataType) { * Comment */ private void updateExportDataType() { - if (getJRadioButtonVariables().isSelected()) setExportDataType(ExportConstants.DataType.PDE_VARIABLE_DATA); - if (getJRadioButtonParticles().isSelected()) setExportDataType(ExportConstants.DataType.PDE_PARTICLE_DATA); + if (getJRadioButtonVariables().isSelected()) setExportDataType(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA); + if (getJRadioButtonParticles().isSelected()) setExportDataType(ExportSpecss.ExportableDataType.PDE_PARTICLE_DATA); return; } diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java index 7c79bb90d6..4bbbd91989 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java @@ -38,6 +38,7 @@ import javax.swing.JTextArea; import javax.swing.JTextField; +import cbit.vcell.export.server.*; import org.vcell.util.BeanUtils; import org.vcell.util.Range; import org.vcell.util.gui.DialogUtils; @@ -45,12 +46,6 @@ import cbit.image.DisplayAdapterService; import cbit.image.DisplayPreferences; import cbit.image.ImagePaneModel; -import cbit.vcell.export.server.ExportConstants; -import cbit.vcell.export.server.ExportFormat; -import cbit.vcell.export.server.FormatSpecificSpecs; -import cbit.vcell.export.server.ImageSpecs; -import cbit.vcell.export.server.MovieSpecs; -import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.solvers.CartesianMesh; @SuppressWarnings("serial") @@ -450,7 +445,7 @@ public void actionPerformed(ActionEvent e) { meshMode = (scalingCombobox.getSelectedItem().equals(MESH_MODE_TEXT)?ImagePaneModel.MESH_MODE:ImagePaneModel.NORMAL_MODE); imageScale = (meshMode == ImagePaneModel.MESH_MODE?viewZoom:Integer.valueOf((String)scalingCombobox.getSelectedItem())); imageDim = FormatSpecificSpecs.getImageDimension(meshMode, imageScale, mesh, normalAxis); - imageDim = FormatSpecificSpecs.getMirrorDimension(mirrorComboBox.getSelectedIndex(), imageDim.width, imageDim.height); + imageDim = FormatSpecificSpecs.getMirrorDimension(ExportSpecss.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), imageDim.width, imageDim.height); imageDim.height = (bSeparate?imageDim.height:imageDim.height*variableNames.length); } String finalFileDescription = null; @@ -774,7 +769,7 @@ public FormatSpecificSpecs getSpecs() { bOverLay, displayPreferences, (encodeFormatGIF.isSelected()?ExportFormat.GIF:ExportFormat.FORMAT_JPEG), - mirrorComboBox.getSelectedIndex(), + ExportSpecss.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), volVarMembrOutlineThickness, imageScaling, membrScaling, @@ -788,8 +783,8 @@ public FormatSpecificSpecs getSpecs() { return new ImageSpecs( displayPreferences, mediaType, - (encodeFormatGIF.isSelected()?ExportConstants.COMPRESSED_GIF_DEFAULT:ExportConstants.COMPRESSED_JPEG_DEFAULT), - mirrorComboBox.getSelectedIndex(), + (encodeFormatGIF.isSelected()? ExportSpecss.CompressionFormats.COMPRESSED_GIF_DEFAULT:ExportSpecss.CompressionFormats.COMPRESSED_JPEG_DEFAULT), + ExportSpecss.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), duration, 0/*Infinite*/, volVarMembrOutlineThickness, diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java index 191dd2f1a3..f3f1d3db54 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java @@ -5,15 +5,12 @@ import javax.swing.*; import java.awt.*; -public class N5SettingsPanel extends javax.swing.JPanel implements ExportConstants, java.awt.event.ActionListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, javax.swing.event.ChangeListener { +public class N5SettingsPanel extends javax.swing.JPanel implements java.awt.event.ActionListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, javax.swing.event.ChangeListener { private javax.swing.JButton ivjJButtonOK = null; private javax.swing.JLabel ivjJLabelDataType = null; private javax.swing.JRadioButton ivjJRadioButtonParticles = null; private javax.swing.JRadioButton ivjJRadioButtonVariables = null; protected transient cbit.vcell.export.gui.ASCIISettingsPanelListener fieldASCIISettingsPanelListenerEventMulticaster = null; - private javax.swing.JCheckBox ivjJCheckBoxSwitch = null; - private javax.swing.JLabel ivjJLabelAdditional = null; - private ExportConstants.DataType fieldExportDataType; private javax.swing.JButton ivjCancelJButton = null; private javax.swing.JPanel mainPanel = null; private ExportSpecs.SimulationSelector simulationSelector; @@ -267,7 +264,7 @@ public N5Specs getN5Specs(){ int[] paramScanIndexes = simulationSelector == null ? null : simulationSelector.getselectedParamScanIndexes(); String dataSetName = getJTextFieldDataSetName().getText(); - return new N5Specs(DataType.PDE_VARIABLE_DATA, ExportFormat.N5, N5Specs.CompressionLevel.GZIP, dataSetName); + return new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, N5Specs.CompressionLevel.GZIP, dataSetName); } private JLabel lblSeeVcellHelp; diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java index 569a1335d3..9e2e428216 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java @@ -10,12 +10,12 @@ package cbit.vcell.export.gui; -import cbit.vcell.export.server.ExportConstants; +import cbit.vcell.export.server.ExportSpecss; import cbit.vcell.export.server.RasterSpecs; /** * This type was created in VisualAge. */ -public class RasterSettingsPanel extends javax.swing.JPanel implements ExportConstants, java.awt.event.ActionListener { +public class RasterSettingsPanel extends javax.swing.JPanel implements java.awt.event.ActionListener { private javax.swing.JButton ivjJButtonOK = null; private javax.swing.ButtonGroup ivjButtonGroup1 = null; private javax.swing.JLabel ivjJLabelDataType = null; @@ -420,10 +420,10 @@ private javax.swing.JRadioButton getJRadioButtonSingle() { */ public RasterSpecs getRasterSpecs() { // nrrd raster format - int format = -1; - if (getJRadioButtonSingle().isSelected()) {format = NRRD_SINGLE;} - if (getJRadioButtonByTime().isSelected()) {format = NRRD_BY_TIME;} - if (getJRadioButtonByVariable().isSelected()) {format = NRRD_BY_VARIABLE;} + ExportSpecss.RasterFormats format = null; + if (getJRadioButtonSingle().isSelected()) {format = ExportSpecss.RasterFormats.NRRD_SINGLE;} + if (getJRadioButtonByTime().isSelected()) {format = ExportSpecss.RasterFormats.NRRD_BY_TIME;} + if (getJRadioButtonByVariable().isSelected()) {format = ExportSpecss.RasterFormats.NRRD_BY_VARIABLE;} return new RasterSpecs(format, getJCheckBoxSeparateHeader().isSelected()); } /** diff --git a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java index 5a11dfc137..c3a6ab084b 100644 --- a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java @@ -47,6 +47,7 @@ import javax.swing.undo.UndoableEdit; import javax.swing.undo.UndoableEditSupport; +import cbit.vcell.export.server.*; import org.vcell.optimization.ProfileData; import org.vcell.util.ClientTaskStatusSupport; import org.vcell.util.Compare; @@ -77,14 +78,6 @@ import cbit.vcell.client.data.SimulationWorkspaceModelInfo; import cbit.vcell.client.task.AsynchClientTask; import cbit.vcell.client.task.ClientTaskDispatcher; -import cbit.vcell.export.server.ExportConstants; -import cbit.vcell.export.server.ExportFormat; -import cbit.vcell.export.server.ExportSpecs; -import cbit.vcell.export.server.FormatSpecificSpecs; -import cbit.vcell.export.server.GeometrySpecs; -import cbit.vcell.export.server.MovieSpecs; -import cbit.vcell.export.server.TimeSpecs; -import cbit.vcell.export.server.VariableSpecs; import cbit.vcell.field.FieldDataIdentifierSpec; import cbit.vcell.field.FieldFunctionArguments; import cbit.vcell.field.FieldUtilities; @@ -134,6 +127,8 @@ import cbit.vcell.solver.SimulationModelInfo; import cbit.vcell.solver.SimulationSymbolTable; +import static cbit.vcell.export.server.ExportSpecss.VariableMode.VARIABLE_MULTI; + @SuppressWarnings("serial") public class FRAPStudyPanel extends JPanel implements PropertyChangeListener{ @@ -1368,12 +1363,12 @@ public void run(Hashtable hashTable) throws Exception ExportFormat format = ExportFormat.QUICKTIME; String[] variableNames = new String[]{NORM_FLUOR_VAR, NORM_SIM_VAR}; - VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportConstants.VARIABLE_MULTI); + VariableSpecs variableSpecs = new VariableSpecs(variableNames, VARIABLE_MULTI); // int endTimeIndex = (int)Math.round(sim.getSolverTaskDescription().getTimeBounds().getEndingTime()/((UniformOutputTimeSpec)sim.getSolverTaskDescription().getOutputTimeSpec()).getOutputTimeStep()); int endTimeIndex = getFRAPSimDataViewerPanel().getOriginalDataViewer().getPdeDataContext().getTimePoints().length - 1; - TimeSpecs timeSpecs = new TimeSpecs(0, endTimeIndex, pdeDataContext.getTimePoints(), ExportConstants.TIME_RANGE); - int geoMode = ExportConstants.GEOMETRY_SLICE; + TimeSpecs timeSpecs = new TimeSpecs(0, endTimeIndex, pdeDataContext.getTimePoints(), ExportSpecss.TimeMode.TIME_RANGE); + ExportSpecss.GeometryMode geoMode = ExportSpecss.GeometryMode.GEOMETRY_SLICE; GeometrySpecs geometrySpecs = new GeometrySpecs(null, Coordinate.Z_AXIS, 0, geoMode); double duration = 10000; //10s @@ -1388,7 +1383,7 @@ public void run(Hashtable hashTable) throws Exception true, displayPref, ExportFormat.QUICKTIME, - ExportConstants.NO_MIRRORING, + ExportSpecss.MirroringMethod.NO_MIRRORING, volVarMemOutlineThickness, imageScale, membraneScale, diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java index c78b7baedf..ce91ca6cf8 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java @@ -10,6 +10,7 @@ package cbit.vcell.export.server; +import cbit.rmi.event.ExportStatusEventCreator; import cbit.vcell.export.server.FileDataContainerManager.FileDataContainerID; import cbit.vcell.geometry.SinglePoint; import cbit.vcell.math.VariableType; @@ -40,10 +41,10 @@ * * @author: Ion Moraru */ -public class ASCIIExporter implements ExportConstants { +public class ASCIIExporter { private final static Logger lg = LogManager.getLogger(ASCIIExporter.class); - private ExportServiceImpl exportServiceImpl = null; + private ExportStatusEventCreator exportServiceImpl = null; /** * Insert the method's description here. @@ -51,7 +52,7 @@ public class ASCIIExporter implements ExportConstants { * * @param exportServiceImpl cbit.vcell.export.server.ExportServiceImpl */ - public ASCIIExporter(ExportServiceImpl exportServiceImpl){ + public ASCIIExporter(ExportStatusEventCreator exportServiceImpl){ this.exportServiceImpl = exportServiceImpl; } @@ -184,7 +185,7 @@ private List exportODEData(OutputContext outputContext, long jobID SimulationDescription simulationDescription = new SimulationDescription(outputContext, user, dataServerImpl, vcdID, true, null); fileDataContainerManager.append(exportOutput.getFileDataContainerID(), simulationDescription.getHeader(dataType)); fileDataContainerManager.append(exportOutput.getFileDataContainerID(), getODEDataValues(jobID, user, dataServerImpl, vcdID, variableSpecs.getVariableNames(), timeSpecs.getBeginTimeIndex(), timeSpecs.getEndTimeIndex(), asciiSpecs.getSwitchRowsColumns(), fileDataContainerManager)); - dataID += variableSpecs.getModeID() == 0 ? variableSpecs.getVariableNames()[0] : "ManyVars"; + dataID += variableSpecs.getMode() == ExportSpecss.VariableMode.VARIABLE_ONE ? variableSpecs.getVariableNames()[0] : "ManyVars"; return Arrays.asList(exportOutput); } @@ -428,7 +429,7 @@ private ExportOutput sofyaFormat(OutputContext outputContext, long jobID, User u final int SIM_COUNT = simNameSimDataIDs.length; final int PARAMSCAN_COUNT = (asciiSpecs.getExportMultipleParamScans() != null ? asciiSpecs.getExportMultipleParamScans().length : 1); final int TIME_COUNT = timeSpecs.getEndTimeIndex() - timeSpecs.getBeginTimeIndex() + 1; - if(PARAMSCAN_COUNT > 1 || geometrySpecs.getModeID() != GEOMETRY_SELECTIONS/* || geometrySpecs.getCurves().length != 0*/){ + if(PARAMSCAN_COUNT > 1 || geometrySpecs.getMode() != ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS/* || geometrySpecs.getCurves().length != 0*/){ throw new DataAccessException("Alternate csv format cannot have parameter scans and must be 'point selection' type"); } final long MESSAGE_LIMIT = 5000;//millisecodns @@ -565,7 +566,7 @@ private List exportPDEData(OutputContext outputContext, long jobID final int TIME_COUNT = endTimeIndex - beginTimeIndex + 1; double TOTAL_EXPORTS_OPS = 0; - switch(geometrySpecs.getModeID()){ + switch(geometrySpecs.getMode()){ case GEOMETRY_SELECTIONS: TOTAL_EXPORTS_OPS = SIM_COUNT * PARAMSCAN_COUNT * variableSpecs.getVariableNames().length * (geometrySpecs.getCurves().length + (geometrySpecs.getPointCount() > 0 ? 1 : 0)); break; @@ -636,7 +637,7 @@ private List exportPDEData(OutputContext outputContext, long jobID insertInts(hdf5GroupID, PCS.TIMEBOUNDS.name(), new long[]{2}, new int[]{beginTimeIndex, endTimeIndex});//UiTableExporterToHDF5.writeHDF5Dataset(hdf5GroupID, PCS.TIMEBOUNDS.name(), new long[] {2}, new int[] {beginTimeIndex,endTimeIndex},false); } - switch(geometrySpecs.getModeID()){ + switch(geometrySpecs.getMode()){ case GEOMETRY_SELECTIONS:{ // Set mesh on SpatialSelection because mesh is transient field because it's too big for messaging SpatialSelection[] spatialSelections = geometrySpecs.getSelections(); @@ -735,7 +736,7 @@ private List exportPDEData(OutputContext outputContext, long jobID case GEOMETRY_SLICE: case GEOMETRY_FULL:{ int sliceNumber = geometrySpecs.getSliceNumber(); - if(geometrySpecs.getModeID() == GEOMETRY_FULL){ + if(geometrySpecs.getMode() == ExportSpecss.GeometryMode.GEOMETRY_FULL){ sliceNumber = -1; } String dataID = "_Slice_" + Coordinate.getNormalAxisPlaneName(geometrySpecs.getAxis()) + "_" + sliceNumber + "_"; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java index c7272c198a..642f0d7148 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java @@ -21,7 +21,7 @@ public class ASCIISpecs extends FormatSpecificSpecs implements Serializable { public static enum CsvRoiLayout {var_time_val,time_sim_var} private boolean switchRowsColumns; private ExportFormat format; - private ExportConstants.DataType dataType; + private ExportSpecss.ExportableDataType dataType; private ExportSpecs.SimNameSimDataID[] simNameSimDataIDs; private int[] exportMultipleParamScans; private CsvRoiLayout csvLayout; @@ -29,7 +29,7 @@ public static enum CsvRoiLayout {var_time_val,time_sim_var} /** * TextSpecs constructor comment. */ -public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportConstants.DataType dataType, ExportFormat format, +public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, int[] exportMultipleParamScans, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns) { this.format = format; this.dataType = dataType; @@ -40,7 +40,7 @@ public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportConsta this.isHDF5 = isHDF5; } -public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportConstants.DataType dataType, ExportFormat format, +public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns){ this(simNameSimDataIDs, dataType, format, null, csvLayout, isHDF5, switchRowsColumns); } @@ -83,7 +83,7 @@ public ExportSpecs.SimNameSimDataID[] getSimNameSimDataIDs(){ * This method was created in VisualAge. * @return int */ -public ExportConstants.DataType getDataType() { +public ExportSpecss.ExportableDataType getDataType() { return dataType; } /** diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportConstants.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportConstants.java deleted file mode 100644 index 2fa25da723..0000000000 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportConstants.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 1999-2011 University of Connecticut Health Center - * - * Licensed under the MIT License (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.opensource.org/licenses/mit-license.php - */ - -package cbit.vcell.export.server; -/** - * This type was created in VisualAge. - */ -public interface ExportConstants { - - // image mirroring types - public final static int NO_MIRRORING = 0; - public final static int MIRROR_LEFT = 1; - public final static int MIRROR_TOP = 2; - public final static int MIRROR_RIGHT = 3; - public final static int MIRROR_BOTTOM = 4; - - // color modes - public final static int GRAYSCALE = 0; - public final static int COLOR1 = 1; - public final static int RAW_RGB = 0; - - // image file formats - public final static int GIF = 0; - public final static int ANIMATED_GIF = 1; - public final static int TIFF = 2; - public final static int JPEG = 3; - - // image compression formats - public final static int UNCOMPRESSED = 0; - public final static int COMPRESSED_GIF_DEFAULT = 1; - public final static int COMPRESSED_LZW = 2; - public final static int COMPRESSED_JPEG_DEFAULT = 3; - - // ascii file formats - public final static int CSV = 0; - - // raster file formats - public final static int NRRD_SINGLE = 0; - public final static int NRRD_BY_TIME = 1; - public final static int NRRD_BY_VARIABLE = 2; - - // export destination - public static final int LOCAL_FILES = 0; - public static final int REMOTE_ZIPFILE = 1; - - // exportable data types - enum DataType { - ODE_VARIABLE_DATA, - PDE_VARIABLE_DATA, - PDE_PARTICLE_DATA - } - - // simulation data types - public static final int NO_DATA_AVAILABLE = 0; - public static final int ODE_SIMULATION = 1; - public static final int PDE_SIMULATION_NO_PARTICLES = 2; - public static final int PDE_SIMULATION_WITH_PARTICLES = 3; - - // export modes - public static final int TIME_POINT = 0; - public static final int TIME_RANGE = 1; - public static final int VARIABLE_ONE = 0; - public static final int VARIABLE_MULTI = 1; - public static final int VARIABLE_ALL = 2; - public static final int GEOMETRY_SELECTIONS = 0; - public static final int GEOMETRY_SLICE = 1; - public static final int GEOMETRY_FULL = 2; - -} diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java new file mode 100644 index 0000000000..2a34048ecf --- /dev/null +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java @@ -0,0 +1,133 @@ +package cbit.vcell.export.server; + +import org.vcell.util.document.VCDataIdentifier; + +public abstract class ExportSpecss { + + public record ExportRequest( + VCDataIdentifier dataIdentifier, + ExportFormat format, + TimeSpecs timeSpecs, + VariableSpecs variableSpecs, + GeometrySpecs geometrySpecs, + FormatSpecificSpecs formatSpecificSpecs, + String simulationName, + String contextName + ){ } + + + public enum GeometryMode{ + GEOMETRY_SELECTIONS(0), + GEOMETRY_SLICE(1), + GEOMETRY_FULL(2); + + public final int intValue; + public static GeometryMode getGeometryMode(int intValue) { + switch (intValue) { + case 0: return GEOMETRY_SELECTIONS; + case 1: return GEOMETRY_SLICE; + case 2: return GEOMETRY_FULL; + } + throw new IllegalArgumentException(); + } + GeometryMode(int i){ + intValue = i; + } + } + + public enum TimeMode{ + TIME_POINT(0), + TIME_RANGE(1); + + public final int intValue; + public static TimeMode getTimeMode(int i){ + switch(i){ + case 0: return TIME_POINT; + case 1: return TIME_RANGE; + } + throw new IllegalArgumentException(); + } + TimeMode(int i){ + intValue = i; + } + } + + public enum VariableMode{ + VARIABLE_ONE(0), + VARIABLE_MULTI(1), + VARIABLE_ALL(2); + + public final int intValue; + public static VariableMode getVariableMode(int i){ + switch(i){ + case 0: return VARIABLE_ONE; + case 1: return VARIABLE_MULTI; + case 2: return VARIABLE_ALL; + } + throw new IllegalArgumentException(); + } + + VariableMode(int i){ + intValue = i; + } + } + + public enum RasterFormats{ + NRRD_SINGLE(0), + NRRD_BY_TIME(1), + NRRD_BY_VARIABLE(2); + + public final int intValue; + RasterFormats(int i){ + intValue = i; + } + } + + public enum CompressionFormats{ + UNCOMPRESSED(0), + COMPRESSED_GIF_DEFAULT(1), + COMPRESSED_LZW(2), + COMPRESSED_JPEG_DEFAULT(3); + + public final int intValue; + CompressionFormats(int i){ + intValue = i; + } + } + + public enum ExportableDataType { + ODE_VARIABLE_DATA, + PDE_VARIABLE_DATA, + PDE_PARTICLE_DATA + } + + public enum SimulationDataType { + NO_DATA_AVAILABLE(0), + ODE_SIMULATION(1), + PDE_SIMULATION_NO_PARTICLES(2), + PDE_SIMULATION_WITH_PARTICLES(3); + + public final int intValue; + SimulationDataType(int i){ + intValue = i; + } + } + + public enum MirroringMethod { + NO_MIRRORING(0), + MIRROR_LEFT(1), + MIRROR_TOP(2), + MIRROR_RIGHT(3), + MIRROR_BOTTOM(4); + + public static MirroringMethod getMirroringMethod(int value) { + MirroringMethod[] values = MirroringMethod.values(); + return values[value]; + } + + public final int value; + MirroringMethod(int value) { + this.value = value; + } + } +} diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java index 408f5af8a3..e2b30d1bab 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java @@ -21,11 +21,11 @@ public class ExportUtils { * @return int[] * @param pixels int[] */ -public static int[] extendMirrorPixels(int[] pixels, int width, int height, int mode) throws DataFormatException { +public static int[] extendMirrorPixels(int[] pixels, int width, int height, ExportSpecss.MirroringMethod mode) throws DataFormatException { if (pixels.length != width * height) throw new DataFormatException("Pixel number incompatible with given width, height"); int[] mirroredPixels; switch (mode) { - case ExportConstants.MIRROR_LEFT: + case MIRROR_LEFT: mirroredPixels = new int[pixels.length * 2]; for (int i=0;i nrrdinfoV = new Vector(); @@ -404,7 +405,7 @@ private NrrdInfo[] exportPDEData(OutputContext outputContext,long jobID, User us } } case NRRD_BY_VARIABLE : { - switch (geometrySpecs.getModeID()) { + switch (geometrySpecs.getMode()) { case GEOMETRY_FULL: { Vector nrrdinfoV = new Vector(); int progressIndex = 1; @@ -463,7 +464,7 @@ private NrrdInfo[] exportPDEData(OutputContext outputContext,long jobID, User us } } - private static long fireThrottledProgress(ExportServiceImpl exportServiceImpl,long lastUpdateTime,String message,long jobID,VCDataIdentifier vcdID,int progressIndex,int endIndex){ + private static long fireThrottledProgress(ExportStatusEventCreator exportServiceImpl,long lastUpdateTime,String message,long jobID,VCDataIdentifier vcdID,int progressIndex,int endIndex){ if(lastUpdateTime == 0 || (System.currentTimeMillis() - lastUpdateTime)>5000){ lastUpdateTime = System.currentTimeMillis(); exportServiceImpl.fireExportProgress(jobID, vcdID, message,(double)(progressIndex)/(double)(endIndex+1)); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java index e088c245b3..02d2552df4 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java @@ -16,7 +16,7 @@ * This type was created in VisualAge. */ public class RasterSpecs extends FormatSpecificSpecs implements Serializable { - private int format; + private ExportSpecss.RasterFormats format; private boolean separateHeader; /** @@ -25,7 +25,7 @@ public class RasterSpecs extends FormatSpecificSpecs implements Serializable { * @param format int * @param separateHeader boolean */ -public RasterSpecs(int format, boolean separateHeader) { +public RasterSpecs(ExportSpecss.RasterFormats format, boolean separateHeader) { this.format = format; this.separateHeader = separateHeader; } @@ -55,7 +55,7 @@ public boolean equals(java.lang.Object object) { * Creation date: (4/23/2004 11:34:51 AM) * @return int */ -public int getFormat() { +public ExportSpecss.RasterFormats getFormat() { return format; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java index 3180555ca0..04ee297d26 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java @@ -18,11 +18,11 @@ public class TimeSpecs implements Serializable { private int beginTimeIndex; private int endTimeIndex; private double[] allTimes; - private int modeID; + private ExportSpecss.TimeMode modeID; /** * TimeSpecs constructor comment. */ -public TimeSpecs(int beginTimeIndex, int endTimeIndex, double[] allTimes, int modeID) { +public TimeSpecs(int beginTimeIndex, int endTimeIndex, double[] allTimes, ExportSpecss.TimeMode modeID) { this.beginTimeIndex = beginTimeIndex; this.endTimeIndex = endTimeIndex; this.allTimes = allTimes; @@ -40,7 +40,7 @@ public boolean equals(Object object) { if ( beginTimeIndex == timeSpecs.getBeginTimeIndex() && endTimeIndex == timeSpecs.getEndTimeIndex() && - modeID == timeSpecs.getModeID() && + modeID == timeSpecs.getMode() && allTimes.length == timeSpecs.getAllTimes().length ) { for (int i = 0; i < allTimes.length; i++){ @@ -74,13 +74,11 @@ public int getBeginTimeIndex() { public int getEndTimeIndex() { return endTimeIndex; } -/** - * This method was created in VisualAge. - * @return int - */ -public int getModeID() { + +public ExportSpecss.TimeMode getMode(){ return modeID; } + /** * Insert the method's description here. * Creation date: (4/2/2001 4:33:23 PM) diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java index b18c8f598d..75326f7795 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java @@ -16,19 +16,15 @@ * This type was created in VisualAge. */ public class VariableSpecs implements Serializable { - private String[] variableNames; - private int modeID; -/** - * This method was created in VisualAge. - * @param variableNames java.lang.String[] - * @param scaleSettings cbit.image.Range[] - */ -public VariableSpecs(String[] variableNames, int modeID) { + private final String[] variableNames; + private final ExportSpecss.VariableMode modeID; + +public VariableSpecs(String[] variableNames, ExportSpecss.VariableMode modeID) { this.variableNames = variableNames; this.modeID = modeID; } -public VariableSpecs (List variableNames, int modeID){ +public VariableSpecs (List variableNames, ExportSpecss.VariableMode modeID){ this(variableNames.toArray(new String[0]), modeID); } @@ -41,7 +37,7 @@ public VariableSpecs (List variableNames, int modeID){ public boolean equals(Object object) { if (object instanceof VariableSpecs) { VariableSpecs variableSpecs = (VariableSpecs)object; - if (modeID == variableSpecs.getModeID()) { + if (modeID == variableSpecs.getMode()) { if (variableNames.length == variableSpecs.getVariableNames().length) { for (int i = 0; i < variableNames.length; i++){ if (! variableNames[i].equals(variableSpecs.getVariableNames()[i])) { @@ -54,13 +50,11 @@ public boolean equals(Object object) { } return false; } -/** - * This method was created in VisualAge. - * @return int - */ -public int getModeID() { + +public ExportSpecss.VariableMode getMode() { return modeID; } + /** * This method was created in VisualAge. * @return java.lang.String[] diff --git a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java index 4a6fee1aff..3175fda2e9 100644 --- a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java +++ b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java @@ -177,12 +177,12 @@ public void makeN5FileWithSpecificSimulationResults(N5Specs.CompressionLevel com OutputContext outputContext = new OutputContext(new AnnotatedFunction[0]); - VariableSpecs variableSpecs = new VariableSpecs(variables.stream().map(di -> di.getName()).toList(), Integer.parseInt(modelID)); - GeometrySpecs geometrySpecs = new GeometrySpecs(new SpatialSelection[0], 0, 0, 0); - N5Specs n5Specs = new N5Specs(ExportConstants.DataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, modelID); + VariableSpecs variableSpecs = new VariableSpecs(variables.stream().map(di -> di.getName()).toList(), ExportSpecss.VariableMode.VARIABLE_MULTI); + GeometrySpecs geometrySpecs = new GeometrySpecs(new SpatialSelection[0], 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS); + N5Specs n5Specs = new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, modelID); double[] allTimes = dataServer.getDataSetTimes(testUser,n5Exporter.getVcDataID()); - TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, variableSpecs.getModeID()); + TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportSpecss.TimeMode.TIME_RANGE); ExportSpecs exportSpecs = new ExportSpecs(n5Exporter.getVcDataID(), ExportFormat.N5, variableSpecs, timeSpecs, geometrySpecs, n5Specs, "", ""); HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; exportSpecs.setExportMetaData(new HumanReadableExportData("", "", "", new ArrayList<>(), "", "", false, dummyMaskInfo)); From 2325097c979d783bf7d05005ef29d54bfe927541 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 3 Jul 2025 11:17:16 -0400 Subject: [PATCH 04/41] Export Notification System Separated from Implementation --- .../main/java/org/vcell/cli/run/RunUtils.java | 2 +- .../gui/VirtualFrapWindowManager.java | 4 +- .../export/server/ExportServiceImpl.java | 264 ++++-------------- .../cbit/vcell/export/server/IMGExporter.java | 13 +- .../export/server/OldExportEventCreator.java | 111 ++++++++ .../cbit/vcell/export/N5ExporterTest.java | 3 +- .../bootstrap/LocalVCellConnection.java | 2 +- .../message/server/data/SimDataServer.java | 2 +- 8 files changed, 177 insertions(+), 224 deletions(-) create mode 100644 vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java index 73539b5fc5..d711afaece 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java @@ -411,7 +411,7 @@ private static void exportDocument(ExportServiceImpl exportServiceImpl, DataServ Collection exportOutputs; FileDataContainerManager fileDataContainerManager = new FileDataContainerManager(); - ASCIIExporter asciiExporter = new ASCIIExporter(exportServiceImpl); + ASCIIExporter asciiExporter = new ASCIIExporter(exportServiceImpl.getEventCreator()); JobRequest jobRequest = JobRequest.createExportJobRequest(vcId.getOwner()); try { diff --git a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java index cb6fc55879..e3314e20c1 100644 --- a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java @@ -150,7 +150,7 @@ public void startExport(Component requester,OutputContext outContext, ExportSpec try { ExportServiceImpl exportServiceImpl = new ExportServiceImpl(); DataServerImpl dataServerImpl = new DataServerImpl(localWorkSpace.getDataSetControllerImpl(),exportServiceImpl); - exportServiceImpl.addExportListener(new ExportListener() { + exportServiceImpl.getEventCreator().addExportListener(new ExportListener() { public void exportMessage(ExportEvent event) { System.out.println(event.toString()); } @@ -170,7 +170,7 @@ public ExportEvent startExportMovie(ExportSpecs exportSpecs, OutputContext outpu ExportServiceImpl exportServiceImpl = new ExportServiceImpl(); DataServerImpl dataServerImpl = new DataServerImpl(localWorkSpace.getDataSetControllerImpl(),exportServiceImpl); - exportServiceImpl.addExportListener(new ExportListener() { + exportServiceImpl.getEventCreator().addExportListener(new ExportListener() { public void exportMessage(ExportEvent event) { System.out.println(event.toString()); } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java index 26290c8633..d9dd653277 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java @@ -18,7 +18,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Collection; -import java.util.Hashtable; import java.util.zip.DataFormatException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -29,15 +28,11 @@ import org.vcell.util.ClientTaskStatusSupport; import org.vcell.util.DataAccessException; import org.vcell.util.UserCancelException; -import org.vcell.util.document.ExternalDataIdentifier; -import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; -import org.vcell.util.document.VCDataIdentifier; import com.google.common.io.Files; import cbit.rmi.event.ExportEvent; -import cbit.rmi.event.ExportListener; import cbit.vcell.export.nrrd.NrrdInfo; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.simdata.DataServerImpl; @@ -47,160 +42,41 @@ /** * This type was created in VisualAge. */ -public class ExportServiceImpl implements ExportService, ExportStatusEventCreator { +public class ExportServiceImpl implements ExportService { public static final Logger lg = LogManager.getLogger(ExportServiceImpl.class); - private javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList(); + private final OldExportEventCreator eventCreator = new OldExportEventCreator(); - private Hashtable jobRequestIDs = new Hashtable(); - private Hashtable completedExportRequests = new Hashtable(); - - -/** - * Insert the method's description here. - * Creation date: (3/29/2001 4:09:29 PM) - * @param log cbit.vcell.server.SessionLog - */ -public ExportServiceImpl() { -} - - -/** - * Insert the method's description here. - * Creation date: (3/29/2001 5:18:16 PM) - * @param listener ExportListener - */ -public synchronized void addExportListener(ExportListener listener) { - listenerList.add(ExportListener.class, listener); -} - - -/** - * Insert the method's description here. - * Creation date: (4/1/2001 11:20:45 AM) - * @deprecated - */ -public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location,ExportSpecs exportSpecs) { - User user = null; - Object object = jobRequestIDs.get(new Long(jobID)); - if (object != null) { - user = (User)object; - } - TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); - VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); - final KeyValue dataKey; - if (vcdID instanceof VCSimulationDataIdentifier) { - dataKey = ((VCSimulationDataIdentifier)vcdID).getSimulationKey(); - }else if (vcdID instanceof ExternalDataIdentifier) { - dataKey = ((ExternalDataIdentifier)vcdID).getSimulationKey(); - }else { - throw new RuntimeException("unexpected VCDataIdentifier"); - } - ExportEvent event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, - format, location, null, timeSpecs, varSpecs); - event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); - fireExportEvent(event); - return event; -} - - -public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { - User user = null; - Object object = jobRequestIDs.get(new Long(jobID)); - if (object != null) { - user = (User)object; - } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_ASSEMBLING, format, null, null, null, null); - fireExportEvent(event); -} - - -/** - * Insert the method's description here. - * Creation date: (11/17/2000 11:43:22 AM) - * @param event cbit.rmi.event.ExportEvent - */ -public void fireExportEvent(ExportEvent event) { - // Guaranteed to return a non-null array - Object[] listeners = listenerList.getListenerList(); - // Reset the source to allow proper wiring - event.setSource(this); - // Process the listeners last to first, notifying - // those that are interested in this event - for (int i = listeners.length-2; i>=0; i-=2) { - if (listeners[i]==ExportListener.class) { - ((ExportListener)listeners[i+1]).exportMessage(event); - } - } -} - - -/** - * Insert the method's description here. - * Creation date: (4/1/2001 11:20:45 AM) - * @deprecated - */ -public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { - User user = null; - Object object = jobRequestIDs.get(new Long(jobID)); - if (object != null) { - user = (User)object; + public ExportStatusEventCreator getEventCreator() { + return eventCreator; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); - fireExportEvent(event); -} -/** - * Insert the method's description here. - * Creation date: (4/1/2001 11:20:45 AM) - * @param exportSpecs cbit.vcell.export.server.ExportSpecs - * @param progress double - */ -public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { - User user = null; - Object object = jobRequestIDs.get(new Long(jobID)); - if (object != null) { - user = (User)object; - } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_PROGRESS, format, null, new Double(progress), null, null); - fireExportEvent(event); +public ExportServiceImpl() { } -/** - * Insert the method's description here. - * Creation date: (4/1/2001 11:20:45 AM) - * @deprecated - */ -public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { - User user = null; - Object object = jobRequestIDs.get(new Long(jobID)); - if (object != null) { - user = (User)object; - } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_START, format, null, null, null, null); - fireExportEvent(event); +public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs)throws DataAccessException { + return makeRemoteFile(outputContext,user, dataServerImpl, exportSpecs, eventCreator); } -public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs)throws DataAccessException -{ - return makeRemoteFile(outputContext,user, dataServerImpl, exportSpecs, true); +public ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, boolean zip, ClientTaskStatusSupport clientTaskStatusSupport)throws DataAccessException { + return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, zip, clientTaskStatusSupport); } -public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, boolean bSaveAsZip) throws DataAccessException -{ - return makeRemoteFile(outputContext, user, dataServerImpl, exportSpecs, bSaveAsZip, null); +public static ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator) throws DataAccessException{ + return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, true, null); } -public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, boolean bSaveAsZip, ClientTaskStatusSupport clientTaskStatusSupport) throws DataAccessException { +public static ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator, boolean bSaveAsZip, ClientTaskStatusSupport clientTaskStatusSupport) throws DataAccessException { // if export completes successfully, we return the generated event for logging if (user == null) { throw new DataAccessException("ERROR: user is null"); } JobRequest newExportJob = JobRequest.createExportJobRequest(user); - jobRequestIDs.put(new Long(newExportJob.getExportJobID()), user); + if (eventCreator instanceof OldExportEventCreator evc){ + evc.putJobRequest(new Long(newExportJob.getExportJobID()), user); + } if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): " + newExportJob + ", " + exportSpecs); String fileFormat = null; switch (exportSpecs.getFormat()) { @@ -224,39 +100,14 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer case N5: fileFormat = N5Specs.n5Suffix.toUpperCase(); break; -// case IMAGEJ: -// fileFormat = "IMAGEJ"; -// break; } - fireExportStarted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat); + eventCreator.fireExportStarted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat); try { String exportBaseURL = PropertyLoader.getRequiredProperty(PropertyLoader.exportBaseURLProperty); String exportBaseDir = PropertyLoader.getRequiredProperty(PropertyLoader.exportBaseDirInternalProperty); - -// // see if we've done this before, and try to get it -// // for now, works only for the life of the server (eventually will be persistent) -// Object completed = completedExportRequests.get(exportSpecs); -// if (completed != null) { -// try { -// JobRequest previousRequest = (JobRequest)completedExportRequests.get(exportSpecs); -// File file = new File(exportBaseDir + previousRequest.getJobID() + ".zip"); -// if (file.exists()) { -// URL url = new URL(exportBaseURL + file.getName()); -// if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): Found previously made file: " + file.getName()); -// fireExportCompleted(newExportJob.getJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString()); -// // now that we start logging exports, we should do the persistence thing soon... -// // so far retutn null, so we at least don't double log during the same server session -// return null; -// } -// } catch (Throwable exc) { -// completedExportRequests.remove(exportSpecs); -// if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): WARNING: did not find previous export output; attempting to export again"); -// } -// } - // we need to make new output if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): Starting new export job: " + newExportJob); FileDataContainerManager fileDataContainerManager = new FileDataContainerManager(); @@ -265,7 +116,7 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer switch (exportSpecs.getFormat()) { case CSV: case HDF5: - ASCIIExporter asciiExporter = new ASCIIExporter(this); + ASCIIExporter asciiExporter = new ASCIIExporter(eventCreator); Collection asciiOut = asciiExporter.makeASCIIData(outputContext,newExportJob, user, dataServerImpl, exportSpecs,fileDataContainerManager); exportOutputs = asciiOut.toArray(new ExportOutput[asciiOut.size()]); if(((ASCIISpecs)exportSpecs.getFormatSpecificSpecs()).isHDF5()) { @@ -277,46 +128,45 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer Files.copy(tempHDF5File, downloadableHDF5File); tempHDF5File.delete(); URL url = new URL(exportBaseURL + downloadableHDF5File.getName()); - return fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); + return eventCreator.fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); } - return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); case QUICKTIME: case GIF: case FORMAT_JPEG: case ANIMATED_GIF: - IMGExporter imgExporter = new IMGExporter(this); + IMGExporter imgExporter = new IMGExporter(eventCreator); exportOutputs = imgExporter.makeMediaData(outputContext,newExportJob, user, dataServerImpl, exportSpecs,clientTaskStatusSupport,fileDataContainerManager); boolean bOverrideZip = exportOutputs.length == 1; if(bSaveAsZip && !bOverrideZip){ - return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); }else{ - return makeRemoteFile_Unzipped(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return makeRemoteFile_Unzipped(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); } case NRRD: -// case IMAGEJ: - RasterExporter rrExporter = new RasterExporter(this); + RasterExporter rrExporter = new RasterExporter(eventCreator); NrrdInfo[] nrrdInfos = rrExporter.makeRasterData(outputContext,newExportJob, user, dataServerImpl, exportSpecs, fileDataContainerManager); - return makeRemoteFile(fileFormat, exportBaseDir, exportBaseURL, nrrdInfos, exportSpecs, newExportJob, fileDataContainerManager); + return makeRemoteFile(fileFormat, exportBaseDir, exportBaseURL, nrrdInfos, exportSpecs, newExportJob, fileDataContainerManager, eventCreator); case UCD: - RasterExporter rrExporterUCD = new RasterExporter(this); + RasterExporter rrExporterUCD = new RasterExporter(eventCreator); exportOutputs = rrExporterUCD.makeUCDData(outputContext,newExportJob, user, dataServerImpl, exportSpecs,fileDataContainerManager); - return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); case PLY: - RasterExporter rrExporterPLY = new RasterExporter(this); + RasterExporter rrExporterPLY = new RasterExporter(eventCreator); exportOutputs = rrExporterPLY.makePLYWithTexData(outputContext,newExportJob, user, dataServerImpl, exportSpecs,fileDataContainerManager); - return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); case VTK_IMAGE: - RasterExporter rrExporterVTK = new RasterExporter(this); + RasterExporter rrExporterVTK = new RasterExporter(eventCreator); exportOutputs = rrExporterVTK.makeVTKImageData(outputContext,newExportJob, user, dataServerImpl, exportSpecs,fileDataContainerManager); - return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); case VTK_UNSTRUCT: - RasterExporter rrExporterVTKU = new RasterExporter(this); + RasterExporter rrExporterVTKU = new RasterExporter(eventCreator); exportOutputs = rrExporterVTKU.makeVTKUnstructuredData(outputContext,newExportJob, user, dataServerImpl, exportSpecs,fileDataContainerManager); - return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager); + return saveResultsToRemoteFile(fileFormat, exportBaseDir, exportBaseURL, exportOutputs, exportSpecs, newExportJob,fileDataContainerManager, eventCreator); case N5: - N5Exporter n5Exporter = new N5Exporter(this, user, dataServerImpl, (VCSimulationDataIdentifier) exportSpecs.getVCDataIdentifier()); + N5Exporter n5Exporter = new N5Exporter(eventCreator, user, dataServerImpl, (VCSimulationDataIdentifier) exportSpecs.getVCDataIdentifier()); ExportOutput exportOutput = n5Exporter.makeN5Data(outputContext, newExportJob, exportSpecs, fileDataContainerManager); - return makeRemoteN5File(fileFormat, n5Exporter.getN5FileNameHash(), exportOutput, exportSpecs, newExportJob, n5Exporter.getN5FilePathSuffix()); + return makeRemoteN5File(fileFormat, n5Exporter.getN5FileNameHash(), exportOutput, exportSpecs, newExportJob, n5Exporter.getN5FilePathSuffix(), eventCreator); default: throw new DataAccessException("Unknown export format requested"); } @@ -329,7 +179,7 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer } catch (Throwable exc) { lg.error(exc.getMessage(), exc); - fireExportFailed(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, exc.getMessage()); + eventCreator.fireExportFailed(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, exc.getMessage()); throw new DataAccessException(exc.getMessage()); } } @@ -339,7 +189,10 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataSer * Insert the method's description here. * Creation date: (4/26/2004 6:47:56 PM) */ -private ExportEvent makeRemoteFile(String fileFormat, String exportBaseDir, String exportBaseURL, NrrdInfo[] nrrdInfos, ExportSpecs exportSpecs, JobRequest newExportJob, FileDataContainerManager fileDataContainerManager) throws DataFormatException, IOException, MalformedURLException { +private static ExportEvent makeRemoteFile(String fileFormat, String exportBaseDir, String exportBaseURL, + NrrdInfo[] nrrdInfos, ExportSpecs exportSpecs, JobRequest newExportJob, + FileDataContainerManager fileDataContainerManager, + ExportStatusEventCreator eventCreator) throws DataFormatException, IOException, MalformedURLException { boolean exportValid = true; // check outputs and package into zip file @@ -371,10 +224,9 @@ private ExportEvent makeRemoteFile(String fileFormat, String exportBaseDir, Stri } if (exportValid) { - completedExportRequests.put(exportSpecs, newExportJob); if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): Successfully exported to file: " + zipFile.getName()); URL url = new URL(exportBaseURL + zipFile.getName()); - return fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); + return eventCreator.fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); } else { throw new DataFormatException("Export Server could not produce valid data !"); @@ -386,9 +238,13 @@ private ExportEvent makeRemoteFile(String fileFormat, String exportBaseDir, Stri * This function saves the remote file into a compressed zip file. * Creation date: (4/26/2004 6:47:56 PM) */ -private ExportEvent saveResultsToRemoteFile(String fileFormat, String exportBaseDir, String exportBaseURL, ExportOutput[] exportOutputs, ExportSpecs exportSpecs, JobRequest newExportJob, FileDataContainerManager fileDataContainerManager) throws DataFormatException, IOException, MalformedURLException { +private static ExportEvent saveResultsToRemoteFile(String fileFormat, String exportBaseDir, + String exportBaseURL, ExportOutput[] exportOutputs, + ExportSpecs exportSpecs, JobRequest newExportJob, + FileDataContainerManager fileDataContainerManager, + ExportStatusEventCreator eventCreator) throws DataFormatException, IOException, MalformedURLException { boolean exportValid = true; - fireExportAssembling(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat); + eventCreator.fireExportAssembling(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat); // check outputs and package into zip file File zipFile = new File(exportBaseDir + newExportJob.getExportJobID() + ".zip"); @@ -413,10 +269,9 @@ private ExportEvent saveResultsToRemoteFile(String fileFormat, String exportBase zipOut.close(); if (exportValid) { - completedExportRequests.put(exportSpecs, newExportJob); if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): Successfully exported to file: " + zipFile.getName()); URL url = new URL(exportBaseURL + zipFile.getName()); - return fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); + return eventCreator.fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); } else { throw new DataFormatException("Export Server could not produce valid data !"); @@ -426,7 +281,11 @@ private ExportEvent saveResultsToRemoteFile(String fileFormat, String exportBase /** * Save remote file in it original format without compression. */ -private ExportEvent makeRemoteFile_Unzipped(String fileFormat, String exportBaseDir, String exportBaseURL, ExportOutput[] exportOutputs, ExportSpecs exportSpecs, JobRequest newExportJob,FileDataContainerManager fileDataContainerManager) throws DataFormatException, IOException, MalformedURLException +private static ExportEvent makeRemoteFile_Unzipped(String fileFormat, String exportBaseDir, + String exportBaseURL, ExportOutput[] exportOutputs, + ExportSpecs exportSpecs, JobRequest newExportJob, + FileDataContainerManager fileDataContainerManager, + ExportStatusEventCreator eventCreator) throws DataFormatException, IOException, MalformedURLException { boolean exportValid = true; String fileNames = ""; @@ -464,10 +323,9 @@ private ExportEvent makeRemoteFile_Unzipped(String fileFormat, String exportBase exportValid = false; } if (exportValid) { - completedExportRequests.put(exportSpecs, newExportJob); if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): Successfully exported to file: " + fileNames); URL url = new URL(exportBaseURL + fileNames); - return fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); + return eventCreator.fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url.toString(),exportSpecs); } else { throw new DataFormatException("Export Server could not produce valid data !"); @@ -475,28 +333,20 @@ private ExportEvent makeRemoteFile_Unzipped(String fileFormat, String exportBase } -private ExportEvent makeRemoteN5File(String fileFormat, String fileName, ExportOutput exportOutput, ExportSpecs exportSpecs, JobRequest newExportJob, String pathSuffix) throws DataFormatException, IOException{ +private static ExportEvent makeRemoteN5File(String fileFormat, String fileName, ExportOutput exportOutput, + ExportSpecs exportSpecs, JobRequest newExportJob, String pathSuffix, + ExportStatusEventCreator eventCreator) throws DataFormatException, IOException{ if (exportOutput.isValid()) { - completedExportRequests.put(exportSpecs, newExportJob); String url = PropertyLoader.getRequiredProperty(PropertyLoader.s3ExportBaseURLProperty); url += "/" + pathSuffix; N5Specs n5Specs = (N5Specs) exportSpecs.getFormatSpecificSpecs(); url += "?dataSetName=" + newExportJob.getExportJobID(); if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): Successfully exported to file: " + fileName); - return fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url, exportSpecs); + return eventCreator.fireExportCompleted(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat, url, exportSpecs); } else { throw new DataFormatException("Export Server could not produce valid data !"); } } - -/** - * Insert the method's description here. - * Creation date: (3/29/2001 5:18:16 PM) - * @param listener ExportListener - */ -public synchronized void removeExportListener(ExportListener listener) { - listenerList.remove(ExportListener.class, listener); -} } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java index 439f30eec7..77e2faa04b 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java @@ -81,17 +81,8 @@ public static void main(String [] args) throws Exception{ VCSimulationIdentifier vcSimID = new VCSimulationIdentifier(new KeyValue(SimulationKey), user); VCSimulationDataIdentifier vcdID = new VCSimulationDataIdentifier(vcSimID, 0); - class PrintingExportServiceImpl extends ExportServiceImpl { - public PrintingExportServiceImpl(){ - super(); - } - @Override - public void fireExportEvent(ExportEvent event) { - super.fireExportEvent(event); - System.out.println("Event type="+event.getEventTypeID()+" JobID="+event.getJobID()+" progress="+event.getProgress()); - } - } - ExportServiceImpl exportServiceImpl = new PrintingExportServiceImpl(); + + ExportServiceImpl exportServiceImpl = new ExportServiceImpl(); Cachetable cachetable = new Cachetable(10*Cachetable.minute,1000000L); File primaryDir = new File(primaryDirStr); DataSetControllerImpl dataSetControllerImpl = new DataSetControllerImpl(cachetable,primaryDir,null); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java b/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java new file mode 100644 index 0000000000..76d123d4c8 --- /dev/null +++ b/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java @@ -0,0 +1,111 @@ +package cbit.vcell.export.server; + +import cbit.rmi.event.ExportEvent; +import cbit.rmi.event.ExportListener; +import cbit.rmi.event.ExportStatusEventCreator; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import org.vcell.util.document.ExternalDataIdentifier; +import org.vcell.util.document.KeyValue; +import org.vcell.util.document.User; +import org.vcell.util.document.VCDataIdentifier; + +import java.util.Hashtable; + +public class OldExportEventCreator implements ExportStatusEventCreator { + private javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList(); + private Hashtable jobRequestIDs = new Hashtable(); + + + public void putJobRequest(Long jobRequestID, User user){ + jobRequestIDs.put(jobRequestID, user); + } + + public synchronized void addExportListener(ExportListener listener) { + listenerList.add(ExportListener.class, listener); + } + + + public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { + User user = null; + Object object = jobRequestIDs.get(new Long(jobID)); + if (object != null) { + user = (User)object; + } + TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); + VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); + final KeyValue dataKey; + if (vcdID instanceof VCSimulationDataIdentifier) { + dataKey = ((VCSimulationDataIdentifier)vcdID).getSimulationKey(); + }else if (vcdID instanceof ExternalDataIdentifier) { + dataKey = ((ExternalDataIdentifier)vcdID).getSimulationKey(); + }else { + throw new RuntimeException("unexpected VCDataIdentifier"); + } + ExportEvent event = new ExportEvent( + this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, + format, location, null, timeSpecs, varSpecs); + event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); + fireExportEvent(event); + return event; + } + + + public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { + User user = null; + Object object = jobRequestIDs.get(new Long(jobID)); + if (object != null) { + user = (User)object; + } + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_ASSEMBLING, format, null, null, null, null); + fireExportEvent(event); + } + + public void fireExportEvent(ExportEvent event) { + // Guaranteed to return a non-null array + Object[] listeners = listenerList.getListenerList(); + // Reset the source to allow proper wiring + event.setSource(this); + // Process the listeners last to first, notifying + // those that are interested in this event + for (int i = listeners.length-2; i>=0; i-=2) { + if (listeners[i]==ExportListener.class) { + ((ExportListener)listeners[i+1]).exportMessage(event); + } + } + } + + public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { + User user = null; + Object object = jobRequestIDs.get(new Long(jobID)); + if (object != null) { + user = (User)object; + } + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); + fireExportEvent(event); + } + + public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { + User user = null; + Object object = jobRequestIDs.get(new Long(jobID)); + if (object != null) { + user = (User)object; + } + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_PROGRESS, format, null, new Double(progress), null, null); + fireExportEvent(event); + } + + + public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { + User user = null; + Object object = jobRequestIDs.get(new Long(jobID)); + if (object != null) { + user = (User)object; + } + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_START, format, null, null, null, null); + fireExportEvent(event); + } + + public synchronized void removeExportListener(ExportListener listener) { + listenerList.remove(ExportListener.class, listener); + } +} diff --git a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java index 3175fda2e9..7236c2c1b9 100644 --- a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java +++ b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java @@ -200,7 +200,8 @@ private void setExportTestState(TestModels simModel) throws IOException, DataAcc VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simModel.simID), testUser); vcDataID = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); - n5Exporter = new N5Exporter(exportService, testUser, dataServer, vcDataID); + OldExportEventCreator oldExportEventCreator = new OldExportEventCreator(); + n5Exporter = new N5Exporter(oldExportEventCreator, testUser, dataServer, vcDataID); dataIdentifiers = new ArrayList<>(Arrays.asList(dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), testUser, vcDataID))); modelMesh = dataServer.getMesh(testUser, vcDataID); diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java index 11b85d1112..4b62b3fc32 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java @@ -82,7 +82,7 @@ public LocalVCellConnection(UserLoginInfo userLoginInfo, SimulationDatabase simu this.exportServiceImpl = exportServiceImpl; this.dataSetControllerImpl = dataSetControllerImpl; - this.exportServiceImpl.addExportListener(this); + this.exportServiceImpl.getEventCreator().addExportListener(this); this.dataSetControllerImpl.addDataJobListener(this); performanceMonitoringFacility = new PerformanceMonitoringFacility(this.userLoginInfo.getUser()); diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java b/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java index 4f55dce9d2..a47024b9ce 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java @@ -73,7 +73,7 @@ public SimDataServer() throws Exception { dataSetControllerImpl.addDataJobListener(this); // add export listener - exportServiceImpl.addExportListener(this); + exportServiceImpl.getEventCreator().addExportListener(this); } public void init(SimDataServiceType serviceType) throws Exception { From 6b0617f27bf3871b328e94822652c8b8f33f8097 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 3 Jul 2025 13:26:34 -0400 Subject: [PATCH 05/41] Manual Queue Connection --- .../org/vcell/restq/QuarkusStartUpTasks.java | 19 ++++++ .../activemq/ExportRequestListenerMQ.java | 66 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java diff --git a/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java b/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java index 795b63f70e..a00a314fcb 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java +++ b/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java @@ -3,21 +3,30 @@ import cbit.sql.ServerStartUpTasks; import cbit.vcell.modeldb.AdminDBTopLevel; import io.quarkus.runtime.StartupEvent; +import io.smallrye.common.annotation.Identifier; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.event.Observes; import jakarta.inject.Inject; +import jakarta.ws.rs.Produces; +import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.util.DataAccessException; import org.vcell.util.document.User; +import javax.jms.Connection; +import javax.jms.JMSException; +import javax.jms.MessageProducer; +import javax.jms.QueueConnection; import java.sql.SQLException; @ApplicationScoped public class QuarkusStartUpTasks { private final static Logger logger = LogManager.getLogger(QuarkusStartUpTasks.class); + public static final String internalMQBeanIdentifier = "internal"; + @Inject AgroalConnectionFactory connectionFactory; @@ -27,4 +36,14 @@ public void onStartUp(@Observes StartupEvent ev) throws SQLException, DataAccess logger.info("Startup tasks executed successfully"); } + @Produces + @ApplicationScoped + @Identifier(internalMQBeanIdentifier) + private QueueConnection getInternalQueueConnectionFactory() throws JMSException { + ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); + QueueConnection connection = connectionFactory.createQueueConnection("admin", "admin"); + connection.start(); + return connection; + } + } diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java new file mode 100644 index 0000000000..fafca411ea --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -0,0 +1,66 @@ +package org.vcell.restq.activemq; + +import cbit.rmi.event.ExportEvent; +import cbit.vcell.export.server.ExportServiceImpl; +import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.simdata.OutputContext; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.smallrye.common.annotation.Identifier; +import jakarta.annotation.PostConstruct; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.apache.activemq.command.ActiveMQMessage; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.eclipse.microprofile.reactive.messaging.Channel; +import org.eclipse.microprofile.reactive.messaging.Emitter; +import org.vcell.restq.QuarkusStartUpTasks; +import org.vcell.restq.handlers.ExportResource; +import org.vcell.restq.services.Exports.ExportService; + +import javax.jms.*; +import java.util.concurrent.ExecutorService; + +@ApplicationScoped +public class ExportRequestListenerMQ { + private static final Logger logger = LogManager.getLogger(ExportRequestListenerMQ.class); + + @Inject + @Identifier(QuarkusStartUpTasks.internalMQBeanIdentifier) + QueueConnection queueConnection; + + @Inject + ExportService exportService; + + @Inject + ObjectMapper jsonMapper; + + @PostConstruct + void init() { + try { + QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); + Destination destination = session.createQueue("dataReq"); + session.createTextMessage(); + session.createProducer(destination).send(new ActiveMQMessage()); + + MessageConsumer consumer = session.createConsumer(destination); + consumer.setMessageListener(message -> { + if (message instanceof TextMessage tm) { + try { + ExportResource.ExportJob exportJob = jsonMapper.readValue(tm.getText(), ExportResource.ExportJob.class); + exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs()); + } catch (JsonProcessingException | JMSException e) { + throw new RuntimeException(e); + } + } else { + logger.error("Message is not a TextMessage"); + } + }); + + } catch (Exception e) { + logger.error(e); + throw new RuntimeException("Failed to setup JMS manually", e); + } + } +} From 7770e65ab29beb0f06e2c62d0b7857e2203eb36b Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 10 Jul 2025 10:57:57 -0400 Subject: [PATCH 06/41] Add AMQP Support --- .../cbit/vcell/export/server/ExportSpecs.java | 19 ++++ .../java/org/vcell/util/document/User.java | 4 +- vcell-rest/pom.xml | 10 ++ .../activemq/ExportRequestListenerMQ.java | 94 ++++++++++++------- .../vcell/restq/services/ExportService.java | 29 ------ .../restq/services/Exports/ExportService.java | 92 ++++++++++++++++++ .../src/main/resources/application.properties | 12 +++ 7 files changed, 196 insertions(+), 64 deletions(-) delete mode 100644 vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java create mode 100644 vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java index cf4db27659..6f5c043290 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java @@ -14,6 +14,8 @@ import cbit.vcell.solver.MathOverrides; import cbit.vcell.solver.Simulation; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; import org.vcell.util.BeanUtils; import org.vcell.util.Compare; import org.vcell.util.Matchable; @@ -176,6 +178,23 @@ public ExportSpecs(org.vcell.util.document.VCDataIdentifier vcdID, ExportFormat this.contextName = contextName; } + @JsonCreator + public ExportSpecs(@JsonProperty("vcdataIdentifier") VCDataIdentifier vcdataIdentifier, @JsonProperty("format") ExportFormat format, + @JsonProperty("variableSpecs") VariableSpecs variableSpecs, @JsonProperty("timeSpecs") TimeSpecs timeSpecs, + @JsonProperty("geometrySpecs") GeometrySpecs geometrySpecs, @JsonProperty("formatSpecificSpecs") FormatSpecificSpecs formatSpecificSpecs, + @JsonProperty("simulationName") String simulationName, @JsonProperty("contextName") String contextName, + @JsonProperty("humanReadableExportData") HumanReadableExportData humanReadableExportData) { + this.vcDataIdentifier = vcdataIdentifier; + this.format = format; + this.variableSpecs = variableSpecs; + this.timeSpecs = timeSpecs; + this.geometrySpecs = geometrySpecs; + this.formatSpecificSpecs = formatSpecificSpecs; + this.simulatioName = simulationName; + this.contextName = contextName; + this.humanReadableExportData = humanReadableExportData; + } + public String getContextName(){ return contextName; } diff --git a/vcell-core/src/main/java/org/vcell/util/document/User.java b/vcell-core/src/main/java/org/vcell/util/document/User.java index 2392553d05..0046d8077c 100644 --- a/vcell-core/src/main/java/org/vcell/util/document/User.java +++ b/vcell-core/src/main/java/org/vcell/util/document/User.java @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.Comparator; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; @@ -58,7 +59,8 @@ public String toSubject() { /** * User constructor comment. */ -public User(String userid, KeyValue key) { +@JsonCreator +public User(@JsonProperty("userName") String userid, @JsonProperty("key") KeyValue key) { this.userName = userid; this.key = key; } diff --git a/vcell-rest/pom.xml b/vcell-rest/pom.xml index 4c67027864..82fab56f1c 100644 --- a/vcell-rest/pom.xml +++ b/vcell-rest/pom.xml @@ -226,6 +226,16 @@ io.quarkus quarkus-hibernate-validator + + io.quarkus + quarkus-smallrye-reactive-messaging-amqp + + + org.awaitility + awaitility + test + + diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index fafca411ea..5d1534d6cc 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -1,66 +1,92 @@ package org.vcell.restq.activemq; -import cbit.rmi.event.ExportEvent; -import cbit.vcell.export.server.ExportServiceImpl; +import cbit.vcell.export.server.ExportFormat; import cbit.vcell.export.server.ExportSpecs; import cbit.vcell.simdata.OutputContext; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.smallrye.common.annotation.Identifier; +import io.vertx.core.Vertx; +import io.vertx.core.WorkerExecutor; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; -import org.apache.activemq.command.ActiveMQMessage; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.eclipse.microprofile.reactive.messaging.Channel; -import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.vcell.restq.QuarkusStartUpTasks; +import org.eclipse.microprofile.reactive.messaging.Incoming; +import org.eclipse.microprofile.reactive.messaging.Message; import org.vcell.restq.handlers.ExportResource; import org.vcell.restq.services.Exports.ExportService; +import org.vcell.restq.services.Exports.ExportStatusCreator; +import org.vcell.util.document.User; +import org.vcell.util.document.VCDataIdentifier; -import javax.jms.*; -import java.util.concurrent.ExecutorService; +import javax.jms.JMSException; +import java.util.ArrayList; +import java.util.concurrent.*; @ApplicationScoped public class ExportRequestListenerMQ { private static final Logger logger = LogManager.getLogger(ExportRequestListenerMQ.class); - - @Inject - @Identifier(QuarkusStartUpTasks.internalMQBeanIdentifier) - QueueConnection queueConnection; + private final ArrayList acceptedJobs = new ArrayList<>(); + private WorkerExecutor workerExecutor; + private final ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); @Inject ExportService exportService; - @Inject - ObjectMapper jsonMapper; + ExportStatusCreator exportStatusCreator; + @Inject + ObjectMapper mapper; + @Inject + Vertx vertx; @PostConstruct - void init() { - try { - QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); - Destination destination = session.createQueue("dataReq"); - session.createTextMessage(); - session.createProducer(destination).send(new ActiveMQMessage()); + void init(){ + workerExecutor = vertx.createSharedWorkerExecutor("export-pool"); + } - MessageConsumer consumer = session.createConsumer(destination); - consumer.setMessageListener(message -> { - if (message instanceof TextMessage tm) { - try { - ExportResource.ExportJob exportJob = jsonMapper.readValue(tm.getText(), ExportResource.ExportJob.class); - exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs()); - } catch (JsonProcessingException | JMSException e) { - throw new RuntimeException(e); - } - } else { - logger.error("Message is not a TextMessage"); - } - }); + @Incoming("processed-export-request") + public CompletionStage consumeExportRequest(Message message) { + try { + String exportJobJSON = message.getPayload(); + ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); + startJob(exportJob); + +// Uni.createFrom().future(Unchecked.supplier(() -> { +// try { +// exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs()); +// } catch (JMSException | JsonProcessingException e) { +// throw new RuntimeException(e); +// } +// return null; +// }), +// Duration.of(15, ChronoUnit.MINUTES) +// ); +// exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs()); + acceptedJobs.add(exportJob); + return message.ack(); } catch (Exception e) { logger.error(e); throw new RuntimeException("Failed to setup JMS manually", e); } } + + public void startJob(ExportResource.ExportJob exportJob) { + threadPoolExecutor.submit(() -> { + try { + exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs(), exportJob.id()); + } catch (Exception e){ + logger.error(e); + VCDataIdentifier dataIdentifier = exportJob.exportSpecs() == null ? null : exportJob.exportSpecs().getVCDataIdentifier(); + ExportFormat format = exportJob.exportSpecs() == null ? null : exportJob.exportSpecs().getFormat(); + exportStatusCreator.fireExportFailed(exportJob.id(), dataIdentifier, + format == null ? null : format.toString(), e.getMessage()); + } + }); + } + + public ArrayList getAcceptedJobs(){ + return acceptedJobs; + } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java deleted file mode 100644 index 3aa5abfad2..0000000000 --- a/vcell-rest/src/main/java/org/vcell/restq/services/ExportService.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.vcell.restq.services; - -import cbit.vcell.modeldb.DatabaseServerImpl; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import org.vcell.restq.db.AgroalConnectionFactory; -import org.vcell.restq.handlers.ExportResource; -import org.vcell.util.DataAccessException; -import org.vcell.util.document.User; - -@ApplicationScoped -public class ExportService { - private final DatabaseServerImpl databaseServer; - - @Inject - public ExportService(AgroalConnectionFactory connectionFactory) throws DataAccessException { - this.databaseServer = new DatabaseServerImpl(connectionFactory, connectionFactory.getKeyFactory()); - } - - - public ExportResource.ExportHistory getExportHistory(User user) throws DataAccessException { - return new ExportResource.ExportHistory("Hello"); - } - - public void addExportHistory(User user, ExportResource.ExportHistory history) throws DataAccessException { - databaseServer.addExportHistory(user, history.exportHistory()); - } - -} diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java new file mode 100644 index 0000000000..e23c1f3797 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -0,0 +1,92 @@ +package org.vcell.restq.services.Exports; + +import cbit.rmi.event.ExportEvent; +import cbit.vcell.export.server.*; +import cbit.vcell.modeldb.DatabaseServerImpl; +import cbit.vcell.resource.PropertyLoader; +import cbit.vcell.simdata.DataServerImpl; +import cbit.vcell.simdata.DataSetControllerImpl; +import cbit.vcell.simdata.OutputContext; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.smallrye.common.annotation.Blocking; +import io.smallrye.common.annotation.Identifier; +import io.smallrye.mutiny.Multi; +import io.vertx.core.Vertx; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.eclipse.microprofile.reactive.messaging.Channel; +import org.eclipse.microprofile.reactive.messaging.Emitter; +import org.vcell.restq.QuarkusStartUpTasks; +import org.vcell.restq.db.AgroalConnectionFactory; +import org.vcell.restq.handlers.ExportResource; +import org.vcell.util.DataAccessException; +import org.vcell.util.ObjectNotFoundException; +import org.vcell.util.document.User; + +import javax.jms.JMSException; +import javax.jms.QueueConnection; +import java.io.*; + +@ApplicationScoped +public class ExportService { + private final DatabaseServerImpl databaseServer; + private final DataServerImpl dataServer; + +// @Inject +// @Identifier(QuarkusStartUpTasks.internalMQBeanIdentifier) +// QueueConnection internalQueueConnection; + + @Inject + ExportStatusCreator exportStatusCreator; + + @Inject + ObjectMapper jsonMapper; + + @Inject + @Channel("export-request") + Emitter exportJobEmitter; + + private final static Logger lg = LogManager.getLogger(ExportService.class); + + @Inject + public ExportService(AgroalConnectionFactory connectionFactory, ExportStatusCreator exportStatusCreator) throws DataAccessException, FileNotFoundException { + this.databaseServer = new DatabaseServerImpl(connectionFactory, connectionFactory.getKeyFactory()); + this.exportStatusCreator = exportStatusCreator; + String primarySimDataDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, "/simdata"); + String secondarySimDataDir = PropertyLoader.getProperty(PropertyLoader.secondarySimDataDirInternalProperty, "/simdata"); + this.dataServer = new DataServerImpl(new DataSetControllerImpl(null, new File(primarySimDataDir), new File(secondarySimDataDir)), + new ExportServiceImpl()); + } + + public ExportResource.ExportHistory getExportHistory(User user) throws DataAccessException { + return new ExportResource.ExportHistory("Hello"); + } + + public void addExportHistory(User user, ExportResource.ExportHistory history) throws DataAccessException { + databaseServer.addExportHistory(user, history.exportHistory()); + } + + public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JMSException, JsonProcessingException { + exportStatusCreator.addServerExportListener(exportJob.user(), exportJob.id()); + exportJobEmitter.send(jsonMapper.writeValueAsString(exportJob)); + } + + public Multi getExportStatuses(User user, long jobID) throws ObjectNotFoundException { + return exportStatusCreator.getUsersExportStatus(user, jobID); + } + + public void startExportJob(User user, OutputContext outputContext, ExportSpecs exportSpecs, long jobID) throws JMSException, JsonProcessingException { + try { + if (Thread.currentThread().getName().contains("event-loop")){ + throw new RuntimeException("EXPORTS ARE USING THE EVENT LOOP."); + } + ExportServiceImpl.makeRemoteFile(outputContext, user, dataServer, exportSpecs, exportStatusCreator, jobID); + } catch (DataAccessException e) { + throw new RuntimeException(e); + } + } + +} diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 206bb71cd8..ee2c15c8eb 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -141,6 +141,18 @@ quarkus.swagger-ui.always-include=true %dev.quarkus.swagger-ui.oauth-use-pkce-with-authorization-code-grant=true %test.quarkus.swagger-ui.oauth-use-pkce-with-authorization-code-grant=false +############# +# ActiveMQ # +############ +# TODO: Update activeMQ to Artemis so that Quarkus can auto-handle everything through properties +mp.messaging.outgoing.export-request.connector=smallrye-amqp +mp.messaging.outgoing.export-request.address=export-request + +mp.messaging.incoming.processed-export-request.connector=smallrye-amqp +mp.messaging.incoming.processed-export-request.address=export-request + + + ## VCell properties %dev,test.vcell.softwareVersion=8.0.0 quarkus.mailer.from=VCell_Support@uchc.edu From a3b08852d5c7483f3abdb032c4e21cec615b9366 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 10 Jul 2025 11:00:01 -0400 Subject: [PATCH 07/41] Update Export Notification System --- .../export/server/ExportServiceImpl.java | 14 +-- .../cbit/vcell/export/server/JobRequest.java | 14 +++ .../services/Exports/ExportStatusCreator.java | 118 ++++++++++++++++++ 3 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java index d9dd653277..26927caf1a 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java @@ -57,25 +57,25 @@ public ExportServiceImpl() { public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs)throws DataAccessException { - return makeRemoteFile(outputContext,user, dataServerImpl, exportSpecs, eventCreator); + return makeRemoteFile(outputContext,user, dataServerImpl, exportSpecs, eventCreator, JobRequest.createExportJobRequest(user).getExportJobID()); } public ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, boolean zip, ClientTaskStatusSupport clientTaskStatusSupport)throws DataAccessException { - return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, zip, clientTaskStatusSupport); + return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, zip, clientTaskStatusSupport, JobRequest.createExportJobRequest(user).getExportJobID()); } -public static ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator) throws DataAccessException{ - return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, true, null); +public static ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator, long jobRequestID) throws DataAccessException{ + return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, true, null, jobRequestID); } -public static ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator, boolean bSaveAsZip, ClientTaskStatusSupport clientTaskStatusSupport) throws DataAccessException { +private static ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator, boolean bSaveAsZip, ClientTaskStatusSupport clientTaskStatusSupport, long jobRequestID) throws DataAccessException { // if export completes successfully, we return the generated event for logging if (user == null) { throw new DataAccessException("ERROR: user is null"); } - JobRequest newExportJob = JobRequest.createExportJobRequest(user); + JobRequest newExportJob = JobRequest.createExportJobRequest(user, jobRequestID); if (eventCreator instanceof OldExportEventCreator evc){ - evc.putJobRequest(new Long(newExportJob.getExportJobID()), user); + evc.putJobRequest(newExportJob.getExportJobID(), user); } if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): " + newExportJob + ", " + exportSpecs); String fileFormat = null; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/JobRequest.java b/vcell-core/src/main/java/cbit/vcell/export/server/JobRequest.java index dfcca6d5e5..a8bd654c9c 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/JobRequest.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/JobRequest.java @@ -35,6 +35,11 @@ private JobRequest(User user, int jobType) { this.jobType = jobType; this.jobID = random.nextInt() + 5000000000L; } +private JobRequest(User user, int jobType, long jobID) { + this.user = user; + this.jobType = jobType; + this.jobID = jobID; +} /** * Insert the method's description here. * Creation date: (4/3/2001 3:48:06 PM) @@ -48,6 +53,15 @@ public static JobRequest createExportJobRequest(User user) { return new JobRequest(user, EXPORT_JOB); } } + +public static JobRequest createExportJobRequest(User user, long jobID) { + if (user == null) { + throw new NullPointerException("User cannot be null"); + } else { + return new JobRequest(user, EXPORT_JOB, jobID); + } +} + /** * Insert the method's description here. * Creation date: (4/3/2001 4:21:34 PM) diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java new file mode 100644 index 0000000000..c311bff955 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java @@ -0,0 +1,118 @@ +package org.vcell.restq.services.Exports; + +import cbit.rmi.event.ExportEvent; +import cbit.rmi.event.ExportListener; +import cbit.rmi.event.ExportStatusEventCreator; +import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.export.server.TimeSpecs; +import cbit.vcell.export.server.VariableSpecs; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.helpers.MultiEmitterProcessor; +import jakarta.enterprise.context.ApplicationScoped; +import org.vcell.util.ObjectNotFoundException; +import org.vcell.util.document.ExternalDataIdentifier; +import org.vcell.util.document.KeyValue; +import org.vcell.util.document.User; +import org.vcell.util.document.VCDataIdentifier; + +import java.util.Hashtable; + +@ApplicationScoped +public class ExportStatusCreator implements ExportStatusEventCreator { + private final Hashtable jobRequestToUser = new Hashtable(); + private final Hashtable> listeners = new Hashtable<>(); + + protected ExportSpecs exportExists(ExportSpecs exportSpecs) { + // Call DB for export history and check if it exists. Store in cache if it exists for future requests. + return exportSpecs; + } + + public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { + User user = jobRequestToUser.get(jobID); + + if (!listeners.containsKey(user.getName() + jobID)) { + throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); + } + TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); + VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); + final KeyValue dataKey; + if (vcdID instanceof VCSimulationDataIdentifier) { + dataKey = ((VCSimulationDataIdentifier)vcdID).getSimulationKey(); + }else if (vcdID instanceof ExternalDataIdentifier) { + dataKey = ((ExternalDataIdentifier)vcdID).getSimulationKey(); + }else { + throw new RuntimeException("unexpected VCDataIdentifier"); + } + ExportEvent event = new ExportEvent( + this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, + format, location, null, timeSpecs, varSpecs); + event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); + + event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); + listeners.get(user.getName() + jobID).onNext(event); + listeners.get(user.getName() + jobID).complete(); + removeServerExportListener(user, jobID); + return event; + } + + public synchronized void addExportListener(ExportListener listener) { + throw new IllegalCallerException("addExportListener not implemented for the server"); + } + + public synchronized Multi getUsersExportStatus(User user, long exportJobID) throws ObjectNotFoundException { + if (!listeners.containsKey(user.getName() + exportJobID)) { + throw new ObjectNotFoundException("Did not find entry for user " + user.getName() + " and job id " + exportJobID); + } + return listeners.get(user.getName() + exportJobID).toMulti(); + } + + public synchronized void addServerExportListener(User user, long exportJobID){ + MultiEmitterProcessor emitter = MultiEmitterProcessor.create(); + listeners.put(user.getName() + exportJobID, emitter); + jobRequestToUser.put(exportJobID, user); + } + + public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { + User user = jobRequestToUser.get(jobID); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_ASSEMBLING, format, null, null, null, null); + fireExportEvent(event); + } + + public void fireExportEvent(ExportEvent event) { + if (!listeners.containsKey(event.getUser().getName() + event.getJobID())){ + throw new RuntimeException("Did not find entry for user " + event.getUser().getName() + " and job id " + event.getJobID()); + } + MultiEmitterProcessor listener = listeners.get(event.getUser().getName() + event.getJobID()); + listener.onNext(event); + } + + public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { + User user = jobRequestToUser.get(jobID); + if (!listeners.containsKey(user.getName() + jobID)) { + throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); + } + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); + listeners.get(user.getName() + jobID).onNext(event); + listeners.get(user.getName() + jobID).complete(); + removeServerExportListener(user, jobID); + } + + public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { + User user = jobRequestToUser.get(jobID); + + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_PROGRESS, format, null, progress, null, null); + fireExportEvent(event); + } + + public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { + User user = jobRequestToUser.get(jobID); + + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_START, format, null, null, null, null); + fireExportEvent(event); + } + + public synchronized void removeServerExportListener(User user, long exportJobID){ + listeners.remove(user.getName() + exportJobID); + } +} From e96f75ffe64b33d0c263f7cd949756ebd3af8c2d Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 10 Jul 2025 11:01:04 -0400 Subject: [PATCH 08/41] Export Request Tests --- .../org/vcell/restq/ExportRequestTest.java | 212 ++++++++++++++++++ .../org/vcell/restq/TestEndpointUtils.java | 24 ++ .../SimID_597714292_0_.functions | 12 + .../Administrator/SimID_597714292_0_.fvinput | 70 ++++++ .../Administrator/SimID_597714292_0_.hdf5 | Bin 0 -> 12960 bytes .../Administrator/SimID_597714292_0_.mesh | 83 +++++++ .../SimID_597714292_0_.meshmetrics | 56 +++++ .../SimID_597714292_0_.subdomains | 5 + .../Administrator/SimID_597714292_0_.vcg | 64 ++++++ .../SimID_597714292_0__0.simtask.xml | 123 ++++++++++ 10 files changed, 649 insertions(+) create mode 100644 vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.functions create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.fvinput create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.hdf5 create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.mesh create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.meshmetrics create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.subdomains create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.vcg create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0__0.simtask.xml diff --git a/vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java b/vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java new file mode 100644 index 0000000000..d22303188c --- /dev/null +++ b/vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java @@ -0,0 +1,212 @@ +package org.vcell.restq; + +import cbit.rmi.event.ExportEvent; +import cbit.vcell.export.server.*; +import cbit.vcell.math.VariableType; +import cbit.vcell.modeldb.DatabaseServerImpl; +import cbit.vcell.resource.PropertyLoader; +import cbit.vcell.simdata.*; +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationIdentifier; +import cbit.vcell.xml.XmlParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import io.quarkus.test.junit.QuarkusTest; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.helpers.BlockingIterable; +import jakarta.inject.Inject; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.junit.jupiter.api.*; +import org.testcontainers.shaded.org.awaitility.Awaitility; +import org.vcell.restclient.ApiException; +import org.vcell.restq.activemq.ExportRequestListenerMQ; +import org.vcell.restq.config.CDIVCellConfigProvider; +import org.vcell.restq.db.AgroalConnectionFactory; +import org.vcell.restq.handlers.ExportResource; +import org.vcell.restq.services.Exports.ExportService; +import org.vcell.restq.services.Exports.ExportStatusCreator; +import org.vcell.util.DataAccessException; +import org.vcell.util.ObjectNotFoundException; +import org.vcell.util.document.KeyValue; + +import javax.jms.JMSException; +import java.beans.PropertyVetoException; +import java.io.File; +import java.io.IOException; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +@QuarkusTest +public class ExportRequestTest { + @ConfigProperty(name = "quarkus.http.test-port") + Integer testPort; + + @Inject + AgroalConnectionFactory agroalConnectionFactory; + + @Inject + ExportRequestListenerMQ requestListenerMQ; + @Inject + ExportService exportService; + @Inject + ExportStatusCreator statusCreator; + + private DatabaseServerImpl databaseServer; + private DataServerImpl dataServer; + private final String simulationID = "597714292"; + + @BeforeAll + public static void setupConfig(){ + PropertyLoader.setConfigProvider(new CDIVCellConfigProvider()); + } + + @BeforeEach + public void setUp() throws IOException, DataAccessException { + databaseServer = new DatabaseServerImpl(agroalConnectionFactory, agroalConnectionFactory.getKeyFactory()); + + File testSimData = new File(ExportRequestTest.class.getResource("/simdata").getPath()); + TestEndpointUtils.setSystemProperties(testSimData.getAbsolutePath(), System.getProperty("java.io.tmpdir")); + Cachetable cachetable = new Cachetable(10 * Cachetable.minute, 10000); + DataSetControllerImpl dataSetController = new DataSetControllerImpl(cachetable, testSimData, testSimData); + dataServer = new DataServerImpl(dataSetController, null); + } + + @AfterEach + public void removeOIDCMappings() throws SQLException, DataAccessException { + TestEndpointUtils.clearAllBioModelEntries(agroalConnectionFactory); + TestEndpointUtils.restoreSystemProperties(); + } + + @Test + public void testExportQueue() throws JMSException, JsonProcessingException, ObjectNotFoundException { + ExportSpecs exportSpecs = new ExportSpecs(null, null, null, null, null, null, "TestSim", null); + ExportResource.ExportJob exportJob = new ExportResource.ExportJob(1, TestEndpointUtils.administratorUser, + exportSpecs, new AnnotatedFunction[]{}); + exportService.addExportJobToQueue(exportJob); + Awaitility.await().atMost(1, TimeUnit.SECONDS) + .untilAsserted(() -> { + Assertions.assertFalse(requestListenerMQ.getAcceptedJobs().isEmpty()); + Assertions.assertEquals(exportJob.exportSpecs().getSimulationName(), requestListenerMQ.getAcceptedJobs().get(0).exportSpecs().getSimulationName()); + }); + Multi status = statusCreator.getUsersExportStatus(TestEndpointUtils.administratorUser, exportJob.id()); + + // This request should fail + Awaitility.await().atMost(3, TimeUnit.SECONDS).untilAsserted(() -> { + Assertions.assertThrows(Exception.class, () -> statusCreator.getUsersExportStatus(exportJob.user(), exportJob.id())); + }); + } + + @Test + public void testExportStatus() throws Exception { + long jobID = 1; + ExportSpecs exportSpecs = getValidExportSpec(0, 1); + Multi status = createExportListener(exportSpecs, jobID); + BlockingIterable blockingIterable = status.subscribe().asIterable(); + CompletableFuture.runAsync(() -> { + try { + ExportServiceImpl.makeRemoteFile(new OutputContext(new AnnotatedFunction[]{}), TestEndpointUtils.administratorUser, + dataServer, exportSpecs, statusCreator, jobID); + } catch (Exception e) { + // If an exception is thrown during the export process, the blocking iterable will hang because no finish statement has been sent + throw new RuntimeException(e); + } + }); + int i = 0; + for (ExportEvent exportEvent : blockingIterable) { + switch (i){ + case 0: + Assertions.assertNull(exportEvent.getProgress()); + Assertions.assertEquals(ExportEvent.EXPORT_START, exportEvent.getEventTypeID()); + break; + case 1: + Assertions.assertEquals(.25,exportEvent.getProgress()); + Assertions.assertEquals(ExportEvent.EXPORT_PROGRESS, exportEvent.getEventTypeID()); + break; + case 2: + Assertions.assertEquals(.8125,exportEvent.getProgress()); + Assertions.assertEquals(ExportEvent.EXPORT_PROGRESS, exportEvent.getEventTypeID()); + Assertions.assertNull(exportEvent.getLocation()); + break; + case 3: + Assertions.assertNull(exportEvent.getProgress()); + Assertions.assertEquals(ExportEvent.EXPORT_COMPLETE, exportEvent.getEventTypeID()); + Assertions.assertNotNull(exportEvent.getLocation()); + break; + default: + Assertions.fail(); + } + Assertions.assertEquals(1, exportEvent.getJobID()); + Assertions.assertEquals(simulationID, exportEvent.getDataKey().toString()); + Assertions.assertEquals(ExportFormat.N5.name(), exportEvent.getFormat()); + i++; + } + + long badJobID = 2; + ExportSpecs badExportSpecs = new ExportSpecs(exportSpecs.getVCDataIdentifier(), null, null, null, null, null, "TestSim", null); + status = createExportListener(badExportSpecs, badJobID); + CompletableFuture.runAsync(() -> { + try { + ExportResource.ExportJob exportJob = new ExportResource.ExportJob(badJobID, TestEndpointUtils.administratorUser, + badExportSpecs, new AnnotatedFunction[]{}); + requestListenerMQ.startJob(exportJob); + Assertions.fail(); + } catch (Exception e) { + Assertions.assertInstanceOf(NullPointerException.class, e); + } + }); + blockingIterable = status.subscribe().asIterable(); + for (ExportEvent exportEvent : blockingIterable) { + Assertions.assertEquals(ExportEvent.EXPORT_FAILURE, exportEvent.getEventTypeID()); + } + } + + + private ExportResource.ExportRequest getValidExportRequest(int startTimeIndex, int endTimeIndex) throws Exception { + N5Specs.CompressionLevel compressionLevel = N5Specs.CompressionLevel.RAW; + VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simulationID), TestEndpointUtils.administratorUser); + VCSimulationDataIdentifier simulationDataIdentifier = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); + DataIdentifier[] dataIdentifier = dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), TestEndpointUtils.administratorUser, simulationDataIdentifier); + DataIdentifier volumetricDataID = getOneDIWithSpecificType(VariableType.VOLUME, dataIdentifier); + + VariableSpecs variableSpecs = new VariableSpecs(new ArrayList<>(){{add(volumetricDataID.getName());}}, ExportSpecss.VariableMode.VARIABLE_ONE); + GeometrySpecs geometrySpecs = new GeometrySpecs(new SpatialSelection[0], 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS); + N5Specs n5Specs = new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, simulationID); + + double[] allTimes = dataServer.getDataSetTimes(TestEndpointUtils.administratorUser, simulationDataIdentifier); + TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportSpecss.TimeMode.TIME_RANGE); + + return new ExportResource.ExportRequest(new ArrayList<>(){},ExportFormat.N5, simulationDataIdentifier, + n5Specs, geometrySpecs, timeSpecs, variableSpecs, vcSimulationIdentifier.getID(), ""); + } + + private ExportSpecs getValidExportSpec(int startTimeIndex, int endTimeIndex) throws Exception { + ExportResource.ExportRequest request = getValidExportRequest(startTimeIndex, endTimeIndex); + return new ExportSpecs(request.dataIdentifier(), request.exportFormat(), request.variableSpecs(), + request.timeSpecs(), request.geometrySpecs(), request.formatSpecificSpecs(), request.simulationName(), + request.contextName()); + } + + private DataIdentifier getOneDIWithSpecificType(VariableType variableType, DataIdentifier[] dataIdentifiers){ + for(DataIdentifier dataIdentifier: dataIdentifiers){ + if(dataIdentifier.getVariableType().equals(variableType)){ + return dataIdentifier; + } + } + throw new RuntimeException("Cannot find variable type " + variableType); + } + + private Multi createExportListener(ExportSpecs exportSpecs, long jobID) throws Exception { + HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; + exportSpecs.setExportMetaData(new HumanReadableExportData("", "", "", new ArrayList<>(), "", "", false, dummyMaskInfo)); + + ExportResource.ExportJob exportJob = new ExportResource.ExportJob(jobID, TestEndpointUtils.administratorUser, + exportSpecs, new AnnotatedFunction[]{}); + statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); + + return statusCreator.getUsersExportStatus(TestEndpointUtils.administratorUser, exportJob.id()); + } + +} diff --git a/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java b/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java index a76126c598..5465d009fe 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java +++ b/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java @@ -10,6 +10,7 @@ import cbit.vcell.modeldb.AdminDBTopLevel; import cbit.vcell.modeldb.DatabaseServerImpl; import cbit.vcell.parser.Expression; +import cbit.vcell.resource.PropertyLoader; import cbit.vcell.solver.Simulation; import cbit.vcell.solver.TimeBounds; import cbit.vcell.xml.XMLSource; @@ -188,4 +189,27 @@ public static void clearAllBioModelEntries(AgroalConnectionFactory agroalConnect connection.commit(); new DatabaseServerImpl(agroalConnectionFactory, agroalConnectionFactory.getKeyFactory()).cleanupDatabase(); } + + + private final static String previousExportBaseDir = PropertyLoader.getProperty(PropertyLoader.exportBaseDirInternalProperty, System.getProperty("java.io.tmpdir")); + private final static String previousSimDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, System.getProperty("java.io.tmpdir")); + private final static String previousN5Path = PropertyLoader.getProperty(PropertyLoader.n5DataDir, System.getProperty("java.io.tmpdir")); + private final static String previousExportURL = PropertyLoader.getProperty(PropertyLoader.exportBaseURLProperty, "http://localhost:8080/exports"); + private final static String previousS3BaseURL = PropertyLoader.getProperty(PropertyLoader.exportBaseURLProperty, "http://localhost:8080/s3"); + + public static void setSystemProperties(String simDir, String exportBaseDir){ + PropertyLoader.setProperty(PropertyLoader.primarySimDataDirInternalProperty, simDir); + PropertyLoader.setProperty(PropertyLoader.exportBaseDirInternalProperty, exportBaseDir); + PropertyLoader.setProperty(PropertyLoader.exportBaseURLProperty, previousExportURL); + PropertyLoader.setProperty(PropertyLoader.n5DataDir, exportBaseDir); + PropertyLoader.setProperty(PropertyLoader.s3ExportBaseURLProperty, previousS3BaseURL); + } + + public static void restoreSystemProperties(){ + PropertyLoader.setProperty(PropertyLoader.primarySimDataDirInternalProperty, previousSimDir); + PropertyLoader.setProperty(PropertyLoader.exportBaseDirInternalProperty, previousExportBaseDir); + PropertyLoader.setProperty(PropertyLoader.n5DataDir, previousN5Path); + PropertyLoader.setProperty(PropertyLoader.exportBaseURLProperty, previousExportURL); + PropertyLoader.setProperty(PropertyLoader.s3ExportBaseURLProperty, previousS3BaseURL); + } } diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.functions b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.functions new file mode 100644 index 0000000000..fe47c9360f --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.functions @@ -0,0 +1,12 @@ +##--------------------------------------------- +## /home/zeke/.vcell/simdata/temp/SimID_597714292_0_.functions +##--------------------------------------------- + +Cyt::Dex_init_uM; (10.0 * ((x < -5.0) || (x > 5.0) || (y < -5.0) || (y > 5.0))); ; Volume_VariableType; false +Cyt::Size_Cyt; vcRegionVolume('Cyt'); ; Volume_Region_VariableType; false +EC::Size_EC; vcRegionVolume('EC'); ; Volume_Region_VariableType; false +Cyt_EC_membrane::Size_PM; vcRegionArea('Cyt_EC_membrane'); ; Membrane_Region_VariableType; false +Cyt_EC_membrane::sobj_Cyt1_EC0_size; vcRegionArea('Cyt_EC_membrane'); ; Membrane_Region_VariableType; false +Cyt::vobj_Cyt1_size; vcRegionVolume('Cyt'); ; Volume_Region_VariableType; false +EC::vobj_EC0_size; vcRegionVolume('EC'); ; Volume_Region_VariableType; false + diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.fvinput b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.fvinput new file mode 100644 index 0000000000..329f83892f --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.fvinput @@ -0,0 +1,70 @@ +# Simulation Parameters +SIMULATION_PARAM_BEGIN +SOLVER SUNDIALS_PDE_SOLVER 1.0E-7 1.0E-9 0.01 +BASE_FILE_NAME /home/zeke/.vcell/simdata/temp/SimID_597714292_0_ +ENDING_TIME 2.0 +TIME_STEP 0.5 +KEEP_EVERY 1 +SIMULATION_PARAM_END + +# Model description: FEATURE name handle boundary_conditions +MODEL_BEGIN +FEATURE Cyt 1 flux flux flux flux +FEATURE EC 0 flux flux flux flux +MEMBRANE Cyt_EC_membrane Cyt EC flux flux flux flux +MODEL_END + +# Mesh file +MESH_BEGIN +VCG_FILE /home/zeke/.vcell/simdata/temp/SimID_597714292_0_.vcg +MESH_END + +# Variables : type name domain time_dependent_flag advection_flag grad_flag solve_whole_mesh_flag solve_regions +VARIABLE_BEGIN +VOLUME_PDE Dex Cyt false false false false Cyt +VARIABLE_END + +POST_PROCESSING_BLOCK_BEGIN +POST_PROCESSING_BLOCK_END + +COMPARTMENT_BEGIN Cyt + +EQUATION_BEGIN Dex +INITIAL (10.0 * ((x < -5.0) || (x > 5.0) || (y < -5.0) || (y > 5.0))); +RATE 0.0; +DIFFUSION 20.0; +VELOCITY_X 0.0; +VELOCITY_Y 0.0; +BOUNDARY_XM 0.0; +BOUNDARY_XP 0.0; +BOUNDARY_YM 0.0; +BOUNDARY_YP 0.0; +EQUATION_END + +COMPARTMENT_END + +COMPARTMENT_BEGIN EC + +EQUATION_BEGIN Dex +INITIAL 0.0; +RATE 0.0; +DIFFUSION 0.0; +VELOCITY_X 0.0; +VELOCITY_Y 0.0; +BOUNDARY_XM 0.0; +BOUNDARY_XP 0.0; +BOUNDARY_YM 0.0; +BOUNDARY_YP 0.0; +EQUATION_END + +COMPARTMENT_END + + +MEMBRANE_BEGIN Cyt_EC_membrane Cyt EC + +JUMP_CONDITION_BEGIN Dex +FLUX Cyt 0.0; +JUMP_CONDITION_END + +MEMBRANE_END + diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.hdf5 b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.hdf5 new file mode 100644 index 0000000000000000000000000000000000000000..2cb40f53634b234481678e77be83b733d988f902 GIT binary patch literal 12960 zcmeHMO-NKx6u$3`=2OQ~iy8-_Sr}+3%#VZ-;T6Uj7uld9tidqN;Em}zS?z`tqzLztTWR}gnGVk1T&zbw~`R=*r zoViYfg2$>V+!cg1MIj}m+U(+E1=^&ak06io0q96T$AM1Cydx3zM~Dl?YhZr6UT=3t z2Qf5pex&dg{kAKb6x>;f9f^1lM(-dH);W9wvX3i!E7&KKKLA{FL-V?L{f`iMF? z61Tu#3gs799oG*P8-T)I69IdE!SnUecCK_Izj)2Yfy?qf8xQq~T*8{~^X0cs zPwHxn_EI{pK&{2m@EK~31vj|IM;?=LbI z`DQcxexo#7|0wtaJ;y>&>^YD_0fzDSg!f>6y;cy@ru=##5Qm%d>-{Zh(}ydEBl9lW z*m!ViQWh;ty~fQSPk z4v07);(&+)A`XZ+@cVIK^X`Q_@E>OnKf3Vz*Y1Tj4-YEvFnnOuy`jLvg2&jFz{7Hw z1tSm;2y7_?UcKY@_vz#O{{D{h_UO&$Rdi3_NyhhjFMSX4QINZoi`S2K?WU)_o!_Qw w-Ek literal 0 HcmV?d00001 diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.mesh b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.mesh new file mode 100644 index 0000000000..f2a0da87f5 --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.mesh @@ -0,0 +1,83 @@ +Version 1.2 +CartesianMesh { + // X Y Z + Size 15 15 1 + Extent 22 22 1 + Origin -11 -11 0 + + VolumeRegionsMapSubvolume { + 2 + //VolRegID SubvolID Volume + 0 0 165.44897959183703 //EC + 1 1 318.55102040816394 //Cyt + } + + MembraneRegionsMapVolumeRegion { + 1 + //MemRegID VolReg1 VolReg2 Surface + 0 1 0 63.554568856679239 + } + + VolumeElementsMapVolumeRegion { + 225 Compressed + 789C6360200E30C2213E394C79460C884F0E218F5D0E263F50B2F8DD4CC8BF84C28A503863070073 + A40082 + } + + MembraneElements { + 52 + //Indx Vol1 Vol2 Conn0 Conn1 Conn2 Conn3 MemRegID + 0 20 5 1 5 -1 -1 0 + 1 21 6 2 0 -1 -1 0 + 2 22 7 3 1 -1 -1 0 + 3 23 8 4 2 -1 -1 0 + 4 24 9 7 3 -1 -1 0 + 5 20 19 6 0 -1 -1 0 + 6 34 19 5 9 -1 -1 0 + 7 24 25 8 4 -1 -1 0 + 8 40 25 11 7 -1 -1 0 + 9 34 33 10 6 -1 -1 0 + 10 48 33 9 13 -1 -1 0 + 11 40 41 12 8 -1 -1 0 + 12 56 41 15 11 -1 -1 0 + 13 48 47 14 10 -1 -1 0 + 14 62 47 13 17 -1 -1 0 + 15 56 57 16 12 -1 -1 0 + 16 72 57 19 15 -1 -1 0 + 17 62 61 18 14 -1 -1 0 + 18 76 61 17 21 -1 -1 0 + 19 72 73 20 16 -1 -1 0 + 20 88 73 22 19 -1 -1 0 + 21 76 75 23 18 -1 -1 0 + 22 88 89 24 20 -1 -1 0 + 23 91 90 25 21 -1 -1 0 + 24 103 104 26 22 -1 -1 0 + 25 106 105 27 23 -1 -1 0 + 26 118 119 28 24 -1 -1 0 + 27 121 120 29 25 -1 -1 0 + 28 133 134 31 26 -1 -1 0 + 29 136 135 30 27 -1 -1 0 + 30 136 151 33 29 -1 -1 0 + 31 148 149 32 28 -1 -1 0 + 32 148 163 31 35 -1 -1 0 + 33 152 151 34 30 -1 -1 0 + 34 152 167 37 33 -1 -1 0 + 35 162 163 36 32 -1 -1 0 + 36 162 177 35 39 -1 -1 0 + 37 168 167 38 34 -1 -1 0 + 38 168 183 41 37 -1 -1 0 + 39 176 177 40 36 -1 -1 0 + 40 176 191 39 43 -1 -1 0 + 41 184 183 42 38 -1 -1 0 + 42 184 199 45 41 -1 -1 0 + 43 190 191 44 40 -1 -1 0 + 44 190 205 43 50 -1 -1 0 + 45 200 199 46 42 -1 -1 0 + 46 200 215 47 45 -1 -1 0 + 47 201 216 48 46 -1 -1 0 + 48 202 217 49 47 -1 -1 0 + 49 203 218 51 48 -1 -1 0 + 50 204 205 51 44 -1 -1 0 + 51 204 219 50 49 -1 -1 0 + } +} diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.meshmetrics b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.meshmetrics new file mode 100644 index 0000000000..96a5fff573 --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.meshmetrics @@ -0,0 +1,56 @@ +MembraneElements { +52 +Index RegionIndex X Y Z Area Nx Ny Nz +0 0 -3.1428571428571432 -10.214285714285715 0.5 1.2866801134234394 0.38268343236508989 0.92387953251128663 0 +1 0 -1.5714285714285712 -10.214285714285715 0.5 1.5259772384943238 0.19794522583524796 0.98021308273713248 0 +2 0 0 -10.214285714285715 0.5 1.5558817078648897 -2.925694557147251e-17 1 0 +3 0 1.5714285714285712 -10.214285714285715 0.5 1.5259772384943238 -0.19794522583524804 0.98021308273713248 0 +4 0 3.1428571428571423 -10.214285714285715 0.5 1.2866801134234394 -0.38268343236508989 0.92387953251128663 0 +5 0 -3.9285714285714288 -9.4285714285714288 0.5 1.0561990333182676 -0.44721359549995809 -0.89442719099991574 0 +6 0 -4.7142857142857144 -8.6428571428571423 0.5 1.0796665857654677 0.49269881498359303 0.87019990675347869 0 +7 0 3.9285714285714279 -9.4285714285714288 0.5 1.0561990333182676 -0.44721359549995798 0.89442719099991586 0 +8 0 4.7142857142857135 -8.6428571428571423 0.5 1.0796665857654677 -0.49269881498359303 0.87019990675347869 0 +9 0 -5.5 -7.8571428571428577 0.5 1.0861712976328299 -0.56062880930518388 -0.82806723046927289 0 +10 0 -6.2857142857142856 -7.0714285714285712 0.5 1.1316859845181357 0.63398890560553822 0.77334214133790236 0 +11 0 5.4999999999999991 -7.8571428571428577 0.5 1.0861712976328297 -0.56062880930518388 0.82806723046927289 0 +12 0 6.2857142857142847 -7.0714285714285712 0.5 1.1316859845181355 -0.63398890560553822 0.77334214133790224 0 +13 0 -7.0714285714285712 -6.2857142857142856 0.5 1.1316859845181357 -0.77334214133790236 -0.63398890560553822 0 +14 0 -7.8571428571428577 -5.5 0.5 1.0861712976328299 0.82806723046927289 0.56062880930518388 0 +15 0 7.0714285714285712 -6.2857142857142856 0.5 1.1316859845181357 -0.77334214133790247 0.633988905605538 0 +16 0 7.8571428571428577 -5.5 0.5 1.0861712976328299 -0.828067230469273 0.56062880930518377 0 +17 0 -8.6428571428571423 -4.7142857142857144 0.5 1.0796665857654677 -0.87019990675347869 -0.49269881498359303 0 +18 0 -9.4285714285714288 -3.9285714285714288 0.5 1.0561990333182676 0.89442719099991574 0.44721359549995809 0 +19 0 8.6428571428571423 -4.7142857142857144 0.5 1.0796665857654677 -0.8701999067534788 0.49269881498359297 0 +20 0 9.428571428571427 -3.9285714285714288 0.5 1.0561990333182676 -0.89442719099991586 0.44721359549995798 0 +21 0 -10.214285714285715 -3.1428571428571432 0.5 1.2866801134234394 -0.92387953251128663 -0.38268343236508989 0 +22 0 10.214285714285714 -3.1428571428571432 0.5 1.2866801134234394 -0.92387953251128674 0.38268343236508978 0 +23 0 -10.214285714285715 -1.5714285714285712 0.5 1.5259772384943238 -0.98021308273713248 -0.19794522583524796 0 +24 0 10.214285714285714 -1.5714285714285712 0.5 1.5259772384943238 -0.98021308273713248 0.19794522583524779 0 +25 0 -10.214285714285715 0 0.5 1.5558817078648897 -1 2.925694557147251e-17 0 +26 0 10.214285714285714 0 0.5 1.5558817078648897 -1 -2.9256945571472504e-17 0 +27 0 -10.214285714285715 1.5714285714285712 0.5 1.5259772384943238 -0.98021308273713248 0.19794522583524804 0 +28 0 10.214285714285714 1.5714285714285712 0.5 1.5259772384943238 -0.98021308273713248 -0.19794522583524785 0 +29 0 -10.214285714285715 3.1428571428571423 0.5 1.2866801134234394 -0.92387953251128663 0.38268343236508989 0 +30 0 -9.4285714285714288 3.9285714285714279 0.5 1.0561990333182676 -0.89442719099991586 0.44721359549995798 0 +31 0 10.214285714285714 3.1428571428571423 0.5 1.2866801134234394 -0.92387953251128674 -0.38268343236508978 0 +32 0 9.428571428571427 3.9285714285714279 0.5 1.0561990333182676 0.89442719099991597 0.44721359549995798 0 +33 0 -8.6428571428571423 4.7142857142857135 0.5 1.0796665857654677 -0.87019990675347869 0.49269881498359303 0 +34 0 -7.8571428571428577 5.4999999999999991 0.5 1.0861712976328297 -0.82806723046927289 0.56062880930518388 0 +35 0 8.6428571428571423 4.7142857142857135 0.5 1.0796665857654677 -0.8701999067534788 -0.49269881498359297 0 +36 0 7.8571428571428577 5.4999999999999991 0.5 1.0861712976328299 0.82806723046927289 0.56062880930518388 0 +37 0 -7.0714285714285712 6.2857142857142847 0.5 1.1316859845181355 -0.77334214133790224 0.63398890560553822 0 +38 0 -6.2857142857142856 7.0714285714285712 0.5 1.1316859845181357 -0.633988905605538 0.77334214133790247 0 +39 0 7.0714285714285712 6.2857142857142847 0.5 1.1316859845181357 -0.77334214133790236 -0.63398890560553822 0 +40 0 6.2857142857142847 7.0714285714285712 0.5 1.1316859845181357 0.63398890560553822 0.77334214133790236 0 +41 0 -5.5 7.8571428571428577 0.5 1.0861712976328299 -0.56062880930518377 0.828067230469273 0 +42 0 -4.7142857142857144 8.6428571428571423 0.5 1.0796665857654677 -0.49269881498359297 0.8701999067534788 0 +43 0 5.4999999999999991 7.8571428571428577 0.5 1.0861712976328299 -0.56062880930518388 -0.82806723046927289 0 +44 0 4.7142857142857135 8.6428571428571423 0.5 1.0796665857654677 0.49269881498359297 0.8701999067534788 0 +45 0 -3.9285714285714288 9.428571428571427 0.5 1.0561990333182676 -0.44721359549995798 0.89442719099991586 0 +46 0 -3.1428571428571432 10.214285714285714 0.5 1.2866801134234394 -0.38268343236508978 0.92387953251128674 0 +47 0 -1.5714285714285712 10.214285714285714 0.5 1.5259772384943238 -0.19794522583524779 0.98021308273713248 0 +48 0 0 10.214285714285714 0.5 1.5558817078648897 2.9256945571472504e-17 1 0 +49 0 1.5714285714285712 10.214285714285714 0.5 1.5259772384943238 0.19794522583524785 0.98021308273713248 0 +50 0 3.9285714285714279 9.428571428571427 0.5 1.0561990333182676 -0.44721359549995798 -0.89442719099991597 0 +51 0 3.1428571428571423 10.214285714285714 0.5 1.2866801134234394 0.38268343236508978 0.92387953251128674 0 +} \ No newline at end of file diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.subdomains b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.subdomains new file mode 100644 index 0000000000..13ff3d61a6 --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.subdomains @@ -0,0 +1,5 @@ +# CompartmentSubDomain name, handle +# MembraneSubDomain name, inside compartment name, handle, outside compartment name, handle +CompartmentSubDomain, Cyt, 1 +CompartmentSubDomain, EC, 0 +MembraneSubDomain, Cyt_EC_membrane, Cyt, 1, EC, 0 diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.vcg b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.vcg new file mode 100644 index 0000000000..8dc6a3a7d4 --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.vcg @@ -0,0 +1,64 @@ +name FRAP_geometry171328045 +dimension 2 +size 22.0 22.0 +origin -11.0 -11.0 +volumeRegions 2 +EC0 165.44897959183672 0 +Cyt1 318.55102040816325 1 +membraneRegions 1 +membrane_EC0_Cyt1 62.65640422868889 1 0 +volumeSamples 15 15 +789C6360200E30C2213E394C79460C884F0E218F5D0E263F50B2F8DD4CC8BF84C28A503863070073A40082 +cells 52 +0 5 20 1.2406917254435774 -2.691326353348986 -9.761279861810234 5.0 0.315479148540966 0.9489325091047662 0.0 +1 6 21 1.3861264586081314 -1.4149944278824884 -10.043315093745358 5.0 0.12456157492214774 0.9922118796169063 0.0 +2 7 22 1.4546577168826746 -1.0547118733938987E-15 -10.129644141108102 5.0 0.0 1.0 0.0 +3 8 23 1.386126458608131 1.414994427882486 -10.043315093745358 5.0 -0.1245615749221478 0.9922118796169063 0.0 +4 9 24 1.2406917254435774 2.6913263533489835 -9.761279861810234 5.0 -0.315479148540966 0.9489325091047662 0.0 +5 19 20 1.1411935952620955 -3.764902375990901 -9.264835717065516 5.0 0.5270586190124305 0.8498289310941997 0.0 +6 19 34 1.1142530240724278 -4.671964927696909 -8.600536356268337 5.0 0.6525652482343406 0.7577325364512557 0.0 +7 25 24 1.1411935952620955 3.764902375990898 -9.264835717065516 5.0 -0.5270586190124305 0.8498289310941997 0.0 +8 25 40 1.1142530240724278 4.671964927696906 -8.600536356268337 5.0 -0.6525652482343406 0.7577325364512557 0.0 +9 33 34 1.111287093446442 -5.492731761502864 -7.849874618645721 5.0 0.6966702651018015 0.71739148428385 0.0 +10 33 48 1.1111697733120987 -6.284943424767933 -7.070657710482218 5.0 0.7057725661434031 0.7084384834827621 0.0 +11 41 40 1.1112870934464427 5.492731761502862 -7.849874618645721 5.0 -0.6966702651018012 0.7173914842838505 0.0 +12 41 56 1.1111697733120987 6.284943424767931 -7.070657710482218 5.0 -0.7057725661434031 0.7084384834827621 0.0 +13 47 48 1.1111697733120987 -7.070657710482218 -6.284943424767933 5.0 0.7084384834827621 0.7057725661434031 0.0 +14 47 62 1.111287093446442 -7.849874618645721 -5.492731761502864 5.0 0.71739148428385 0.6966702651018015 0.0 +15 57 56 1.1111697733120982 7.070657710482216 -6.284943424767933 5.0 -0.7084384834827624 0.7057725661434027 0.0 +16 57 72 1.1112870934464414 7.8498746186457184 -5.492731761502864 5.0 -0.7173914842838505 0.6966702651018012 0.0 +17 61 62 1.1142530240724278 -8.600536356268337 -4.671964927696909 5.0 0.7577325364512557 0.6525652482343406 0.0 +18 61 76 1.1411935952620955 -9.264835717065516 -3.764902375990901 5.0 0.8498289310941997 0.5270586190124305 0.0 +19 73 72 1.1142530240724278 8.600536356268334 -4.671964927696909 5.0 -0.7577325364512557 0.6525652482343406 0.0 +20 73 88 1.1411935952620955 9.264835717065512 -3.764902375990901 5.0 -0.8498289310941997 0.5270586190124305 0.0 +21 75 76 1.2406917254435774 -9.761279861810234 -2.691326353348986 5.0 0.9489325091047662 0.315479148540966 0.0 +22 89 88 1.2406917254435774 9.76127986181023 -2.691326353348986 5.0 -0.9489325091047662 0.315479148540966 0.0 +23 90 91 1.3861264586081314 -10.043315093745358 -1.4149944278824884 5.0 0.9922118796169063 0.12456157492214774 0.0 +24 104 103 1.3861264586081314 10.043315093745354 -1.4149944278824884 5.0 -0.9922118796169063 0.12456157492214774 0.0 +25 105 106 1.4546577168826746 -10.129644141108102 -1.0547118733938987E-15 5.0 1.0 -0.0 0.0 +26 119 118 1.4546577168826746 10.129644141108098 -1.0547118733938987E-15 5.0 -1.0 0.0 0.0 +27 120 121 1.3861264586081314 -10.043315093745358 1.414994427882486 5.0 0.9922118796169063 -0.12456157492214774 0.0 +28 134 133 1.3861264586081314 10.043315093745354 1.414994427882486 5.0 -0.9922118796169063 -0.12456157492214774 0.0 +29 135 136 1.240691725443577 -9.761279861810234 2.691326353348984 5.0 0.9489325091047662 -0.3154791485409661 0.0 +30 151 136 1.1411935952620955 -9.264835717065516 3.764902375990898 5.0 0.8498289310941997 -0.5270586190124305 0.0 +31 149 148 1.240691725443577 9.76127986181023 2.691326353348984 5.0 -0.9489325091047662 -0.3154791485409661 0.0 +32 163 148 1.1411935952620955 9.264835717065512 3.764902375990898 5.0 -0.8498289310941997 -0.5270586190124305 0.0 +33 151 152 1.1142530240724278 -8.600536356268337 4.671964927696906 5.0 0.7577325364512557 -0.6525652482343406 0.0 +34 167 152 1.111287093446442 -7.849874618645721 5.492731761502862 5.0 0.71739148428385 -0.6966702651018015 0.0 +35 163 162 1.1142530240724278 8.600536356268334 4.671964927696906 5.0 -0.7577325364512557 -0.6525652482343406 0.0 +36 177 162 1.1112870934464414 7.8498746186457184 5.492731761502862 5.0 -0.7173914842838505 -0.6966702651018012 0.0 +37 167 168 1.1111697733120987 -7.070657710482218 6.284943424767929 5.0 0.7084384834827621 -0.7057725661434031 0.0 +38 183 168 1.1111697733120995 -6.284943424767933 7.070657710482216 5.0 0.7057725661434034 -0.7084384834827616 0.0 +39 177 176 1.1111697733120982 7.070657710482216 6.284943424767929 5.0 -0.7084384834827624 -0.7057725661434027 0.0 +40 191 176 1.1111697733120995 6.284943424767931 7.070657710482216 5.0 -0.7057725661434034 -0.7084384834827616 0.0 +41 183 184 1.111287093446442 -5.492731761502864 7.84987461864572 5.0 0.6966702651018015 -0.71739148428385 0.0 +42 199 184 1.1142530240724278 -4.671964927696909 8.600536356268336 5.0 0.6525652482343406 -0.7577325364512557 0.0 +43 191 190 1.1112870934464427 5.492731761502862 7.84987461864572 5.0 -0.6966702651018012 -0.7173914842838505 0.0 +44 205 190 1.1142530240724278 4.671964927696906 8.600536356268336 5.0 -0.6525652482343406 -0.7577325364512557 0.0 +45 199 200 1.1411935952620946 -3.764902375990901 9.264835717065514 5.0 0.5270586190124292 -0.8498289310942002 0.0 +46 215 200 1.2406917254435774 -2.691326353348986 9.76127986181023 5.0 0.315479148540966 -0.9489325091047662 0.0 +47 216 201 1.3861264586081314 -1.4149944278824884 10.043315093745354 5.0 0.12456157492214774 -0.9922118796169063 0.0 +48 217 202 1.4546577168826746 -1.0547118733938987E-15 10.129644141108098 5.0 -0.0 -1.0 0.0 +49 218 203 1.386126458608131 1.414994427882486 10.043315093745354 5.0 -0.1245615749221478 -0.9922118796169063 0.0 +50 205 204 1.1411935952620946 3.764902375990898 9.264835717065514 5.0 -0.5270586190124292 -0.8498289310942002 0.0 +51 219 204 1.2406917254435774 2.6913263533489835 9.76127986181023 5.0 -0.315479148540966 -0.9489325091047662 0.0 diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0__0.simtask.xml b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0__0.simtask.xml new file mode 100644 index 0000000000..091cd798fc --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0__0.simtask.xml @@ -0,0 +1,123 @@ + + + cloned from 'FRAP_130359' owned by user ACowan +cloned from 'FRAP_130359' owned by user Education +cloned from 'FRAP_130359' owned by user tutorial +cloned from 'FRAP_130359' owned by user susan + 96485.3321 + 9.64853321E-5 + 1.0E-9 + 6.02214179E11 + 3.141592653589793 + 8314.46261815 + 300.0 + 1.0 + 20.0 + 1000.0 + 0.001660538783162726 + 0.0 + 1.0 + 1.0 + + (10.0 * ((x < - 5.0) || (x > 5.0) || (y < - 5.0) || (y > 5.0))) + (VolumePerUnitVolume_Cyt * vcRegionVolume('Cyt')) + (VolumePerUnitVolume_EC * vcRegionVolume('EC')) + (AreaPerUnitArea_PM * vcRegionArea('Cyt_EC_membrane')) + vcRegionArea('Cyt_EC_membrane') + vcRegionVolume('Cyt') + vcRegionVolume('EC') + + + + + + + + + 0.0 + Dex_diffusionRate + Dex_init_uM + + + + + + + + + + + + + + + + + + + 0.0 + 0.0 + + + + + + cloned from 'FRAP_130359' owned by user ACowan +cloned from 'FRAP_130359' owned by user Education +cloned from 'FRAP_130359' owned by user tutorial +cloned from 'FRAP_130359' owned by user susan + + + + cloned from 'FRAP' owned by user ACowan +cloned from 'FRAP 1' owned by user Education +cloned from 'FRAP 1' owned by user tutorial +FRAP Simulation for tutorial. + + + + + + + 2 + + 1 + + + + + + + + + + + + cloned from 'FRAP_geometry171328045' owned by user ACowan +cloned from 'FRAP_geometry' owned by user Education +cloned from 'FRAP_geometry' owned by user tutorial +cloned from 'FRAP_geometry' owned by user susan + + + + (((x * x) + (y * y)) < 100.0) + + + 1.0 + + + + + + + + + + + cloned from 'FRAP_geometry171328045' owned by user ACowan +cloned from 'FRAP_geometry' owned by user Education +cloned from 'FRAP_geometry' owned by user tutorial +cloned from 'FRAP_geometry' owned by user susan + + + \ No newline at end of file From 5b52c0b86ea76a4a725b2e314c04d360059af798 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 16 Jul 2025 09:53:21 -0400 Subject: [PATCH 09/41] Curve Selection Enums --- .../vcell/geometry/gui/CurveEditorTool.java | 8 +++--- .../simdata/gui/PDEDataContextPanel.java | 4 +-- .../cbit/vcell/geometry/CurveRenderer.java | 20 ++++++------- .../vcell/geometry/CurveSelectionInfo.java | 28 +++++++++++-------- .../cbit/vcell/simdata/SpatialSelection.java | 10 +++---- 5 files changed, 37 insertions(+), 33 deletions(-) diff --git a/vcell-client/src/main/java/cbit/vcell/geometry/gui/CurveEditorTool.java b/vcell-client/src/main/java/cbit/vcell/geometry/gui/CurveEditorTool.java index 23d80eee7e..d484304074 100644 --- a/vcell-client/src/main/java/cbit/vcell/geometry/gui/CurveEditorTool.java +++ b/vcell-client/src/main/java/cbit/vcell/geometry/gui/CurveEditorTool.java @@ -297,7 +297,7 @@ public void mouseDragged(MouseEvent event) { } CurveSelectionInfo csi = getCurveRenderer().getSelection(); if (csi != null) { - if (csi.getType() == CurveSelectionInfo.TYPE_SEGMENT || csi.getType() == CurveSelectionInfo.TYPE_U) { + if (csi.getType() == CurveSelectionInfo.CurveSelectionType.SEGMENT.intValue || csi.getType() == CurveSelectionInfo.CurveSelectionType.U.intValue) { //extend the selection CurveSelectionInfo csiExtended = getCurveRenderer().extend(getWorldCoordinateValue(event.getPoint())); if (csiExtended != null) { @@ -535,18 +535,18 @@ private boolean move(double xDelta, double yDelta,CurveSelectionInfo csi,int nor break; } } - if(!bAllSame && (csi.getType()== CurveSelectionInfo.TYPE_CURVE)){ + if(!bAllSame && (csi.getType()== CurveSelectionInfo.CurveSelectionType.CURVE.intValue)){ return false; } // //Set new Controlpoints // for(int i=0;i < cpc.getControlPointCount();i+= 1){ - if (csi.getType() == CurveSelectionInfo.TYPE_CONTROL_POINT ) { + if (csi.getType() == CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue ) { if(csi.getControlPoint() == i){ cpc.setControlPoint(i,newCPArr[i]); } - } else if(csi.getType()== CurveSelectionInfo.TYPE_CURVE){ + } else if(csi.getType()== CurveSelectionInfo.CurveSelectionType.CURVE.intValue){ cpc.setControlPoint(i,newCPArr[i]); } } diff --git a/vcell-client/src/main/java/cbit/vcell/simdata/gui/PDEDataContextPanel.java b/vcell-client/src/main/java/cbit/vcell/simdata/gui/PDEDataContextPanel.java index e6d6dcd45a..39b6f763fe 100644 --- a/vcell-client/src/main/java/cbit/vcell/simdata/gui/PDEDataContextPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/simdata/gui/PDEDataContextPanel.java @@ -857,7 +857,7 @@ public Curve[] getAllUserCurves() { */ public String getCurveValue(CurveSelectionInfo csi) { String infoS = null; - if (csi.getType() == CurveSelectionInfo.TYPE_SEGMENT) { + if (csi.getType() == CurveSelectionInfo.CurveSelectionType.SEGMENT.intValue) { if (membranesAndIndexes != null) { java.util.Enumeration keysEnum = membranesAndIndexes.keys(); while (keysEnum.hasMoreElements()) { @@ -1717,7 +1717,7 @@ public CurveSelectionInfo findChomboCurveSelectionInfoForPoint(CoordinateIndex c { if (memIndexes[idx] == memIndex) { - return new CurveSelectionInfo(sc, CurveSelectionInfo.TYPE_SEGMENT, idx); + return new CurveSelectionInfo(sc, CurveSelectionInfo.CurveSelectionType.SEGMENT.intValue, idx); } } } diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/CurveRenderer.java b/vcell-core/src/main/java/cbit/vcell/geometry/CurveRenderer.java index 36184716e4..6b6357f22b 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/CurveRenderer.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/CurveRenderer.java @@ -301,7 +301,7 @@ private void drawControlPoints(java.awt.Graphics2D g2D, CurveRendererCurveInfo c g2D.setColor(Color.white); } g2D.draw(circle); - if(getSelection().getType() == CurveSelectionInfo.TYPE_CONTROL_POINT && j == getSelection().getControlPoint()){ + if(getSelection().getType() == CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue && j == getSelection().getControlPoint()){ g2D.setColor(Color.red); g2D.fill(circle); } @@ -396,14 +396,14 @@ public CurveSelectionInfo extend(Coordinate pickPoint){ return null; } CurveSelectionInfo csi = null; - if(getSelection().getType() == CurveSelectionInfo.TYPE_SEGMENT){ + if(getSelection().getType() == CurveSelectionInfo.CurveSelectionType.SEGMENT.intValue){ csi = getClosestSegmentSelectionInfo(pickPoint, getSelection().getCurve()); if(csi != null){ if(csi.getCurve() == getSelection().getCurve() && csi.getSegment() != getSelection().getSegmentExtended()){ getSelection().setSegmentExtended(csi.getSegment()); } } - } else if(getSelection().getType() == CurveSelectionInfo.TYPE_U){ + } else if(getSelection().getType() == CurveSelectionInfo.CurveSelectionType.U.intValue){ csi = pickU(pickPoint, getSelection().getCurve()); } return null; @@ -620,7 +620,7 @@ public CurveSelectionInfo getClosestSegmentSelectionInfo(Coordinate pickPoint, C //CurveRendererCurveInfo crci = (CurveRendererCurveInfo)curveTable.get(pickCurve); double pickedSegment = pickSegmentProjected(pickPoint, pickCurve); if(pickedSegment != Curve.NONE_SELECTED){ - csi = new CurveSelectionInfo(pickCurve, CurveSelectionInfo.TYPE_SEGMENT, pickedSegment); + csi = new CurveSelectionInfo(pickCurve, CurveSelectionInfo.CurveSelectionType.SEGMENT.intValue, pickedSegment); } return csi; } @@ -917,7 +917,7 @@ private CurveSelectionInfo pickControlPoint(Coordinate pickPoint, ControlPointCu if(pickCurve instanceof ControlPointCurve){ double pickedCP = pickControlPointProjected(pickPoint, pickCurve); if(pickedCP != Curve.NONE_SELECTED){ - csi = new CurveSelectionInfo(pickCurve, CurveSelectionInfo.TYPE_CONTROL_POINT, pickedCP); + csi = new CurveSelectionInfo(pickCurve, CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue, pickedCP); } } return csi; @@ -996,7 +996,7 @@ private CurveSelectionInfo pickU(Coordinate pickPoint, Curve pickCurve){ //CurveRendererCurveInfo crci = (CurveRendererCurveInfo)curveTable.get(pickCurve); double pickedU = pickUProjected(pickPoint, pickCurve); if(pickedU != Curve.NONE_SELECTED){ - csi = new CurveSelectionInfo(pickCurve, CurveSelectionInfo.TYPE_U, pickedU); + csi = new CurveSelectionInfo(pickCurve, CurveSelectionInfo.CurveSelectionType.U.intValue, pickedU); } return csi; } @@ -1083,11 +1083,11 @@ public synchronized void removePropertyChangeListener(java.lang.String propertyN public void removeSelected(int operation){ if(getSelection() != null){ Curve selected = getSelection().getCurve(); - if(getSelection().getType() == CurveSelectionInfo.TYPE_CONTROL_POINT){ + if(getSelection().getType() == CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue){ boolean bDeleteKeyPressed = (operation == java.awt.event.KeyEvent.VK_DELETE); int newSelectedControlPoint = ((ControlPointCurve) selected).removeControlPoint(getSelection().getControlPoint(), bDeleteKeyPressed); if(newSelectedControlPoint != CurveSelectionInfo.NONE_SELECTED){ - setSelection(new CurveSelectionInfo((ControlPointCurve) selected, CurveSelectionInfo.TYPE_CONTROL_POINT, newSelectedControlPoint)); + setSelection(new CurveSelectionInfo((ControlPointCurve) selected, CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue, newSelectedControlPoint)); return; } } @@ -1155,12 +1155,12 @@ public void renderPropertyVisible(Curve curve, boolean visible){ public void selectNext(){ if(getSelection() != null){ - if(getSelection().getType() == CurveSelectionInfo.TYPE_CONTROL_POINT){ + if(getSelection().getType() == CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue){ int scp = getSelection().getControlPoint() + 1; if(scp >= ((ControlPointCurve) getSelection().getCurve()).getControlPointCount()){ scp = 0; } - setSelection(new CurveSelectionInfo((ControlPointCurve) getSelection().getCurve(), CurveSelectionInfo.TYPE_CONTROL_POINT, scp)); + setSelection(new CurveSelectionInfo((ControlPointCurve) getSelection().getCurve(), CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue, scp)); return; } //else if (getSelection().getType() == CurveSelectionInfo.TYPE_SEGMENT) { diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java b/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java index 21fe6c5951..d76d7c8aad 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java @@ -19,10 +19,14 @@ public class CurveSelectionInfo implements java.io.Serializable, org.vcell.util. // public static final int NONE_SELECTED = -1; // - public static final int TYPE_CURVE = 0; - public static final int TYPE_CONTROL_POINT = 1; - public static final int TYPE_SEGMENT = 2; - public static final int TYPE_U = 3; + + public enum CurveSelectionType{ + CURVE(0), CONTROL_POINT(1), SEGMENT(2), U(3), NONE(-1); + public final int intValue; + CurveSelectionType(int intValue){ + this.intValue = intValue; + } + } private static final String TYPE_LABEL[] = { "curve","controlPoint","segment","u" }; // @@ -42,7 +46,7 @@ public CurveSelectionInfo(Curve curve) { //curve Selection super(); setCurve(curve); - setType(TYPE_CURVE); + setType(CurveSelectionType.CURVE.intValue); } /** * CurveSelectionInfo constructor comment. @@ -50,7 +54,7 @@ public CurveSelectionInfo(Curve curve) { public CurveSelectionInfo(Curve curve, int type, double index) { //Segment or ControlPoint selection super(); - if (type == TYPE_CONTROL_POINT) { + if (type == CurveSelectionType.CONTROL_POINT.intValue) { if (!(curve instanceof ControlPointCurve)) { throw new IllegalArgumentException("TYPE_CONTROL_POINT must have ControlPointCurve"); } @@ -58,18 +62,18 @@ public CurveSelectionInfo(Curve curve, int type, double index) { throw new IllegalArgumentException("index out of range for ControlPointCurve"); } setControlPoint((int) index); - } else if (type == TYPE_SEGMENT) { + } else if (type == CurveSelectionType.SEGMENT.intValue) { if (index < 0 || index >= curve.getSegmentCount()) { throw new IllegalArgumentException("Segment index out of range for Curve"); } setSegment((int) index); - } else if (type == TYPE_U) { + } else if (type == CurveSelectionType.U.intValue) { if (index < 0 || index > 1) { throw new IllegalArgumentException("U must be between 0 and 1"); } setU(index); } else { - throw new IllegalArgumentException("type must be either TYPE_CONTROL_POINT or TYPE_SEGMENT or TYPE_U"); + throw new IllegalArgumentException("type must be either CurveSelectionType.CONTROL_POINT or CurveSelectionType.SEGMENT or CurveSelectionType.U"); } setCurve(curve); @@ -82,7 +86,7 @@ public CurveSelectionInfo(Curve curve,int argBeginSegment,int argEndSegment,bool //curve Selection super(); setCurve(curve); - setType(TYPE_SEGMENT); + setType(CurveSelectionType.SEGMENT.intValue); this.fieldSegment = argBeginSegment; if(argBeginSegment != argEndSegment){ this.fieldSegmentExtended = argEndSegment; @@ -147,8 +151,8 @@ public Curve getCurve() { * @param selectionU double */ public double getCurveUfromSelectionU(double selectionU) { - if (getType() != TYPE_SEGMENT){ - throw new RuntimeException("CurveSelectionInfo.getCurveUfromSelectionU(), cannot call when type!=TYPE_SEGMENT"); + if (getType() != CurveSelectionType.SEGMENT.intValue){ + throw new RuntimeException("CurveSelectionInfo.getCurveUfromSelectionU(), cannot call when type!=CurveSelectionType.SEGMENT"); } int beginSeg = getSegment(); diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java index e726f5612e..503713fd8a 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java @@ -120,7 +120,7 @@ protected SpatialSelection(CurveSelectionInfo argCurveSelectionInfo, VariableTyp if (argCurveSelectionInfo==null || argMesh==null || argVarType==null){ throw new IllegalArgumentException("null argument"); } - if (argCurveSelectionInfo.getType()==CurveSelectionInfo.TYPE_CURVE && !argCurveSelectionInfo.getCurve().isValid()){ + if (argCurveSelectionInfo.getType()==CurveSelectionInfo.CurveSelectionType.CURVE.intValue && !argCurveSelectionInfo.getCurve().isValid()){ throw new IllegalArgumentException("curve is invalid"); } @@ -280,12 +280,12 @@ public String toString() { cbit.vcell.geometry.Curve curve = this.curveSelectionInfo.getCurve(); if (isPoint()){ return "Point="+curve.hashCode()+" ["+((cbit.vcell.geometry.SinglePoint)curve).getBeginningCoordinate()+"]"; - }else if(this.curveSelectionInfo.getType() == CurveSelectionInfo.TYPE_CURVE || - this.curveSelectionInfo.getType() == CurveSelectionInfo.TYPE_CONTROL_POINT){ + }else if(this.curveSelectionInfo.getType() == CurveSelectionInfo.CurveSelectionType.CURVE.intValue || + this.curveSelectionInfo.getType() == CurveSelectionInfo.CurveSelectionType.CONTROL_POINT.intValue){ return "Curve="+curve.hashCode()+" ["+curve.getBeginningCoordinate()+" to "+curve.getEndingCoordinate()+"]"; - }else if(this.curveSelectionInfo.getType() == CurveSelectionInfo.TYPE_SEGMENT){ + }else if(this.curveSelectionInfo.getType() == CurveSelectionInfo.CurveSelectionType.SEGMENT.intValue){ return "Curve="+curve.hashCode()+" Segments ["+this.curveSelectionInfo.getSegmentCount()+"]"; - }else if(this.curveSelectionInfo.getType() == CurveSelectionInfo.TYPE_U){ + }else if(this.curveSelectionInfo.getType() == CurveSelectionInfo.CurveSelectionType.U.intValue){ return "Curve="+curve.hashCode()+" U ["+this.curveSelectionInfo.getU()+" to "+this.curveSelectionInfo.getUExtended()+"]"; }else{ return "Curve="+curve.hashCode(); From 9db86100f7ac6f8fefb53c02b8c45e8dbae499e9 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 16 Jul 2025 09:57:03 -0400 Subject: [PATCH 10/41] DTO JSON Annotations --- .../java/cbit/rmi/event/MessageEvent.java | 4 ++++ .../vcell/export/server/GeometrySpecs.java | 12 ++++++++++ .../cbit/vcell/export/server/TimeSpecs.java | 9 +++++++- .../vcell/export/server/VariableSpecs.java | 8 ++++++- .../main/java/cbit/vcell/math/Function.java | 3 +++ .../cbit/vcell/solver/AnnotatedFunction.java | 2 ++ .../solver/VCSimulationDataIdentifier.java | 12 +++++++++- .../vcell/solver/VCSimulationIdentifier.java | 4 +++- .../vcell/util/document/VCDataIdentifier.java | 23 +++++++++++++++++++ 9 files changed, 73 insertions(+), 4 deletions(-) diff --git a/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java b/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java index 58a7ef24ac..7e0e69ea66 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java @@ -9,6 +9,7 @@ */ package cbit.rmi.event; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.vcell.util.document.User; /** @@ -17,7 +18,9 @@ * @author: IIM */ public abstract class MessageEvent extends java.util.EventObject { + @JsonIgnore private MessageSource messageSource = null; + @JsonIgnore private MessageData messageData = null; public final static int EXPORT_PROGRESS = 1004; @@ -102,6 +105,7 @@ public MessageSource getMessageSource() { * Creation date: (1/10/2001 11:18:44 AM) * @param newSource java.lang.Object */ +@JsonIgnore public void setSource(Object newSource) { source = newSource; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java index 3a5b6afeff..58b219af82 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java @@ -13,6 +13,8 @@ import java.io.IOException; import java.io.Serializable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -27,6 +29,7 @@ public class GeometrySpecs implements Serializable { private final static Logger lg = LogManager.getLogger(GeometrySpecs.class); + @JsonIgnore private byte[][] serializedSelections = null; private transient SpatialSelection[] spatialSelections = null; private final int axis; @@ -41,6 +44,8 @@ public class GeometrySpecs implements Serializable { * @param sliceNumber int * @param geometryMode GeometryMode */ + + @JsonCreator public GeometrySpecs(SpatialSelection[] selections, int axis, int sliceNumber, ExportSpecss.GeometryMode geometryMode){ if(selections != null){ try { @@ -102,6 +107,7 @@ public boolean equals(Object object){ * * @return int */ + @JsonIgnore public int getAxis(){ return axis; } @@ -112,6 +118,7 @@ public int getAxis(){ * * @return cbit.vcell.simdata.gui.SpatialSelection[] */ + @JsonIgnore public SpatialSelection[] getCurves(){ int count = 0; for(int i = 0; getSelections() != null && i < getSelections().length; i++){ @@ -130,6 +137,7 @@ public SpatialSelection[] getCurves(){ return curves; } + @JsonIgnore public ExportSpecss.GeometryMode getMode(){ return modeID; } @@ -141,6 +149,7 @@ public ExportSpecss.GeometryMode getMode(){ * * @return cbit.vcell.geometry.CoordinateIndex[] */ + @JsonIgnore public int[] getPointIndexes(){ switch(getMode()){ case GEOMETRY_SLICE:{ @@ -164,6 +173,7 @@ public int[] getPointIndexes(){ } } + @JsonIgnore public int getPointCount(){ switch(getMode()){ case GEOMETRY_SLICE:{ @@ -184,6 +194,7 @@ public int getPointCount(){ } } + @JsonIgnore public SpatialSelection[] getPointSpatialSelections(){ switch(getMode()){ case GEOMETRY_SLICE:{ @@ -245,6 +256,7 @@ public SpatialSelection[] getSelections(){ * * @return int */ + @JsonIgnore public int getSliceNumber(){ return sliceNumber; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java index 04ee297d26..d3f5b6aab5 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java @@ -10,6 +10,10 @@ package cbit.vcell.export.server; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.io.Serializable; /** * This type was created in VisualAge. @@ -18,11 +22,14 @@ public class TimeSpecs implements Serializable { private int beginTimeIndex; private int endTimeIndex; private double[] allTimes; + @JsonIgnore private ExportSpecss.TimeMode modeID; /** * TimeSpecs constructor comment. */ -public TimeSpecs(int beginTimeIndex, int endTimeIndex, double[] allTimes, ExportSpecss.TimeMode modeID) { +@JsonCreator +public TimeSpecs(@JsonProperty("beginTimeIndex") int beginTimeIndex, @JsonProperty("endTimeIndex") int endTimeIndex, + @JsonProperty("allTimes") double[] allTimes, @JsonProperty("mode") ExportSpecss.TimeMode modeID) { this.beginTimeIndex = beginTimeIndex; this.endTimeIndex = endTimeIndex; this.allTimes = allTimes; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java index 75326f7795..77cd2ec13b 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java @@ -10,6 +10,10 @@ package cbit.vcell.export.server; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.io.Serializable; import java.util.List; /** @@ -17,6 +21,7 @@ */ public class VariableSpecs implements Serializable { private final String[] variableNames; + @JsonIgnore private final ExportSpecss.VariableMode modeID; public VariableSpecs(String[] variableNames, ExportSpecss.VariableMode modeID) { @@ -24,7 +29,8 @@ public VariableSpecs(String[] variableNames, ExportSpecss.VariableMode modeID) { this.modeID = modeID; } -public VariableSpecs (List variableNames, ExportSpecss.VariableMode modeID){ +@JsonCreator +public VariableSpecs (@JsonProperty("variableNames") List variableNames, @JsonProperty("mode") ExportSpecss.VariableMode modeID){ this(variableNames.toArray(new String[0]), modeID); } diff --git a/vcell-core/src/main/java/cbit/vcell/math/Function.java b/vcell-core/src/main/java/cbit/vcell/math/Function.java index 91ea60d8c7..46d5141970 100644 --- a/vcell-core/src/main/java/cbit/vcell/math/Function.java +++ b/vcell-core/src/main/java/cbit/vcell/math/Function.java @@ -12,6 +12,8 @@ import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionBindingException; import cbit.vcell.parser.SymbolTable; +import com.fasterxml.jackson.annotation.JsonIgnore; + /** * This class was generated by a SmartGuide. * @@ -77,6 +79,7 @@ public Expression getExpression() { * This method was created by a SmartGuide. * @return java.lang.String */ +@JsonIgnore public String getVCML() { return VCML.Function+" "+getQualifiedName()+"\t "+exp.infix()+";"; } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/AnnotatedFunction.java b/vcell-core/src/main/java/cbit/vcell/solver/AnnotatedFunction.java index 3f439cda74..9d117d9dcd 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/AnnotatedFunction.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/AnnotatedFunction.java @@ -12,6 +12,7 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyVetoException; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.vcell.util.Matchable; import cbit.vcell.mapping.SimulationContext.Kind; @@ -146,6 +147,7 @@ public void setName(String name) throws PropertyVetoException { setName(name); } +@JsonIgnore @Override public void setUnitDefinition(VCUnitDefinition unit) throws PropertyVetoException { throw new RuntimeException("unit not editable"); diff --git a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java index 038c0aa403..bbf87b86ea 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationDataIdentifier.java @@ -10,14 +10,22 @@ package cbit.vcell.solver; +import cbit.vcell.export.server.FormatSpecificSpecs; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.document.KeyValue; import org.vcell.util.document.SimResampleInfoProvider; +import org.vcell.util.document.VCDataIdentifier; /** * Insert the type's description here. * Creation date: (8/24/2004 10:55:36 AM) * @author: Jim Schaff */ +@Schema(allOf = VCDataIdentifier.class, requiredProperties = {"type"}, properties = {@SchemaProperty(name = "type", defaultValue = "VCSimulationDataIdentifier", type = SchemaType.STRING)}) public class VCSimulationDataIdentifier implements java.io.Serializable, @@ -26,11 +34,13 @@ public class VCSimulationDataIdentifier private VCSimulationIdentifier vcSimID = null; private int jobIndex = -1; + private final String type = "VCSimulationDataIdentifier"; /** * VCSimulationIdentifier constructor comment. */ -public VCSimulationDataIdentifier(VCSimulationIdentifier vcSimID, int jobIndex) { +@JsonCreator +public VCSimulationDataIdentifier(@JsonProperty("vcSimID") VCSimulationIdentifier vcSimID, @JsonProperty("jobIndex") int jobIndex) { this.vcSimID = vcSimID; this.jobIndex = jobIndex; } diff --git a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java index aecbdbae4d..15c7980fa5 100644 --- a/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java +++ b/vcell-core/src/main/java/cbit/vcell/solver/VCSimulationIdentifier.java @@ -10,6 +10,7 @@ package cbit.vcell.solver; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -24,7 +25,8 @@ public final class VCSimulationIdentifier implements java.io.Serializable { /** * VCSimulationIdentifier constructor comment. */ -public VCSimulationIdentifier(org.vcell.util.document.KeyValue argSimulationKey, org.vcell.util.document.User argOwner) { +@JsonCreator +public VCSimulationIdentifier(@JsonProperty("simulationKey") org.vcell.util.document.KeyValue argSimulationKey, @JsonProperty("owner") org.vcell.util.document.User argOwner) { super(); this.simulationKey = argSimulationKey; this.owner = argOwner; diff --git a/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java b/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java index ade5dd205d..040088f1b6 100644 --- a/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java +++ b/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java @@ -11,11 +11,34 @@ package org.vcell.util.document; +import cbit.vcell.export.server.*; +import cbit.vcell.simdata.MergedDataInfo; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationDataIdentifierOldStyle; +import cbit.vcell.solver.VCSimulationIdentifier; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; +import org.eclipse.microprofile.openapi.annotations.media.Schema; + /** * Insert the type's description here. * Creation date: (9/19/2003 5:16:48 PM) * @author: Anuradha Lakshminarayana */ +@Schema( // Including One of destroys inheritance, and instead generates a factory class + discriminatorMapping = { + @DiscriminatorMapping(value = "VCSimulationDataIdentifier", schema = VCSimulationDataIdentifier.class), + }, + discriminatorProperty = "type", + oneOf = {VCSimulationDataIdentifier.class, ExternalDataIdentifier.class, MergedDataInfo.class, VCSimulationDataIdentifierOldStyle.class} +) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "type", // Discriminator field + visible = true +) +@JsonSubTypes({@JsonSubTypes.Type(value = VCSimulationDataIdentifier.class, name = "VCSimulationDataIdentifier")}) public interface VCDataIdentifier { /** * Insert the method's description here. From 7bd635e53b3bc0ab0aa7ec2501d9918fc7c56749 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 16 Jul 2025 10:02:53 -0400 Subject: [PATCH 11/41] Discriminators for Format Specs --- .../cbit/vcell/export/server/ASCIISpecs.java | 1 + .../export/server/FormatSpecificSpecs.java | 44 ++++++++++++++++++- .../cbit/vcell/export/server/ImageSpecs.java | 1 + .../cbit/vcell/export/server/MovieSpecs.java | 1 + .../cbit/vcell/export/server/N5Specs.java | 35 ++++++++++++--- .../cbit/vcell/export/server/PLYSpecs.java | 1 + .../cbit/vcell/export/server/RasterSpecs.java | 1 + 7 files changed, 75 insertions(+), 9 deletions(-) diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java index 642f0d7148..c798dff777 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java @@ -31,6 +31,7 @@ public static enum CsvRoiLayout {var_time_val,time_sim_var} */ public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, int[] exportMultipleParamScans, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns) { + super("ASCIISpecs"); this.format = format; this.dataType = dataType; this.switchRowsColumns = switchRowsColumns; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java index 8125ca201d..ecce76f3b5 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java @@ -24,6 +24,12 @@ import javax.imageio.ImageWriter; import javax.imageio.stream.ImageOutputStream; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; import cbit.image.ImagePaneModel; @@ -31,17 +37,49 @@ import cbit.vcell.export.gloworm.quicktime.VideoMediaSampleJPEG; import cbit.vcell.export.gloworm.quicktime.VideoMediaSampleRaw; import cbit.vcell.solvers.CartesianMesh; +import org.vcell.util.document.GroupAccessAll; +import org.vcell.util.document.GroupAccessNone; +import org.vcell.util.document.GroupAccessSome; + /** * Dummy parent class. */ +@Schema( + discriminatorMapping = { + @DiscriminatorMapping(value = "N5", schema = N5Specs.class), + @DiscriminatorMapping(value = "ASCIISpecs", schema = ASCIISpecs.class), + @DiscriminatorMapping(value = "ImageSpecs", schema = ImageSpecs.class), + @DiscriminatorMapping(value = "RasterSpecs", schema = RasterSpecs.class), + @DiscriminatorMapping(value = "PLYSpecs", schema = PLYSpecs.class), + @DiscriminatorMapping(value = "MovieSpecs", schema = MovieSpecs.class) + }, + discriminatorProperty = "format", + requiredProperties = {"format"} + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "format", // Discriminator field + visible = true +) +@JsonSubTypes({@JsonSubTypes.Type(value = N5Specs.class, name = "N5"), @JsonSubTypes.Type(value = ASCIISpecs.class, name = "ASCIISpecs"), + @JsonSubTypes.Type(value = ImageSpecs.class, name = "ImageSpecs"), @JsonSubTypes.Type(value = RasterSpecs.class, name = "RasterSpecs"), + @JsonSubTypes.Type(value = PLYSpecs.class, name = "PLYSpecs"), @JsonSubTypes.Type(value = MovieSpecs.class, name = "MovieSpecs")}) + public abstract class FormatSpecificSpecs implements Serializable { + @JsonIgnore public static final Dimension SMOLDYN_DEFAULT_FRAME_SIZE = new Dimension(800,800); public static final int PARTICLE_NONE = 0; public static final int PARTICLE_SELECT = 2; public final static int CODEC_NONE = 0; public final static int CODEC_JPEG = 1; + public String format; + public FormatSpecificSpecs(String format) { + this.format = format; + } + + @JsonIgnore public static VideoMediaSample getVideoMediaSample( int width,int height,int sampleDuration,boolean isGrayScale,int compressionType,float compressionQuality,int[] argbData) throws Exception{ @@ -75,7 +113,7 @@ public static VideoMediaSample getVideoMediaSample( return new VideoMediaSampleRaw(width, height, sampleDuration,bytes,Integer.SIZE, false); } } - + @JsonIgnore public static VideoMediaSampleJPEG encodeJPEG(BufferedImage bufferedImage,float compressionQuality,int width,int height,int sampleDuration,int bitsPerPixel,boolean isGrayscale) throws Exception{ ImageWriter imageWriter = ImageIO.getImageWritersBySuffix("jpeg").next(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); @@ -120,6 +158,7 @@ public static int getSliceCount(boolean bAllSlices,int normalAxis,CartesianMesh * Creation date: (3/2/2001 12:03:46 AM) * @return java.awt.Dimension */ + @JsonIgnore public static Dimension getMeshDimensionUnscaled(int normalAxis,CartesianMesh mesh) { switch (normalAxis){ case Coordinate.X_AXIS:{ @@ -146,7 +185,8 @@ public static Dimension getMeshDimensionUnscaled(int normalAxis,CartesianMesh me } } } - + + @JsonIgnore public static Dimension getImageDimension(int meshMode,int imageScale,CartesianMesh mesh,int normalAxis) { ImagePaneModel imagePaneModel = new ImagePaneModel(); imagePaneModel.setMode(meshMode); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java index 34360fa2ea..017f273ed4 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java @@ -46,6 +46,7 @@ public ImageSpecs(DisplayPreferences[] displayPreferences, ExportFormat mediaTyp ExportSpecss.CompressionFormats compression, ExportSpecss.MirroringMethod mirroringType, double duration, int loopingMode, int volVarMembrOutlineThickness, int imageScaling,int membraneScaling,int meshMode,float compressionQuality,boolean bOverlay,int particleMode) { + super("ImageSpecs"); this.displayPreferences = displayPreferences; this.format = mediaType; this.compression = compression; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java index deab36a4b5..6464b55ff9 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java @@ -44,6 +44,7 @@ public class MovieSpecs extends FormatSpecificSpecs implements Serializable { public MovieSpecs(double duration, boolean overlayMode, DisplayPreferences[] displayPreferences, ExportFormat format, ExportSpecss.MirroringMethod mirroringType, int volVarMembrOutlineThickness, int imageScaling,int membraneScaling,int meshMode,int compressionType,float compressionQuality,boolean bQTVR,int particleMode) { + super("MovieSpecs"); this.duration = duration; this.overlayMode = overlayMode; this.displayPreferences = displayPreferences; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java index 13b3b3534f..54ceab2b87 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java @@ -11,14 +11,20 @@ package cbit.vcell.export.server; import cbit.vcell.math.MathException; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.Gson; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.janelia.saalfeldlab.n5.*; import org.vcell.util.DataAccessException; +import org.vcell.util.document.GroupAccess; import java.io.FileWriter; import java.io.IOException; import java.io.Serializable; -import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; @@ -26,9 +32,11 @@ * This type was created in VisualAge. */ @SuppressWarnings("serial") +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"format"}) public class N5Specs extends FormatSpecificSpecs implements Serializable { - private final ExportFormat format; + private final ExportFormat formatType; private final ExportSpecss.ExportableDataType dataType; + @JsonIgnore private final CompressionLevel compression; public final String dataSetName; @@ -45,12 +53,25 @@ public static enum CompressionLevel{ /** * TextSpecs constructor comment. */ - public N5Specs(ExportSpecss.ExportableDataType dataType, ExportFormat format, CompressionLevel compressionLevel, String dataSetName) { - this.format = format; + public N5Specs(ExportSpecss.ExportableDataType dataType, ExportFormat format, + CompressionLevel compressionLevel, String dataSetName) { + super("N5"); + this.formatType = format; this.dataType = dataType; this.compression = compressionLevel; this.dataSetName = dataSetName; } + + @JsonCreator + public N5Specs(@JsonProperty("dataType") ExportSpecss.ExportableDataType dataType, @JsonProperty("format") ExportFormat format, + @JsonProperty("dataSetName") String dataSetName){ + super("N5"); + this.formatType = format; + this.dataType = dataType; + this.dataSetName = dataSetName; + this.compression = CompressionLevel.BZIP; + } + /** * This method was created in VisualAge. * @return int @@ -62,8 +83,8 @@ public ExportSpecss.ExportableDataType getDataType() { * This method was created in VisualAge. * @return int */ - public ExportFormat getFormat() { - return format; + public ExportFormat getFormatType() { + return formatType; } public Compression getCompression(){ @@ -90,7 +111,7 @@ public boolean equals(Object object) { * @return java.lang.String */ public String toString() { - return "N5Specs: [compression: " + format + ", chunking: " + dataType + ", switchRowsColumns: " + "]"; + return "N5Specs: [compression: " + formatType + ", chunking: " + dataType + ", switchRowsColumns: " + "]"; } public static void writeImageJMetaData(long jobID,long[] dimensions, int[] blockSize, Compression compression, N5FSWriter n5FSWriter, String datasetName, int numChannels, int zSlices, diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java index 5d61dff87c..6f15ed3876 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java @@ -8,6 +8,7 @@ public class PLYSpecs extends FormatSpecificSpecs { private boolean bIncludeTextures = false; private DisplayPreferences[] displayPreferences; public PLYSpecs(boolean bIncludeTextures,DisplayPreferences[] displayPreferences){ + super("PLYSpecs"); this.bIncludeTextures = bIncludeTextures; this.displayPreferences = displayPreferences; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java index 02d2552df4..ea5538a74a 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java @@ -26,6 +26,7 @@ public class RasterSpecs extends FormatSpecificSpecs implements Serializable { * @param separateHeader boolean */ public RasterSpecs(ExportSpecss.RasterFormats format, boolean separateHeader) { + super("RasterSpecs"); this.format = format; this.separateHeader = separateHeader; } From 8d82478de782b13ae550f4696d829de532e8dbad Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 16 Jul 2025 10:35:19 -0400 Subject: [PATCH 12/41] Update Export Creation and Status --- .../org/vcell/restq/QuarkusStartUpTasks.java | 11 -- .../activemq/ExportRequestListenerMQ.java | 70 ++++++--- .../vcell/restq/handlers/ExportResource.java | 140 ++++++++++++++++-- .../restq/services/Exports/ExportService.java | 66 +++++---- .../services/Exports/ExportStatusCreator.java | 51 +++++-- 5 files changed, 253 insertions(+), 85 deletions(-) diff --git a/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java b/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java index a00a314fcb..98ec53808c 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java +++ b/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java @@ -25,8 +25,6 @@ public class QuarkusStartUpTasks { private final static Logger logger = LogManager.getLogger(QuarkusStartUpTasks.class); - public static final String internalMQBeanIdentifier = "internal"; - @Inject AgroalConnectionFactory connectionFactory; @@ -36,14 +34,5 @@ public void onStartUp(@Observes StartupEvent ev) throws SQLException, DataAccess logger.info("Startup tasks executed successfully"); } - @Produces - @ApplicationScoped - @Identifier(internalMQBeanIdentifier) - private QueueConnection getInternalQueueConnectionFactory() throws JMSException { - ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616"); - QueueConnection connection = connectionFactory.createQueueConnection("admin", "admin"); - connection.start(); - return connection; - } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index 5d1534d6cc..5ee65edaa3 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -1,7 +1,13 @@ package org.vcell.restq.activemq; -import cbit.vcell.export.server.ExportFormat; +import cbit.vcell.export.server.ExportServiceImpl; import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.export.server.GeometrySpecs; +import cbit.vcell.export.server.HumanReadableExportData; +import cbit.vcell.modeldb.DatabaseServerImpl; +import cbit.vcell.resource.PropertyLoader; +import cbit.vcell.simdata.DataServerImpl; +import cbit.vcell.simdata.DataSetControllerImpl; import cbit.vcell.simdata.OutputContext; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -14,15 +20,22 @@ import org.apache.logging.log4j.Logger; import org.eclipse.microprofile.reactive.messaging.Incoming; import org.eclipse.microprofile.reactive.messaging.Message; +import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.restq.handlers.ExportResource; import org.vcell.restq.services.Exports.ExportService; import org.vcell.restq.services.Exports.ExportStatusCreator; +import org.vcell.util.DataAccessException; +import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; -import org.vcell.util.document.VCDataIdentifier; import javax.jms.JMSException; +import java.io.File; +import java.io.FileNotFoundException; +import java.sql.SQLException; import java.util.ArrayList; -import java.util.concurrent.*; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; @ApplicationScoped public class ExportRequestListenerMQ { @@ -30,6 +43,8 @@ public class ExportRequestListenerMQ { private final ArrayList acceptedJobs = new ArrayList<>(); private WorkerExecutor workerExecutor; private final ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); + private DataServerImpl dataServer; + @Inject ExportService exportService; @@ -38,11 +53,17 @@ public class ExportRequestListenerMQ { @Inject ObjectMapper mapper; @Inject + AgroalConnectionFactory connectionFactory; + @Inject Vertx vertx; @PostConstruct - void init(){ + void init() throws FileNotFoundException { workerExecutor = vertx.createSharedWorkerExecutor("export-pool"); + String primarySimDataDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, "/simdata"); + String secondarySimDataDir = PropertyLoader.getProperty(PropertyLoader.secondarySimDataDirInternalProperty, "/simdata"); + this.dataServer = new DataServerImpl(new DataSetControllerImpl(null, new File(primarySimDataDir), new File(secondarySimDataDir)), + new ExportServiceImpl()); } @@ -52,18 +73,6 @@ public CompletionStage consumeExportRequest(Message message) { String exportJobJSON = message.getPayload(); ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); startJob(exportJob); - -// Uni.createFrom().future(Unchecked.supplier(() -> { -// try { -// exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs()); -// } catch (JMSException | JsonProcessingException e) { -// throw new RuntimeException(e); -// } -// return null; -// }), -// Duration.of(15, ChronoUnit.MINUTES) -// ); -// exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs()); acceptedJobs.add(exportJob); return message.ack(); } catch (Exception e) { @@ -75,17 +84,36 @@ public CompletionStage consumeExportRequest(Message message) { public void startJob(ExportResource.ExportJob exportJob) { threadPoolExecutor.submit(() -> { try { - exportService.startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportJob.exportSpecs(), exportJob.id()); + ExportSpecs exportSpecs = getExportSpecs(exportJob); + startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportSpecs, exportJob.id()); } catch (Exception e){ logger.error(e); - VCDataIdentifier dataIdentifier = exportJob.exportSpecs() == null ? null : exportJob.exportSpecs().getVCDataIdentifier(); - ExportFormat format = exportJob.exportSpecs() == null ? null : exportJob.exportSpecs().getFormat(); - exportStatusCreator.fireExportFailed(exportJob.id(), dataIdentifier, - format == null ? null : format.toString(), e.getMessage()); + exportStatusCreator.fireExportFailed(exportJob.id(), exportJob.vcdID(), + exportJob.format() == null ? null : exportJob.format().toString(), e.getMessage()); } }); } + private ExportSpecs getExportSpecs(ExportResource.ExportJob exportJob) throws SQLException, DataAccessException { + GeometrySpecs geometrySpecs = new GeometrySpecs(exportJob.geometrySpecs().selections(), exportJob.geometrySpecs().axis(), + exportJob.geometrySpecs().sliceNumber(), exportJob.geometrySpecs().geometryMode()); + HumanReadableExportData humanReadableExportData = new HumanReadableExportData(null, + null, null, null, null, null, false, exportJob.subVolume()); + return new ExportSpecs(exportJob.vcdID(), exportJob.format(), exportJob.variableSpecs(), exportJob.timeSpecs(), + geometrySpecs, exportJob.formatSpecificSpecs(), exportJob.simulationName(), exportJob.contextName(), humanReadableExportData); + } + + private void startExportJob(User user, OutputContext outputContext, ExportSpecs exportSpecs, long jobID) throws JMSException, JsonProcessingException { + try { + if (Thread.currentThread().getName().contains("event-loop")){ + throw new RuntimeException("EXPORTS ARE USING THE EVENT LOOP."); + } + ExportServiceImpl.makeRemoteFile(outputContext, user, dataServer, exportSpecs, exportStatusCreator, jobID); + } catch (DataAccessException e) { + throw new RuntimeException(e); + } + } + public ArrayList getAcceptedJobs(){ return acceptedJobs; } diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index d5b8ab44f2..4248b9bd71 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -1,18 +1,49 @@ package org.vcell.restq.handlers; +import cbit.image.VCImage; +import cbit.rmi.event.ExportEvent; +import cbit.vcell.export.server.*; +import cbit.vcell.math.Variable; +import cbit.vcell.math.VariableType; +import cbit.vcell.modeldb.SimulationRep; +import cbit.vcell.parser.Expression; +import cbit.vcell.parser.ExpressionException; +import cbit.vcell.simdata.SpatialSelection; +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationIdentifier; +import com.fasterxml.jackson.core.JsonProcessingException; import io.quarkus.security.identity.SecurityIdentity; +import io.quarkus.vertx.http.Compressed; +import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; +import io.vertx.core.eventbus.EventBus; +import io.vertx.core.http.HttpServerRequest; import jakarta.annotation.security.RolesAllowed; import jakarta.inject.Inject; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; import org.eclipse.microprofile.openapi.annotations.Operation; +import org.jboss.resteasy.reactive.RestStreamElementType; import org.vcell.restq.errors.exceptions.DataAccessWebException; import org.vcell.restq.errors.exceptions.NotAuthenticatedWebException; -import org.vcell.restq.services.ExportService; +import org.vcell.restq.errors.exceptions.NotFoundWebException; +import org.vcell.restq.errors.exceptions.RuntimeWebException; +import org.vcell.restq.services.Exports.ExportService; +import org.vcell.restq.services.SimulationRestService; import org.vcell.restq.services.UserRestService; import org.vcell.util.DataAccessException; +import org.vcell.util.ObjectNotFoundException; +import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; +import org.vcell.util.document.VCDataIdentifier; + +import javax.jms.JMSException; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; @Path("/api/v1/exports") public class ExportResource { @@ -23,25 +54,30 @@ public class ExportResource { UserRestService userRestService; @Inject ExportService exportService; + @Inject + SimulationRestService simulationRestService; + + @Context + HttpServerRequest request; @Path("/history") - @POST + @GET @RolesAllowed("user") - @Operation(operationId = "addExportHistory", description = "Adds provided export information to a users export history.") - public void addExportHistory(ExportHistory history) throws DataAccessWebException, NotAuthenticatedWebException { + @Operation(operationId = "getExportHistory") + public ExportHistory getExportHistory() throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); - try{ - exportService.addExportHistory(user, history); + try { + return exportService.getExportHistory(user); } catch (DataAccessException e) { throw new DataAccessWebException(e.getMessage(), e); } } @Path("/history") - @GET + @DELETE @RolesAllowed("user") - @Operation(operationId = "getExportHistory") - public ExportHistory getExportHistory() throws DataAccessWebException, NotAuthenticatedWebException { + @Operation(operationId = "deleteExportHistory") + public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); try { return exportService.getExportHistory(user); @@ -50,9 +86,89 @@ public ExportHistory getExportHistory() throws DataAccessWebException, NotAuthen } } + @Path("/{exportJobID}/status") + @GET + @RolesAllowed("user") + @Produces(MediaType.APPLICATION_JSON) + @Operation(operationId = "exportStatus") + public ExportEvent pollExportStatus(@PathParam("exportJobID") long exportJobID) throws DataAccessWebException, NotAuthenticatedWebException { + User user = userRestService.getUserFromIdentity(securityIdentity); + try{ + return exportService.getMostRecentExportStatus(user, exportJobID); + } catch (DataAccessException e) { + throw new DataAccessWebException(e.getMessage(), e); + } + } + + @Path("/{exportJobID}/status-sse") + @GET + @RolesAllowed("user") + @Produces(MediaType.SERVER_SENT_EVENTS) + @RestStreamElementType(MediaType.APPLICATION_JSON) + @Operation(hidden = true) + public Multi exportStatus(@PathParam("exportJobID") long exportJobID) throws DataAccessWebException, NotAuthenticatedWebException, NotFoundWebException { + User user = userRestService.getUserFromIdentity(securityIdentity); + try { + return exportService.getExportStatuses(user, exportJobID); + } catch (ObjectNotFoundException e) { + throw new NotFoundWebException(e.getMessage(), e); + } + } + + @Path("") + @POST + @RolesAllowed("user") + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + @Operation(operationId = "export") + public long createExport(ExportRequest er) throws DataAccessWebException, NotAuthenticatedWebException { + User user = userRestService.getUserFromIdentity(securityIdentity); + try{ + ExportJob exportJob = exportService.createExportJobFromRequest(user, er); + exportService.addExportJobToQueue(exportJob); + return exportJob.id(); + } catch (JMSException | JsonProcessingException | DataAccessException | SQLException e) { + throw new RuntimeWebException(e.getMessage(), e); + } + } + + + public record ExportRequest( + ArrayList outputContext, ExportFormat exportFormat, + String simulationID, int simulationJob, + FormatSpecificSpecs formatSpecificSpecs, + GeometrySpecDTO geometrySpecs, + TimeSpecs timeSpecs, VariableSpecs variableSpecs, + HashMap subVolume, + String simulationName, String contextName + ){ } + + public record AnnotatedFunctionDTO( + String functionName, + String functionExpression, + String error, + Variable.Domain domain, + VariableType functionType, + AnnotatedFunction.FunctionCategory category + ) { } public record ExportHistory( String exportHistory ){ } + public record ExportJob( + long id, + User user, + AnnotatedFunction[] outputContext, + VCDataIdentifier vcdID, + ExportFormat format, + VariableSpecs variableSpecs, TimeSpecs timeSpecs, + GeometrySpecDTO geometrySpecs, FormatSpecificSpecs formatSpecificSpecs, + HashMap subVolume, + String simulationName,String contextName + ){ } + + public record GeometrySpecDTO( + SpatialSelection[] selections, int axis, int sliceNumber, ExportSpecss.GeometryMode geometryMode + ){ } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index e23c1f3797..2223ccd06d 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -1,47 +1,46 @@ package org.vcell.restq.services.Exports; import cbit.rmi.event.ExportEvent; -import cbit.vcell.export.server.*; +import cbit.vcell.export.server.JobRequest; import cbit.vcell.modeldb.DatabaseServerImpl; -import cbit.vcell.resource.PropertyLoader; -import cbit.vcell.simdata.DataServerImpl; -import cbit.vcell.simdata.DataSetControllerImpl; -import cbit.vcell.simdata.OutputContext; +import cbit.vcell.modeldb.SimulationRep; +import cbit.vcell.parser.Expression; +import cbit.vcell.parser.ExpressionException; +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationIdentifier; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.smallrye.common.annotation.Blocking; -import io.smallrye.common.annotation.Identifier; import io.smallrye.mutiny.Multi; -import io.vertx.core.Vertx; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.vcell.restq.QuarkusStartUpTasks; import org.vcell.restq.db.AgroalConnectionFactory; +import org.vcell.restq.errors.exceptions.RuntimeWebException; import org.vcell.restq.handlers.ExportResource; +import org.vcell.restq.services.SimulationRestService; import org.vcell.util.DataAccessException; import org.vcell.util.ObjectNotFoundException; +import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; import javax.jms.JMSException; -import javax.jms.QueueConnection; -import java.io.*; +import java.io.FileNotFoundException; +import java.sql.SQLException; @ApplicationScoped public class ExportService { private final DatabaseServerImpl databaseServer; - private final DataServerImpl dataServer; - -// @Inject -// @Identifier(QuarkusStartUpTasks.internalMQBeanIdentifier) -// QueueConnection internalQueueConnection; @Inject ExportStatusCreator exportStatusCreator; + @Inject + SimulationRestService simulationRestService; + @Inject ObjectMapper jsonMapper; @@ -55,10 +54,6 @@ public class ExportService { public ExportService(AgroalConnectionFactory connectionFactory, ExportStatusCreator exportStatusCreator) throws DataAccessException, FileNotFoundException { this.databaseServer = new DatabaseServerImpl(connectionFactory, connectionFactory.getKeyFactory()); this.exportStatusCreator = exportStatusCreator; - String primarySimDataDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, "/simdata"); - String secondarySimDataDir = PropertyLoader.getProperty(PropertyLoader.secondarySimDataDirInternalProperty, "/simdata"); - this.dataServer = new DataServerImpl(new DataSetControllerImpl(null, new File(primarySimDataDir), new File(secondarySimDataDir)), - new ExportServiceImpl()); } public ExportResource.ExportHistory getExportHistory(User user) throws DataAccessException { @@ -78,15 +73,28 @@ public Multi getExportStatuses(User user, long jobID) throws Object return exportStatusCreator.getUsersExportStatus(user, jobID); } - public void startExportJob(User user, OutputContext outputContext, ExportSpecs exportSpecs, long jobID) throws JMSException, JsonProcessingException { - try { - if (Thread.currentThread().getName().contains("event-loop")){ - throw new RuntimeException("EXPORTS ARE USING THE EVENT LOOP."); - } - ExportServiceImpl.makeRemoteFile(outputContext, user, dataServer, exportSpecs, exportStatusCreator, jobID); - } catch (DataAccessException e) { - throw new RuntimeException(e); - } + public ExportEvent getMostRecentExportStatus(User user, long jobID) throws ObjectNotFoundException { + return exportStatusCreator.getMostRecentExportStatus(user, jobID); + } + + public ExportResource.ExportJob createExportJobFromRequest(User user, ExportResource.ExportRequest request) throws SQLException, DataAccessException { + SimulationRep simulationRep = simulationRestService.getSimulationRep(new KeyValue(request.simulationID())); + VCSimulationIdentifier simulationIdentifier = new VCSimulationIdentifier(simulationRep.getKey(), simulationRep.getOwner()); + VCSimulationDataIdentifier dataIdentifier = new VCSimulationDataIdentifier(simulationIdentifier, request.simulationJob()); + JobRequest newExportJob = JobRequest.createExportJobRequest(user); + long exportID = newExportJob.getExportJobID(); + AnnotatedFunction[] annotatedFunctions = request.outputContext().stream().map( + dto -> { + try { + return new AnnotatedFunction(dto.functionName(), new Expression(dto.functionExpression()), dto.domain(), dto.error(), + dto.functionType(), dto.category()); + } catch (ExpressionException e) { + throw new RuntimeWebException(e.getMessage(), e); + } + } + ).toArray(AnnotatedFunction[]::new); + return new ExportResource.ExportJob(exportID, user, annotatedFunctions, dataIdentifier, request.exportFormat(), + request.variableSpecs(), request.timeSpecs(), request.geometrySpecs(), request.formatSpecificSpecs(), request.subVolume(), request.simulationName(), request.contextName()); } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java index c311bff955..d0e21d5a13 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java @@ -8,6 +8,7 @@ import cbit.vcell.export.server.VariableSpecs; import cbit.vcell.solver.VCSimulationDataIdentifier; import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; import io.smallrye.mutiny.helpers.MultiEmitterProcessor; import jakarta.enterprise.context.ApplicationScoped; import org.vcell.util.ObjectNotFoundException; @@ -17,11 +18,13 @@ import org.vcell.util.document.VCDataIdentifier; import java.util.Hashtable; +import java.util.concurrent.ConcurrentHashMap; @ApplicationScoped public class ExportStatusCreator implements ExportStatusEventCreator { - private final Hashtable jobRequestToUser = new Hashtable(); - private final Hashtable> listeners = new Hashtable<>(); + private final ConcurrentHashMap jobRequestToUser = new ConcurrentHashMap<>(); + private final ConcurrentHashMap> listeners = new ConcurrentHashMap<>(); + private final ConcurrentHashMap mostRecentExportEvents = new ConcurrentHashMap<>(); protected ExportSpecs exportExists(ExportSpecs exportSpecs) { // Call DB for export history and check if it exists. Store in cache if it exists for future requests. @@ -30,8 +33,9 @@ protected ExportSpecs exportExists(ExportSpecs exportSpecs) { public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { User user = jobRequestToUser.get(jobID); + String key = entryKey(user, jobID); - if (!listeners.containsKey(user.getName() + jobID)) { + if (!listeners.containsKey(key)) { throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); } TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); @@ -50,8 +54,9 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); - listeners.get(user.getName() + jobID).onNext(event); - listeners.get(user.getName() + jobID).complete(); + listeners.get(key).onNext(event); + listeners.get(key).complete(); + mostRecentExportEvents.put(key, event); removeServerExportListener(user, jobID); return event; } @@ -61,16 +66,30 @@ public synchronized void addExportListener(ExportListener listener) { } public synchronized Multi getUsersExportStatus(User user, long exportJobID) throws ObjectNotFoundException { - if (!listeners.containsKey(user.getName() + exportJobID)) { + String key = entryKey(user, exportJobID); + if (!listeners.containsKey(key)) { throw new ObjectNotFoundException("Did not find entry for user " + user.getName() + " and job id " + exportJobID); } - return listeners.get(user.getName() + exportJobID).toMulti(); + return listeners.get(key).toMulti(); + } + + public synchronized ExportEvent getMostRecentExportStatus (User user, long exportJobID) throws ObjectNotFoundException { + String key = entryKey(user, exportJobID); + if (!mostRecentExportEvents.containsKey(key)) { + throw new ObjectNotFoundException("Did not find entry for user " + user.getName() + " and job id " + exportJobID); + } + return mostRecentExportEvents.get(key); } public synchronized void addServerExportListener(User user, long exportJobID){ MultiEmitterProcessor emitter = MultiEmitterProcessor.create(); - listeners.put(user.getName() + exportJobID, emitter); + String key = entryKey(user, exportJobID); + listeners.put(key, emitter); jobRequestToUser.put(exportJobID, user); + ExportEvent event = new ExportEvent( + this, exportJobID, user, "", null, ExportEvent.EXPORT_ASSEMBLING, + "", "", 0.0, null, null); + mostRecentExportEvents.put(key, event); } public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { @@ -80,21 +99,25 @@ public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String form } public void fireExportEvent(ExportEvent event) { - if (!listeners.containsKey(event.getUser().getName() + event.getJobID())){ + String key = entryKey(event.getUser(), event.getJobID()); + if (!listeners.containsKey(key)){ throw new RuntimeException("Did not find entry for user " + event.getUser().getName() + " and job id " + event.getJobID()); } MultiEmitterProcessor listener = listeners.get(event.getUser().getName() + event.getJobID()); listener.onNext(event); + mostRecentExportEvents.put(key, event); } public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { User user = jobRequestToUser.get(jobID); - if (!listeners.containsKey(user.getName() + jobID)) { + String key = entryKey(user, jobID); + if (!listeners.containsKey(key)) { throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); } ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); - listeners.get(user.getName() + jobID).onNext(event); - listeners.get(user.getName() + jobID).complete(); + listeners.get(key).onNext(event); + listeners.get(key).complete(); + mostRecentExportEvents.put(key, event); removeServerExportListener(user, jobID); } @@ -115,4 +138,8 @@ public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) public synchronized void removeServerExportListener(User user, long exportJobID){ listeners.remove(user.getName() + exportJobID); } + + private String entryKey(User user, long jobID){ + return user.getName() + jobID; + } } From 7ebc3dd8a80c2ee3118ace5b232a6f7a7423152c Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 16 Jul 2025 10:35:50 -0400 Subject: [PATCH 13/41] Decrease Default Logging Verbosity --- vcell-rest/src/main/resources/application.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index ee2c15c8eb..94acf63a1d 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -9,10 +9,10 @@ quarkus.http.cors=true quarkus.log.level=INFO %dev.quarkus.log.level=TRACE %test.quarkus.log.level=DEBUG -quarkus.log.category."io.agr".level=DEBUG -quarkus.log.category."net.java.ssl".level=DEBUG -quarkus.log.category."sun.security".level=DEBUG -quarkus.log.category."io.smallrye.config".level=DEBUG +quarkus.log.category."io.agr".level=INFO +quarkus.log.category."net.java.ssl".level=INFO +quarkus.log.category."sun.security".level=INFO +quarkus.log.category."io.smallrye.config".level=INFO quarkus.log.category."org.sbml.jsbml".level=INFO quarkus.log.json.fields.logger-name.enabled=true quarkus.log.json.fields.stack-trace.enabled=true From b60d0abf1081381dd246b0c6504e76b1a4bad830 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 17 Jul 2025 08:54:41 -0400 Subject: [PATCH 14/41] Update Status Endpoint Have it return a set of export events. --- .../main/java/cbit/rmi/event/ExportEvent.java | 19 ++++-- .../vcell/restq/handlers/ExportResource.java | 10 ++- .../restq/services/Exports/ExportService.java | 5 +- .../services/Exports/ExportStatusCreator.java | 61 ++++++++++++------- 4 files changed, 61 insertions(+), 34 deletions(-) diff --git a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java index 2f8b8a9e21..d14f49a501 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java @@ -17,6 +17,8 @@ import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; +import java.util.Objects; + /** * This is the event class to support the cbit.vcell.desktop.controls.ExportListener interface. */ @@ -44,8 +46,8 @@ public ExportEvent(Object source, long jobID, User user, format,location,argProgress,timeSpecs,variableSpecs); } - public ExportEvent(Object source, long jobID, User user, - String dataIdString, KeyValue dataKey, int argEventType, + public ExportEvent(Object source, long jobID, User user, + String dataIdString, KeyValue dataKey, int argEventType, String format, String location, Double argProgress, TimeSpecs timeSpecs, VariableSpecs variableSpecs) { super(source, new MessageSource(source, dataIdString), new MessageData(argProgress)); @@ -179,10 +181,19 @@ public String toString() { + dataIdString; } + @Override + public boolean equals(Object obj) { + if (obj instanceof ExportEvent ex){ + return ex.getJobID() == getJobID() && ex.getUser().compareEqual(getUser()); + } + return false; + } + public int hashCode(){ + return Objects.hash(getJobID(), getUser().getName()); + } - -public void setHumanReadableExportData(HumanReadableExportData humanReadableExportData){ + public void setHumanReadableExportData(HumanReadableExportData humanReadableExportData){ this.humanReadableExportData = humanReadableExportData; } diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index 4248b9bd71..d910404150 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -44,6 +44,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; +import java.util.Set; @Path("/api/v1/exports") public class ExportResource { @@ -57,9 +58,6 @@ public class ExportResource { @Inject SimulationRestService simulationRestService; - @Context - HttpServerRequest request; - @Path("/history") @GET @RolesAllowed("user") @@ -86,15 +84,15 @@ public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, N } } - @Path("/{exportJobID}/status") + @Path("/status") @GET @RolesAllowed("user") @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "exportStatus") - public ExportEvent pollExportStatus(@PathParam("exportJobID") long exportJobID) throws DataAccessWebException, NotAuthenticatedWebException { + public Set pollExportStatus() throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); try{ - return exportService.getMostRecentExportStatus(user, exportJobID); + return exportService.getMostRecentExportStatus(user); } catch (DataAccessException e) { throw new DataAccessWebException(e.getMessage(), e); } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index 2223ccd06d..aa8fb99026 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -30,6 +30,7 @@ import javax.jms.JMSException; import java.io.FileNotFoundException; import java.sql.SQLException; +import java.util.Set; @ApplicationScoped public class ExportService { @@ -73,8 +74,8 @@ public Multi getExportStatuses(User user, long jobID) throws Object return exportStatusCreator.getUsersExportStatus(user, jobID); } - public ExportEvent getMostRecentExportStatus(User user, long jobID) throws ObjectNotFoundException { - return exportStatusCreator.getMostRecentExportStatus(user, jobID); + public Set getMostRecentExportStatus(User user) throws ObjectNotFoundException { + return exportStatusCreator.getMostRecentExportStatus(user); } public ExportResource.ExportJob createExportJobFromRequest(User user, ExportResource.ExportRequest request) throws SQLException, DataAccessException { diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java index d0e21d5a13..901b9d9e50 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java @@ -8,7 +8,6 @@ import cbit.vcell.export.server.VariableSpecs; import cbit.vcell.solver.VCSimulationDataIdentifier; import io.smallrye.mutiny.Multi; -import io.smallrye.mutiny.Uni; import io.smallrye.mutiny.helpers.MultiEmitterProcessor; import jakarta.enterprise.context.ApplicationScoped; import org.vcell.util.ObjectNotFoundException; @@ -17,14 +16,18 @@ import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; -import java.util.Hashtable; +import java.util.HashSet; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; @ApplicationScoped public class ExportStatusCreator implements ExportStatusEventCreator { private final ConcurrentHashMap jobRequestToUser = new ConcurrentHashMap<>(); private final ConcurrentHashMap> listeners = new ConcurrentHashMap<>(); - private final ConcurrentHashMap mostRecentExportEvents = new ConcurrentHashMap<>(); + private final ConcurrentHashMap> mostRecentExportEvents = new ConcurrentHashMap<>(); // TODO: Clean out this set + protected ExportSpecs exportExists(ExportSpecs exportSpecs) { // Call DB for export history and check if it exists. Store in cache if it exists for future requests. @@ -35,9 +38,6 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin User user = jobRequestToUser.get(jobID); String key = entryKey(user, jobID); - if (!listeners.containsKey(key)) { - throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); - } TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); final KeyValue dataKey; @@ -52,12 +52,20 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, format, location, null, timeSpecs, varSpecs); event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); - event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); - listeners.get(key).onNext(event); - listeners.get(key).complete(); - mostRecentExportEvents.put(key, event); - removeServerExportListener(user, jobID); + + + synchronized (this){ + if (!listeners.containsKey(key)) { + throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); + } + listeners.get(key).onNext(event); + listeners.get(key).complete(); + replaceSetEntry(user, event); + removeServerExportListener(user, jobID); + jobRequestToUser.remove(jobID); + } + return event; } @@ -73,12 +81,11 @@ public synchronized Multi getUsersExportStatus(User user, long expo return listeners.get(key).toMulti(); } - public synchronized ExportEvent getMostRecentExportStatus (User user, long exportJobID) throws ObjectNotFoundException { - String key = entryKey(user, exportJobID); - if (!mostRecentExportEvents.containsKey(key)) { - throw new ObjectNotFoundException("Did not find entry for user " + user.getName() + " and job id " + exportJobID); + public synchronized Set getMostRecentExportStatus (User user) throws ObjectNotFoundException { + if (!mostRecentExportEvents.containsKey(user)) { + throw new ObjectNotFoundException("Did not find entry for user " + user.getName()); } - return mostRecentExportEvents.get(key); + return mostRecentExportEvents.get(user); } public synchronized void addServerExportListener(User user, long exportJobID){ @@ -89,7 +96,10 @@ public synchronized void addServerExportListener(User user, long exportJobID){ ExportEvent event = new ExportEvent( this, exportJobID, user, "", null, ExportEvent.EXPORT_ASSEMBLING, "", "", 0.0, null, null); - mostRecentExportEvents.put(key, event); + if (!mostRecentExportEvents.containsKey(user)) { + mostRecentExportEvents.put(user, new HashSet<>()); + } + mostRecentExportEvents.get(user).add(event); } public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { @@ -98,17 +108,17 @@ public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String form fireExportEvent(event); } - public void fireExportEvent(ExportEvent event) { + public synchronized void fireExportEvent(ExportEvent event) { String key = entryKey(event.getUser(), event.getJobID()); if (!listeners.containsKey(key)){ throw new RuntimeException("Did not find entry for user " + event.getUser().getName() + " and job id " + event.getJobID()); } MultiEmitterProcessor listener = listeners.get(event.getUser().getName() + event.getJobID()); listener.onNext(event); - mostRecentExportEvents.put(key, event); + replaceSetEntry(event.getUser(), event); } - public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { + public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { User user = jobRequestToUser.get(jobID); String key = entryKey(user, jobID); if (!listeners.containsKey(key)) { @@ -117,8 +127,10 @@ public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); listeners.get(key).onNext(event); listeners.get(key).complete(); - mostRecentExportEvents.put(key, event); + + replaceSetEntry(user, event); removeServerExportListener(user, jobID); + jobRequestToUser.remove(jobID); } public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { @@ -135,11 +147,16 @@ public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) fireExportEvent(event); } - public synchronized void removeServerExportListener(User user, long exportJobID){ + public void removeServerExportListener(User user, long exportJobID){ listeners.remove(user.getName() + exportJobID); } private String entryKey(User user, long jobID){ return user.getName() + jobID; } + + private void replaceSetEntry(User user, ExportEvent newEvent){ + mostRecentExportEvents.get(user).remove(newEvent); + mostRecentExportEvents.get(user).add(newEvent); + } } From be29fcca74ff50708b8de35edd12bcacd60a02e0 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 17 Jul 2025 08:47:43 -0400 Subject: [PATCH 15/41] Separate Classes --- .../main/java/org/vcell/cli/run/RunUtils.java | 6 +- .../vcell/client/FieldDataWindowManager.java | 2 +- .../cbit/vcell/client/data/PDEDataViewer.java | 7 +- .../vcell/client/data/PDEExportDataPanel.java | 16 +-- .../vcell/client/data/SimResultsViewer.java | 7 +- .../vcell/export/gui/ASCIISettingsPanel.java | 2 +- .../vcell/export/gui/N5SettingsPanel.java | 2 +- .../vcell/export/server/ASCIIExporter.java | 4 +- .../cbit/vcell/export/server/ASCIISpecs.java | 12 +- .../export/server/ExportParamScanInfo.java | 84 ++++++++++++ .../cbit/vcell/export/server/ExportSpecs.java | 122 +----------------- .../export/server/FormatSpecificSpecs.java | 8 +- .../cbit/vcell/export/server/ImageSpecs.java | 3 + .../cbit/vcell/export/server/MovieSpecs.java | 3 + .../cbit/vcell/export/server/N5Specs.java | 2 +- .../cbit/vcell/export/server/PLYSpecs.java | 2 + .../cbit/vcell/export/server/RasterSpecs.java | 3 + .../vcell/export/server/SimNameSimDataID.java | 55 ++++++++ 18 files changed, 187 insertions(+), 153 deletions(-) create mode 100644 vcell-core/src/main/java/cbit/vcell/export/server/ExportParamScanInfo.java create mode 100644 vcell-core/src/main/java/cbit/vcell/export/server/SimNameSimDataID.java diff --git a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java index d711afaece..9fa3e13617 100644 --- a/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java +++ b/vcell-cli/src/main/java/org/vcell/cli/run/RunUtils.java @@ -447,9 +447,9 @@ private static ExportSpecs getExportSpecs(OutputContext outputContext, User user GeometrySpecs geometrySpecs = new GeometrySpecs(null, 2, 0, ExportSpecss.GeometryMode.GEOMETRY_FULL); // String simulationName,VCSimulationIdentifier vcSimulationIdentifier,ExportParamScanInfo exportParamScanInfo - ExportSpecs.ExportParamScanInfo exportParamScanInfo = ExportSpecs.getParamScanInfo(vcellSim,jobIndex); - ExportSpecs.SimNameSimDataID snsdi= new ExportSpecs.SimNameSimDataID(vcellSim.getName(), vcSimID, exportParamScanInfo); - ExportSpecs.SimNameSimDataID[] simNameSimDataIDs = { snsdi }; + ExportParamScanInfo exportParamScanInfo = ExportParamScanInfo.getParamScanInfo(vcellSim,jobIndex); + SimNameSimDataID snsdi= new SimNameSimDataID(vcellSim.getName(), vcSimID, exportParamScanInfo); + SimNameSimDataID[] simNameSimDataIDs = { snsdi }; FormatSpecificSpecs formatSpecificSpecs = new ASCIISpecs(simNameSimDataIDs, ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.CSV, ASCIISpecs.CsvRoiLayout.var_time_val, true, false); diff --git a/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java b/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java index 29402549a1..f7f11c8065 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/FieldDataWindowManager.java @@ -28,7 +28,7 @@ import cbit.vcell.clientdb.FieldDataDBEvent; import cbit.vcell.clientdb.FieldDataDBEventListener; import cbit.vcell.export.server.ExportSpecs; -import cbit.vcell.export.server.ExportSpecs.SimNameSimDataID; +import cbit.vcell.export.server.SimNameSimDataID; import cbit.vcell.field.gui.FieldDataGUIPanel; import cbit.vcell.geometry.Geometry; import cbit.vcell.math.MathDescription; diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java index 311550adf0..5d4b366891 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEDataViewer.java @@ -69,7 +69,7 @@ import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; -import cbit.vcell.mapping.SimulationContext; +import cbit.vcell.export.server.SimNameSimDataID; import cbit.vcell.solver.*; import org.vcell.util.gui.GeneralGuiUtils; import org.vcell.util.*; @@ -118,7 +118,6 @@ import cbit.vcell.export.gloworm.quicktime.VideoMediaChunk; import cbit.vcell.export.gloworm.quicktime.VideoMediaSample; import cbit.vcell.export.gui.ExportMonitorPanel; -import cbit.vcell.export.server.ExportSpecs; import cbit.vcell.export.server.FileDataContainerManager; import cbit.vcell.export.server.FormatSpecificSpecs; import cbit.vcell.geometry.Curve; @@ -440,7 +439,7 @@ public void run(Hashtable hashTable) throws Exception { getPDEDataContextPanel1().setPdeDataContext(getPdeDataContext()); getPDEExportPanel1().setSimulation(getSimulation()); getPDEExportPanel1().setPdeDataContext(getPdeDataContext(), - (getSimulation()==null?null:new ExportSpecs.SimNameSimDataID(getSimulation().getName(), getSimulation().getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), null))); + (getSimulation()==null?null:new SimNameSimDataID(getSimulation().getName(), getSimulation().getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), null))); CartesianMesh cartesianMesh = (getPdeDataContext() != null?getPdeDataContext().getCartesianMesh():null); if (cartesianMesh != null && cartesianMesh.getGeometryDimension() == 3 && cartesianMesh.getNumMembraneElements() > 0){ @@ -2261,7 +2260,7 @@ public static boolean isParameterScan(PDEDataContext oldValue,PDEDataContext new return(oldSimKey != null && newSimKey != null && oldSimKey.equals(newSimKey)); } -public void setSimNameSimDataID(ExportSpecs.SimNameSimDataID simNameSimDataID){ +public void setSimNameSimDataID(SimNameSimDataID simNameSimDataID){ getPDEExportPanel1().setPdeDataContext(getPdeDataContext(),simNameSimDataID); } /** diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java index fdfe413ddd..5679d926b9 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java @@ -21,7 +21,7 @@ import cbit.vcell.client.task.AsynchClientTask; import cbit.vcell.client.task.ClientTaskDispatcher; import cbit.vcell.export.server.*; -import cbit.vcell.export.server.ExportSpecs.SimNameSimDataID; +import cbit.vcell.export.server.SimNameSimDataID; import cbit.vcell.geometry.SubVolume; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.VariableType; @@ -693,7 +693,7 @@ private ExportSpecs.SimulationSelector createSimulationSelector(){ ExportSpecs.SimulationSelector simulationSelector = new ExportSpecs.SimulationSelector(){ - private ExportSpecs.SimNameSimDataID[] multiSimNameSimDataIDs; + private SimNameSimDataID[] multiSimNameSimDataIDs; // private ExportSpecs.ExportParamScanInfo exportParamScanInfo; private int[] selectedParamScanIndexes; private Simulation[] simulations; @@ -714,7 +714,7 @@ public SimNameSimDataID[] getSelectedSimDataInfo() { // } // } if(multiSimNameSimDataIDs == null){ - return new ExportSpecs.SimNameSimDataID[] {currentSimNameSimDataID}; + return new SimNameSimDataID[] {currentSimNameSimDataID}; } return multiSimNameSimDataIDs; } @@ -735,13 +735,13 @@ public void selectSimulations() { new String[] {"Simulation","Mesh x,y,z","NumTimePoints","EndTime","Output Descr."}, rowData, ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); if (choices != null) { - multiSimNameSimDataIDs = new ExportSpecs.SimNameSimDataID[choices.length]; + multiSimNameSimDataIDs = new SimNameSimDataID[choices.length]; for (int i = 0; i < choices.length; i++) { multiSimNameSimDataIDs[i] = - new ExportSpecs.SimNameSimDataID( + new SimNameSimDataID( simulations[choices[i]].getName(), simulations[choices[i]].getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), - ExportSpecs.getParamScanInfo(simulations[choices[i]], (currentSimNameSimDataID==null?0:currentSimNameSimDataID.getDefaultJobIndex())) + ExportParamScanInfo.getParamScanInfo(simulations[choices[i]], (currentSimNameSimDataID==null?0:currentSimNameSimDataID.getDefaultJobIndex())) ); } } @@ -1877,8 +1877,8 @@ public void setNormalAxis(int normalAxis) { * @param pdeDataContext The new value for the property. * @see #getPdeDataContext */ -private ExportSpecs.SimNameSimDataID currentSimNameSimDataID; -public void setPdeDataContext(PDEDataContext pdeDataContext,ExportSpecs.SimNameSimDataID currentSimNameSimDataID) { +private SimNameSimDataID currentSimNameSimDataID; +public void setPdeDataContext(PDEDataContext pdeDataContext, SimNameSimDataID currentSimNameSimDataID) { //currentSimNameSimDataID 2 states //1. with ExportSpecs.ExportParamScanInfo //2. without ExportSpecs.ExportParamScanInfo diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java b/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java index 746d8aa345..e4382369fc 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/SimResultsViewer.java @@ -16,7 +16,8 @@ import cbit.vcell.client.task.ClientTaskDispatcher; import cbit.vcell.client.task.ClientTaskDispatcher.BlockingTimer; import cbit.vcell.export.gui.ExportMonitorPanel; -import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.export.server.ExportParamScanInfo; +import cbit.vcell.export.server.SimNameSimDataID; import cbit.vcell.mapping.SimulationContext; import cbit.vcell.math.Constant; import cbit.vcell.mathmodel.MathModel; @@ -309,7 +310,7 @@ public void actionPerformed(ActionEvent e) { } }); } else { - pdeDataViewer.setSimNameSimDataID(new ExportSpecs.SimNameSimDataID(getSimulation().getName(), getSimulation().getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), ExportSpecs.getParamScanInfo(getSimulation(), getSelectedParamScanJobIndex()))); + pdeDataViewer.setSimNameSimDataID(new SimNameSimDataID(getSimulation().getName(), getSimulation().getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), ExportParamScanInfo.getParamScanInfo(getSimulation(), getSelectedParamScanJobIndex()))); } setParamChoicesPanel(panel); @@ -487,7 +488,7 @@ public void run(Hashtable hashTable) throws Exception { if (hashTable.get(ClientTaskDispatcher.TASK_ABORTED_BY_ERROR) == null) { ClientPDEDataContext newPDEDC = (ClientPDEDataContext)hashTable.get("newPDEDC"); pdeDataViewer.setPdeDataContext(newPDEDC); - pdeDataViewer.setSimNameSimDataID(new ExportSpecs.SimNameSimDataID(getSimulation().getName(), getSimulation().getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), ExportSpecs.getParamScanInfo(getSimulation(), vcdid.getJobIndex()))); + pdeDataViewer.setSimNameSimDataID(new SimNameSimDataID(getSimulation().getName(), getSimulation().getSimulationInfo().getAuthoritativeVCSimulationIdentifier(), ExportParamScanInfo.getParamScanInfo(getSimulation(), vcdid.getJobIndex()))); }else{ if(listReset != null && pdeDataViewer != null && pdeDataViewer.getPdeDataContext() != null && pdeDataViewer.getPdeDataContext().getVCDataIdentifier() != null){ listReset.reset(pdeDataViewer.getPdeDataContext().getVCDataIdentifier()); diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java index cffa1039ea..baef497470 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java @@ -240,7 +240,7 @@ protected void fireJButtonOKAction_actionPerformed(java.util.EventObject newEven * @return The asciiSpecs property value. */ public ASCIISpecs getAsciiSpecs() { - ExportSpecs.SimNameSimDataID[] simDataID = simulationSelector == null ? null : simulationSelector.getSelectedSimDataInfo(); + SimNameSimDataID[] simDataID = simulationSelector == null ? null : simulationSelector.getSelectedSimDataInfo(); int[] paramScanIndexes = simulationSelector == null ? null : simulationSelector.getselectedParamScanIndexes(); ASCIISpecs.CsvRoiLayout roiLayout = isCSVExport && getTimeSimVarChkBox().isSelected() ? ASCIISpecs.CsvRoiLayout.time_sim_var: ASCIISpecs.CsvRoiLayout.var_time_val; diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java index f3f1d3db54..c87cfc0222 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java @@ -260,7 +260,7 @@ public void stateChanged(javax.swing.event.ChangeEvent e) { } public N5Specs getN5Specs(){ - ExportSpecs.SimNameSimDataID[] simDataID = simulationSelector == null ? null : simulationSelector.getSelectedSimDataInfo(); + SimNameSimDataID[] simDataID = simulationSelector == null ? null : simulationSelector.getSelectedSimDataInfo(); int[] paramScanIndexes = simulationSelector == null ? null : simulationSelector.getselectedParamScanIndexes(); String dataSetName = getJTextFieldDataSetName().getText(); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java index ce91ca6cf8..a3120121ba 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java @@ -424,7 +424,7 @@ private int[] getallSampleIndexes(GeometrySpecs geometrySpecs, CartesianMesh mes private ExportOutput sofyaFormat(OutputContext outputContext, long jobID, User user, DataServerImpl dataServerImpl, final VCDataIdentifier orig_vcdID, VariableSpecs variableSpecs, TimeSpecs timeSpecs, GeometrySpecs geometrySpecs, ASCIISpecs asciiSpecs, String contextName, FileDataContainerManager fileDataContainerManager) throws DataAccessException, IOException{ - ExportSpecs.SimNameSimDataID[] simNameSimDataIDs = asciiSpecs.getSimNameSimDataIDs(); + SimNameSimDataID[] simNameSimDataIDs = asciiSpecs.getSimNameSimDataIDs(); CartesianMesh mesh = dataServerImpl.getMesh(user, orig_vcdID);//use mesh to calulate indexes final int SIM_COUNT = simNameSimDataIDs.length; final int PARAMSCAN_COUNT = (asciiSpecs.getExportMultipleParamScans() != null ? asciiSpecs.getExportMultipleParamScans().length : 1); @@ -556,7 +556,7 @@ private List exportPDEData(OutputContext outputContext, long jobID if (!MacosArm64) { NativeLib.HDF5.load(); } - ExportSpecs.SimNameSimDataID[] simNameSimDataIDs = asciiSpecs.getSimNameSimDataIDs(); + SimNameSimDataID[] simNameSimDataIDs = asciiSpecs.getSimNameSimDataIDs(); Vector exportOutputV = new Vector(); double progressCounter = 0; final int SIM_COUNT = simNameSimDataIDs.length; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java index c798dff777..8e1ac39971 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java @@ -12,25 +12,27 @@ import java.io.Serializable; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Compare; /** * This type was created in VisualAge. */ @SuppressWarnings("serial") +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class ASCIISpecs extends FormatSpecificSpecs implements Serializable { public static enum CsvRoiLayout {var_time_val,time_sim_var} private boolean switchRowsColumns; private ExportFormat format; private ExportSpecss.ExportableDataType dataType; - private ExportSpecs.SimNameSimDataID[] simNameSimDataIDs; + private SimNameSimDataID[] simNameSimDataIDs; private int[] exportMultipleParamScans; private CsvRoiLayout csvLayout; private boolean isHDF5; /** * TextSpecs constructor comment. */ -public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, - int[] exportMultipleParamScans, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns) { +public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, + int[] exportMultipleParamScans, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns) { super("ASCIISpecs"); this.format = format; this.dataType = dataType; @@ -41,7 +43,7 @@ public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportSpecss this.isHDF5 = isHDF5; } -public ASCIISpecs(ExportSpecs.SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, +public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns){ this(simNameSimDataIDs, dataType, format, null, csvLayout, isHDF5, switchRowsColumns); } @@ -77,7 +79,7 @@ public boolean equals(java.lang.Object object) { public int[] getExportMultipleParamScans(){ return exportMultipleParamScans; } -public ExportSpecs.SimNameSimDataID[] getSimNameSimDataIDs(){ +public SimNameSimDataID[] getSimNameSimDataIDs(){ return simNameSimDataIDs; } /** diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportParamScanInfo.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportParamScanInfo.java new file mode 100644 index 0000000000..eae5f8e07b --- /dev/null +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportParamScanInfo.java @@ -0,0 +1,84 @@ +package cbit.vcell.export.server; + +import cbit.vcell.solver.MathOverrides; +import cbit.vcell.solver.Simulation; +import org.vcell.util.Compare; +import org.vcell.util.Matchable; + +import java.io.Serializable; +import java.util.Arrays; + +public class ExportParamScanInfo implements Matchable, Serializable { + private int[] paramScanJobIndexes;//these are the param scan job indexes we are possibly interested in + private int defaultParamScanJobIndex;//this is the "selected" param scan simdata job index at the time this object was created, 0 if no param scan + private String[] paramScanConstantNames; + private String[][] paramScanConstantValues; + + + public ExportParamScanInfo(int[] paramScanJobIndexes, int defaultParamScanJobIndex, String[] paramScanConstantNames, String[][] paramScanConstantValues) { + this.paramScanJobIndexes = paramScanJobIndexes; + this.defaultParamScanJobIndex = defaultParamScanJobIndex; + this.paramScanConstantNames = paramScanConstantNames; + this.paramScanConstantValues = paramScanConstantValues; + } + + public static ExportParamScanInfo getParamScanInfo(Simulation simulation, int selectedParamScanJobIndex){ + int scanCount = simulation.getScanCount(); + if(scanCount == 1){//no parameter scan + return null; + } + String[] scanConstantNames = simulation.getMathOverrides().getScannedConstantNames(); + Arrays.sort(scanConstantNames); + int[] paramScanJobIndexes = new int[scanCount]; + String[][] scanConstValues = new String[scanCount][scanConstantNames.length]; + for (int i = 0; i < scanCount; i++) { + paramScanJobIndexes[i] = i; + for (int j = 0; j < scanConstantNames.length; j++) { + String paramScanValue = simulation.getMathOverrides().getActualExpression(scanConstantNames[j], new MathOverrides.ScanIndex(i)).infix(); + // System.out.println("ScanIndex="+i+" ScanConstName='"+scanConstantNames[j]+"' paramScanValue="+paramScanValue); + scanConstValues[i][j] = paramScanValue; + } + } + return new ExportParamScanInfo(paramScanJobIndexes, selectedParamScanJobIndex, scanConstantNames, scanConstValues); + } + + public boolean compareEqual(Matchable obj) { + if (obj instanceof ExportParamScanInfo) { + ExportParamScanInfo exportParamScanInfo = (ExportParamScanInfo) obj; + if (defaultParamScanJobIndex == exportParamScanInfo.defaultParamScanJobIndex && + Compare.isEqualOrNull(paramScanJobIndexes, exportParamScanInfo.paramScanJobIndexes)) { + + for (int i = 0; paramScanConstantNames != null && i < paramScanConstantNames.length; i++) { + if (!paramScanConstantNames[i].equals(exportParamScanInfo.paramScanConstantNames[i])) { + return false; + } + } + for (int i = 0; paramScanConstantValues != null && i < paramScanConstantValues.length; i++) { + if (!paramScanConstantValues[i].equals(exportParamScanInfo.paramScanConstantValues[i])) { + return false; + } + } + + return true; + } + } + return false; + + } + + public int[] getParamScanJobIndexes() { + return paramScanJobIndexes; + } + + public int getDefaultParamScanJobIndex() { + return defaultParamScanJobIndex; + } + + public String[] getParamScanConstantNames() { + return paramScanConstantNames; + } + + public String[][] getParamScanConstantValues() { + return paramScanConstantValues; + } +} diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java index 6f5c043290..352036a95d 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecs.java @@ -10,22 +10,17 @@ package cbit.vcell.export.server; import java.io.Serializable; -import java.util.Arrays; -import cbit.vcell.solver.MathOverrides; -import cbit.vcell.solver.Simulation; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import org.vcell.util.BeanUtils; import org.vcell.util.Compare; -import org.vcell.util.Matchable; import org.vcell.util.Range; import org.vcell.util.document.VCDataIdentifier; import cbit.image.DisplayAdapterService; import cbit.image.DisplayPreferences; -import cbit.vcell.solver.VCSimulationDataIdentifier; -import cbit.vcell.solver.VCSimulationIdentifier; + /** * This type was created in VisualAge. */ @@ -42,128 +37,15 @@ public class ExportSpecs implements Serializable { private HumanReadableExportData humanReadableExportData; - public static ExportParamScanInfo getParamScanInfo(Simulation simulation, int selectedParamScanJobIndex){ - int scanCount = simulation.getScanCount(); - if(scanCount == 1){//no parameter scan - return null; - } - String[] scanConstantNames = simulation.getMathOverrides().getScannedConstantNames(); - Arrays.sort(scanConstantNames); - int[] paramScanJobIndexes = new int[scanCount]; - String[][] scanConstValues = new String[scanCount][scanConstantNames.length]; - for (int i = 0; i < scanCount; i++) { - paramScanJobIndexes[i] = i; - for (int j = 0; j < scanConstantNames.length; j++) { - String paramScanValue = simulation.getMathOverrides().getActualExpression(scanConstantNames[j], new MathOverrides.ScanIndex(i)).infix(); - // System.out.println("ScanIndex="+i+" ScanConstName='"+scanConstantNames[j]+"' paramScanValue="+paramScanValue); - scanConstValues[i][j] = paramScanValue; - } - } - return new ExportParamScanInfo(paramScanJobIndexes, selectedParamScanJobIndex, scanConstantNames, scanConstValues); - } - public interface SimulationSelector{ public void selectSimulations(); public void selectParamScanInfo(); - public ExportSpecs.SimNameSimDataID[] getSelectedSimDataInfo(); + public SimNameSimDataID[] getSelectedSimDataInfo(); public int[] getselectedParamScanIndexes(); public int getNumAvailableSimulations(); public int getNumAvailableParamScans(); } - public static class ExportParamScanInfo implements Matchable,Serializable{ - private int[] paramScanJobIndexes;//these are the param scan job indexes we are possibly interested in - private int defaultParamScanJobIndex;//this is the "selected" param scan simdata job index at the time this object was created, 0 if no param scan - private String[] paramScanConstantNames; - private String[][] paramScanConstantValues; - - - public ExportParamScanInfo(int[] paramScanJobIndexes,int defaultParamScanJobIndex, String[] paramScanConstantNames,String[][] paramScanConstantValues) { - this.paramScanJobIndexes = paramScanJobIndexes; - this.defaultParamScanJobIndex = defaultParamScanJobIndex; - this.paramScanConstantNames = paramScanConstantNames; - this.paramScanConstantValues = paramScanConstantValues; - } - public boolean compareEqual(Matchable obj) { - if (obj instanceof ExportParamScanInfo) { - ExportParamScanInfo exportParamScanInfo = (ExportParamScanInfo)obj; - if (defaultParamScanJobIndex == exportParamScanInfo.defaultParamScanJobIndex && - Compare.isEqualOrNull(paramScanJobIndexes, exportParamScanInfo.paramScanJobIndexes)){ - - for (int i = 0;paramScanConstantNames!=null && i 0){ - throw new IllegalArgumentException("Error SimNameSimDataID.getVCDataIdentifier: jobIndex > 0 unexpected with no parameter scan"); - }else if(exportParamScanInfo != null && paramScanJobIndex >= exportParamScanInfo.getParamScanJobIndexes().length){ - throw new IllegalArgumentException("Error SimNameSimDataID.getVCDataIdentifier: jobIndex > parameter scan count"); - } - return new VCSimulationDataIdentifier(vcSimulationIdentifier, paramScanJobIndex); - } - public int getDefaultJobIndex(){ - return (exportParamScanInfo==null?0:exportParamScanInfo.defaultParamScanJobIndex); - } - public ExportParamScanInfo getExportParamScanInfo(){ - return exportParamScanInfo; - } - public String getSimulationName(){ - return simulationName; - } - public boolean compareEqual(Matchable obj) { - if (obj instanceof SimNameSimDataID) { - SimNameSimDataID simNameSimDataID = (SimNameSimDataID)obj; - if ( - simulationName.equals(simNameSimDataID.getSimulationName()) && - vcSimulationIdentifier.equals(simNameSimDataID.vcSimulationIdentifier) && - Compare.isEqualOrNull(exportParamScanInfo, simNameSimDataID.getExportParamScanInfo())){ - return true; - } - } - return false; - } - } - - /** - * This method was created in VisualAge. - */ public ExportSpecs(org.vcell.util.document.VCDataIdentifier vcdID, ExportFormat format, VariableSpecs variableSpecs, TimeSpecs timeSpecs, GeometrySpecs geometrySpecs, FormatSpecificSpecs formatSpecificSpecs, diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java index ecce76f3b5..a922230463 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java @@ -58,7 +58,7 @@ ) @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - property = "format", // Discriminator field + property = "specClass", // Discriminator field visible = true ) @JsonSubTypes({@JsonSubTypes.Type(value = N5Specs.class, name = "N5"), @JsonSubTypes.Type(value = ASCIISpecs.class, name = "ASCIISpecs"), @@ -73,10 +73,10 @@ public abstract class FormatSpecificSpecs implements Serializable { public final static int CODEC_NONE = 0; public final static int CODEC_JPEG = 1; - public String format; + public String specClass; - public FormatSpecificSpecs(String format) { - this.format = format; + public FormatSpecificSpecs(String specClass) { + this.specClass = specClass; } @JsonIgnore diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java index 017f273ed4..2963e53774 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java @@ -13,10 +13,13 @@ import java.io.Serializable; import cbit.image.DisplayPreferences; +import org.eclipse.microprofile.openapi.annotations.media.Schema; + /** * This type was created in VisualAge. */ @SuppressWarnings("serial") +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class ImageSpecs extends FormatSpecificSpecs implements Serializable { private DisplayPreferences[] displayPreferences; private ExportFormat format; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java index 6464b55ff9..84f4e633f4 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java @@ -13,10 +13,13 @@ import java.io.Serializable; import cbit.image.DisplayPreferences; +import org.eclipse.microprofile.openapi.annotations.media.Schema; + /** * This type was created in VisualAge. */ @SuppressWarnings("serial") +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class MovieSpecs extends FormatSpecificSpecs implements Serializable { private double duration; private boolean overlayMode; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java index 54ceab2b87..9cf6cdac6f 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java @@ -32,7 +32,7 @@ * This type was created in VisualAge. */ @SuppressWarnings("serial") -@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"format"}) +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class N5Specs extends FormatSpecificSpecs implements Serializable { private final ExportFormat formatType; private final ExportSpecss.ExportableDataType dataType; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java index 6f15ed3876..db2c7d523e 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/PLYSpecs.java @@ -1,9 +1,11 @@ package cbit.vcell.export.server; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Compare; import cbit.image.DisplayPreferences; +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class PLYSpecs extends FormatSpecificSpecs { private boolean bIncludeTextures = false; private DisplayPreferences[] displayPreferences; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java index ea5538a74a..f8c4c553d5 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java @@ -11,10 +11,13 @@ package cbit.vcell.export.server; +import org.eclipse.microprofile.openapi.annotations.media.Schema; + import java.io.Serializable; /** * This type was created in VisualAge. */ +@Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class RasterSpecs extends FormatSpecificSpecs implements Serializable { private ExportSpecss.RasterFormats format; private boolean separateHeader; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/SimNameSimDataID.java b/vcell-core/src/main/java/cbit/vcell/export/server/SimNameSimDataID.java new file mode 100644 index 0000000000..1688ddc39d --- /dev/null +++ b/vcell-core/src/main/java/cbit/vcell/export/server/SimNameSimDataID.java @@ -0,0 +1,55 @@ +package cbit.vcell.export.server; + +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationIdentifier; +import org.vcell.util.Compare; +import org.vcell.util.Matchable; +import org.vcell.util.document.VCDataIdentifier; + +import java.io.Serializable; + +public class SimNameSimDataID implements Matchable, Serializable { + private String simulationName; + private VCSimulationIdentifier vcSimulationIdentifier; + private ExportParamScanInfo exportParamScanInfo; + + public SimNameSimDataID(String simulationName, VCSimulationIdentifier vcSimulationIdentifier, ExportParamScanInfo exportParamScanInfo) { + this.simulationName = simulationName; + this.vcSimulationIdentifier = vcSimulationIdentifier; + this.exportParamScanInfo = exportParamScanInfo; + } + + public VCDataIdentifier getVCDataIdentifier(int paramScanJobIndex) { + if (exportParamScanInfo == null && paramScanJobIndex > 0) { + throw new IllegalArgumentException("Error SimNameSimDataID.getVCDataIdentifier: jobIndex > 0 unexpected with no parameter scan"); + } else if (exportParamScanInfo != null && paramScanJobIndex >= exportParamScanInfo.getParamScanJobIndexes().length) { + throw new IllegalArgumentException("Error SimNameSimDataID.getVCDataIdentifier: jobIndex > parameter scan count"); + } + return new VCSimulationDataIdentifier(vcSimulationIdentifier, paramScanJobIndex); + } + + public int getDefaultJobIndex() { + return (exportParamScanInfo == null ? 0 : exportParamScanInfo.getDefaultParamScanJobIndex()); + } + + public ExportParamScanInfo getExportParamScanInfo() { + return exportParamScanInfo; + } + + public String getSimulationName() { + return simulationName; + } + + public boolean compareEqual(Matchable obj) { + if (obj instanceof SimNameSimDataID) { + SimNameSimDataID simNameSimDataID = (SimNameSimDataID) obj; + if ( + simulationName.equals(simNameSimDataID.getSimulationName()) && + vcSimulationIdentifier.equals(simNameSimDataID.vcSimulationIdentifier) && + Compare.isEqualOrNull(exportParamScanInfo, simNameSimDataID.getExportParamScanInfo())) { + return true; + } + } + return false; + } +} From c00e592413f304492b3126422079a3dc08c5039f Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 23 Jul 2025 08:35:53 -0400 Subject: [PATCH 16/41] Annotations to Facilitate DTOs --- .../cbit/vcell/geometry/AnalyticCurve.java | 3 +++ .../cbit/vcell/geometry/CompositeCurve.java | 4 ++- .../vcell/geometry/ControlPointCurve.java | 27 ++++++++++++++----- .../main/java/cbit/vcell/geometry/Curve.java | 23 +++++++++++++++- .../cbit/vcell/geometry/SampledCurve.java | 11 +++++--- .../main/java/cbit/vcell/geometry/Spline.java | 6 +++-- .../cbit/vcell/simdata/SpatialSelection.java | 18 +++++++++++-- .../simdata/SpatialSelectionContour.java | 5 +++- .../simdata/SpatialSelectionMembrane.java | 8 +++++- .../vcell/simdata/SpatialSelectionVolume.java | 4 ++- 10 files changed, 90 insertions(+), 19 deletions(-) diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java index 955d1cd7df..61c2705ca1 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java @@ -12,6 +12,7 @@ import java.util.Map; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; import org.vcell.util.Matchable; @@ -31,6 +32,7 @@ * exceptions in the abstract base class Curve...which violates * a fundamental OO design principle. */ +@Schema(allOf = {Curve.class}, requiredProperties = {"type"}) public class AnalyticCurve extends Curve implements SymbolTable { private Expression expX = null; private Expression expY = null; @@ -41,6 +43,7 @@ public class AnalyticCurve extends Curve implements SymbolTable { */ public AnalyticCurve(Expression x, Expression y, Expression z) throws ExpressionBindingException { // cbit.util.Assertion.assert (x != null && y != null && z != null); + super("AnalyticCurve"); this.expX = x; this.expY = y; this.expZ = z; diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java index a4c13fa5bc..49bca12247 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java @@ -10,18 +10,20 @@ package cbit.vcell.geometry; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; /** * This type was created in VisualAge. */ +@Schema(allOf = {Curve.class}, requiredProperties = {"type"}) public class CompositeCurve extends Curve { java.util.Vector fieldCurves = new java.util.Vector (); /** * CompositeCurve constructor comment. */ public CompositeCurve() { - super(); + super("CompositeCurve"); } /** * This method was created in VisualAge. diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java index aa179d45a8..ff01cab419 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java @@ -12,6 +12,8 @@ import java.util.Vector; +import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; /** @@ -20,30 +22,43 @@ * @author: */ @SuppressWarnings("serial") +@Schema( + allOf = {Curve.class}, + discriminatorMapping = { + @DiscriminatorMapping(value = "Spline", schema = Spline.class), + @DiscriminatorMapping(value = "SampledCurve", schema = SampledCurve.class) + }, + discriminatorProperty = "type", + requiredProperties = {"type"} +) public abstract class ControlPointCurve extends Curve { private Vector controlPoints = new Vector(); public static final int INFINITE = 0; + public final String type; /** * ControlPointCurve constructor comment. */ -protected ControlPointCurve() { - super(); +protected ControlPointCurve(String type) { + super("ControlPointCurve"); + this.type = type; } /** * ControlPointCurve constructor comment. */ -protected ControlPointCurve(Coordinate[] argControlPoints) { - super(); +protected ControlPointCurve(Coordinate[] argControlPoints, String type) { + super("ControlPointCurve"); for (int c = 0; c < argControlPoints.length; c += 1) { controlPoints.addElement(argControlPoints[c]); } + this.type = type; } /** * ControlPointCurve constructor comment. */ -protected ControlPointCurve(Coordinate argControlPoint) { - super(); +protected ControlPointCurve(Coordinate argControlPoint, String type) { + super("ControlPointCurve"); controlPoints.addElement(argControlPoint); + this.type = type; } /** * Insert the method's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/Curve.java b/vcell-core/src/main/java/cbit/vcell/geometry/Curve.java index 96c4780afb..9430f02502 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/Curve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/Curve.java @@ -10,6 +10,12 @@ package cbit.vcell.geometry; +import cbit.vcell.simdata.SpatialSelectionContour; +import cbit.vcell.simdata.SpatialSelectionMembrane; +import cbit.vcell.simdata.SpatialSelectionVolume; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; /** * This type was created in VisualAge. @@ -19,21 +25,36 @@ * decision reflecting immutability from the standpoint of * the user. */ + +@Schema( + discriminatorMapping = { + @DiscriminatorMapping(value = "AnalyticCurve", schema = AnalyticCurve.class), + @DiscriminatorMapping(value = "CompositeCurve", schema = CompositeCurve.class), + @DiscriminatorMapping(value = "ControlPointCurve", schema = ControlPointCurve.class) + }, + discriminatorProperty = "type", + requiredProperties = {"type"} +) public abstract class Curve implements org.vcell.util.Matchable, java.io.Serializable, Cloneable { //Leave false by default private boolean bClosed = false; // public static final int NONE_SELECTED = -1; private static final int DEFAULT_NUM_SAMPLES_FLAG = 0; + @JsonIgnore private transient int fieldNumSamplePoints = DEFAULT_NUM_SAMPLES_FLAG; + @JsonIgnore private transient SampledCurve sampledCurve = null; + @JsonIgnore private transient int sampledCurveID = 0; private String description = null; + public final String type; /** * Curve constructor comment. */ -protected Curve() { +protected Curve(String type) { + this.type = type; } /** * Insert the method's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java index 075cd9956e..9e89835e78 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java @@ -10,34 +10,37 @@ package cbit.vcell.geometry; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; + /** * This type was created in VisualAge. */ +@Schema(allOf = {ControlPointCurve.class}, requiredProperties = {"type"}) public class SampledCurve extends ControlPointCurve { /** * SampledCurve constructor comment. */ public SampledCurve() { - super(); + super("SampledCurve"); } /** * SampledCurve constructor comment. */ public SampledCurve(Coordinate[] argControlPoints) { - super(argControlPoints); + super(argControlPoints, "SampledCurve"); } /** * SampledCurve constructor comment. */ protected SampledCurve(Coordinate argControlPoint) { - super(argControlPoint); + super(argControlPoint, "SampledCurve"); } /** * SampledCurve constructor comment. */ public SampledCurve(Curve sampleThisCurve, int samplePointCount) { - super(); + super("SampledCurve"); for (int c = 0; c < samplePointCount; c += 1) { double u = (double) c / (double) (samplePointCount - 1); appendControlPoint(new Coordinate(sampleThisCurve.getX(u), sampleThisCurve.getY(u), sampleThisCurve.getZ(u))); diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java b/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java index 106a4ef05c..75f0ae7b3e 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java @@ -10,22 +10,24 @@ package cbit.vcell.geometry; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; /** * This type was created in VisualAge. */ +@Schema(allOf = {ControlPointCurve.class}, requiredProperties = {"type"}) public class Spline extends ControlPointCurve { /** * Insert the method's description here. * Creation date: (7/19/00 12:55:31 PM) */ -public Spline() {} +public Spline() {super("Spline");} /** * Spline constructor comment. */ public Spline(Coordinate[] argControlPoints) { - super(argControlPoints); + super(argControlPoints, "Spline"); } /** * Insert the method's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java index 503713fd8a..4a87bf7c3b 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java @@ -9,6 +9,9 @@ */ package cbit.vcell.simdata; +import cbit.vcell.export.server.*; +import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; import cbit.vcell.geometry.CurveSelectionInfo; @@ -19,14 +22,24 @@ * Creation date: (2/26/2001 3:48:34 PM) * @author: Jim Schaff */ +@Schema( + discriminatorMapping = { + @DiscriminatorMapping(value = "Membrane", schema = SpatialSelectionMembrane.class), + @DiscriminatorMapping(value = "Contour", schema = SpatialSelectionContour.class), + @DiscriminatorMapping(value = "Volume", schema = SpatialSelectionVolume.class) + }, + discriminatorProperty = "type", + requiredProperties = {"type"} +) public abstract class SpatialSelection implements java.io.Serializable, org.vcell.util.Matchable { private CurveSelectionInfo curveSelectionInfo = null; transient private CartesianMesh mesh = null; private VariableType varType = null; + public final String type; // - public class SSHelper { + public static class SSHelper { VariableType varType; Coordinate[] meshCoords; @@ -116,7 +129,7 @@ private void initValues(double[] sourceValues){ /** * SpatialSelection constructor comment. */ -protected SpatialSelection(CurveSelectionInfo argCurveSelectionInfo, VariableType argVarType, CartesianMesh argMesh){ +protected SpatialSelection(CurveSelectionInfo argCurveSelectionInfo, VariableType argVarType, CartesianMesh argMesh, String type){ if (argCurveSelectionInfo==null || argMesh==null || argVarType==null){ throw new IllegalArgumentException("null argument"); } @@ -127,6 +140,7 @@ protected SpatialSelection(CurveSelectionInfo argCurveSelectionInfo, VariableTyp this.curveSelectionInfo = argCurveSelectionInfo; this.mesh = argMesh; this.varType = argVarType; + this.type = type; } diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java index 245b505b06..de2ec2d6e9 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java @@ -11,11 +11,14 @@ package cbit.vcell.simdata; +import org.eclipse.microprofile.openapi.annotations.media.Schema; + /** * Insert the type's description here. * Creation date: (7/18/2001 2:39:54 PM) * @author: Frank Morgan */ +@Schema(allOf = {SpatialSelection.class}) public class SpatialSelectionContour extends SpatialSelection { private int[] fieldSampledDataIndexes = null; /** @@ -27,7 +30,7 @@ public class SpatialSelectionContour extends SpatialSelection { * @param selectionKind int */ public SpatialSelectionContour(cbit.vcell.geometry.CurveSelectionInfo argCurveSelectionInfo, cbit.vcell.math.VariableType argVarType, cbit.vcell.solvers.CartesianMesh argMesh, int[] sampledDataIndexes) { - super(argCurveSelectionInfo, argVarType, argMesh); + super(argCurveSelectionInfo, argVarType, argMesh, "Contour"); if (argVarType.equals(cbit.vcell.math.VariableType.CONTOUR)){ fieldSampledDataIndexes = sampledDataIndexes; }else if (argVarType.equals(cbit.vcell.math.VariableType.CONTOUR_REGION)){ diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java index 471dda0ba9..a4a33c3a70 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java @@ -10,12 +10,18 @@ package cbit.vcell.simdata; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; +import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; +import org.vcell.util.document.GroupAccess; + /** * Insert the type's description here. * Creation date: (7/18/2001 2:39:54 PM) * @author: Frank Morgan */ +@Schema(allOf = {SpatialSelection.class}) public class SpatialSelectionMembrane extends SpatialSelection { private int[] fieldSampledDataIndexes = null; private cbit.vcell.geometry.SampledCurve selectionSource = null; @@ -33,7 +39,7 @@ public SpatialSelectionMembrane( cbit.vcell.solvers.CartesianMesh argMesh, int[] sampledDataIndexes, cbit.vcell.geometry.SampledCurve argSelectionSource) { - super(argCurveSelectionInfo, argVarType, argMesh); + super(argCurveSelectionInfo, argVarType, argMesh, "Membrane"); selectionSource = argSelectionSource; if (argVarType.equals(cbit.vcell.math.VariableType.MEMBRANE)) { diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java index 3c6fcd89a5..29e01df177 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java @@ -13,6 +13,7 @@ import java.util.Arrays; import java.util.Vector; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; import org.vcell.util.CoordinateIndex; @@ -25,10 +26,11 @@ * Creation date: (7/18/2001 2:39:21 PM) * @author: Frank Morgan */ +@Schema(allOf = {SpatialSelection.class}) public class SpatialSelectionVolume extends SpatialSelection { public SpatialSelectionVolume(cbit.vcell.geometry.CurveSelectionInfo argCurveSelectionInfo, cbit.vcell.math.VariableType argVarType, cbit.vcell.solvers.CartesianMesh argMesh) { - super(argCurveSelectionInfo, argVarType, argMesh); + super(argCurveSelectionInfo, argVarType, argMesh, "Volume"); } private boolean areTouching(org.vcell.util.CoordinateIndex ci1, org.vcell.util.CoordinateIndex ci2) { From 7a63c2e99b87158fd423d5db1556e9679a0dc78e Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 28 Jul 2025 10:11:04 -0400 Subject: [PATCH 17/41] Update Dependencies --- vcell-math/pom.xml | 11 +++++++++++ vcell-rest/pom.xml | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/vcell-math/pom.xml b/vcell-math/pom.xml index 5badde90a3..a84e1bfc3d 100644 --- a/vcell-math/pom.xml +++ b/vcell-math/pom.xml @@ -91,6 +91,12 @@ org.vcell vcell-util ${project.version} + + + biz.aQute.bnd + biz.aQute.bnd.annotation + + @@ -115,5 +121,10 @@ + + org.eclipse.microprofile.openapi + microprofile-openapi-api + ${microprofile-openapi.version} + diff --git a/vcell-rest/pom.xml b/vcell-rest/pom.xml index 82fab56f1c..634d322a31 100644 --- a/vcell-rest/pom.xml +++ b/vcell-rest/pom.xml @@ -235,6 +235,12 @@ awaitility test + + org.apache.qpid + qpid-jms-client + 2.7.0 + test + From 6570e0e36e75729048522d471718674c2f7afce4 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 28 Jul 2025 10:20:48 -0400 Subject: [PATCH 18/41] Update Endpoints --- .../org/vcell/restq/QuarkusStartUpTasks.java | 4 - .../activemq/ExportRequestListenerMQ.java | 76 ++++++++----------- .../vcell/restq/handlers/ExportResource.java | 53 +++++-------- .../restq/services/Exports/ExportService.java | 34 +++++---- 4 files changed, 70 insertions(+), 97 deletions(-) diff --git a/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java b/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java index 98ec53808c..9216547889 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java +++ b/vcell-rest/src/main/java/org/vcell/restq/QuarkusStartUpTasks.java @@ -15,10 +15,6 @@ import org.vcell.util.DataAccessException; import org.vcell.util.document.User; -import javax.jms.Connection; -import javax.jms.JMSException; -import javax.jms.MessageProducer; -import javax.jms.QueueConnection; import java.sql.SQLException; @ApplicationScoped diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index 5ee65edaa3..5a10674fa7 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -1,18 +1,11 @@ package org.vcell.restq.activemq; -import cbit.vcell.export.server.ExportServiceImpl; -import cbit.vcell.export.server.ExportSpecs; -import cbit.vcell.export.server.GeometrySpecs; -import cbit.vcell.export.server.HumanReadableExportData; -import cbit.vcell.modeldb.DatabaseServerImpl; +import cbit.vcell.export.server.*; import cbit.vcell.resource.PropertyLoader; import cbit.vcell.simdata.DataServerImpl; import cbit.vcell.simdata.DataSetControllerImpl; import cbit.vcell.simdata.OutputContext; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.vertx.core.Vertx; -import io.vertx.core.WorkerExecutor; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -25,26 +18,23 @@ import org.vcell.restq.services.Exports.ExportService; import org.vcell.restq.services.Exports.ExportStatusCreator; import org.vcell.util.DataAccessException; -import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; -import javax.jms.JMSException; import java.io.File; import java.io.FileNotFoundException; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.*; @ApplicationScoped public class ExportRequestListenerMQ { private static final Logger logger = LogManager.getLogger(ExportRequestListenerMQ.class); - private final ArrayList acceptedJobs = new ArrayList<>(); - private WorkerExecutor workerExecutor; + private final ExportResource.ExportJob[] acceptedJobs = new ExportResource.ExportJob[100]; private final ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); + private final ScheduledExecutorService canceller = Executors.newSingleThreadScheduledExecutor(); private DataServerImpl dataServer; - + private TimeUnit waitUnit = TimeUnit.MINUTES; @Inject ExportService exportService; @@ -54,12 +44,9 @@ public class ExportRequestListenerMQ { ObjectMapper mapper; @Inject AgroalConnectionFactory connectionFactory; - @Inject - Vertx vertx; @PostConstruct void init() throws FileNotFoundException { - workerExecutor = vertx.createSharedWorkerExecutor("export-pool"); String primarySimDataDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, "/simdata"); String secondarySimDataDir = PropertyLoader.getProperty(PropertyLoader.secondarySimDataDirInternalProperty, "/simdata"); this.dataServer = new DataServerImpl(new DataSetControllerImpl(null, new File(primarySimDataDir), new File(secondarySimDataDir)), @@ -73,48 +60,45 @@ public CompletionStage consumeExportRequest(Message message) { String exportJobJSON = message.getPayload(); ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); startJob(exportJob); - acceptedJobs.add(exportJob); return message.ack(); } catch (Exception e) { logger.error(e); - throw new RuntimeException("Failed to setup JMS manually", e); + return message.nack(e); } } - public void startJob(ExportResource.ExportJob exportJob) { - threadPoolExecutor.submit(() -> { - try { - ExportSpecs exportSpecs = getExportSpecs(exportJob); - startExportJob(exportJob.user(), new OutputContext(exportJob.outputContext()), exportSpecs, exportJob.id()); - } catch (Exception e){ - logger.error(e); - exportStatusCreator.fireExportFailed(exportJob.id(), exportJob.vcdID(), - exportJob.format() == null ? null : exportJob.format().toString(), e.getMessage()); - } - }); + public CompletableFuture startJob(ExportResource.ExportJob exportJob) { + CompletableFuture future = CompletableFuture.runAsync(() -> { + try { + ExportSpecs exportSpecs = getExportSpecs(exportJob); + ExportServiceImpl.makeRemoteFile(new OutputContext(exportJob.outputContext()), exportJob.user(), dataServer, exportSpecs, exportStatusCreator, exportJob.id()); + } catch (SQLException | DataAccessException e) { + throw new RuntimeException(e); + } + }, threadPoolExecutor) + .orTimeout(15, waitUnit) + .exceptionally(ex -> { + exportStatusCreator.fireExportFailed(exportJob.id(), exportJob.vcdID(), + exportJob.format() == null ? null : exportJob.format().toString(), ex.getMessage()); + logger.error("Error thrown when trying to start export job", ex); + throw new RuntimeException(ex); + }); + return future; } private ExportSpecs getExportSpecs(ExportResource.ExportJob exportJob) throws SQLException, DataAccessException { GeometrySpecs geometrySpecs = new GeometrySpecs(exportJob.geometrySpecs().selections(), exportJob.geometrySpecs().axis(), exportJob.geometrySpecs().sliceNumber(), exportJob.geometrySpecs().geometryMode()); + Map subVolume = exportJob.formatSpecificSpecs() instanceof N5Specs n5ExportRequest ? + n5ExportRequest.getSubVolumeMapping() : null; HumanReadableExportData humanReadableExportData = new HumanReadableExportData(null, - null, null, null, null, null, false, exportJob.subVolume()); + null, null, null, null, null, false, subVolume); return new ExportSpecs(exportJob.vcdID(), exportJob.format(), exportJob.variableSpecs(), exportJob.timeSpecs(), geometrySpecs, exportJob.formatSpecificSpecs(), exportJob.simulationName(), exportJob.contextName(), humanReadableExportData); } - private void startExportJob(User user, OutputContext outputContext, ExportSpecs exportSpecs, long jobID) throws JMSException, JsonProcessingException { - try { - if (Thread.currentThread().getName().contains("event-loop")){ - throw new RuntimeException("EXPORTS ARE USING THE EVENT LOOP."); - } - ExportServiceImpl.makeRemoteFile(outputContext, user, dataServer, exportSpecs, exportStatusCreator, jobID); - } catch (DataAccessException e) { - throw new RuntimeException(e); - } + public void setThreadWaitTimeUnit(TimeUnit timeUnit) { + waitUnit = timeUnit; } - public ArrayList getAcceptedJobs(){ - return acceptedJobs; - } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index d910404150..2d80e795e7 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -1,52 +1,35 @@ package org.vcell.restq.handlers; -import cbit.image.VCImage; import cbit.rmi.event.ExportEvent; import cbit.vcell.export.server.*; import cbit.vcell.math.Variable; import cbit.vcell.math.VariableType; -import cbit.vcell.modeldb.SimulationRep; -import cbit.vcell.parser.Expression; -import cbit.vcell.parser.ExpressionException; import cbit.vcell.simdata.SpatialSelection; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.VCSimulationDataIdentifier; -import cbit.vcell.solver.VCSimulationIdentifier; import com.fasterxml.jackson.core.JsonProcessingException; import io.quarkus.security.identity.SecurityIdentity; -import io.quarkus.vertx.http.Compressed; import io.smallrye.mutiny.Multi; -import io.smallrye.mutiny.Uni; -import io.vertx.core.eventbus.EventBus; -import io.vertx.core.http.HttpServerRequest; import jakarta.annotation.security.RolesAllowed; import jakarta.inject.Inject; -import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.*; -import jakarta.ws.rs.core.Context; import jakarta.ws.rs.core.MediaType; import org.eclipse.microprofile.openapi.annotations.Operation; import org.jboss.resteasy.reactive.RestStreamElementType; -import org.vcell.restq.errors.exceptions.DataAccessWebException; -import org.vcell.restq.errors.exceptions.NotAuthenticatedWebException; -import org.vcell.restq.errors.exceptions.NotFoundWebException; -import org.vcell.restq.errors.exceptions.RuntimeWebException; +import org.vcell.restq.errors.exceptions.*; import org.vcell.restq.services.Exports.ExportService; import org.vcell.restq.services.SimulationRestService; import org.vcell.restq.services.UserRestService; import org.vcell.util.DataAccessException; import org.vcell.util.ObjectNotFoundException; -import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; -import javax.jms.JMSException; import java.sql.SQLException; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Map; import java.util.Set; -@Path("/api/v1/exports") +@Path("/api/v1/export") public class ExportResource { @Inject @@ -61,7 +44,7 @@ public class ExportResource { @Path("/history") @GET @RolesAllowed("user") - @Operation(operationId = "getExportHistory") + @Operation(operationId = "getExportHistory", hidden = true) public ExportHistory getExportHistory() throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); try { @@ -74,7 +57,7 @@ public ExportHistory getExportHistory() throws DataAccessWebException, NotAuthen @Path("/history") @DELETE @RolesAllowed("user") - @Operation(operationId = "deleteExportHistory") + @Operation(operationId = "deleteExportHistory", hidden = true) public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); try { @@ -88,13 +71,13 @@ public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, N @GET @RolesAllowed("user") @Produces(MediaType.APPLICATION_JSON) - @Operation(operationId = "exportStatus") - public Set pollExportStatus() throws DataAccessWebException, NotAuthenticatedWebException { + @Operation(operationId = "exportStatus", description = "Get the status of your most recent export jobs.") + public Set pollExportStatus() throws DataAccessWebException, NotAuthenticatedWebException, NotFoundWebException { User user = userRestService.getUserFromIdentity(securityIdentity); try{ return exportService.getMostRecentExportStatus(user); - } catch (DataAccessException e) { - throw new DataAccessWebException(e.getMessage(), e); + } catch (ObjectNotFoundException e) { + throw new NotFoundWebException(e.getMessage(), e); } } @@ -113,20 +96,26 @@ public Multi exportStatus(@PathParam("exportJobID") long exportJobI } } - @Path("") + + @Path("/N5") @POST @RolesAllowed("user") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) - @Operation(operationId = "export") - public long createExport(ExportRequest er) throws DataAccessWebException, NotAuthenticatedWebException { + @Operation(operationId = "exportN5", description = "Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications.") + public long createN5Export(N5ExportRequest er) throws DataAccessWebException, NotAuthenticatedWebException, UnprocessableContentWebException, BadRequestWebException { User user = userRestService.getUserFromIdentity(securityIdentity); try{ - ExportJob exportJob = exportService.createExportJobFromRequest(user, er); + N5Specs n5Specs = new N5Specs(er.exportableDataType(), ExportFormat.N5, er.datasetName, er.subVolume); + ExportJob exportJob = exportService.createExportJobFromRequest(user, er.standardExportInformation, n5Specs, ExportFormat.N5); exportService.addExportJobToQueue(exportJob); return exportJob.id(); - } catch (JMSException | JsonProcessingException | DataAccessException | SQLException e) { - throw new RuntimeWebException(e.getMessage(), e); + } catch ( JsonProcessingException e) { + throw new UnprocessableContentWebException(e.getMessage(), e); + } catch (DataAccessException e){ + throw new DataAccessWebException(e.getMessage(), e); + } catch (SQLException e){ + throw new BadRequestWebException(e.getMessage(), e); } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index aa8fb99026..a4fa301689 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -1,6 +1,8 @@ package org.vcell.restq.services.Exports; import cbit.rmi.event.ExportEvent; +import cbit.vcell.export.server.ExportFormat; +import cbit.vcell.export.server.FormatSpecificSpecs; import cbit.vcell.export.server.JobRequest; import cbit.vcell.modeldb.DatabaseServerImpl; import cbit.vcell.modeldb.SimulationRep; @@ -27,7 +29,6 @@ import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; -import javax.jms.JMSException; import java.io.FileNotFoundException; import java.sql.SQLException; import java.util.Set; @@ -65,7 +66,7 @@ public void addExportHistory(User user, ExportResource.ExportHistory history) th databaseServer.addExportHistory(user, history.exportHistory()); } - public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JMSException, JsonProcessingException { + public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException { exportStatusCreator.addServerExportListener(exportJob.user(), exportJob.id()); exportJobEmitter.send(jsonMapper.writeValueAsString(exportJob)); } @@ -78,24 +79,27 @@ public Set getMostRecentExportStatus(User user) throws ObjectNotFou return exportStatusCreator.getMostRecentExportStatus(user); } - public ExportResource.ExportJob createExportJobFromRequest(User user, ExportResource.ExportRequest request) throws SQLException, DataAccessException { - SimulationRep simulationRep = simulationRestService.getSimulationRep(new KeyValue(request.simulationID())); + public ExportResource.ExportJob createExportJobFromRequest(User user, ExportResource.StandardExportInfo request, FormatSpecificSpecs formatSpecificSpecs, ExportFormat format) throws DataAccessException, SQLException { + SimulationRep simulationRep = simulationRestService.getSimulationRep(new KeyValue(request.simulationKey())); VCSimulationIdentifier simulationIdentifier = new VCSimulationIdentifier(simulationRep.getKey(), simulationRep.getOwner()); VCSimulationDataIdentifier dataIdentifier = new VCSimulationDataIdentifier(simulationIdentifier, request.simulationJob()); JobRequest newExportJob = JobRequest.createExportJobRequest(user); long exportID = newExportJob.getExportJobID(); - AnnotatedFunction[] annotatedFunctions = request.outputContext().stream().map( - dto -> { - try { - return new AnnotatedFunction(dto.functionName(), new Expression(dto.functionExpression()), dto.domain(), dto.error(), - dto.functionType(), dto.category()); - } catch (ExpressionException e) { - throw new RuntimeWebException(e.getMessage(), e); + AnnotatedFunction[] annotatedFunctions = {}; + if (request.outputContext() != null){ + annotatedFunctions = request.outputContext().stream().map( + dto -> { + try { + return new AnnotatedFunction(dto.functionName(), new Expression(dto.functionExpression()), dto.domain(), dto.error(), + dto.functionType(), dto.category()); + } catch (ExpressionException e) { + throw new RuntimeWebException(e.getMessage(), e); + } } - } - ).toArray(AnnotatedFunction[]::new); - return new ExportResource.ExportJob(exportID, user, annotatedFunctions, dataIdentifier, request.exportFormat(), - request.variableSpecs(), request.timeSpecs(), request.geometrySpecs(), request.formatSpecificSpecs(), request.subVolume(), request.simulationName(), request.contextName()); + ).toArray(AnnotatedFunction[]::new); + } + return new ExportResource.ExportJob(exportID, user, annotatedFunctions, dataIdentifier, format, + request.variableSpecs(), request.timeSpecs(), request.geometrySpecs(), formatSpecificSpecs, request.simulationName(), request.contextName()); } } From dc62b351e4232dce154ec776bf50a4ea3b80d379 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 28 Jul 2025 10:09:28 -0400 Subject: [PATCH 19/41] DTO Updates --- .../events/ExportHumanReadableDataSpec.java | 5 ++-- .../org/vcell/api/types/utils/DTOOldAPI.java | 2 +- .../vcell/client/ClientRequestManager.java | 7 ++--- .../vcell/client/data/ExportSettings.java | 2 +- .../vcell/client/data/PDEExportDataPanel.java | 8 +++++- .../export/gui/ExportMonitorPanelTest.java | 5 ++-- .../export/gui/ExportMonitorTableModel.java | 14 ++++++---- .../main/java/cbit/rmi/event/ExportEvent.java | 28 +++++++++++++++---- .../java/cbit/rmi/event/MessageEvent.java | 6 ---- .../vcell/export/server/ExportSpecss.java | 24 ++++++++++++++++ .../server/HumanReadableExportData.java | 5 ++-- .../cbit/vcell/export/server/N5Specs.java | 15 +++++++--- .../export/server/OldExportEventCreator.java | 10 +++---- .../cbit/vcell/geometry/AnalyticCurve.java | 20 ++++++++++++- .../cbit/vcell/geometry/CompositeCurve.java | 4 ++- .../vcell/geometry/ControlPointCurve.java | 5 +++- .../vcell/geometry/CurveSelectionInfo.java | 22 +++++++++++++++ .../cbit/vcell/geometry/SampledCurve.java | 4 ++- .../main/java/cbit/vcell/geometry/Spline.java | 4 ++- .../cbit/vcell/simdata/SpatialSelection.java | 4 +++ .../simdata/SpatialSelectionContour.java | 7 ++++- .../simdata/SpatialSelectionMembrane.java | 16 +++++++++-- .../vcell/simdata/SpatialSelectionVolume.java | 7 ++++- .../java/cbit/vcell/parser/Expression.java | 3 ++ .../vcell/restq/handlers/ExportResource.java | 18 ++++++------ .../restq/openapi/ObjectMapperCustomizer.java | 14 ++++++++++ .../services/Exports/ExportStatusCreator.java | 13 +++++---- 27 files changed, 209 insertions(+), 63 deletions(-) diff --git a/vcell-api-types/src/main/java/org/vcell/api/types/events/ExportHumanReadableDataSpec.java b/vcell-api-types/src/main/java/org/vcell/api/types/events/ExportHumanReadableDataSpec.java index 5987471191..4fbea677d1 100644 --- a/vcell-api-types/src/main/java/org/vcell/api/types/events/ExportHumanReadableDataSpec.java +++ b/vcell-api-types/src/main/java/org/vcell/api/types/events/ExportHumanReadableDataSpec.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; public class ExportHumanReadableDataSpec { public final String bioModelName; @@ -11,14 +12,14 @@ public class ExportHumanReadableDataSpec { public String serverSavedFileName; public String applicationType; public boolean nonSpatial; - public HashMap subVolume; + public Map subVolume; public int zSlices; public int tSlices; public int numChannels; public ExportHumanReadableDataSpec(String bioModelName, String applicationName, String simulationName, ArrayList differentParameterValues, - String serverSavedFileName, String applicationType, boolean nonSpatial, HashMap subVolume, + String serverSavedFileName, String applicationType, boolean nonSpatial, Map subVolume, int zSlices, int tSlices, int numChannels){ this.bioModelName = bioModelName; this.applicationName = applicationName; diff --git a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java index 7c7ebf9a1e..6d29f743bc 100644 --- a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java +++ b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java @@ -69,7 +69,7 @@ public static ExportEvent exportEventFromJsonRep(Object eventSource, ExportEvent } ExportEvent event = new ExportEvent( eventSource, rep.jobid, user, - rep.dataIdString, new KeyValue(rep.dataKey), rep.eventType, + rep.dataIdString, new KeyValue(rep.dataKey), ExportSpecss.ExportProgressType.getExportProgressType(rep.eventType), rep.format, rep.location, rep.progress, timeSpecs, variableSpecs); event.setHumanReadableExportData(humanReadableExportData1); diff --git a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java index dcd6f56719..99245b4cfa 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java @@ -33,10 +33,7 @@ import cbit.vcell.clientdb.DocumentManager; import cbit.vcell.desktop.ClientLogin; import cbit.vcell.desktop.ImageDbTreePanel; -import cbit.vcell.export.server.ExportFormat; -import cbit.vcell.export.server.ExportSpecs; -import cbit.vcell.export.server.HumanReadableExportData; -import cbit.vcell.export.server.N5Specs; +import cbit.vcell.export.server.*; import cbit.vcell.field.FieldDataFileConversion; import cbit.vcell.field.io.FieldData; import cbit.vcell.geometry.*; @@ -2819,7 +2816,7 @@ public void exportDocument(TopLevelWindowManager manager, FileFilter forceFilefi } public void exportMessage(ExportEvent event) { - if (event.getEventTypeID() == ExportEvent.EXPORT_COMPLETE) { + if (event.getEventType() == ExportSpecss.ExportProgressType.EXPORT_COMPLETE) { // try to download the thing if(!Objects.equals(event.getFormat(), ExportFormat.N5.name())){ downloadExportedData(getMdiManager().getFocusedWindowManager().getComponent(), getUserPreferences(), event); diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java b/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java index 9ab93ec29c..4c24831334 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java @@ -33,7 +33,7 @@ public class ExportSettings implements ASCIISettingsPanelListener, RasterSetting protected transient java.beans.PropertyChangeSupport propertyChange; private ExportFormat fieldSelectedFormat; private cbit.vcell.export.server.FormatSpecificSpecs fieldFormatSpecificSpecs = null; - private ExportSpecss.SimulationDataType fieldSimDataType = null; + private ExportSpecss.SimulationDataType fieldSimDataType = ExportSpecss.SimulationDataType.NO_DATA_AVAILABLE; private JPanel ivjJDialogContentPane = null; private JDialog ivjJDialogASCIISettings = null; private JDialog ivjJDialogMediaSettings = null; diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java index 5679d926b9..4f6b8cbec0 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java @@ -665,13 +665,19 @@ private ExportSpecs getExportSpecs() { } } - String serverSavedFileName = getExportSettings1().getFormatSpecificSpecs() instanceof N5Specs ? ((N5Specs) getExportSettings1().getFormatSpecificSpecs()).dataSetName : ""; boolean nonSpatial = sc.getGeometry().getDimension() == 0; HashMap subVolumes = new HashMap<>(); for(SubVolume subVolume: sc.getGeometry().getGeometrySpec().getSubVolumes()){ subVolumes.put(subVolume.getHandle(), subVolume.getName()); } + + String serverSavedFileName = ""; + if (getExportSettings1().getFormatSpecificSpecs() instanceof N5Specs n5Specs){ + serverSavedFileName = n5Specs.dataSetName; + n5Specs.subVolumeMapping = subVolumes; + } + HumanReadableExportData humanReadableExportData = new HumanReadableExportData(getSimulation().getName(), sc.getName(), sc.getBioModel().getName(), differentParameterValues, serverSavedFileName, sc.getApplicationType().name(), nonSpatial, subVolumes); GeometrySpecs geometrySpecs = new GeometrySpecs(selections, getNormalAxis(), getSlice(), geoMode); diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java index ccd5b8c88d..56ef54de72 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java @@ -16,6 +16,7 @@ */ import javax.swing.JFrame; +import cbit.vcell.export.server.ExportSpecss; import org.vcell.util.document.KeyValue; import cbit.rmi.event.ExportEvent; @@ -45,13 +46,13 @@ public void windowClosing(java.awt.event.WindowEvent e) { VCSimulationDataIdentifier vcSimDataId = new VCSimulationDataIdentifier(new VCSimulationIdentifier(new KeyValue("234"), null),1); aExportMonitorPanel.addExportEvent(new ExportEvent( aExportMonitorPanel, 123456789L, null, - vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEvent.EXPORT_PROGRESS, + vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportSpecss.ExportProgressType.EXPORT_PROGRESS, "CSV", "", new Double(0.47), null, null), "bogus [application: model]"); aExportMonitorPanel.addExportEvent(new ExportEvent( aExportMonitorPanel, 987654321L, null, - vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEvent.EXPORT_COMPLETE, + vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportSpecss.ExportProgressType.EXPORT_COMPLETE, "GIF", "http://nrcam.uchc.edu/export/987654321.zip", new Double(1), null, null), "simulation [application: model]"); diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java index a357f8c550..9ce9088988 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java @@ -17,6 +17,8 @@ import cbit.rmi.event.ExportEvent; import cbit.vcell.export.ExportStatus; +import cbit.vcell.export.server.ExportSpecss.ExportProgressType; + /** * Insert the type's description here. * Creation date: (4/4/2001 12:14:46 PM) @@ -67,25 +69,25 @@ public int addExportEvent(String resultSetID, ExportEvent event) { // now update the cells exportStatus.setFormat(event.getFormat()); exportStatus.setDestination(event.getLocation()); - switch (event.getEventTypeID()) { - case cbit.rmi.event.ExportEvent.EXPORT_START: { + switch (event.getEventType()) { + case EXPORT_START: { exportStatus.getProgressBar().setString("Starting export..."); break; } - case cbit.rmi.event.ExportEvent.EXPORT_PROGRESS: { + case EXPORT_PROGRESS: { exportStatus.getProgressBar().setValue((int)(event.getProgress().doubleValue() * 100)); exportStatus.getProgressBar().setString(null); break; } - case cbit.rmi.event.ExportEvent.EXPORT_ASSEMBLING: { + case EXPORT_ASSEMBLING: { exportStatus.getProgressBar().setString("Building export file..."); break; } - case cbit.rmi.event.ExportEvent.EXPORT_FAILURE: { + case EXPORT_FAILURE: { exportStatus.getProgressBar().setString("Export failed!"); break; } - case cbit.rmi.event.ExportEvent.EXPORT_COMPLETE: { + case EXPORT_COMPLETE: { exportStatus.getProgressBar().setValue(100); exportStatus.getProgressBar().setString("Complete"); exportStatus.setComplete(Boolean.TRUE); diff --git a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java index d14f49a501..feadcd02e6 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java @@ -10,9 +10,12 @@ package cbit.rmi.event; +import cbit.vcell.export.server.ExportSpecss; import cbit.vcell.export.server.HumanReadableExportData; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; @@ -23,21 +26,32 @@ * This is the event class to support the cbit.vcell.desktop.controls.ExportListener interface. */ public class ExportEvent extends MessageEvent { - private final int eventType; + @JsonProperty(value = "eventType") + private final ExportSpecss.ExportProgressType eventType; + @JsonProperty(value = "progress") private final Double progress; + @JsonProperty(value = "format") private final String format; + @JsonProperty(value = "location") private final String location; + @JsonProperty(value = "user") private final User user; + @JsonProperty(value = "jobID") private final long jobID; + @JsonProperty(value = "dataKey") private final KeyValue dataKey; + @JsonProperty(value = "dataIdString") private final String dataIdString; + @JsonProperty(value = "timeSpecs") private final TimeSpecs timeSpecs; + @JsonProperty(value = "variableSpecs") private final VariableSpecs variableSpecs; + @JsonIgnore private HumanReadableExportData humanReadableExportData = null; public ExportEvent(Object source, long jobID, User user, - VCDataIdentifier vcDataId, int argEventType, + VCDataIdentifier vcDataId, ExportSpecss.ExportProgressType argEventType, String format, String location, Double argProgress, TimeSpecs timeSpecs, VariableSpecs variableSpecs) { @@ -47,7 +61,7 @@ public ExportEvent(Object source, long jobID, User user, } public ExportEvent(Object source, long jobID, User user, - String dataIdString, KeyValue dataKey, int argEventType, + String dataIdString, KeyValue dataKey, ExportSpecss.ExportProgressType argEventType, String format, String location, Double argProgress, TimeSpecs timeSpecs, VariableSpecs variableSpecs) { super(source, new MessageSource(source, dataIdString), new MessageData(argProgress)); @@ -69,7 +83,12 @@ public ExportEvent(Object source, long jobID, User user, * Creation date: (1/4/01 1:24:16 PM) * @return int */ +@JsonIgnore public int getEventTypeID() { + return eventType.intValue; +} + +public ExportSpecss.ExportProgressType getEventType() { return eventType; } @@ -127,7 +146,6 @@ public KeyValue getDataKey() { return dataKey; } - public String getDataIdString() { return dataIdString; } @@ -144,7 +162,7 @@ public boolean isSupercededBy(MessageEvent messageEvent) { if (messageEvent instanceof ExportEvent){ ExportEvent exportEvent = (ExportEvent)messageEvent; - if (eventType == EXPORT_PROGRESS && exportEvent.eventType == EXPORT_PROGRESS){ + if (eventType == ExportSpecss.ExportProgressType.EXPORT_PROGRESS && exportEvent.eventType == ExportSpecss.ExportProgressType.EXPORT_PROGRESS){ if (getProgress() < exportEvent.getProgress()){ return true; } diff --git a/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java b/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java index 7e0e69ea66..c423de9706 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/MessageEvent.java @@ -22,12 +22,6 @@ public abstract class MessageEvent extends java.util.EventObject { private MessageSource messageSource = null; @JsonIgnore private MessageData messageData = null; - - public final static int EXPORT_PROGRESS = 1004; - public final static int EXPORT_ASSEMBLING = 1005; - public final static int EXPORT_FAILURE = 1006; - public final static int EXPORT_COMPLETE = 1007; - public final static int EXPORT_START = 1008; public final static int POLLING_STAT = 1009; public final static int SAVING_STAT = 1010; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java index 2a34048ecf..0b643d34a9 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java @@ -113,6 +113,30 @@ public enum SimulationDataType { } } + public enum ExportProgressType { + EXPORT_START(1008), + EXPORT_COMPLETE(1007), + EXPORT_FAILURE(1006), + EXPORT_ASSEMBLING(1005), + EXPORT_PROGRESS(1004); + + public static ExportProgressType getExportProgressType(int i) { + switch (i) { + case 1008: return EXPORT_START; + case 1007: return EXPORT_COMPLETE; + case 1006: return EXPORT_FAILURE; + case 1005: return EXPORT_ASSEMBLING; + case 1004: return EXPORT_PROGRESS; + } + throw new IllegalArgumentException("Unknown ExportProgressType int value: " + i); + } + + public final int intValue; + ExportProgressType(int i){ + intValue = i; + } + } + public enum MirroringMethod { NO_MIRRORING(0), MIRROR_LEFT(1), diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java b/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java index 34122f0938..46b7ede6f5 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java @@ -3,6 +3,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; public class HumanReadableExportData implements Serializable { public final String simulationName; @@ -13,13 +14,13 @@ public class HumanReadableExportData implements Serializable { // File name that is saved by the user or server. In N5 case it'll be the dataset name. This way individual datasets can be automatically opened public String serverSavedFileName; public boolean nonSpatial; - public HashMap subVolume; + public Map subVolume; public int zSlices; public int tSlices; public int numChannels; public HumanReadableExportData(String simulationName, String applicationName, String biomodelName, ArrayList differentParameterValues, - String serverSavedFileName, String applicationType, boolean nonSpatial, HashMap subVolume){ + String serverSavedFileName, String applicationType, boolean nonSpatial, Map subVolume){ this.simulationName = simulationName; this.applicationName = applicationName; this.biomodelName = biomodelName; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java index 9cf6cdac6f..624958b88d 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java @@ -27,6 +27,7 @@ import java.io.Serializable; import java.nio.file.Path; import java.util.HashMap; +import java.util.Map; /** * This type was created in VisualAge. @@ -36,6 +37,7 @@ public class N5Specs extends FormatSpecificSpecs implements Serializable { private final ExportFormat formatType; private final ExportSpecss.ExportableDataType dataType; + public Map subVolumeMapping; @JsonIgnore private final CompressionLevel compression; @@ -60,18 +62,23 @@ public N5Specs(ExportSpecss.ExportableDataType dataType, ExportFormat format, this.dataType = dataType; this.compression = compressionLevel; this.dataSetName = dataSetName; + this.subVolumeMapping = null; // it gets set within the HumanReadableExportData } @JsonCreator public N5Specs(@JsonProperty("dataType") ExportSpecss.ExportableDataType dataType, @JsonProperty("format") ExportFormat format, - @JsonProperty("dataSetName") String dataSetName){ + @JsonProperty("dataSetName") String dataSetName, @JsonProperty("subVolumeMapping") Map subVolumeMapping) { super("N5"); this.formatType = format; this.dataType = dataType; this.dataSetName = dataSetName; this.compression = CompressionLevel.BZIP; + this.subVolumeMapping = subVolumeMapping; } + public Map getSubVolumeMapping() { + return subVolumeMapping; + } /** * This method was created in VisualAge. * @return int @@ -115,7 +122,7 @@ public String toString() { } public static void writeImageJMetaData(long jobID,long[] dimensions, int[] blockSize, Compression compression, N5FSWriter n5FSWriter, String datasetName, int numChannels, int zSlices, - int timeLength, HashMap maskMapping, double pixelHeight, + int timeLength, Map maskMapping, double pixelHeight, double pixelWidth, double pixelDepth, String unit, HashMap channelInfo) throws MathException, DataAccessException { try { HashMap compresssionMap = new HashMap<>(){{put("type", compression.getType().toLowerCase());}}; @@ -135,14 +142,14 @@ public static void writeImageJMetaData(long jobID,long[] dimensions, int[] block record ImageJMetaData(long[] dimensions ,int[] blockSize, HashMap compression, String dataType, String name, double fps, double frameInterval, double pixelWidth, double pixelHeight, double pixelDepth, double xOrigin, double yOrigin, double zOrigin, int numChannels, int numSlices, int numFrames, - int type, String unit, HashMap maskMapping, HashMap channelInfo){ + int type, String unit, Map maskMapping, HashMap channelInfo){ // https://github.com/saalfeldlab/n5 //https://imagej.nih.gov/ij/developer/api/ij/ij/ImagePlus.html#getType() Grayscale with float types //https://imagej.nih.gov/ij/developer/api/ij/ij/measure/Calibration.html#getUnit() public static ImageJMetaData generateDefaultRecord(long[] dimensions ,int[] blockSize, HashMap compression, String dataSetName, int numChannels, - int numSlices, int numFrames, HashMap maskMapping, double pixelHeight, double pixelWidth, + int numSlices, int numFrames, Map maskMapping, double pixelHeight, double pixelWidth, double pixelDepth, String unit, HashMap channelInfo){ return new ImageJMetaData(dimensions, blockSize, compression, DataType.FLOAT64.name().toLowerCase() ,dataSetName, 0.0, 0.0, pixelWidth, pixelHeight, pixelDepth, 0.0, 0.0, 0.0, numChannels, numSlices, numFrames, 2, unit, maskMapping, channelInfo); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java b/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java index 76d123d4c8..51b9a44824 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java @@ -42,7 +42,7 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin throw new RuntimeException("unexpected VCDataIdentifier"); } ExportEvent event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, + this, jobID, user, vcdID.getID(), dataKey, ExportSpecss.ExportProgressType.EXPORT_COMPLETE, format, location, null, timeSpecs, varSpecs); event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); fireExportEvent(event); @@ -56,7 +56,7 @@ public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String form if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_ASSEMBLING, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); fireExportEvent(event); } @@ -80,7 +80,7 @@ public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); fireExportEvent(event); } @@ -90,7 +90,7 @@ public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_PROGRESS, format, null, new Double(progress), null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_PROGRESS, format, null, new Double(progress), null, null); fireExportEvent(event); } @@ -101,7 +101,7 @@ public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_START, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_START, format, null, null, null, null); fireExportEvent(event); } diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java index 61c2705ca1..384c61c993 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/AnalyticCurve.java @@ -12,7 +12,10 @@ import java.util.Map; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; import org.vcell.util.Matchable; @@ -32,7 +35,7 @@ * exceptions in the abstract base class Curve...which violates * a fundamental OO design principle. */ -@Schema(allOf = {Curve.class}, requiredProperties = {"type"}) +@Schema(allOf = {Curve.class}, requiredProperties = {"type"}, properties = {@SchemaProperty(name = "type", type = SchemaType.STRING, defaultValue = "AnalyticCurve")}) public class AnalyticCurve extends Curve implements SymbolTable { private Expression expX = null; private Expression expY = null; @@ -239,4 +242,19 @@ public void getEntries(Map entryMap) { entryMap.put(ReservedParameterSymbol.getU().getName(), ReservedParameterSymbol.getU()); } +@JsonIgnore +public Expression getExpressionX(){ + return expX; +} + +@JsonIgnore +public Expression getExpressionY() { + return expY; +} + +@JsonIgnore +public Expression getExpressionZ() { + return expZ; +} + } diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java index 49bca12247..e098262793 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/CompositeCurve.java @@ -10,13 +10,15 @@ package cbit.vcell.geometry; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; /** * This type was created in VisualAge. */ -@Schema(allOf = {Curve.class}, requiredProperties = {"type"}) +@Schema(allOf = {Curve.class}, requiredProperties = {"type"}, properties = {@SchemaProperty(name = "type", type = SchemaType.STRING, defaultValue = "CompositeCurve")}) public class CompositeCurve extends Curve { java.util.Vector fieldCurves = new java.util.Vector (); /** diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java index ff01cab419..182079cd18 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/ControlPointCurve.java @@ -12,8 +12,10 @@ import java.util.Vector; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; /** @@ -29,7 +31,8 @@ @DiscriminatorMapping(value = "SampledCurve", schema = SampledCurve.class) }, discriminatorProperty = "type", - requiredProperties = {"type"} + requiredProperties = {"type"}, + properties = {@SchemaProperty(name = "type", type = SchemaType.STRING, defaultValue = "ControlPointCurve")} ) public abstract class ControlPointCurve extends Curve { private Vector controlPoints = new Vector(); diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java b/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java index d76d7c8aad..b1fc067c63 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/CurveSelectionInfo.java @@ -10,6 +10,8 @@ package cbit.vcell.geometry; +import com.fasterxml.jackson.annotation.JsonIgnore; + /** * Insert the type's description here. * Creation date: (10/15/00 1:10:11 PM) @@ -125,6 +127,7 @@ public boolean compareEqual(org.vcell.util.Matchable obj) { * @return The controlPoint property value. * @see #setControlPoint */ +@JsonIgnore public int getControlPoint() { return fieldControlPoint; } @@ -133,6 +136,7 @@ public int getControlPoint() { * @return The controlPointExtended property value. * @see #setControlPointExtended */ +@JsonIgnore public int getControlPointExtended() { return fieldControlPointExtended; } @@ -141,6 +145,7 @@ public int getControlPointExtended() { * @return The curve property value. * @see #setCurve */ +@JsonIgnore public Curve getCurve() { return fieldCurve; } @@ -150,6 +155,7 @@ public Curve getCurve() { * @return double * @param selectionU double */ +@JsonIgnore public double getCurveUfromSelectionU(double selectionU) { if (getType() != CurveSelectionType.SEGMENT.intValue){ throw new RuntimeException("CurveSelectionInfo.getCurveUfromSelectionU(), cannot call when type!=CurveSelectionType.SEGMENT"); @@ -220,6 +226,7 @@ public double getCurveUfromSelectionU(double selectionU) { * @return The directionNegative property value. * @see #setDirectionNegative */ +@JsonIgnore public boolean getDirectionNegative() { return fieldDirectionNegative; } @@ -228,6 +235,7 @@ public boolean getDirectionNegative() { * @return The segment property value. * @see #setSegment */ +@JsonIgnore public int getSegment() { return fieldSegment; } @@ -236,6 +244,7 @@ public int getSegment() { * Creation date: (7/18/01 5:49:24 PM) * @return int */ +@JsonIgnore public int getSegmentCount() { int beginSeg = getSegment(); int endSeg = getSegmentExtended(); @@ -292,6 +301,7 @@ public int getSegmentCount() { * @return The segmentExtended property value. * @see #setSegmentExtended */ +@JsonIgnore public int getSegmentExtended() { return fieldSegmentExtended; } @@ -300,6 +310,7 @@ public int getSegmentExtended() { * @return The segment property value. * @see #setSegment */ +@JsonIgnore public int[] getSegmentsInSelectionOrder() { if(getSegmentCount() <= 0){ @@ -374,6 +385,7 @@ public int[] getSegmentsInSelectionOrder() { * @return The type property value. * @see #setType */ +@JsonIgnore public int getType() { return fieldType; } @@ -382,6 +394,7 @@ public int getType() { * @return The u property value. * @see #setU */ +@JsonIgnore public double getU() { return fieldU; } @@ -390,6 +403,7 @@ public double getU() { * @return The uExtended property value. * @see #setUExtended */ +@JsonIgnore public double getUExtended() { return fieldUExtended; } @@ -456,6 +470,7 @@ public boolean isSegmentSelected(int soi) { * @param controlPoint The new value for the property. * @see #getControlPoint */ +@JsonIgnore private void setControlPoint(int controlPoint) { fieldControlPoint = controlPoint; } @@ -464,6 +479,7 @@ private void setControlPoint(int controlPoint) { * @param curve The new value for the property. * @see #getCurve */ +@JsonIgnore private void setCurve(Curve curve) { Curve oldValue = fieldCurve; fieldCurve = curve; @@ -474,6 +490,7 @@ private void setCurve(Curve curve) { * @param directionNegative The new value for the property. * @see #getDirectionNegative */ +@JsonIgnore private void setDirectionNegative(boolean directionNegative) { fieldDirectionNegative = directionNegative; } @@ -482,6 +499,7 @@ private void setDirectionNegative(boolean directionNegative) { * @param segment The new value for the property. * @see #getSegment */ +@JsonIgnore private void setSegment(int segment) { fieldSegment = segment; } @@ -490,6 +508,7 @@ private void setSegment(int segment) { * @param segmentExtended The new value for the property. * @see #getSegmentExtended */ +@JsonIgnore public void setSegmentExtended(int segmentExtended) { if (getSegment() == NONE_SELECTED) { setSegment(segmentExtended); @@ -516,6 +535,7 @@ public void setSegmentExtended(int segmentExtended) { * @param type The new value for the property. * @see #getType */ +@JsonIgnore private void setType(int type) { int oldValue = fieldType; fieldType = type; @@ -526,6 +546,7 @@ private void setType(int type) { * @param u The new value for the property. * @see #getU */ +@JsonIgnore private void setU(double u) { fieldU = u; } @@ -534,6 +555,7 @@ private void setU(double u) { * @param uExtended The new value for the property. * @see #getUExtended */ +@JsonIgnore public void setUExtended(double uExtended) { if (getU() == NONE_SELECTED) { setU(uExtended); diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java b/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java index 9e89835e78..9ff46f1cdc 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/SampledCurve.java @@ -10,13 +10,15 @@ package cbit.vcell.geometry; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; /** * This type was created in VisualAge. */ -@Schema(allOf = {ControlPointCurve.class}, requiredProperties = {"type"}) +@Schema(allOf = {ControlPointCurve.class}, requiredProperties = {"type"}, properties = {@SchemaProperty(name = "type", type = SchemaType.STRING, defaultValue = "SampledCurve")}) public class SampledCurve extends ControlPointCurve { /** * SampledCurve constructor comment. diff --git a/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java b/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java index 75f0ae7b3e..885e048966 100644 --- a/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java +++ b/vcell-core/src/main/java/cbit/vcell/geometry/Spline.java @@ -10,13 +10,15 @@ package cbit.vcell.geometry; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; /** * This type was created in VisualAge. */ -@Schema(allOf = {ControlPointCurve.class}, requiredProperties = {"type"}) +@Schema(allOf = {ControlPointCurve.class}, requiredProperties = {"type"}, properties = {@SchemaProperty(name = "type", type = SchemaType.STRING, defaultValue = "Spline")}) public class Spline extends ControlPointCurve { /** * Insert the method's description here. diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java index 4a87bf7c3b..a227ac4011 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelection.java @@ -10,6 +10,7 @@ package cbit.vcell.simdata; import cbit.vcell.export.server.*; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.eclipse.microprofile.openapi.annotations.media.DiscriminatorMapping; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Coordinate; @@ -183,6 +184,7 @@ public cbit.vcell.geometry.CurveSelectionInfo getCurveSelectionInfo() { * @return int * @param u double */ +@JsonIgnore public abstract int getIndex(double u); @@ -191,6 +193,7 @@ public cbit.vcell.geometry.CurveSelectionInfo getCurveSelectionInfo() { * Creation date: (7/18/2001 3:14:22 PM) * @return double */ +@JsonIgnore public abstract double getLengthInMicrons(); @@ -199,6 +202,7 @@ public cbit.vcell.geometry.CurveSelectionInfo getCurveSelectionInfo() { * Creation date: (4/2/2001 1:54:58 PM) * @return cbit.vcell.solvers.CartesianMesh */ +@JsonIgnore public cbit.vcell.solvers.CartesianMesh getMesh() { return mesh; } diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java index de2ec2d6e9..eea773ea60 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java @@ -11,14 +11,17 @@ package cbit.vcell.simdata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; /** * Insert the type's description here. * Creation date: (7/18/2001 2:39:54 PM) * @author: Frank Morgan */ -@Schema(allOf = {SpatialSelection.class}) +@Schema(allOf = {SpatialSelection.class}, properties = {@SchemaProperty(name = "type", defaultValue = "Contour", type = SchemaType.STRING)}) public class SpatialSelectionContour extends SpatialSelection { private int[] fieldSampledDataIndexes = null; /** @@ -48,6 +51,7 @@ public SpatialSelectionContour(cbit.vcell.geometry.CurveSelectionInfo argCurveSe * @return int * @param u double */ +@JsonIgnore public int getIndex(double selectionU) { int index = -1; @@ -132,6 +136,7 @@ public int[] getIndexSamples() { * Creation date: (7/18/2001 3:29:48 PM) * @return double */ +@JsonIgnore public double getLengthInMicrons() { return getCurveSelectionInfo().getCurve().getSpatialLength(); } diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java index a4a33c3a70..268e12f87b 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionMembrane.java @@ -10,6 +10,8 @@ package cbit.vcell.simdata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; @@ -21,9 +23,10 @@ * Creation date: (7/18/2001 2:39:54 PM) * @author: Frank Morgan */ -@Schema(allOf = {SpatialSelection.class}) +@Schema(allOf = {SpatialSelection.class}, requiredProperties = "type", properties = {@SchemaProperty(name = "type", defaultValue = "Membrane", type = SchemaType.STRING)}) public class SpatialSelectionMembrane extends SpatialSelection { private int[] fieldSampledDataIndexes = null; + @JsonProperty(value = "selectionSource") private cbit.vcell.geometry.SampledCurve selectionSource = null; /** * SpatialSelectionGeometry constructor comment. @@ -62,6 +65,7 @@ public SpatialSelectionMembrane( * @return int * @param u double */ +@JsonIgnore public int getIndex(double selectionU) { int index = -1; @@ -78,6 +82,7 @@ public int getIndex(double selectionU) { * Creation date: (7/18/01 5:59:31 PM) * @return int[] */ +@JsonIgnore public SSHelper getIndexSamples() { int[] membraneSegmentSelectionIndexes = getCurveSelectionInfo().getSegmentsInSelectionOrder(); @@ -160,6 +165,7 @@ public SSHelper getIndexSamples() { * Creation date: (7/18/2001 3:29:48 PM) * @return double */ +@JsonIgnore public double getLengthInMicrons() { double[] segmentLengths = getSegmentLengths(); double length = 0.0; @@ -173,6 +179,7 @@ public double getLengthInMicrons() { * Creation date: (7/14/2004 2:54:03 PM) * @return double[] */ +@JsonIgnore public double[] getSegmentLengths() { int[] membraneSegmentSelectionIndexes = getCurveSelectionInfo().getSegmentsInSelectionOrder(); double[] segmentLengths = new double[membraneSegmentSelectionIndexes.length]; @@ -181,7 +188,12 @@ public double[] getSegmentLengths() { } return segmentLengths; } -/** + + public int[] getFieldSampledDataIndexes() { + return fieldSampledDataIndexes; + } + + /** * Insert the method's description here. * Creation date: (10/23/2004 12:11:37 PM) * @return cbit.vcell.geometry.SampledCurve diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java index 29e01df177..e8422ebd28 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java @@ -13,7 +13,10 @@ import java.util.Arrays; import java.util.Vector; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; +import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.vcell.util.Coordinate; import org.vcell.util.CoordinateIndex; @@ -26,7 +29,7 @@ * Creation date: (7/18/2001 2:39:21 PM) * @author: Frank Morgan */ -@Schema(allOf = {SpatialSelection.class}) +@Schema(allOf = {SpatialSelection.class}, properties = {@SchemaProperty(name = "type", defaultValue = "Volume", type = SchemaType.STRING)}) public class SpatialSelectionVolume extends SpatialSelection { public SpatialSelectionVolume(cbit.vcell.geometry.CurveSelectionInfo argCurveSelectionInfo, cbit.vcell.math.VariableType argVarType, cbit.vcell.solvers.CartesianMesh argMesh) { @@ -86,6 +89,7 @@ private CoordinateIndex getCoordinateIndexFromWC(Coordinate wc) { return getMesh().getCoordinateIndexFromFractionalIndex(fi); } +@JsonIgnore public int getIndex(double u) { return getConvertedIndexFromU(u); @@ -211,6 +215,7 @@ public SSHelper getIndexSamples(double begin,double end) { * Creation date: (2/28/2001 2:29:30 AM) * @return double */ +@JsonIgnore public double getLengthInMicrons() { return getIndexSamples(0.0,1.0).getWorldCoordinateTotalLength(); diff --git a/vcell-math/src/main/java/cbit/vcell/parser/Expression.java b/vcell-math/src/main/java/cbit/vcell/parser/Expression.java index d4b3fdc06d..e876330ad5 100644 --- a/vcell-math/src/main/java/cbit/vcell/parser/Expression.java +++ b/vcell-math/src/main/java/cbit/vcell/parser/Expression.java @@ -17,6 +17,8 @@ import jscl.math.Generic; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; +import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.vcell.util.Issue.IssueSource; import org.vcell.util.Matchable; @@ -25,6 +27,7 @@ import net.sourceforge.interval.ia_math.RealInterval; @SuppressWarnings("serial") +@Schema(type = SchemaType.STRING) public class Expression implements java.io.Serializable, org.vcell.util.Matchable, IssueSource { private final static Logger logger = LogManager.getLogger(Expression.class); diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index 2d80e795e7..7f3fd6ae47 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -119,15 +119,18 @@ public long createN5Export(N5ExportRequest er) throws DataAccessWebException, No } } + public record N5ExportRequest( + StandardExportInfo standardExportInformation, + Map subVolume, + ExportSpecss.ExportableDataType exportableDataType, + String datasetName + ){ } - public record ExportRequest( - ArrayList outputContext, ExportFormat exportFormat, - String simulationID, int simulationJob, - FormatSpecificSpecs formatSpecificSpecs, + public record StandardExportInfo( + ArrayList outputContext, String contextName, + String simulationName, String simulationKey, int simulationJob, GeometrySpecDTO geometrySpecs, - TimeSpecs timeSpecs, VariableSpecs variableSpecs, - HashMap subVolume, - String simulationName, String contextName + TimeSpecs timeSpecs, VariableSpecs variableSpecs ){ } public record AnnotatedFunctionDTO( @@ -151,7 +154,6 @@ public record ExportJob( ExportFormat format, VariableSpecs variableSpecs, TimeSpecs timeSpecs, GeometrySpecDTO geometrySpecs, FormatSpecificSpecs formatSpecificSpecs, - HashMap subVolume, String simulationName,String contextName ){ } diff --git a/vcell-rest/src/main/java/org/vcell/restq/openapi/ObjectMapperCustomizer.java b/vcell-rest/src/main/java/org/vcell/restq/openapi/ObjectMapperCustomizer.java index dadf9f5865..fc8d227281 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/openapi/ObjectMapperCustomizer.java +++ b/vcell-rest/src/main/java/org/vcell/restq/openapi/ObjectMapperCustomizer.java @@ -1,5 +1,6 @@ package org.vcell.restq.openapi; +import cbit.vcell.parser.Expression; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; @@ -17,6 +18,7 @@ public class ObjectMapperCustomizer implements io.quarkus.jackson.ObjectMapperCu public void customize(ObjectMapper objectMapper) { SimpleModule myModule = new SimpleModule(); myModule.addSerializer(KeyValue.class, new KeyValueSerializer()); + myModule.addSerializer(Expression.class, new ExpressionSerializer()); objectMapper.registerModule(myModule); } @@ -31,4 +33,16 @@ public void serialize(KeyValue kv, JsonGenerator jsonGenerator, SerializerProvid jsonGenerator.writeString(kv.toString()); } } + + private static class ExpressionSerializer extends StdSerializer { + + public ExpressionSerializer() { + super(Expression.class); + } + + @Override + public void serialize(Expression ex, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + jsonGenerator.writeString(ex.infix()); + } + } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java index 901b9d9e50..df1711ff71 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java @@ -4,6 +4,7 @@ import cbit.rmi.event.ExportListener; import cbit.rmi.event.ExportStatusEventCreator; import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.export.server.ExportSpecss; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; import cbit.vcell.solver.VCSimulationDataIdentifier; @@ -49,7 +50,7 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin throw new RuntimeException("unexpected VCDataIdentifier"); } ExportEvent event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportEvent.EXPORT_COMPLETE, + this, jobID, user, vcdID.getID(), dataKey, ExportSpecss.ExportProgressType.EXPORT_COMPLETE, format, location, null, timeSpecs, varSpecs); event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); @@ -94,7 +95,7 @@ public synchronized void addServerExportListener(User user, long exportJobID){ listeners.put(key, emitter); jobRequestToUser.put(exportJobID, user); ExportEvent event = new ExportEvent( - this, exportJobID, user, "", null, ExportEvent.EXPORT_ASSEMBLING, + this, exportJobID, user, "", null, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, "", "", 0.0, null, null); if (!mostRecentExportEvents.containsKey(user)) { mostRecentExportEvents.put(user, new HashSet<>()); @@ -104,7 +105,7 @@ public synchronized void addServerExportListener(User user, long exportJobID){ public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_ASSEMBLING, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); fireExportEvent(event); } @@ -124,7 +125,7 @@ public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, St if (!listeners.containsKey(key)) { throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_FAILURE, format, message, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); listeners.get(key).onNext(event); listeners.get(key).complete(); @@ -136,14 +137,14 @@ public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, St public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_PROGRESS, format, null, progress, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_PROGRESS, format, null, progress, null, null); fireExportEvent(event); } public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEvent.EXPORT_START, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_START, format, null, null, null, null); fireExportEvent(event); } From a3e64a924ccd113c466c316b0cf8da2466ab57f2 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 28 Jul 2025 10:21:59 -0400 Subject: [PATCH 20/41] Tests for Export --- .../src/main/resources/application.properties | 11 +- .../org/vcell/restq/TestEndpointUtils.java | 15 ++ .../restq/exports/ExportRequestTest.java | 135 ++++++++++++++++ .../ExportServerTest.java} | 151 ++++++++++-------- 4 files changed, 236 insertions(+), 76 deletions(-) create mode 100644 vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java rename vcell-rest/src/test/java/org/vcell/restq/{ExportRequestTest.java => exports/ExportServerTest.java} (50%) diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 94acf63a1d..2a7befe08d 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -144,14 +144,13 @@ quarkus.swagger-ui.always-include=true ############# # ActiveMQ # ############ -# TODO: Update activeMQ to Artemis so that Quarkus can auto-handle everything through properties -mp.messaging.outgoing.export-request.connector=smallrye-amqp -mp.messaging.outgoing.export-request.address=export-request - -mp.messaging.incoming.processed-export-request.connector=smallrye-amqp -mp.messaging.incoming.processed-export-request.address=export-request +%test.mp.messaging.outgoing.export-request.connector=smallrye-amqp +%test.mp.messaging.outgoing.export-request.address=export-request +%test.mp.messaging.incoming.processed-export-request.connector=smallrye-amqp +%test.mp.messaging.incoming.processed-export-request.address=export-request +amqp.devservices.port=2300 ## VCell properties %dev,test.vcell.softwareVersion=8.0.0 diff --git a/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java b/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java index 5465d009fe..5827133f44 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java +++ b/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java @@ -27,6 +27,7 @@ import org.vcell.restclient.model.Publication; import org.vcell.restclient.model.UserLoginInfoForMapping; import org.vcell.restq.db.AgroalConnectionFactory; +import org.vcell.util.BigString; import org.vcell.util.DataAccessException; import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; @@ -188,6 +189,20 @@ public static void clearAllBioModelEntries(AgroalConnectionFactory agroalConnect connection.commit(); new DatabaseServerImpl(agroalConnectionFactory, agroalConnectionFactory.getKeyFactory()).cleanupDatabase(); + connection.close(); + } + + public static void insertAdminsSimulation(DatabaseServerImpl databaseServer, AgroalConnectionFactory connectionFactory) throws IOException, DataAccessException, SQLException { + InputStream xmlFile = TestEndpointUtils.class.getResourceAsStream("/simdata/Administrator/SimID_597714292_0__0.simtask.xml"); + assert xmlFile != null; + String readXML = new String(xmlFile.readAllBytes()); + xmlFile.close(); + databaseServer.saveSimulation(administratorUser, new BigString(readXML), false); + Object object = new Object(); + Connection connection = connectionFactory.getConnection(object); + connection.prepareStatement("UPDATE vc_simulation SET id = 597714292 WHERE name = 'FRAP'").executeUpdate(); + connection.commit(); + connection.close(); } diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java new file mode 100644 index 0000000000..c41c2fba51 --- /dev/null +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java @@ -0,0 +1,135 @@ +package org.vcell.restq.exports; + +import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.math.VariableType; +import cbit.vcell.modeldb.DatabaseServerImpl; +import cbit.vcell.resource.PropertyLoader; +import cbit.vcell.simdata.DataIdentifier; +import cbit.vcell.simdata.*; +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationIdentifier; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.keycloak.client.KeycloakTestClient; +import jakarta.inject.Inject; +import org.eclipse.microprofile.config.inject.ConfigProperty; +import org.junit.jupiter.api.*; +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.api.ExportResourceApi; +import org.vcell.restclient.model.*; +import org.vcell.restq.TestEndpointUtils; +import org.vcell.restq.config.CDIVCellConfigProvider; +import org.vcell.restq.db.AgroalConnectionFactory; +import org.vcell.util.DataAccessException; +import org.vcell.util.document.KeyValue; + +import java.io.File; +import java.io.IOException; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; + +@QuarkusTest +public class ExportRequestTest { + @ConfigProperty(name = "quarkus.http.test-port") + Integer testPort; + @Inject + AgroalConnectionFactory agroalConnectionFactory; + + KeycloakTestClient keycloakClient = new KeycloakTestClient(); + + private DataServerImpl dataServer; + private final String simulationID = "597714292"; + private ApiClient aliceAPIClient; + + @BeforeAll + public static void setupConfig(){ + PropertyLoader.setConfigProvider(new CDIVCellConfigProvider()); + } + + @BeforeEach + public void setUp() throws IOException, DataAccessException, ApiException, SQLException { + aliceAPIClient = TestEndpointUtils.createAuthenticatedAPIClient(keycloakClient, testPort, TestEndpointUtils.TestOIDCUsers.alice); + TestEndpointUtils.mapApiClientToAdmin(aliceAPIClient); + DatabaseServerImpl databaseServer = new DatabaseServerImpl(agroalConnectionFactory, agroalConnectionFactory.getKeyFactory()); + + File testSimData = new File(ExportRequestTest.class.getResource("/simdata").getPath()); + TestEndpointUtils.setSystemProperties(testSimData.getAbsolutePath(), System.getProperty("java.io.tmpdir")); + Cachetable cachetable = new Cachetable(10 * Cachetable.minute, 10000); + DataSetControllerImpl dataSetController = new DataSetControllerImpl(cachetable, testSimData, testSimData); + dataServer = new DataServerImpl(dataSetController, null); + TestEndpointUtils.insertAdminsSimulation(databaseServer, agroalConnectionFactory); + } + + @AfterEach + public void removeOIDCMappings() throws SQLException, DataAccessException { + TestEndpointUtils.clearAllBioModelEntries(agroalConnectionFactory); + TestEndpointUtils.restoreSystemProperties(); + } + +// Tests the clients capability to submit exports, our queue for accepting and distributing messages, retrieval of export status, and the export job itself + @Test + public void testExportRequestClient() throws Exception { + ExportResourceApi exportResourceApi = new ExportResourceApi(aliceAPIClient); + N5ExportRequest exportRequest = getValidExportRequestDTO(0, 1); + exportResourceApi.exportN5(exportRequest); + + CompletableFuture future = CompletableFuture.runAsync(() -> { + try{ + Set allEvents = exportResourceApi.exportStatus(); + ExportEvent eventUnderInspection = allEvents.stream().toList().get(0); + Assertions.assertEquals(1, allEvents.size()); + Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, ExportSpecss.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue())); + while (ExportSpecss.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue()) != ExportSpecss.ExportProgressType.EXPORT_COMPLETE){ + allEvents = exportResourceApi.exportStatus(); + eventUnderInspection = allEvents.stream().toList().get(0); + Thread.sleep(500); + } + Assertions.assertEquals(ExportProgressType.COMPLETE, eventUnderInspection.getEventType()); + } catch (Exception e){ + Assertions.fail(); + } + }).orTimeout(20, TimeUnit.SECONDS); + future.join(); + } + + private N5ExportRequest getValidExportRequestDTO(int startTimeIndex, int endTimeIndex) throws Exception { + VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simulationID), TestEndpointUtils.administratorUser); + VCSimulationDataIdentifier simulationDataIdentifier = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); + DataIdentifier[] dataIdentifier = dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), TestEndpointUtils.administratorUser, simulationDataIdentifier); + DataIdentifier volumetricDataID = getOneDIWithSpecificType(VariableType.VOLUME, dataIdentifier); + double[] allTimes = dataServer.getDataSetTimes(TestEndpointUtils.administratorUser, simulationDataIdentifier); + StandardExportInfo exportRequest = new StandardExportInfo() + .simulationKey(simulationID) + .simulationJob(0) + .geometrySpecs(new GeometrySpecDTO().geometryMode(GeometryMode.SELECTIONS).selections(new ArrayList<>())) + .timeSpecs( + new org.vcell.restclient.model.TimeSpecs().beginTimeIndex(startTimeIndex).endTimeIndex(endTimeIndex).allTimes(Arrays.stream(allTimes).boxed().toList()).mode(TimeMode.RANGE) + ) + .variableSpecs( + new org.vcell.restclient.model.VariableSpecs().variableNames(new ArrayList<>(){{add(volumetricDataID.getName());}}).mode(VariableMode.ONE) + ) + .contextName("") + .simulationName(vcSimulationIdentifier.getID()) + .outputContext(new ArrayList<>()); + + return new N5ExportRequest().standardExportInformation(exportRequest) + .exportableDataType(ExportableDataType.PDE_VARIABLE_DATA) + .datasetName("testExport") + .subVolume(new java.util.HashMap<>()); + } + + private DataIdentifier getOneDIWithSpecificType(VariableType variableType, DataIdentifier[] dataIdentifiers){ + for(DataIdentifier dataIdentifier: dataIdentifiers){ + if(dataIdentifier.getVariableType().equals(variableType)){ + return dataIdentifier; + } + } + throw new RuntimeException("Cannot find variable type " + variableType); + } + +} diff --git a/vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java similarity index 50% rename from vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java rename to vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java index d22303188c..54e573a2dd 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/ExportRequestTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java @@ -1,4 +1,4 @@ -package org.vcell.restq; +package org.vcell.restq.exports; import cbit.rmi.event.ExportEvent; import cbit.vcell.export.server.*; @@ -9,16 +9,13 @@ import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; -import cbit.vcell.xml.XmlParseException; -import com.fasterxml.jackson.core.JsonProcessingException; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.helpers.BlockingIterable; import jakarta.inject.Inject; -import org.eclipse.microprofile.config.inject.ConfigProperty; +import jakarta.jms.JMSException; import org.junit.jupiter.api.*; -import org.testcontainers.shaded.org.awaitility.Awaitility; -import org.vcell.restclient.ApiException; +import org.vcell.restq.TestEndpointUtils; import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.restq.config.CDIVCellConfigProvider; import org.vcell.restq.db.AgroalConnectionFactory; @@ -26,52 +23,48 @@ import org.vcell.restq.services.Exports.ExportService; import org.vcell.restq.services.Exports.ExportStatusCreator; import org.vcell.util.DataAccessException; -import org.vcell.util.ObjectNotFoundException; import org.vcell.util.document.KeyValue; -import javax.jms.JMSException; -import java.beans.PropertyVetoException; import java.io.File; import java.io.IOException; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionException; import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; @QuarkusTest -public class ExportRequestTest { - @ConfigProperty(name = "quarkus.http.test-port") - Integer testPort; - +public class ExportServerTest { @Inject AgroalConnectionFactory agroalConnectionFactory; @Inject ExportRequestListenerMQ requestListenerMQ; @Inject - ExportService exportService; - @Inject ExportStatusCreator statusCreator; + @Inject + ExportService exportService; - private DatabaseServerImpl databaseServer; private DataServerImpl dataServer; private final String simulationID = "597714292"; + private final HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; @BeforeAll - public static void setupConfig(){ + public static void setupConfig() throws JMSException { PropertyLoader.setConfigProvider(new CDIVCellConfigProvider()); } @BeforeEach - public void setUp() throws IOException, DataAccessException { - databaseServer = new DatabaseServerImpl(agroalConnectionFactory, agroalConnectionFactory.getKeyFactory()); - - File testSimData = new File(ExportRequestTest.class.getResource("/simdata").getPath()); + public void setUp() throws IOException, DataAccessException, SQLException { + File testSimData = new File(ExportServerTest.class.getResource("/simdata").getPath()); TestEndpointUtils.setSystemProperties(testSimData.getAbsolutePath(), System.getProperty("java.io.tmpdir")); Cachetable cachetable = new Cachetable(10 * Cachetable.minute, 10000); DataSetControllerImpl dataSetController = new DataSetControllerImpl(cachetable, testSimData, testSimData); dataServer = new DataServerImpl(dataSetController, null); + DatabaseServerImpl databaseServer = new DatabaseServerImpl(agroalConnectionFactory, agroalConnectionFactory.getKeyFactory()); + TestEndpointUtils.insertAdminsSimulation(databaseServer, agroalConnectionFactory); } @AfterEach @@ -80,26 +73,11 @@ public void removeOIDCMappings() throws SQLException, DataAccessException { TestEndpointUtils.restoreSystemProperties(); } - @Test - public void testExportQueue() throws JMSException, JsonProcessingException, ObjectNotFoundException { - ExportSpecs exportSpecs = new ExportSpecs(null, null, null, null, null, null, "TestSim", null); - ExportResource.ExportJob exportJob = new ExportResource.ExportJob(1, TestEndpointUtils.administratorUser, - exportSpecs, new AnnotatedFunction[]{}); - exportService.addExportJobToQueue(exportJob); - Awaitility.await().atMost(1, TimeUnit.SECONDS) - .untilAsserted(() -> { - Assertions.assertFalse(requestListenerMQ.getAcceptedJobs().isEmpty()); - Assertions.assertEquals(exportJob.exportSpecs().getSimulationName(), requestListenerMQ.getAcceptedJobs().get(0).exportSpecs().getSimulationName()); - }); - Multi status = statusCreator.getUsersExportStatus(TestEndpointUtils.administratorUser, exportJob.id()); - - // This request should fail - Awaitility.await().atMost(3, TimeUnit.SECONDS).untilAsserted(() -> { - Assertions.assertThrows(Exception.class, () -> statusCreator.getUsersExportStatus(exportJob.user(), exportJob.id())); - }); - } - @Test + // TODO: Add test for the queue itself, ensuring that the ack's and nack's are handled appropriately. + + + @Test //Tests export listener, and the export service directly without any asynchronous behavior public void testExportStatus() throws Exception { long jobID = 1; ExportSpecs exportSpecs = getValidExportSpec(0, 1); @@ -119,20 +97,20 @@ public void testExportStatus() throws Exception { switch (i){ case 0: Assertions.assertNull(exportEvent.getProgress()); - Assertions.assertEquals(ExportEvent.EXPORT_START, exportEvent.getEventTypeID()); + Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_START, exportEvent.getEventType()); break; case 1: Assertions.assertEquals(.25,exportEvent.getProgress()); - Assertions.assertEquals(ExportEvent.EXPORT_PROGRESS, exportEvent.getEventTypeID()); + Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); break; case 2: Assertions.assertEquals(.8125,exportEvent.getProgress()); - Assertions.assertEquals(ExportEvent.EXPORT_PROGRESS, exportEvent.getEventTypeID()); + Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); Assertions.assertNull(exportEvent.getLocation()); break; case 3: Assertions.assertNull(exportEvent.getProgress()); - Assertions.assertEquals(ExportEvent.EXPORT_COMPLETE, exportEvent.getEventTypeID()); + Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_COMPLETE, exportEvent.getEventType()); Assertions.assertNotNull(exportEvent.getLocation()); break; default: @@ -143,50 +121,82 @@ public void testExportStatus() throws Exception { Assertions.assertEquals(ExportFormat.N5.name(), exportEvent.getFormat()); i++; } + } + @Test + public void testInvalidInputException() throws Exception { + ExportSpecs exportSpecs = getValidExportSpec(0, 1); long badJobID = 2; - ExportSpecs badExportSpecs = new ExportSpecs(exportSpecs.getVCDataIdentifier(), null, null, null, null, null, "TestSim", null); - status = createExportListener(badExportSpecs, badJobID); - CompletableFuture.runAsync(() -> { - try { - ExportResource.ExportJob exportJob = new ExportResource.ExportJob(badJobID, TestEndpointUtils.administratorUser, - badExportSpecs, new AnnotatedFunction[]{}); - requestListenerMQ.startJob(exportJob); - Assertions.fail(); - } catch (Exception e) { - Assertions.assertInstanceOf(NullPointerException.class, e); - } + ExportSpecs badExportSpecs = new ExportSpecs(exportSpecs.getVCDataIdentifier(), null, null, null, + new GeometrySpecs(new SpatialSelection[]{}, 1, 1, ExportSpecss.GeometryMode.GEOMETRY_SLICE), null, "TestSim", null); + Multi status = createExportListener(badExportSpecs, badJobID); + CompletableFuture future = CompletableFuture.runAsync(() -> { + ExportResource.ExportJob exportJob = new ExportResource.ExportJob(badJobID, TestEndpointUtils.administratorUser, + new AnnotatedFunction[]{}, exportSpecs.getVCDataIdentifier(), null, null, null, null, null,"TestSim", null); + CompletableFuture job = requestListenerMQ.startJob(exportJob); + job.exceptionally(ex -> { + Assertions.assertEquals(NullPointerException.class, ex.getCause().getCause().getCause().getClass()); + return null; + }).join(); + Assertions.assertTrue(job.isCompletedExceptionally()); }); - blockingIterable = status.subscribe().asIterable(); + BlockingIterable blockingIterable = status.subscribe().asIterable(); for (ExportEvent exportEvent : blockingIterable) { - Assertions.assertEquals(ExportEvent.EXPORT_FAILURE, exportEvent.getEventTypeID()); + Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_FAILURE, exportEvent.getEventType()); } + future.join(); + } + + @Test + public void testLongRunningThread() throws Exception { + ExportResource.ExportJob exportJob = exportService.createExportJobFromRequest(TestEndpointUtils.administratorUser, getValidExportRequest(0, 3).standardExportInformation(), + new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, "TestDataset", dummyMaskInfo), ExportFormat.N5); + statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); + requestListenerMQ.setThreadWaitTimeUnit(TimeUnit.MILLISECONDS); + CompletableFuture job = requestListenerMQ.startJob(exportJob); + try{ + job.join(); + Assertions.fail(); + } catch (CompletionException e) { + Assertions.assertEquals(TimeoutException.class, e.getCause().getCause().getClass()); + } + Assertions.assertTrue(job.isCompletedExceptionally()); + requestListenerMQ.setThreadWaitTimeUnit(TimeUnit.MINUTES); } - private ExportResource.ExportRequest getValidExportRequest(int startTimeIndex, int endTimeIndex) throws Exception { - N5Specs.CompressionLevel compressionLevel = N5Specs.CompressionLevel.RAW; + private ExportResource.N5ExportRequest getValidExportRequest(int startTimeIndex, int endTimeIndex) throws Exception { VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simulationID), TestEndpointUtils.administratorUser); VCSimulationDataIdentifier simulationDataIdentifier = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); DataIdentifier[] dataIdentifier = dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), TestEndpointUtils.administratorUser, simulationDataIdentifier); DataIdentifier volumetricDataID = getOneDIWithSpecificType(VariableType.VOLUME, dataIdentifier); VariableSpecs variableSpecs = new VariableSpecs(new ArrayList<>(){{add(volumetricDataID.getName());}}, ExportSpecss.VariableMode.VARIABLE_ONE); - GeometrySpecs geometrySpecs = new GeometrySpecs(new SpatialSelection[0], 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS); - N5Specs n5Specs = new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, simulationID); + ExportResource.GeometrySpecDTO geometrySpecs = new ExportResource.GeometrySpecDTO(new SpatialSelection[0], 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS); double[] allTimes = dataServer.getDataSetTimes(TestEndpointUtils.administratorUser, simulationDataIdentifier); TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportSpecss.TimeMode.TIME_RANGE); + HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; - return new ExportResource.ExportRequest(new ArrayList<>(){},ExportFormat.N5, simulationDataIdentifier, - n5Specs, geometrySpecs, timeSpecs, variableSpecs, vcSimulationIdentifier.getID(), ""); + ExportResource.StandardExportInfo request = new ExportResource.StandardExportInfo(new ArrayList<>(){},"", "TestSim", simulationID, 0, + geometrySpecs, timeSpecs, variableSpecs); + return new ExportResource.N5ExportRequest(request, dummyMaskInfo, ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, "TestDataset"); } private ExportSpecs getValidExportSpec(int startTimeIndex, int endTimeIndex) throws Exception { - ExportResource.ExportRequest request = getValidExportRequest(startTimeIndex, endTimeIndex); - return new ExportSpecs(request.dataIdentifier(), request.exportFormat(), request.variableSpecs(), - request.timeSpecs(), request.geometrySpecs(), request.formatSpecificSpecs(), request.simulationName(), - request.contextName()); + ExportResource.N5ExportRequest request = getValidExportRequest(startTimeIndex, endTimeIndex); + VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simulationID), TestEndpointUtils.administratorUser); + VCSimulationDataIdentifier simulationDataIdentifier = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); + ExportResource.GeometrySpecDTO geometrySpecs = request.standardExportInformation().geometrySpecs(); + N5Specs n5Specs = new N5Specs(request.exportableDataType(), ExportFormat.N5, request.datasetName(), dummyMaskInfo); + + return new ExportSpecs(simulationDataIdentifier, ExportFormat.N5, request.standardExportInformation().variableSpecs(), + request.standardExportInformation().timeSpecs(), new GeometrySpecs(geometrySpecs.selections(), geometrySpecs.axis(), geometrySpecs.sliceNumber(), geometrySpecs.geometryMode()), + n5Specs, request.standardExportInformation().simulationName(), + request.standardExportInformation().contextName(), new HumanReadableExportData( + request.standardExportInformation().simulationName(), "fds", + "tretre", new ArrayList<>(), "fsdfds", + "fdsfsd", false, request.subVolume())); } private DataIdentifier getOneDIWithSpecificType(VariableType variableType, DataIdentifier[] dataIdentifiers){ @@ -199,11 +209,12 @@ private DataIdentifier getOneDIWithSpecificType(VariableType variableType, DataI } private Multi createExportListener(ExportSpecs exportSpecs, long jobID) throws Exception { - HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; exportSpecs.setExportMetaData(new HumanReadableExportData("", "", "", new ArrayList<>(), "", "", false, dummyMaskInfo)); - + ExportResource.GeometrySpecDTO geometrySpecDTO = new ExportResource.GeometrySpecDTO(exportSpecs.getGeometrySpecs().getSelections(), + exportSpecs.getGeometrySpecs().getAxis(), exportSpecs.getGeometrySpecs().getSliceNumber(), exportSpecs.getGeometrySpecs().getMode()); ExportResource.ExportJob exportJob = new ExportResource.ExportJob(jobID, TestEndpointUtils.administratorUser, - exportSpecs, new AnnotatedFunction[]{}); + new AnnotatedFunction[]{}, exportSpecs.getVCDataIdentifier(), exportSpecs.getFormat(), exportSpecs.getVariableSpecs(), exportSpecs.getTimeSpecs(), + geometrySpecDTO, exportSpecs.getFormatSpecificSpecs(), exportSpecs.getSimulationName(), exportSpecs.getContextName()); statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); return statusCreator.getUsersExportStatus(TestEndpointUtils.administratorUser, exportJob.id()); From c657252ef5273afadf6b2ca8bb73771ae0c5687c Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 28 Jul 2025 11:35:31 -0400 Subject: [PATCH 21/41] Generated Clients --- python-restclient/.openapi-generator/FILES | 54 + python-restclient/README.md | 28 + python-restclient/docs/AnalyticCurve.md | 36 + .../docs/AnnotatedFunctionDTO.md | 33 + python-restclient/docs/CompositeCurve.md | 33 + python-restclient/docs/ControlPointCurve.md | 35 + python-restclient/docs/Coordinate.md | 30 + python-restclient/docs/Curve.md | 38 + python-restclient/docs/CurveSelectionInfo.md | 37 + python-restclient/docs/ExportEvent.md | 38 + python-restclient/docs/ExportProgressType.md | 10 + python-restclient/docs/ExportResourceApi.md | 155 +++ python-restclient/docs/ExportableDataType.md | 10 + python-restclient/docs/FunctionCategory.md | 10 + python-restclient/docs/GeometryMode.md | 10 + python-restclient/docs/GeometrySpecDTO.md | 31 + .../docs/HumanReadableExportData.md | 38 + python-restclient/docs/N5ExportRequest.md | 31 + python-restclient/docs/SampledCurve.md | 33 + python-restclient/docs/SpatialSelection.md | 34 + .../docs/SpatialSelectionContour.md | 31 + .../docs/SpatialSelectionMembrane.md | 30 + .../docs/SpatialSelectionVolume.md | 29 + python-restclient/docs/Spline.md | 32 + python-restclient/docs/StandardExportInfo.md | 35 + python-restclient/docs/TimeMode.md | 10 + python-restclient/docs/TimeSpecs.md | 31 + python-restclient/docs/VariableMode.md | 10 + python-restclient/docs/VariableSpecs.md | 29 + python-restclient/test/test_analytic_curve.py | 68 + .../test/test_annotated_function_dto.py | 68 + .../test/test_composite_curve.py | 61 + .../test/test_control_point_curve.py | 71 + python-restclient/test/test_coordinate.py | 55 + python-restclient/test/test_curve.py | 70 + .../test/test_curve_selection_info.py | 79 ++ python-restclient/test/test_export_event.py | 93 ++ .../test/test_export_progress_type.py | 35 + .../test/test_export_resource_api.py | 44 + .../test/test_exportable_data_type.py | 35 + .../test/test_function_category.py | 35 + python-restclient/test/test_geometry_mode.py | 35 + .../test/test_geometry_spec_dto.py | 109 ++ .../test/test_human_readable_export_data.py | 67 + .../test/test_n5_export_request.py | 141 ++ python-restclient/test/test_sampled_curve.py | 59 + .../test/test_spatial_selection.py | 105 ++ .../test/test_spatial_selection_contour.py | 62 + .../test/test_spatial_selection_membrane.py | 64 + .../test/test_spatial_selection_volume.py | 54 + python-restclient/test/test_spline.py | 58 + .../test/test_standard_export_info.py | 145 ++ python-restclient/test/test_time_mode.py | 35 + python-restclient/test/test_time_specs.py | 58 + python-restclient/test/test_variable_mode.py | 35 + python-restclient/test/test_variable_specs.py | 56 + python-restclient/vcell_client/__init__.py | 27 + .../vcell_client/api/__init__.py | 1 + .../vcell_client/api/export_resource_api.py | 596 ++++++++ .../vcell_client/models/__init__.py | 26 + .../vcell_client/models/analytic_curve.py | 120 ++ .../models/annotated_function_dto.py | 113 ++ .../vcell_client/models/composite_curve.py | 117 ++ .../models/control_point_curve.py | 124 ++ .../vcell_client/models/coordinate.py | 97 ++ .../vcell_client/models/curve.py | 129 ++ .../models/curve_selection_info.py | 116 ++ .../vcell_client/models/export_event.py | 131 ++ .../models/export_progress_type.py | 49 + .../models/exportable_data_type.py | 47 + .../vcell_client/models/function_category.py | 48 + .../vcell_client/models/geometry_mode.py | 47 + .../vcell_client/models/geometry_spec_dto.py | 109 ++ .../models/human_readable_export_data.py | 114 ++ .../vcell_client/models/n5_export_request.py | 105 ++ .../vcell_client/models/sampled_curve.py | 117 ++ .../vcell_client/models/spatial_selection.py | 127 ++ .../models/spatial_selection_contour.py | 115 ++ .../models/spatial_selection_membrane.py | 115 ++ .../models/spatial_selection_volume.py | 112 ++ .../vcell_client/models/spline.py | 116 ++ .../models/standard_export_info.py | 128 ++ .../vcell_client/models/time_mode.py | 46 + .../vcell_client/models/time_specs.py | 101 ++ .../vcell_client/models/variable_mode.py | 47 + .../vcell_client/models/variable_specs.py | 97 ++ tools/openapi.yaml | 568 ++++++++ vcell-restclient/.openapi-generator/FILES | 54 + vcell-restclient/README.md | 30 + vcell-restclient/api/openapi.yaml | 1195 ++++++++++++++++- vcell-restclient/docs/AnalyticCurve.md | 21 + vcell-restclient/docs/AnnotatedFunctionDTO.md | 18 + vcell-restclient/docs/CompositeCurve.md | 18 + vcell-restclient/docs/ControlPointCurve.md | 20 + vcell-restclient/docs/Coordinate.md | 15 + vcell-restclient/docs/Curve.md | 23 + vcell-restclient/docs/CurveSelectionInfo.md | 22 + vcell-restclient/docs/ExportEvent.md | 23 + vcell-restclient/docs/ExportProgressType.md | 19 + vcell-restclient/docs/ExportResourceApi.md | 298 ++++ vcell-restclient/docs/ExportableDataType.md | 15 + vcell-restclient/docs/FunctionCategory.md | 17 + vcell-restclient/docs/GeometryMode.md | 15 + vcell-restclient/docs/GeometrySpecDTO.md | 16 + .../docs/HumanReadableExportData.md | 23 + vcell-restclient/docs/N5ExportRequest.md | 16 + vcell-restclient/docs/SampledCurve.md | 18 + vcell-restclient/docs/SpatialSelection.md | 19 + .../docs/SpatialSelectionContour.md | 16 + .../docs/SpatialSelectionMembrane.md | 15 + .../docs/SpatialSelectionVolume.md | 14 + vcell-restclient/docs/Spline.md | 17 + vcell-restclient/docs/StandardExportInfo.md | 20 + vcell-restclient/docs/TimeMode.md | 13 + vcell-restclient/docs/TimeSpecs.md | 16 + vcell-restclient/docs/VariableMode.md | 15 + vcell-restclient/docs/VariableSpecs.md | 14 + .../restclient/api/ExportResourceApi.java | 225 ++++ .../vcell/restclient/model/AnalyticCurve.java | 510 +++++++ .../model/AnnotatedFunctionDTO.java | 333 +++++ .../restclient/model/CompositeCurve.java | 427 ++++++ .../restclient/model/ControlPointCurve.java | 503 +++++++ .../vcell/restclient/model/Coordinate.java | 222 +++ .../org/vcell/restclient/model/Curve.java | 539 ++++++++ .../restclient/model/CurveSelectionInfo.java | 475 +++++++ .../vcell/restclient/model/ExportEvent.java | 515 +++++++ .../restclient/model/ExportProgressType.java | 84 ++ .../restclient/model/ExportableDataType.java | 80 ++ .../restclient/model/FunctionCategory.java | 82 ++ .../vcell/restclient/model/GeometryMode.java | 80 ++ .../restclient/model/GeometrySpecDTO.java | 275 ++++ .../model/HumanReadableExportData.java | 538 ++++++++ .../restclient/model/N5ExportRequest.java | 274 ++++ .../vcell/restclient/model/SampledCurve.java | 405 ++++++ .../restclient/model/SpatialSelection.java | 392 ++++++ .../model/SpatialSelectionContour.java | 356 +++++ .../model/SpatialSelectionMembrane.java | 310 +++++ .../model/SpatialSelectionVolume.java | 268 ++++ .../org/vcell/restclient/model/Spline.java | 374 ++++++ .../restclient/model/StandardExportInfo.java | 421 ++++++ .../org/vcell/restclient/model/TimeMode.java | 78 ++ .../org/vcell/restclient/model/TimeSpecs.java | 273 ++++ .../vcell/restclient/model/VariableMode.java | 80 ++ .../vcell/restclient/model/VariableSpecs.java | 201 +++ .../restclient/api/ExportResourceApiTest.java | 73 + .../restclient/model/AnalyticCurveTest.java | 133 ++ .../model/AnnotatedFunctionDTOTest.java | 91 ++ .../restclient/model/CompositeCurveTest.java | 135 ++ .../model/ControlPointCurveTest.java | 135 ++ .../restclient/model/CoordinateTest.java | 64 + .../model/CurveSelectionInfoTest.java | 121 ++ .../org/vcell/restclient/model/CurveTest.java | 132 ++ .../restclient/model/ExportEventTest.java | 133 ++ .../model/ExportProgressTypeTest.java | 32 + .../model/ExportableDataTypeTest.java | 32 + .../model/FunctionCategoryTest.java | 32 + .../restclient/model/GeometryModeTest.java | 32 + .../restclient/model/GeometrySpecDTOTest.java | 76 ++ .../model/HumanReadableExportDataTest.java | 132 ++ .../restclient/model/N5ExportRequestTest.java | 76 ++ .../restclient/model/SampledCurveTest.java | 133 ++ .../model/SpatialSelectionContourTest.java | 104 ++ .../model/SpatialSelectionMembraneTest.java | 105 ++ .../model/SpatialSelectionTest.java | 101 ++ .../model/SpatialSelectionVolumeTest.java | 102 ++ .../vcell/restclient/model/SplineTest.java | 133 ++ .../model/StandardExportInfoTest.java | 110 ++ .../vcell/restclient/model/TimeModeTest.java | 32 + .../vcell/restclient/model/TimeSpecsTest.java | 75 ++ .../restclient/model/VariableModeTest.java | 32 + .../restclient/model/VariableSpecsTest.java | 59 + .../modules/openapi/.openapi-generator/FILES | 28 + .../src/app/core/modules/openapi/api/api.ts | 5 +- .../openapi/api/export-resource.service.ts | 232 ++++ .../api/export-resource.serviceInterface.ts | 42 + .../modules/openapi/model/analytic-curve.ts | 27 + .../openapi/model/annotated-function-dto.ts | 28 + .../modules/openapi/model/composite-curve.ts | 24 + .../openapi/model/control-point-curve.ts | 26 + .../core/modules/openapi/model/coordinate.ts | 19 + .../openapi/model/curve-selection-info.ts | 27 + .../app/core/modules/openapi/model/curve.ts | 28 + .../modules/openapi/model/export-event.ts | 35 + .../openapi/model/export-progress-type.ts | 23 + .../openapi/model/exportable-data-type.ts | 21 + .../openapi/model/function-category.ts | 22 + .../modules/openapi/model/geometry-mode.ts | 21 + .../openapi/model/geometry-spec-dto.ts | 25 + .../model/human-readable-export-data.ts | 27 + .../app/core/modules/openapi/model/models.ts | 26 + .../openapi/model/n5-export-request.ts | 25 + .../modules/openapi/model/sampled-curve.ts | 24 + .../model/spatial-selection-contour.ts | 23 + .../model/spatial-selection-membrane.ts | 23 + .../openapi/model/spatial-selection-volume.ts | 21 + .../openapi/model/spatial-selection.ts | 25 + .../app/core/modules/openapi/model/spline.ts | 23 + .../openapi/model/standard-export-info.ts | 28 + .../core/modules/openapi/model/time-mode.ts | 20 + .../core/modules/openapi/model/time-specs.ts | 24 + .../modules/openapi/model/variable-mode.ts | 21 + .../modules/openapi/model/variable-specs.ts | 22 + 202 files changed, 20295 insertions(+), 3 deletions(-) create mode 100644 python-restclient/docs/AnalyticCurve.md create mode 100644 python-restclient/docs/AnnotatedFunctionDTO.md create mode 100644 python-restclient/docs/CompositeCurve.md create mode 100644 python-restclient/docs/ControlPointCurve.md create mode 100644 python-restclient/docs/Coordinate.md create mode 100644 python-restclient/docs/Curve.md create mode 100644 python-restclient/docs/CurveSelectionInfo.md create mode 100644 python-restclient/docs/ExportEvent.md create mode 100644 python-restclient/docs/ExportProgressType.md create mode 100644 python-restclient/docs/ExportResourceApi.md create mode 100644 python-restclient/docs/ExportableDataType.md create mode 100644 python-restclient/docs/FunctionCategory.md create mode 100644 python-restclient/docs/GeometryMode.md create mode 100644 python-restclient/docs/GeometrySpecDTO.md create mode 100644 python-restclient/docs/HumanReadableExportData.md create mode 100644 python-restclient/docs/N5ExportRequest.md create mode 100644 python-restclient/docs/SampledCurve.md create mode 100644 python-restclient/docs/SpatialSelection.md create mode 100644 python-restclient/docs/SpatialSelectionContour.md create mode 100644 python-restclient/docs/SpatialSelectionMembrane.md create mode 100644 python-restclient/docs/SpatialSelectionVolume.md create mode 100644 python-restclient/docs/Spline.md create mode 100644 python-restclient/docs/StandardExportInfo.md create mode 100644 python-restclient/docs/TimeMode.md create mode 100644 python-restclient/docs/TimeSpecs.md create mode 100644 python-restclient/docs/VariableMode.md create mode 100644 python-restclient/docs/VariableSpecs.md create mode 100644 python-restclient/test/test_analytic_curve.py create mode 100644 python-restclient/test/test_annotated_function_dto.py create mode 100644 python-restclient/test/test_composite_curve.py create mode 100644 python-restclient/test/test_control_point_curve.py create mode 100644 python-restclient/test/test_coordinate.py create mode 100644 python-restclient/test/test_curve.py create mode 100644 python-restclient/test/test_curve_selection_info.py create mode 100644 python-restclient/test/test_export_event.py create mode 100644 python-restclient/test/test_export_progress_type.py create mode 100644 python-restclient/test/test_export_resource_api.py create mode 100644 python-restclient/test/test_exportable_data_type.py create mode 100644 python-restclient/test/test_function_category.py create mode 100644 python-restclient/test/test_geometry_mode.py create mode 100644 python-restclient/test/test_geometry_spec_dto.py create mode 100644 python-restclient/test/test_human_readable_export_data.py create mode 100644 python-restclient/test/test_n5_export_request.py create mode 100644 python-restclient/test/test_sampled_curve.py create mode 100644 python-restclient/test/test_spatial_selection.py create mode 100644 python-restclient/test/test_spatial_selection_contour.py create mode 100644 python-restclient/test/test_spatial_selection_membrane.py create mode 100644 python-restclient/test/test_spatial_selection_volume.py create mode 100644 python-restclient/test/test_spline.py create mode 100644 python-restclient/test/test_standard_export_info.py create mode 100644 python-restclient/test/test_time_mode.py create mode 100644 python-restclient/test/test_time_specs.py create mode 100644 python-restclient/test/test_variable_mode.py create mode 100644 python-restclient/test/test_variable_specs.py create mode 100644 python-restclient/vcell_client/api/export_resource_api.py create mode 100644 python-restclient/vcell_client/models/analytic_curve.py create mode 100644 python-restclient/vcell_client/models/annotated_function_dto.py create mode 100644 python-restclient/vcell_client/models/composite_curve.py create mode 100644 python-restclient/vcell_client/models/control_point_curve.py create mode 100644 python-restclient/vcell_client/models/coordinate.py create mode 100644 python-restclient/vcell_client/models/curve.py create mode 100644 python-restclient/vcell_client/models/curve_selection_info.py create mode 100644 python-restclient/vcell_client/models/export_event.py create mode 100644 python-restclient/vcell_client/models/export_progress_type.py create mode 100644 python-restclient/vcell_client/models/exportable_data_type.py create mode 100644 python-restclient/vcell_client/models/function_category.py create mode 100644 python-restclient/vcell_client/models/geometry_mode.py create mode 100644 python-restclient/vcell_client/models/geometry_spec_dto.py create mode 100644 python-restclient/vcell_client/models/human_readable_export_data.py create mode 100644 python-restclient/vcell_client/models/n5_export_request.py create mode 100644 python-restclient/vcell_client/models/sampled_curve.py create mode 100644 python-restclient/vcell_client/models/spatial_selection.py create mode 100644 python-restclient/vcell_client/models/spatial_selection_contour.py create mode 100644 python-restclient/vcell_client/models/spatial_selection_membrane.py create mode 100644 python-restclient/vcell_client/models/spatial_selection_volume.py create mode 100644 python-restclient/vcell_client/models/spline.py create mode 100644 python-restclient/vcell_client/models/standard_export_info.py create mode 100644 python-restclient/vcell_client/models/time_mode.py create mode 100644 python-restclient/vcell_client/models/time_specs.py create mode 100644 python-restclient/vcell_client/models/variable_mode.py create mode 100644 python-restclient/vcell_client/models/variable_specs.py create mode 100644 vcell-restclient/docs/AnalyticCurve.md create mode 100644 vcell-restclient/docs/AnnotatedFunctionDTO.md create mode 100644 vcell-restclient/docs/CompositeCurve.md create mode 100644 vcell-restclient/docs/ControlPointCurve.md create mode 100644 vcell-restclient/docs/Coordinate.md create mode 100644 vcell-restclient/docs/Curve.md create mode 100644 vcell-restclient/docs/CurveSelectionInfo.md create mode 100644 vcell-restclient/docs/ExportEvent.md create mode 100644 vcell-restclient/docs/ExportProgressType.md create mode 100644 vcell-restclient/docs/ExportResourceApi.md create mode 100644 vcell-restclient/docs/ExportableDataType.md create mode 100644 vcell-restclient/docs/FunctionCategory.md create mode 100644 vcell-restclient/docs/GeometryMode.md create mode 100644 vcell-restclient/docs/GeometrySpecDTO.md create mode 100644 vcell-restclient/docs/HumanReadableExportData.md create mode 100644 vcell-restclient/docs/N5ExportRequest.md create mode 100644 vcell-restclient/docs/SampledCurve.md create mode 100644 vcell-restclient/docs/SpatialSelection.md create mode 100644 vcell-restclient/docs/SpatialSelectionContour.md create mode 100644 vcell-restclient/docs/SpatialSelectionMembrane.md create mode 100644 vcell-restclient/docs/SpatialSelectionVolume.md create mode 100644 vcell-restclient/docs/Spline.md create mode 100644 vcell-restclient/docs/StandardExportInfo.md create mode 100644 vcell-restclient/docs/TimeMode.md create mode 100644 vcell-restclient/docs/TimeSpecs.md create mode 100644 vcell-restclient/docs/VariableMode.md create mode 100644 vcell-restclient/docs/VariableSpecs.md create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/AnalyticCurve.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/AnnotatedFunctionDTO.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/CompositeCurve.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/ControlPointCurve.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/Coordinate.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/Curve.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/CurveSelectionInfo.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/ExportProgressType.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/ExportableDataType.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/FunctionCategory.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/GeometryMode.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/GeometrySpecDTO.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/HumanReadableExportData.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/N5ExportRequest.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/SampledCurve.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelection.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionMembrane.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/Spline.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/StandardExportInfo.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/TimeMode.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/TimeSpecs.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/VariableMode.java create mode 100644 vcell-restclient/src/main/java/org/vcell/restclient/model/VariableSpecs.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/AnalyticCurveTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/AnnotatedFunctionDTOTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/CompositeCurveTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/ControlPointCurveTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/CoordinateTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/CurveSelectionInfoTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/CurveTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/ExportEventTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/ExportProgressTypeTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/ExportableDataTypeTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/FunctionCategoryTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/GeometryModeTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/GeometrySpecDTOTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/HumanReadableExportDataTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/N5ExportRequestTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/SampledCurveTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionContourTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionMembraneTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionVolumeTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/SplineTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/StandardExportInfoTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/TimeModeTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/TimeSpecsTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/VariableModeTest.java create mode 100644 vcell-restclient/src/test/java/org/vcell/restclient/model/VariableSpecsTest.java create mode 100644 webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/analytic-curve.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/annotated-function-dto.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/composite-curve.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/control-point-curve.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/coordinate.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/curve-selection-info.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/curve.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/export-event.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/export-progress-type.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/exportable-data-type.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/function-category.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/geometry-mode.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/geometry-spec-dto.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/human-readable-export-data.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/n5-export-request.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/sampled-curve.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/spatial-selection-membrane.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/spatial-selection.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/spline.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/standard-export-info.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/time-mode.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/time-specs.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/variable-mode.ts create mode 100644 webapp-ng/src/app/core/modules/openapi/model/variable-specs.ts diff --git a/python-restclient/.openapi-generator/FILES b/python-restclient/.openapi-generator/FILES index 35d05be577..bd03d3b283 100644 --- a/python-restclient/.openapi-generator/FILES +++ b/python-restclient/.openapi-generator/FILES @@ -3,6 +3,8 @@ README.md docs/AccesTokenRepresentationRecord.md docs/AdminResourceApi.md +docs/AnalyticCurve.md +docs/AnnotatedFunctionDTO.md docs/ApplicationInfo.md docs/BatchSystemType.md docs/BioModel.md @@ -10,9 +12,18 @@ docs/BioModelChildSummary.md docs/BioModelResourceApi.md docs/BioModelSummary.md docs/BiomodelRef.md +docs/CompositeCurve.md +docs/ControlPointCurve.md +docs/Coordinate.md +docs/Curve.md +docs/CurveSelectionInfo.md docs/DataIdentifier.md docs/DetailedState.md docs/Domain.md +docs/ExportEvent.md +docs/ExportProgressType.md +docs/ExportResourceApi.md +docs/ExportableDataType.md docs/Extent.md docs/ExternalDataIdentifier.md docs/FieldData.md @@ -20,8 +31,11 @@ docs/FieldDataReference.md docs/FieldDataResourceApi.md docs/FieldDataSavedResults.md docs/FieldDataShape.md +docs/FunctionCategory.md docs/GIFImage.md +docs/GeometryMode.md docs/GeometryResourceApi.md +docs/GeometrySpecDTO.md docs/GeometrySummary.md docs/GroupAccess.md docs/GroupAccessAll.md @@ -30,6 +44,7 @@ docs/GroupAccessSome.md docs/HelloWorldApi.md docs/HelloWorldMessage.md docs/HtcJobID.md +docs/HumanReadableExportData.md docs/ISize.md docs/Identity.md docs/MathModelChildSummary.md @@ -38,11 +53,13 @@ docs/MathModelSummary.md docs/MathType.md docs/MathmodelRef.md docs/ModelType.md +docs/N5ExportRequest.md docs/Origin.md docs/Publication.md docs/PublicationInfo.md docs/PublicationResourceApi.md docs/SPECIALCLAIM.md +docs/SampledCurve.md docs/SchedulerStatus.md docs/SimulationExecutionStatusRecord.md docs/SimulationJobStatusRecord.md @@ -53,8 +70,16 @@ docs/SimulationResourceApi.md docs/SimulationStatusPersistentRecord.md docs/SolverResourceApi.md docs/SourceModel.md +docs/SpatialSelection.md +docs/SpatialSelectionContour.md +docs/SpatialSelectionMembrane.md +docs/SpatialSelectionVolume.md +docs/Spline.md +docs/StandardExportInfo.md docs/Status.md docs/StatusMessage.md +docs/TimeMode.md +docs/TimeSpecs.md docs/User.md docs/UserIdentityJSONSafe.md docs/UserLoginInfoForMapping.md @@ -68,6 +93,8 @@ docs/VCellHTTPError.md docs/VCellSite.md docs/VCellSoftwareVersion.md docs/VariableDomain.md +docs/VariableMode.md +docs/VariableSpecs.md docs/VariableType.md docs/Version.md docs/VersionFlag.md @@ -77,6 +104,7 @@ vcell_client/__init__.py vcell_client/api/__init__.py vcell_client/api/admin_resource_api.py vcell_client/api/bio_model_resource_api.py +vcell_client/api/export_resource_api.py vcell_client/api/field_data_resource_api.py vcell_client/api/geometry_resource_api.py vcell_client/api/hello_world_api.py @@ -92,21 +120,34 @@ vcell_client/configuration.py vcell_client/exceptions.py vcell_client/models/__init__.py vcell_client/models/acces_token_representation_record.py +vcell_client/models/analytic_curve.py +vcell_client/models/annotated_function_dto.py vcell_client/models/application_info.py vcell_client/models/batch_system_type.py vcell_client/models/bio_model.py vcell_client/models/bio_model_child_summary.py vcell_client/models/bio_model_summary.py vcell_client/models/biomodel_ref.py +vcell_client/models/composite_curve.py +vcell_client/models/control_point_curve.py +vcell_client/models/coordinate.py +vcell_client/models/curve.py +vcell_client/models/curve_selection_info.py vcell_client/models/data_identifier.py vcell_client/models/detailed_state.py vcell_client/models/domain.py +vcell_client/models/export_event.py +vcell_client/models/export_progress_type.py +vcell_client/models/exportable_data_type.py vcell_client/models/extent.py vcell_client/models/external_data_identifier.py vcell_client/models/field_data.py vcell_client/models/field_data_reference.py vcell_client/models/field_data_saved_results.py vcell_client/models/field_data_shape.py +vcell_client/models/function_category.py +vcell_client/models/geometry_mode.py +vcell_client/models/geometry_spec_dto.py vcell_client/models/geometry_summary.py vcell_client/models/gif_image.py vcell_client/models/group_access.py @@ -115,6 +156,7 @@ vcell_client/models/group_access_none.py vcell_client/models/group_access_some.py vcell_client/models/hello_world_message.py vcell_client/models/htc_job_id.py +vcell_client/models/human_readable_export_data.py vcell_client/models/i_size.py vcell_client/models/identity.py vcell_client/models/math_model_child_summary.py @@ -122,9 +164,11 @@ vcell_client/models/math_model_summary.py vcell_client/models/math_type.py vcell_client/models/mathmodel_ref.py vcell_client/models/model_type.py +vcell_client/models/n5_export_request.py vcell_client/models/origin.py vcell_client/models/publication.py vcell_client/models/publication_info.py +vcell_client/models/sampled_curve.py vcell_client/models/scheduler_status.py vcell_client/models/simulation_execution_status_record.py vcell_client/models/simulation_job_status_record.py @@ -133,9 +177,17 @@ vcell_client/models/simulation_queue_entry_status_record.py vcell_client/models/simulation_queue_id.py vcell_client/models/simulation_status_persistent_record.py vcell_client/models/source_model.py +vcell_client/models/spatial_selection.py +vcell_client/models/spatial_selection_contour.py +vcell_client/models/spatial_selection_membrane.py +vcell_client/models/spatial_selection_volume.py vcell_client/models/specialclaim.py +vcell_client/models/spline.py +vcell_client/models/standard_export_info.py vcell_client/models/status.py vcell_client/models/status_message.py +vcell_client/models/time_mode.py +vcell_client/models/time_specs.py vcell_client/models/user.py vcell_client/models/user_identity_json_safe.py vcell_client/models/user_login_info_for_mapping.py @@ -144,6 +196,8 @@ vcell_client/models/v_cell_http_error.py vcell_client/models/v_cell_site.py vcell_client/models/v_cell_software_version.py vcell_client/models/variable_domain.py +vcell_client/models/variable_mode.py +vcell_client/models/variable_specs.py vcell_client/models/variable_type.py vcell_client/models/vc_document_type.py vcell_client/models/vc_image_summary.py diff --git a/python-restclient/README.md b/python-restclient/README.md index 485f570782..9f03577c84 100644 --- a/python-restclient/README.md +++ b/python-restclient/README.md @@ -96,6 +96,8 @@ Class | Method | HTTP request | Description *BioModelResourceApi* | [**get_bio_model_summary**](docs/BioModelResourceApi.md#get_bio_model_summary) | **GET** /api/v1/bioModel/{bioModelID}/summary | All of the text based information about a BioModel (summary, version, publication status, etc...), but not the actual BioModel itself. *BioModelResourceApi* | [**get_bio_model_vcml**](docs/BioModelResourceApi.md#get_bio_model_vcml) | **GET** /api/v1/bioModel/{bioModelID}/vcml_download | Get the BioModel in VCML format. *BioModelResourceApi* | [**save_bio_model**](docs/BioModelResourceApi.md#save_bio_model) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. +*ExportResourceApi* | [**export_n5**](docs/ExportResourceApi.md#export_n5) | **POST** /api/v1/export/N5 | +*ExportResourceApi* | [**export_status**](docs/ExportResourceApi.md#export_status) | **GET** /api/v1/export/status | *FieldDataResourceApi* | [**advanced_create**](docs/FieldDataResourceApi.md#advanced_create) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**analyze_file**](docs/FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and return field data. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores. *FieldDataResourceApi* | [**copy_models_field_data**](docs/FieldDataResourceApi.md#copy_models_field_data) | **POST** /api/v1/fieldData/copyModelsFieldData | Copy all existing field data from a BioModel/MathModel that you have access to, but don't own. @@ -146,22 +148,35 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AccesTokenRepresentationRecord](docs/AccesTokenRepresentationRecord.md) + - [AnalyticCurve](docs/AnalyticCurve.md) + - [AnnotatedFunctionDTO](docs/AnnotatedFunctionDTO.md) - [ApplicationInfo](docs/ApplicationInfo.md) - [BatchSystemType](docs/BatchSystemType.md) - [BioModel](docs/BioModel.md) - [BioModelChildSummary](docs/BioModelChildSummary.md) - [BioModelSummary](docs/BioModelSummary.md) - [BiomodelRef](docs/BiomodelRef.md) + - [CompositeCurve](docs/CompositeCurve.md) + - [ControlPointCurve](docs/ControlPointCurve.md) + - [Coordinate](docs/Coordinate.md) + - [Curve](docs/Curve.md) + - [CurveSelectionInfo](docs/CurveSelectionInfo.md) - [DataIdentifier](docs/DataIdentifier.md) - [DetailedState](docs/DetailedState.md) - [Domain](docs/Domain.md) + - [ExportEvent](docs/ExportEvent.md) + - [ExportProgressType](docs/ExportProgressType.md) + - [ExportableDataType](docs/ExportableDataType.md) - [Extent](docs/Extent.md) - [ExternalDataIdentifier](docs/ExternalDataIdentifier.md) - [FieldData](docs/FieldData.md) - [FieldDataReference](docs/FieldDataReference.md) - [FieldDataSavedResults](docs/FieldDataSavedResults.md) - [FieldDataShape](docs/FieldDataShape.md) + - [FunctionCategory](docs/FunctionCategory.md) - [GIFImage](docs/GIFImage.md) + - [GeometryMode](docs/GeometryMode.md) + - [GeometrySpecDTO](docs/GeometrySpecDTO.md) - [GeometrySummary](docs/GeometrySummary.md) - [GroupAccess](docs/GroupAccess.md) - [GroupAccessAll](docs/GroupAccessAll.md) @@ -169,6 +184,7 @@ Class | Method | HTTP request | Description - [GroupAccessSome](docs/GroupAccessSome.md) - [HelloWorldMessage](docs/HelloWorldMessage.md) - [HtcJobID](docs/HtcJobID.md) + - [HumanReadableExportData](docs/HumanReadableExportData.md) - [ISize](docs/ISize.md) - [Identity](docs/Identity.md) - [MathModelChildSummary](docs/MathModelChildSummary.md) @@ -176,10 +192,12 @@ Class | Method | HTTP request | Description - [MathType](docs/MathType.md) - [MathmodelRef](docs/MathmodelRef.md) - [ModelType](docs/ModelType.md) + - [N5ExportRequest](docs/N5ExportRequest.md) - [Origin](docs/Origin.md) - [Publication](docs/Publication.md) - [PublicationInfo](docs/PublicationInfo.md) - [SPECIALCLAIM](docs/SPECIALCLAIM.md) + - [SampledCurve](docs/SampledCurve.md) - [SchedulerStatus](docs/SchedulerStatus.md) - [SimulationExecutionStatusRecord](docs/SimulationExecutionStatusRecord.md) - [SimulationJobStatusRecord](docs/SimulationJobStatusRecord.md) @@ -188,8 +206,16 @@ Class | Method | HTTP request | Description - [SimulationQueueID](docs/SimulationQueueID.md) - [SimulationStatusPersistentRecord](docs/SimulationStatusPersistentRecord.md) - [SourceModel](docs/SourceModel.md) + - [SpatialSelection](docs/SpatialSelection.md) + - [SpatialSelectionContour](docs/SpatialSelectionContour.md) + - [SpatialSelectionMembrane](docs/SpatialSelectionMembrane.md) + - [SpatialSelectionVolume](docs/SpatialSelectionVolume.md) + - [Spline](docs/Spline.md) + - [StandardExportInfo](docs/StandardExportInfo.md) - [Status](docs/Status.md) - [StatusMessage](docs/StatusMessage.md) + - [TimeMode](docs/TimeMode.md) + - [TimeSpecs](docs/TimeSpecs.md) - [User](docs/User.md) - [UserIdentityJSONSafe](docs/UserIdentityJSONSafe.md) - [UserLoginInfoForMapping](docs/UserLoginInfoForMapping.md) @@ -201,6 +227,8 @@ Class | Method | HTTP request | Description - [VCellSite](docs/VCellSite.md) - [VCellSoftwareVersion](docs/VCellSoftwareVersion.md) - [VariableDomain](docs/VariableDomain.md) + - [VariableMode](docs/VariableMode.md) + - [VariableSpecs](docs/VariableSpecs.md) - [VariableType](docs/VariableType.md) - [Version](docs/Version.md) - [VersionFlag](docs/VersionFlag.md) diff --git a/python-restclient/docs/AnalyticCurve.md b/python-restclient/docs/AnalyticCurve.md new file mode 100644 index 0000000000..1138a79b28 --- /dev/null +++ b/python-restclient/docs/AnalyticCurve.md @@ -0,0 +1,36 @@ +# AnalyticCurve + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [default to 'AnalyticCurve'] +**exp_x** | **str** | | [optional] +**exp_y** | **str** | | [optional] +**exp_z** | **str** | | [optional] +**offset** | [**Coordinate**](Coordinate.md) | | [optional] +**analytic_offset** | [**Coordinate**](Coordinate.md) | | [optional] +**default_num_samples** | **int** | | [optional] +**segment_count** | **int** | | [optional] +**valid** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.analytic_curve import AnalyticCurve + +# TODO update the JSON string below +json = "{}" +# create an instance of AnalyticCurve from a JSON string +analytic_curve_instance = AnalyticCurve.from_json(json) +# print the JSON string representation of the object +print AnalyticCurve.to_json() + +# convert the object into a dict +analytic_curve_dict = analytic_curve_instance.to_dict() +# create an instance of AnalyticCurve from a dict +analytic_curve_form_dict = analytic_curve.from_dict(analytic_curve_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/AnnotatedFunctionDTO.md b/python-restclient/docs/AnnotatedFunctionDTO.md new file mode 100644 index 0000000000..f73b553dbf --- /dev/null +++ b/python-restclient/docs/AnnotatedFunctionDTO.md @@ -0,0 +1,33 @@ +# AnnotatedFunctionDTO + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**function_name** | **str** | | [optional] +**function_expression** | **str** | | [optional] +**error** | **str** | | [optional] +**domain** | [**Domain**](Domain.md) | | [optional] +**function_type** | [**VariableType**](VariableType.md) | | [optional] +**category** | [**FunctionCategory**](FunctionCategory.md) | | [optional] + +## Example + +```python +from vcell_client.models.annotated_function_dto import AnnotatedFunctionDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of AnnotatedFunctionDTO from a JSON string +annotated_function_dto_instance = AnnotatedFunctionDTO.from_json(json) +# print the JSON string representation of the object +print AnnotatedFunctionDTO.to_json() + +# convert the object into a dict +annotated_function_dto_dict = annotated_function_dto_instance.to_dict() +# create an instance of AnnotatedFunctionDTO from a dict +annotated_function_dto_form_dict = annotated_function_dto.from_dict(annotated_function_dto_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/CompositeCurve.md b/python-restclient/docs/CompositeCurve.md new file mode 100644 index 0000000000..940859ed59 --- /dev/null +++ b/python-restclient/docs/CompositeCurve.md @@ -0,0 +1,33 @@ +# CompositeCurve + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [default to 'CompositeCurve'] +**field_curves** | **List[object]** | | [optional] +**curve_count** | **int** | | [optional] +**default_num_samples** | **int** | | [optional] +**segment_count** | **int** | | [optional] +**valid** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.composite_curve import CompositeCurve + +# TODO update the JSON string below +json = "{}" +# create an instance of CompositeCurve from a JSON string +composite_curve_instance = CompositeCurve.from_json(json) +# print the JSON string representation of the object +print CompositeCurve.to_json() + +# convert the object into a dict +composite_curve_dict = composite_curve_instance.to_dict() +# create an instance of CompositeCurve from a dict +composite_curve_form_dict = composite_curve.from_dict(composite_curve_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/ControlPointCurve.md b/python-restclient/docs/ControlPointCurve.md new file mode 100644 index 0000000000..b9df2c9551 --- /dev/null +++ b/python-restclient/docs/ControlPointCurve.md @@ -0,0 +1,35 @@ +# ControlPointCurve + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [default to 'ControlPointCurve'] +**control_points** | [**List[Coordinate]**](Coordinate.md) | | [optional] +**control_point_count** | **int** | | [optional] +**control_points_vector** | [**List[Coordinate]**](Coordinate.md) | | [optional] +**max_control_points** | **int** | | [optional] +**min_control_points** | **int** | | [optional] +**control_point_addable** | **bool** | | [optional] +**valid** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.control_point_curve import ControlPointCurve + +# TODO update the JSON string below +json = "{}" +# create an instance of ControlPointCurve from a JSON string +control_point_curve_instance = ControlPointCurve.from_json(json) +# print the JSON string representation of the object +print ControlPointCurve.to_json() + +# convert the object into a dict +control_point_curve_dict = control_point_curve_instance.to_dict() +# create an instance of ControlPointCurve from a dict +control_point_curve_form_dict = control_point_curve.from_dict(control_point_curve_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/Coordinate.md b/python-restclient/docs/Coordinate.md new file mode 100644 index 0000000000..c5c51eb0f7 --- /dev/null +++ b/python-restclient/docs/Coordinate.md @@ -0,0 +1,30 @@ +# Coordinate + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**x** | **float** | | [optional] +**y** | **float** | | [optional] +**z** | **float** | | [optional] + +## Example + +```python +from vcell_client.models.coordinate import Coordinate + +# TODO update the JSON string below +json = "{}" +# create an instance of Coordinate from a JSON string +coordinate_instance = Coordinate.from_json(json) +# print the JSON string representation of the object +print Coordinate.to_json() + +# convert the object into a dict +coordinate_dict = coordinate_instance.to_dict() +# create an instance of Coordinate from a dict +coordinate_form_dict = coordinate.from_dict(coordinate_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/Curve.md b/python-restclient/docs/Curve.md new file mode 100644 index 0000000000..9738c43999 --- /dev/null +++ b/python-restclient/docs/Curve.md @@ -0,0 +1,38 @@ +# Curve + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**b_closed** | **bool** | | [optional] +**description** | **str** | | [optional] +**type** | **str** | | +**beginning_coordinate** | [**Coordinate**](Coordinate.md) | | [optional] +**default_num_samples** | **int** | | [optional] +**ending_coordinate** | [**Coordinate**](Coordinate.md) | | [optional] +**num_sample_points** | **int** | | [optional] +**segment_count** | **int** | | [optional] +**spatial_length** | **float** | | [optional] +**closed** | **bool** | | [optional] +**valid** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.curve import Curve + +# TODO update the JSON string below +json = "{}" +# create an instance of Curve from a JSON string +curve_instance = Curve.from_json(json) +# print the JSON string representation of the object +print Curve.to_json() + +# convert the object into a dict +curve_dict = curve_instance.to_dict() +# create an instance of Curve from a dict +curve_form_dict = curve.from_dict(curve_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/CurveSelectionInfo.md b/python-restclient/docs/CurveSelectionInfo.md new file mode 100644 index 0000000000..a60cac0db2 --- /dev/null +++ b/python-restclient/docs/CurveSelectionInfo.md @@ -0,0 +1,37 @@ +# CurveSelectionInfo + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_curve** | [**Curve**](Curve.md) | | [optional] +**field_type** | **int** | | [optional] +**field_control_point** | **int** | | [optional] +**field_segment** | **int** | | [optional] +**field_u** | **float** | | [optional] +**field_u_extended** | **float** | | [optional] +**field_control_point_extended** | **int** | | [optional] +**field_segment_extended** | **int** | | [optional] +**field_direction_negative** | **bool** | | [optional] +**crossing** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.curve_selection_info import CurveSelectionInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of CurveSelectionInfo from a JSON string +curve_selection_info_instance = CurveSelectionInfo.from_json(json) +# print the JSON string representation of the object +print CurveSelectionInfo.to_json() + +# convert the object into a dict +curve_selection_info_dict = curve_selection_info_instance.to_dict() +# create an instance of CurveSelectionInfo from a dict +curve_selection_info_form_dict = curve_selection_info.from_dict(curve_selection_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/ExportEvent.md b/python-restclient/docs/ExportEvent.md new file mode 100644 index 0000000000..d299593341 --- /dev/null +++ b/python-restclient/docs/ExportEvent.md @@ -0,0 +1,38 @@ +# ExportEvent + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_type** | [**ExportProgressType**](ExportProgressType.md) | | [optional] +**progress** | **float** | | [optional] +**format** | **str** | | [optional] +**location** | **str** | | [optional] +**user** | [**User**](User.md) | | [optional] +**job_id** | **int** | | [optional] +**data_key** | **str** | | [optional] +**data_id_string** | **str** | | [optional] +**time_specs** | [**TimeSpecs**](TimeSpecs.md) | | [optional] +**variable_specs** | [**VariableSpecs**](VariableSpecs.md) | | [optional] +**human_readable_data** | [**HumanReadableExportData**](HumanReadableExportData.md) | | [optional] + +## Example + +```python +from vcell_client.models.export_event import ExportEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of ExportEvent from a JSON string +export_event_instance = ExportEvent.from_json(json) +# print the JSON string representation of the object +print ExportEvent.to_json() + +# convert the object into a dict +export_event_dict = export_event_instance.to_dict() +# create an instance of ExportEvent from a dict +export_event_form_dict = export_event.from_dict(export_event_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/ExportProgressType.md b/python-restclient/docs/ExportProgressType.md new file mode 100644 index 0000000000..d6565b9228 --- /dev/null +++ b/python-restclient/docs/ExportProgressType.md @@ -0,0 +1,10 @@ +# ExportProgressType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/ExportResourceApi.md b/python-restclient/docs/ExportResourceApi.md new file mode 100644 index 0000000000..bc18fe42d2 --- /dev/null +++ b/python-restclient/docs/ExportResourceApi.md @@ -0,0 +1,155 @@ +# vcell_client.ExportResourceApi + +All URIs are relative to *https://vcell.cam.uchc.edu* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**export_n5**](ExportResourceApi.md#export_n5) | **POST** /api/v1/export/N5 | +[**export_status**](ExportResourceApi.md#export_status) | **GET** /api/v1/export/status | + + +# **export_n5** +> int export_n5(n5_export_request=n5_export_request) + + + +Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + +### Example + +```python +import time +import os +import vcell_client +from vcell_client.models.n5_export_request import N5ExportRequest +from vcell_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://vcell.cam.uchc.edu +# See configuration.py for a list of all supported configuration parameters. +configuration = vcell_client.Configuration( + host = "https://vcell.cam.uchc.edu" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Enter a context with an instance of the API client +with vcell_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = vcell_client.ExportResourceApi(api_client) + n5_export_request = vcell_client.N5ExportRequest() # N5ExportRequest | (optional) + + try: + api_response = api_instance.export_n5(n5_export_request=n5_export_request) + print("The response of ExportResourceApi->export_n5:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExportResourceApi->export_n5: %s\n" % e) +``` + + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **n5_export_request** | [**N5ExportRequest**](N5ExportRequest.md)| | [optional] + +### Return type + +**int** + +### Authorization + +[openId](../README.md#openId) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request. | - | +**401** | Not Authenticated | - | +**403** | Not Allowed | - | +**422** | Unprocessable content submitted | - | +**500** | Data Access Exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **export_status** +> List[ExportEvent] export_status() + + + +Get the status of your most recent export jobs. + +### Example + +```python +import time +import os +import vcell_client +from vcell_client.models.export_event import ExportEvent +from vcell_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://vcell.cam.uchc.edu +# See configuration.py for a list of all supported configuration parameters. +configuration = vcell_client.Configuration( + host = "https://vcell.cam.uchc.edu" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Enter a context with an instance of the API client +with vcell_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = vcell_client.ExportResourceApi(api_client) + + try: + api_response = api_instance.export_status() + print("The response of ExportResourceApi->export_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ExportResourceApi->export_status: %s\n" % e) +``` + + + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**List[ExportEvent]**](ExportEvent.md) + +### Authorization + +[openId](../README.md#openId) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Not Authenticated | - | +**403** | Not Allowed | - | +**404** | Not found | - | +**500** | Data Access Exception | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/python-restclient/docs/ExportableDataType.md b/python-restclient/docs/ExportableDataType.md new file mode 100644 index 0000000000..83676baed2 --- /dev/null +++ b/python-restclient/docs/ExportableDataType.md @@ -0,0 +1,10 @@ +# ExportableDataType + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/FunctionCategory.md b/python-restclient/docs/FunctionCategory.md new file mode 100644 index 0000000000..a81c970cae --- /dev/null +++ b/python-restclient/docs/FunctionCategory.md @@ -0,0 +1,10 @@ +# FunctionCategory + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/GeometryMode.md b/python-restclient/docs/GeometryMode.md new file mode 100644 index 0000000000..357f3fe996 --- /dev/null +++ b/python-restclient/docs/GeometryMode.md @@ -0,0 +1,10 @@ +# GeometryMode + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/GeometrySpecDTO.md b/python-restclient/docs/GeometrySpecDTO.md new file mode 100644 index 0000000000..fdcb1d2324 --- /dev/null +++ b/python-restclient/docs/GeometrySpecDTO.md @@ -0,0 +1,31 @@ +# GeometrySpecDTO + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**selections** | [**List[SpatialSelection]**](SpatialSelection.md) | | [optional] +**axis** | **int** | | [optional] +**slice_number** | **int** | | [optional] +**geometry_mode** | [**GeometryMode**](GeometryMode.md) | | [optional] + +## Example + +```python +from vcell_client.models.geometry_spec_dto import GeometrySpecDTO + +# TODO update the JSON string below +json = "{}" +# create an instance of GeometrySpecDTO from a JSON string +geometry_spec_dto_instance = GeometrySpecDTO.from_json(json) +# print the JSON string representation of the object +print GeometrySpecDTO.to_json() + +# convert the object into a dict +geometry_spec_dto_dict = geometry_spec_dto_instance.to_dict() +# create an instance of GeometrySpecDTO from a dict +geometry_spec_dto_form_dict = geometry_spec_dto.from_dict(geometry_spec_dto_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/HumanReadableExportData.md b/python-restclient/docs/HumanReadableExportData.md new file mode 100644 index 0000000000..bbe8bee352 --- /dev/null +++ b/python-restclient/docs/HumanReadableExportData.md @@ -0,0 +1,38 @@ +# HumanReadableExportData + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**simulation_name** | **str** | | [optional] +**biomodel_name** | **str** | | [optional] +**application_name** | **str** | | [optional] +**different_parameter_values** | **List[str]** | | [optional] +**application_type** | **str** | | [optional] +**server_saved_file_name** | **str** | | [optional] +**non_spatial** | **bool** | | [optional] +**sub_volume** | **Dict[str, str]** | | [optional] +**z_slices** | **int** | | [optional] +**t_slices** | **int** | | [optional] +**num_channels** | **int** | | [optional] + +## Example + +```python +from vcell_client.models.human_readable_export_data import HumanReadableExportData + +# TODO update the JSON string below +json = "{}" +# create an instance of HumanReadableExportData from a JSON string +human_readable_export_data_instance = HumanReadableExportData.from_json(json) +# print the JSON string representation of the object +print HumanReadableExportData.to_json() + +# convert the object into a dict +human_readable_export_data_dict = human_readable_export_data_instance.to_dict() +# create an instance of HumanReadableExportData from a dict +human_readable_export_data_form_dict = human_readable_export_data.from_dict(human_readable_export_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/N5ExportRequest.md b/python-restclient/docs/N5ExportRequest.md new file mode 100644 index 0000000000..8ad83b90da --- /dev/null +++ b/python-restclient/docs/N5ExportRequest.md @@ -0,0 +1,31 @@ +# N5ExportRequest + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**standard_export_information** | [**StandardExportInfo**](StandardExportInfo.md) | | [optional] +**sub_volume** | **Dict[str, str]** | | [optional] +**exportable_data_type** | [**ExportableDataType**](ExportableDataType.md) | | [optional] +**dataset_name** | **str** | | [optional] + +## Example + +```python +from vcell_client.models.n5_export_request import N5ExportRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of N5ExportRequest from a JSON string +n5_export_request_instance = N5ExportRequest.from_json(json) +# print the JSON string representation of the object +print N5ExportRequest.to_json() + +# convert the object into a dict +n5_export_request_dict = n5_export_request_instance.to_dict() +# create an instance of N5ExportRequest from a dict +n5_export_request_form_dict = n5_export_request.from_dict(n5_export_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/SampledCurve.md b/python-restclient/docs/SampledCurve.md new file mode 100644 index 0000000000..2e3411d42c --- /dev/null +++ b/python-restclient/docs/SampledCurve.md @@ -0,0 +1,33 @@ +# SampledCurve + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [default to 'SampledCurve'] +**default_num_samples** | **int** | | [optional] +**max_control_points** | **int** | | [optional] +**min_control_points** | **int** | | [optional] +**segment_count** | **int** | | [optional] +**spatial_length** | **float** | | [optional] + +## Example + +```python +from vcell_client.models.sampled_curve import SampledCurve + +# TODO update the JSON string below +json = "{}" +# create an instance of SampledCurve from a JSON string +sampled_curve_instance = SampledCurve.from_json(json) +# print the JSON string representation of the object +print SampledCurve.to_json() + +# convert the object into a dict +sampled_curve_dict = sampled_curve_instance.to_dict() +# create an instance of SampledCurve from a dict +sampled_curve_form_dict = sampled_curve.from_dict(sampled_curve_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/SpatialSelection.md b/python-restclient/docs/SpatialSelection.md new file mode 100644 index 0000000000..26d4189b5e --- /dev/null +++ b/python-restclient/docs/SpatialSelection.md @@ -0,0 +1,34 @@ +# SpatialSelection + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**curve_selection_info** | [**CurveSelectionInfo**](CurveSelectionInfo.md) | | [optional] +**var_type** | [**VariableType**](VariableType.md) | | [optional] +**type** | **str** | | +**smallest_mesh_cell_dimension_length** | **float** | | [optional] +**variable_type** | [**VariableType**](VariableType.md) | | [optional] +**closed** | **bool** | | [optional] +**point** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.spatial_selection import SpatialSelection + +# TODO update the JSON string below +json = "{}" +# create an instance of SpatialSelection from a JSON string +spatial_selection_instance = SpatialSelection.from_json(json) +# print the JSON string representation of the object +print SpatialSelection.to_json() + +# convert the object into a dict +spatial_selection_dict = spatial_selection_instance.to_dict() +# create an instance of SpatialSelection from a dict +spatial_selection_form_dict = spatial_selection.from_dict(spatial_selection_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/SpatialSelectionContour.md b/python-restclient/docs/SpatialSelectionContour.md new file mode 100644 index 0000000000..6072fdab58 --- /dev/null +++ b/python-restclient/docs/SpatialSelectionContour.md @@ -0,0 +1,31 @@ +# SpatialSelectionContour + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] [default to 'Contour'] +**field_sampled_data_indexes** | **List[int]** | | [optional] +**index_samples** | **List[int]** | | [optional] +**sampled_data_indexes** | **List[int]** | | [optional] + +## Example + +```python +from vcell_client.models.spatial_selection_contour import SpatialSelectionContour + +# TODO update the JSON string below +json = "{}" +# create an instance of SpatialSelectionContour from a JSON string +spatial_selection_contour_instance = SpatialSelectionContour.from_json(json) +# print the JSON string representation of the object +print SpatialSelectionContour.to_json() + +# convert the object into a dict +spatial_selection_contour_dict = spatial_selection_contour_instance.to_dict() +# create an instance of SpatialSelectionContour from a dict +spatial_selection_contour_form_dict = spatial_selection_contour.from_dict(spatial_selection_contour_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/SpatialSelectionMembrane.md b/python-restclient/docs/SpatialSelectionMembrane.md new file mode 100644 index 0000000000..6cef01ef45 --- /dev/null +++ b/python-restclient/docs/SpatialSelectionMembrane.md @@ -0,0 +1,30 @@ +# SpatialSelectionMembrane + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [default to 'Membrane'] +**field_sampled_data_indexes** | **List[int]** | | [optional] +**selection_source** | [**SampledCurve**](SampledCurve.md) | | [optional] + +## Example + +```python +from vcell_client.models.spatial_selection_membrane import SpatialSelectionMembrane + +# TODO update the JSON string below +json = "{}" +# create an instance of SpatialSelectionMembrane from a JSON string +spatial_selection_membrane_instance = SpatialSelectionMembrane.from_json(json) +# print the JSON string representation of the object +print SpatialSelectionMembrane.to_json() + +# convert the object into a dict +spatial_selection_membrane_dict = spatial_selection_membrane_instance.to_dict() +# create an instance of SpatialSelectionMembrane from a dict +spatial_selection_membrane_form_dict = spatial_selection_membrane.from_dict(spatial_selection_membrane_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/SpatialSelectionVolume.md b/python-restclient/docs/SpatialSelectionVolume.md new file mode 100644 index 0000000000..5a128afc3b --- /dev/null +++ b/python-restclient/docs/SpatialSelectionVolume.md @@ -0,0 +1,29 @@ +# SpatialSelectionVolume + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] [default to 'Volume'] +**symmetric** | **bool** | | [optional] + +## Example + +```python +from vcell_client.models.spatial_selection_volume import SpatialSelectionVolume + +# TODO update the JSON string below +json = "{}" +# create an instance of SpatialSelectionVolume from a JSON string +spatial_selection_volume_instance = SpatialSelectionVolume.from_json(json) +# print the JSON string representation of the object +print SpatialSelectionVolume.to_json() + +# convert the object into a dict +spatial_selection_volume_dict = spatial_selection_volume_instance.to_dict() +# create an instance of SpatialSelectionVolume from a dict +spatial_selection_volume_form_dict = spatial_selection_volume.from_dict(spatial_selection_volume_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/Spline.md b/python-restclient/docs/Spline.md new file mode 100644 index 0000000000..541fd63c9e --- /dev/null +++ b/python-restclient/docs/Spline.md @@ -0,0 +1,32 @@ +# Spline + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [default to 'Spline'] +**default_num_samples** | **int** | | [optional] +**max_control_points** | **int** | | [optional] +**min_control_points** | **int** | | [optional] +**segment_count** | **int** | | [optional] + +## Example + +```python +from vcell_client.models.spline import Spline + +# TODO update the JSON string below +json = "{}" +# create an instance of Spline from a JSON string +spline_instance = Spline.from_json(json) +# print the JSON string representation of the object +print Spline.to_json() + +# convert the object into a dict +spline_dict = spline_instance.to_dict() +# create an instance of Spline from a dict +spline_form_dict = spline.from_dict(spline_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/StandardExportInfo.md b/python-restclient/docs/StandardExportInfo.md new file mode 100644 index 0000000000..da7a8f6e8e --- /dev/null +++ b/python-restclient/docs/StandardExportInfo.md @@ -0,0 +1,35 @@ +# StandardExportInfo + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**output_context** | [**List[AnnotatedFunctionDTO]**](AnnotatedFunctionDTO.md) | | [optional] +**context_name** | **str** | | [optional] +**simulation_name** | **str** | | [optional] +**simulation_key** | **str** | | [optional] +**simulation_job** | **int** | | [optional] +**geometry_specs** | [**GeometrySpecDTO**](GeometrySpecDTO.md) | | [optional] +**time_specs** | [**TimeSpecs**](TimeSpecs.md) | | [optional] +**variable_specs** | [**VariableSpecs**](VariableSpecs.md) | | [optional] + +## Example + +```python +from vcell_client.models.standard_export_info import StandardExportInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of StandardExportInfo from a JSON string +standard_export_info_instance = StandardExportInfo.from_json(json) +# print the JSON string representation of the object +print StandardExportInfo.to_json() + +# convert the object into a dict +standard_export_info_dict = standard_export_info_instance.to_dict() +# create an instance of StandardExportInfo from a dict +standard_export_info_form_dict = standard_export_info.from_dict(standard_export_info_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/TimeMode.md b/python-restclient/docs/TimeMode.md new file mode 100644 index 0000000000..c62f77f029 --- /dev/null +++ b/python-restclient/docs/TimeMode.md @@ -0,0 +1,10 @@ +# TimeMode + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/TimeSpecs.md b/python-restclient/docs/TimeSpecs.md new file mode 100644 index 0000000000..883ead2717 --- /dev/null +++ b/python-restclient/docs/TimeSpecs.md @@ -0,0 +1,31 @@ +# TimeSpecs + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**begin_time_index** | **int** | | [optional] +**end_time_index** | **int** | | [optional] +**all_times** | **List[float]** | | [optional] +**mode** | [**TimeMode**](TimeMode.md) | | [optional] + +## Example + +```python +from vcell_client.models.time_specs import TimeSpecs + +# TODO update the JSON string below +json = "{}" +# create an instance of TimeSpecs from a JSON string +time_specs_instance = TimeSpecs.from_json(json) +# print the JSON string representation of the object +print TimeSpecs.to_json() + +# convert the object into a dict +time_specs_dict = time_specs_instance.to_dict() +# create an instance of TimeSpecs from a dict +time_specs_form_dict = time_specs.from_dict(time_specs_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/VariableMode.md b/python-restclient/docs/VariableMode.md new file mode 100644 index 0000000000..01f451d561 --- /dev/null +++ b/python-restclient/docs/VariableMode.md @@ -0,0 +1,10 @@ +# VariableMode + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/docs/VariableSpecs.md b/python-restclient/docs/VariableSpecs.md new file mode 100644 index 0000000000..bf23b40aaa --- /dev/null +++ b/python-restclient/docs/VariableSpecs.md @@ -0,0 +1,29 @@ +# VariableSpecs + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**variable_names** | **List[str]** | | [optional] +**mode** | [**VariableMode**](VariableMode.md) | | [optional] + +## Example + +```python +from vcell_client.models.variable_specs import VariableSpecs + +# TODO update the JSON string below +json = "{}" +# create an instance of VariableSpecs from a JSON string +variable_specs_instance = VariableSpecs.from_json(json) +# print the JSON string representation of the object +print VariableSpecs.to_json() + +# convert the object into a dict +variable_specs_dict = variable_specs_instance.to_dict() +# create an instance of VariableSpecs from a dict +variable_specs_form_dict = variable_specs.from_dict(variable_specs_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python-restclient/test/test_analytic_curve.py b/python-restclient/test/test_analytic_curve.py new file mode 100644 index 0000000000..c467519349 --- /dev/null +++ b/python-restclient/test/test_analytic_curve.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.analytic_curve import AnalyticCurve + +class TestAnalyticCurve(unittest.TestCase): + """AnalyticCurve unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnalyticCurve: + """Test AnalyticCurve + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AnalyticCurve` + """ + model = AnalyticCurve() + if include_optional: + return AnalyticCurve( + type = 'AnalyticCurve', + exp_x = '', + exp_y = '', + exp_z = '', + offset = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + analytic_offset = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + segment_count = 56, + valid = True + ) + else: + return AnalyticCurve( + type = 'AnalyticCurve', + ) + """ + + def testAnalyticCurve(self): + """Test AnalyticCurve""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_annotated_function_dto.py b/python-restclient/test/test_annotated_function_dto.py new file mode 100644 index 0000000000..11f138063b --- /dev/null +++ b/python-restclient/test/test_annotated_function_dto.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.annotated_function_dto import AnnotatedFunctionDTO + +class TestAnnotatedFunctionDTO(unittest.TestCase): + """AnnotatedFunctionDTO unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AnnotatedFunctionDTO: + """Test AnnotatedFunctionDTO + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AnnotatedFunctionDTO` + """ + model = AnnotatedFunctionDTO() + if include_optional: + return AnnotatedFunctionDTO( + function_name = '', + function_expression = '', + error = '', + domain = vcell_client.models.domain.Domain( + name = '', ), + function_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + category = 'PREDEFINED' + ) + else: + return AnnotatedFunctionDTO( + ) + """ + + def testAnnotatedFunctionDTO(self): + """Test AnnotatedFunctionDTO""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_composite_curve.py b/python-restclient/test/test_composite_curve.py new file mode 100644 index 0000000000..4245dce651 --- /dev/null +++ b/python-restclient/test/test_composite_curve.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.composite_curve import CompositeCurve + +class TestCompositeCurve(unittest.TestCase): + """CompositeCurve unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CompositeCurve: + """Test CompositeCurve + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CompositeCurve` + """ + model = CompositeCurve() + if include_optional: + return CompositeCurve( + type = 'CompositeCurve', + field_curves = [ + null + ], + curve_count = 56, + default_num_samples = 56, + segment_count = 56, + valid = True + ) + else: + return CompositeCurve( + type = 'CompositeCurve', + ) + """ + + def testCompositeCurve(self): + """Test CompositeCurve""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_control_point_curve.py b/python-restclient/test/test_control_point_curve.py new file mode 100644 index 0000000000..c88bbfb698 --- /dev/null +++ b/python-restclient/test/test_control_point_curve.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.control_point_curve import ControlPointCurve + +class TestControlPointCurve(unittest.TestCase): + """ControlPointCurve unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ControlPointCurve: + """Test ControlPointCurve + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ControlPointCurve` + """ + model = ControlPointCurve() + if include_optional: + return ControlPointCurve( + type = 'ControlPointCurve', + control_points = [ + vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ) + ], + control_point_count = 56, + control_points_vector = [ + vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ) + ], + max_control_points = 56, + min_control_points = 56, + control_point_addable = True, + valid = True + ) + else: + return ControlPointCurve( + type = 'ControlPointCurve', + ) + """ + + def testControlPointCurve(self): + """Test ControlPointCurve""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_coordinate.py b/python-restclient/test/test_coordinate.py new file mode 100644 index 0000000000..a489a4e76c --- /dev/null +++ b/python-restclient/test/test_coordinate.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.coordinate import Coordinate + +class TestCoordinate(unittest.TestCase): + """Coordinate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Coordinate: + """Test Coordinate + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Coordinate` + """ + model = Coordinate() + if include_optional: + return Coordinate( + x = 1.337, + y = 1.337, + z = 1.337 + ) + else: + return Coordinate( + ) + """ + + def testCoordinate(self): + """Test Coordinate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_curve.py b/python-restclient/test/test_curve.py new file mode 100644 index 0000000000..d1a8cce185 --- /dev/null +++ b/python-restclient/test/test_curve.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.curve import Curve + +class TestCurve(unittest.TestCase): + """Curve unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Curve: + """Test Curve + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Curve` + """ + model = Curve() + if include_optional: + return Curve( + b_closed = True, + description = '', + type = '', + beginning_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + ending_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + num_sample_points = 56, + segment_count = 56, + spatial_length = 1.337, + closed = True, + valid = True + ) + else: + return Curve( + type = '', + ) + """ + + def testCurve(self): + """Test Curve""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_curve_selection_info.py b/python-restclient/test/test_curve_selection_info.py new file mode 100644 index 0000000000..5bbc0f9354 --- /dev/null +++ b/python-restclient/test/test_curve_selection_info.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.curve_selection_info import CurveSelectionInfo + +class TestCurveSelectionInfo(unittest.TestCase): + """CurveSelectionInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CurveSelectionInfo: + """Test CurveSelectionInfo + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CurveSelectionInfo` + """ + model = CurveSelectionInfo() + if include_optional: + return CurveSelectionInfo( + field_curve = vcell_client.models.curve.Curve( + b_closed = True, + description = '', + type = '', + beginning_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + ending_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + num_sample_points = 56, + segment_count = 56, + spatial_length = 1.337, + closed = True, + valid = True, ), + field_type = 56, + field_control_point = 56, + field_segment = 56, + field_u = 1.337, + field_u_extended = 1.337, + field_control_point_extended = 56, + field_segment_extended = 56, + field_direction_negative = True, + crossing = True + ) + else: + return CurveSelectionInfo( + ) + """ + + def testCurveSelectionInfo(self): + """Test CurveSelectionInfo""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_export_event.py b/python-restclient/test/test_export_event.py new file mode 100644 index 0000000000..f899d3e130 --- /dev/null +++ b/python-restclient/test/test_export_event.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.export_event import ExportEvent + +class TestExportEvent(unittest.TestCase): + """ExportEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ExportEvent: + """Test ExportEvent + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ExportEvent` + """ + model = ExportEvent() + if include_optional: + return ExportEvent( + event_type = 'EXPORT_START', + progress = 1.337, + format = '', + location = '', + user = vcell_client.models.user.User( + user_name = '', + key = '', + my_specials = [ + 'admins' + ], ), + job_id = 56, + data_key = '', + data_id_string = '', + time_specs = vcell_client.models.time_specs.TimeSpecs( + begin_time_index = 56, + end_time_index = 56, + all_times = [ + 1.337 + ], + mode = 'TIME_POINT', ), + variable_specs = vcell_client.models.variable_specs.VariableSpecs( + variable_names = [ + '' + ], + mode = 'VARIABLE_ONE', ), + human_readable_data = vcell_client.models.human_readable_export_data.HumanReadableExportData( + simulation_name = '', + biomodel_name = '', + application_name = '', + different_parameter_values = [ + '' + ], + application_type = '', + server_saved_file_name = '', + non_spatial = True, + sub_volume = { + 'key' : '' + }, + z_slices = 56, + t_slices = 56, + num_channels = 56, ) + ) + else: + return ExportEvent( + ) + """ + + def testExportEvent(self): + """Test ExportEvent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_export_progress_type.py b/python-restclient/test/test_export_progress_type.py new file mode 100644 index 0000000000..2c604bd605 --- /dev/null +++ b/python-restclient/test/test_export_progress_type.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.export_progress_type import ExportProgressType + +class TestExportProgressType(unittest.TestCase): + """ExportProgressType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExportProgressType(self): + """Test ExportProgressType""" + # inst = ExportProgressType() + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_export_resource_api.py b/python-restclient/test/test_export_resource_api.py new file mode 100644 index 0000000000..993e90d72b --- /dev/null +++ b/python-restclient/test/test_export_resource_api.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from vcell_client.api.export_resource_api import ExportResourceApi + + +class TestExportResourceApi(unittest.TestCase): + """ExportResourceApi unit test stubs""" + + def setUp(self) -> None: + self.api = ExportResourceApi() + + def tearDown(self) -> None: + pass + + def test_export_n5(self) -> None: + """Test case for export_n5 + + """ + pass + + def test_export_status(self) -> None: + """Test case for export_status + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_exportable_data_type.py b/python-restclient/test/test_exportable_data_type.py new file mode 100644 index 0000000000..782b1d2518 --- /dev/null +++ b/python-restclient/test/test_exportable_data_type.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.exportable_data_type import ExportableDataType + +class TestExportableDataType(unittest.TestCase): + """ExportableDataType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExportableDataType(self): + """Test ExportableDataType""" + # inst = ExportableDataType() + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_function_category.py b/python-restclient/test/test_function_category.py new file mode 100644 index 0000000000..664f48db21 --- /dev/null +++ b/python-restclient/test/test_function_category.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.function_category import FunctionCategory + +class TestFunctionCategory(unittest.TestCase): + """FunctionCategory unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFunctionCategory(self): + """Test FunctionCategory""" + # inst = FunctionCategory() + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_geometry_mode.py b/python-restclient/test/test_geometry_mode.py new file mode 100644 index 0000000000..0c15dfab8c --- /dev/null +++ b/python-restclient/test/test_geometry_mode.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.geometry_mode import GeometryMode + +class TestGeometryMode(unittest.TestCase): + """GeometryMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testGeometryMode(self): + """Test GeometryMode""" + # inst = GeometryMode() + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_geometry_spec_dto.py b/python-restclient/test/test_geometry_spec_dto.py new file mode 100644 index 0000000000..c1a7d3363c --- /dev/null +++ b/python-restclient/test/test_geometry_spec_dto.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.geometry_spec_dto import GeometrySpecDTO + +class TestGeometrySpecDTO(unittest.TestCase): + """GeometrySpecDTO unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GeometrySpecDTO: + """Test GeometrySpecDTO + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GeometrySpecDTO` + """ + model = GeometrySpecDTO() + if include_optional: + return GeometrySpecDTO( + selections = [ + vcell_client.models.spatial_selection.SpatialSelection( + curve_selection_info = vcell_client.models.curve_selection_info.CurveSelectionInfo( + field_curve = vcell_client.models.curve.Curve( + b_closed = True, + description = '', + type = '', + beginning_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + ending_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + num_sample_points = 56, + segment_count = 56, + spatial_length = 1.337, + closed = True, + valid = True, ), + field_type = 56, + field_control_point = 56, + field_segment = 56, + field_u = 1.337, + field_u_extended = 1.337, + field_control_point_extended = 56, + field_segment_extended = 56, + field_direction_negative = True, + crossing = True, ), + var_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + type = '', + smallest_mesh_cell_dimension_length = 1.337, + variable_type = vcell_client.models.variable_type.VariableType( + type = 56, + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + closed = True, + point = True, ) + ], + axis = 56, + slice_number = 56, + geometry_mode = 'GEOMETRY_SELECTIONS' + ) + else: + return GeometrySpecDTO( + ) + """ + + def testGeometrySpecDTO(self): + """Test GeometrySpecDTO""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_human_readable_export_data.py b/python-restclient/test/test_human_readable_export_data.py new file mode 100644 index 0000000000..1a36bb2571 --- /dev/null +++ b/python-restclient/test/test_human_readable_export_data.py @@ -0,0 +1,67 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.human_readable_export_data import HumanReadableExportData + +class TestHumanReadableExportData(unittest.TestCase): + """HumanReadableExportData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> HumanReadableExportData: + """Test HumanReadableExportData + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `HumanReadableExportData` + """ + model = HumanReadableExportData() + if include_optional: + return HumanReadableExportData( + simulation_name = '', + biomodel_name = '', + application_name = '', + different_parameter_values = [ + '' + ], + application_type = '', + server_saved_file_name = '', + non_spatial = True, + sub_volume = { + 'key' : '' + }, + z_slices = 56, + t_slices = 56, + num_channels = 56 + ) + else: + return HumanReadableExportData( + ) + """ + + def testHumanReadableExportData(self): + """Test HumanReadableExportData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_n5_export_request.py b/python-restclient/test/test_n5_export_request.py new file mode 100644 index 0000000000..237c1030a1 --- /dev/null +++ b/python-restclient/test/test_n5_export_request.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.n5_export_request import N5ExportRequest + +class TestN5ExportRequest(unittest.TestCase): + """N5ExportRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> N5ExportRequest: + """Test N5ExportRequest + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `N5ExportRequest` + """ + model = N5ExportRequest() + if include_optional: + return N5ExportRequest( + standard_export_information = vcell_client.models.standard_export_info.StandardExportInfo( + output_context = [ + vcell_client.models.annotated_function_dto.AnnotatedFunctionDTO( + function_name = '', + function_expression = '', + error = '', + domain = vcell_client.models.domain.Domain( + name = '', ), + function_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + category = 'PREDEFINED', ) + ], + context_name = '', + simulation_name = '', + simulation_key = '', + simulation_job = 56, + geometry_specs = vcell_client.models.geometry_spec_dto.GeometrySpecDTO( + selections = [ + vcell_client.models.spatial_selection.SpatialSelection( + curve_selection_info = vcell_client.models.curve_selection_info.CurveSelectionInfo( + field_curve = vcell_client.models.curve.Curve( + b_closed = True, + description = '', + type = '', + beginning_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + ending_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + num_sample_points = 56, + segment_count = 56, + spatial_length = 1.337, + closed = True, + valid = True, ), + field_type = 56, + field_control_point = 56, + field_segment = 56, + field_u = 1.337, + field_u_extended = 1.337, + field_control_point_extended = 56, + field_segment_extended = 56, + field_direction_negative = True, + crossing = True, ), + var_type = vcell_client.models.variable_type.VariableType( + type = 56, + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + type = '', + smallest_mesh_cell_dimension_length = 1.337, + variable_type = , + closed = True, + point = True, ) + ], + axis = 56, + slice_number = 56, + geometry_mode = 'GEOMETRY_SELECTIONS', ), + time_specs = vcell_client.models.time_specs.TimeSpecs( + begin_time_index = 56, + end_time_index = 56, + all_times = [ + 1.337 + ], + mode = 'TIME_POINT', ), + variable_specs = vcell_client.models.variable_specs.VariableSpecs( + variable_names = [ + '' + ], ), ), + sub_volume = { + 'key' : '' + }, + exportable_data_type = 'ODE_VARIABLE_DATA', + dataset_name = '' + ) + else: + return N5ExportRequest( + ) + """ + + def testN5ExportRequest(self): + """Test N5ExportRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_sampled_curve.py b/python-restclient/test/test_sampled_curve.py new file mode 100644 index 0000000000..c82d0837ad --- /dev/null +++ b/python-restclient/test/test_sampled_curve.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.sampled_curve import SampledCurve + +class TestSampledCurve(unittest.TestCase): + """SampledCurve unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SampledCurve: + """Test SampledCurve + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SampledCurve` + """ + model = SampledCurve() + if include_optional: + return SampledCurve( + type = 'SampledCurve', + default_num_samples = 56, + max_control_points = 56, + min_control_points = 56, + segment_count = 56, + spatial_length = 1.337 + ) + else: + return SampledCurve( + type = 'SampledCurve', + ) + """ + + def testSampledCurve(self): + """Test SampledCurve""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_spatial_selection.py b/python-restclient/test/test_spatial_selection.py new file mode 100644 index 0000000000..9402387d26 --- /dev/null +++ b/python-restclient/test/test_spatial_selection.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.spatial_selection import SpatialSelection + +class TestSpatialSelection(unittest.TestCase): + """SpatialSelection unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpatialSelection: + """Test SpatialSelection + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpatialSelection` + """ + model = SpatialSelection() + if include_optional: + return SpatialSelection( + curve_selection_info = vcell_client.models.curve_selection_info.CurveSelectionInfo( + field_curve = vcell_client.models.curve.Curve( + b_closed = True, + description = '', + type = '', + beginning_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + ending_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + num_sample_points = 56, + segment_count = 56, + spatial_length = 1.337, + closed = True, + valid = True, ), + field_type = 56, + field_control_point = 56, + field_segment = 56, + field_u = 1.337, + field_u_extended = 1.337, + field_control_point_extended = 56, + field_segment_extended = 56, + field_direction_negative = True, + crossing = True, ), + var_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + type = '', + smallest_mesh_cell_dimension_length = 1.337, + variable_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + closed = True, + point = True + ) + else: + return SpatialSelection( + type = '', + ) + """ + + def testSpatialSelection(self): + """Test SpatialSelection""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_spatial_selection_contour.py b/python-restclient/test/test_spatial_selection_contour.py new file mode 100644 index 0000000000..27f1af63b7 --- /dev/null +++ b/python-restclient/test/test_spatial_selection_contour.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.spatial_selection_contour import SpatialSelectionContour + +class TestSpatialSelectionContour(unittest.TestCase): + """SpatialSelectionContour unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpatialSelectionContour: + """Test SpatialSelectionContour + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpatialSelectionContour` + """ + model = SpatialSelectionContour() + if include_optional: + return SpatialSelectionContour( + type = None, + field_sampled_data_indexes = [ + 56 + ], + index_samples = [ + 56 + ], + sampled_data_indexes = [ + 56 + ] + ) + else: + return SpatialSelectionContour( + ) + """ + + def testSpatialSelectionContour(self): + """Test SpatialSelectionContour""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_spatial_selection_membrane.py b/python-restclient/test/test_spatial_selection_membrane.py new file mode 100644 index 0000000000..a1a3b91f17 --- /dev/null +++ b/python-restclient/test/test_spatial_selection_membrane.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.spatial_selection_membrane import SpatialSelectionMembrane + +class TestSpatialSelectionMembrane(unittest.TestCase): + """SpatialSelectionMembrane unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpatialSelectionMembrane: + """Test SpatialSelectionMembrane + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpatialSelectionMembrane` + """ + model = SpatialSelectionMembrane() + if include_optional: + return SpatialSelectionMembrane( + type = None, + field_sampled_data_indexes = [ + 56 + ], + selection_source = vcell_client.models.sampled_curve.SampledCurve( + type = 'SampledCurve', + default_num_samples = 56, + max_control_points = 56, + min_control_points = 56, + segment_count = 56, + spatial_length = 1.337, ) + ) + else: + return SpatialSelectionMembrane( + type = None, + ) + """ + + def testSpatialSelectionMembrane(self): + """Test SpatialSelectionMembrane""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_spatial_selection_volume.py b/python-restclient/test/test_spatial_selection_volume.py new file mode 100644 index 0000000000..ae44c7f098 --- /dev/null +++ b/python-restclient/test/test_spatial_selection_volume.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.spatial_selection_volume import SpatialSelectionVolume + +class TestSpatialSelectionVolume(unittest.TestCase): + """SpatialSelectionVolume unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpatialSelectionVolume: + """Test SpatialSelectionVolume + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpatialSelectionVolume` + """ + model = SpatialSelectionVolume() + if include_optional: + return SpatialSelectionVolume( + type = None, + symmetric = True + ) + else: + return SpatialSelectionVolume( + ) + """ + + def testSpatialSelectionVolume(self): + """Test SpatialSelectionVolume""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_spline.py b/python-restclient/test/test_spline.py new file mode 100644 index 0000000000..17f1eae103 --- /dev/null +++ b/python-restclient/test/test_spline.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.spline import Spline + +class TestSpline(unittest.TestCase): + """Spline unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Spline: + """Test Spline + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Spline` + """ + model = Spline() + if include_optional: + return Spline( + type = 'Spline', + default_num_samples = 56, + max_control_points = 56, + min_control_points = 56, + segment_count = 56 + ) + else: + return Spline( + type = 'Spline', + ) + """ + + def testSpline(self): + """Test Spline""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_standard_export_info.py b/python-restclient/test/test_standard_export_info.py new file mode 100644 index 0000000000..003db5efa8 --- /dev/null +++ b/python-restclient/test/test_standard_export_info.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.standard_export_info import StandardExportInfo + +class TestStandardExportInfo(unittest.TestCase): + """StandardExportInfo unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StandardExportInfo: + """Test StandardExportInfo + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StandardExportInfo` + """ + model = StandardExportInfo() + if include_optional: + return StandardExportInfo( + output_context = [ + vcell_client.models.annotated_function_dto.AnnotatedFunctionDTO( + function_name = '', + function_expression = '', + error = '', + domain = vcell_client.models.domain.Domain( + name = '', ), + function_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + category = 'PREDEFINED', ) + ], + context_name = '', + simulation_name = '', + simulation_key = '', + simulation_job = 56, + geometry_specs = vcell_client.models.geometry_spec_dto.GeometrySpecDTO( + selections = [ + vcell_client.models.spatial_selection.SpatialSelection( + curve_selection_info = vcell_client.models.curve_selection_info.CurveSelectionInfo( + field_curve = vcell_client.models.curve.Curve( + b_closed = True, + description = '', + type = '', + beginning_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + default_num_samples = 56, + ending_coordinate = vcell_client.models.coordinate.Coordinate( + x = 1.337, + y = 1.337, + z = 1.337, ), + num_sample_points = 56, + segment_count = 56, + spatial_length = 1.337, + closed = True, + valid = True, ), + field_type = 56, + field_control_point = 56, + field_segment = 56, + field_u = 1.337, + field_u_extended = 1.337, + field_control_point_extended = 56, + field_segment_extended = 56, + field_direction_negative = True, + crossing = True, ), + var_type = vcell_client.models.variable_type.VariableType( + type = 56, + variable_domain = 'VARIABLEDOMAIN_POSTPROCESSING', + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + type = '', + smallest_mesh_cell_dimension_length = 1.337, + variable_type = vcell_client.models.variable_type.VariableType( + type = 56, + name = '', + units = '', + label = '', + legacy_warn = True, + default_label = '', + default_units = '', + type_name = '', ), + closed = True, + point = True, ) + ], + axis = 56, + slice_number = 56, + geometry_mode = 'GEOMETRY_SELECTIONS', ), + time_specs = vcell_client.models.time_specs.TimeSpecs( + begin_time_index = 56, + end_time_index = 56, + all_times = [ + 1.337 + ], + mode = 'TIME_POINT', ), + variable_specs = vcell_client.models.variable_specs.VariableSpecs( + variable_names = [ + '' + ], + mode = 'VARIABLE_ONE', ) + ) + else: + return StandardExportInfo( + ) + """ + + def testStandardExportInfo(self): + """Test StandardExportInfo""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_time_mode.py b/python-restclient/test/test_time_mode.py new file mode 100644 index 0000000000..1257dd701f --- /dev/null +++ b/python-restclient/test/test_time_mode.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.time_mode import TimeMode + +class TestTimeMode(unittest.TestCase): + """TimeMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTimeMode(self): + """Test TimeMode""" + # inst = TimeMode() + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_time_specs.py b/python-restclient/test/test_time_specs.py new file mode 100644 index 0000000000..69af1114e7 --- /dev/null +++ b/python-restclient/test/test_time_specs.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.time_specs import TimeSpecs + +class TestTimeSpecs(unittest.TestCase): + """TimeSpecs unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TimeSpecs: + """Test TimeSpecs + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TimeSpecs` + """ + model = TimeSpecs() + if include_optional: + return TimeSpecs( + begin_time_index = 56, + end_time_index = 56, + all_times = [ + 1.337 + ], + mode = 'TIME_POINT' + ) + else: + return TimeSpecs( + ) + """ + + def testTimeSpecs(self): + """Test TimeSpecs""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_variable_mode.py b/python-restclient/test/test_variable_mode.py new file mode 100644 index 0000000000..be06c0ad0c --- /dev/null +++ b/python-restclient/test/test_variable_mode.py @@ -0,0 +1,35 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.variable_mode import VariableMode + +class TestVariableMode(unittest.TestCase): + """VariableMode unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testVariableMode(self): + """Test VariableMode""" + # inst = VariableMode() + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/test/test_variable_specs.py b/python-restclient/test/test_variable_specs.py new file mode 100644 index 0000000000..078f784987 --- /dev/null +++ b/python-restclient/test/test_variable_specs.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from vcell_client.models.variable_specs import VariableSpecs + +class TestVariableSpecs(unittest.TestCase): + """VariableSpecs unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> VariableSpecs: + """Test VariableSpecs + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `VariableSpecs` + """ + model = VariableSpecs() + if include_optional: + return VariableSpecs( + variable_names = [ + '' + ], + mode = 'VARIABLE_ONE' + ) + else: + return VariableSpecs( + ) + """ + + def testVariableSpecs(self): + """Test VariableSpecs""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python-restclient/vcell_client/__init__.py b/python-restclient/vcell_client/__init__.py index 0f1995c49c..8ad5416366 100644 --- a/python-restclient/vcell_client/__init__.py +++ b/python-restclient/vcell_client/__init__.py @@ -20,6 +20,7 @@ # import apis into sdk package from vcell_client.api.admin_resource_api import AdminResourceApi from vcell_client.api.bio_model_resource_api import BioModelResourceApi +from vcell_client.api.export_resource_api import ExportResourceApi from vcell_client.api.field_data_resource_api import FieldDataResourceApi from vcell_client.api.geometry_resource_api import GeometryResourceApi from vcell_client.api.hello_world_api import HelloWorldApi @@ -43,22 +44,35 @@ # import models into sdk package from vcell_client.models.acces_token_representation_record import AccesTokenRepresentationRecord +from vcell_client.models.analytic_curve import AnalyticCurve +from vcell_client.models.annotated_function_dto import AnnotatedFunctionDTO from vcell_client.models.application_info import ApplicationInfo from vcell_client.models.batch_system_type import BatchSystemType from vcell_client.models.bio_model import BioModel from vcell_client.models.bio_model_child_summary import BioModelChildSummary from vcell_client.models.bio_model_summary import BioModelSummary from vcell_client.models.biomodel_ref import BiomodelRef +from vcell_client.models.composite_curve import CompositeCurve +from vcell_client.models.control_point_curve import ControlPointCurve +from vcell_client.models.coordinate import Coordinate +from vcell_client.models.curve import Curve +from vcell_client.models.curve_selection_info import CurveSelectionInfo from vcell_client.models.data_identifier import DataIdentifier from vcell_client.models.detailed_state import DetailedState from vcell_client.models.domain import Domain +from vcell_client.models.export_event import ExportEvent +from vcell_client.models.export_progress_type import ExportProgressType +from vcell_client.models.exportable_data_type import ExportableDataType from vcell_client.models.extent import Extent from vcell_client.models.external_data_identifier import ExternalDataIdentifier from vcell_client.models.field_data import FieldData from vcell_client.models.field_data_reference import FieldDataReference from vcell_client.models.field_data_saved_results import FieldDataSavedResults from vcell_client.models.field_data_shape import FieldDataShape +from vcell_client.models.function_category import FunctionCategory from vcell_client.models.gif_image import GIFImage +from vcell_client.models.geometry_mode import GeometryMode +from vcell_client.models.geometry_spec_dto import GeometrySpecDTO from vcell_client.models.geometry_summary import GeometrySummary from vcell_client.models.group_access import GroupAccess from vcell_client.models.group_access_all import GroupAccessAll @@ -66,6 +80,7 @@ from vcell_client.models.group_access_some import GroupAccessSome from vcell_client.models.hello_world_message import HelloWorldMessage from vcell_client.models.htc_job_id import HtcJobID +from vcell_client.models.human_readable_export_data import HumanReadableExportData from vcell_client.models.i_size import ISize from vcell_client.models.identity import Identity from vcell_client.models.math_model_child_summary import MathModelChildSummary @@ -73,10 +88,12 @@ from vcell_client.models.math_type import MathType from vcell_client.models.mathmodel_ref import MathmodelRef from vcell_client.models.model_type import ModelType +from vcell_client.models.n5_export_request import N5ExportRequest from vcell_client.models.origin import Origin from vcell_client.models.publication import Publication from vcell_client.models.publication_info import PublicationInfo from vcell_client.models.specialclaim import SPECIALCLAIM +from vcell_client.models.sampled_curve import SampledCurve from vcell_client.models.scheduler_status import SchedulerStatus from vcell_client.models.simulation_execution_status_record import SimulationExecutionStatusRecord from vcell_client.models.simulation_job_status_record import SimulationJobStatusRecord @@ -85,8 +102,16 @@ from vcell_client.models.simulation_queue_id import SimulationQueueID from vcell_client.models.simulation_status_persistent_record import SimulationStatusPersistentRecord from vcell_client.models.source_model import SourceModel +from vcell_client.models.spatial_selection import SpatialSelection +from vcell_client.models.spatial_selection_contour import SpatialSelectionContour +from vcell_client.models.spatial_selection_membrane import SpatialSelectionMembrane +from vcell_client.models.spatial_selection_volume import SpatialSelectionVolume +from vcell_client.models.spline import Spline +from vcell_client.models.standard_export_info import StandardExportInfo from vcell_client.models.status import Status from vcell_client.models.status_message import StatusMessage +from vcell_client.models.time_mode import TimeMode +from vcell_client.models.time_specs import TimeSpecs from vcell_client.models.user import User from vcell_client.models.user_identity_json_safe import UserIdentityJSONSafe from vcell_client.models.user_login_info_for_mapping import UserLoginInfoForMapping @@ -98,6 +123,8 @@ from vcell_client.models.v_cell_site import VCellSite from vcell_client.models.v_cell_software_version import VCellSoftwareVersion from vcell_client.models.variable_domain import VariableDomain +from vcell_client.models.variable_mode import VariableMode +from vcell_client.models.variable_specs import VariableSpecs from vcell_client.models.variable_type import VariableType from vcell_client.models.version import Version from vcell_client.models.version_flag import VersionFlag diff --git a/python-restclient/vcell_client/api/__init__.py b/python-restclient/vcell_client/api/__init__.py index 1527889b82..f4e375f974 100644 --- a/python-restclient/vcell_client/api/__init__.py +++ b/python-restclient/vcell_client/api/__init__.py @@ -3,6 +3,7 @@ # import apis into api package from vcell_client.api.admin_resource_api import AdminResourceApi from vcell_client.api.bio_model_resource_api import BioModelResourceApi +from vcell_client.api.export_resource_api import ExportResourceApi from vcell_client.api.field_data_resource_api import FieldDataResourceApi from vcell_client.api.geometry_resource_api import GeometryResourceApi from vcell_client.api.hello_world_api import HelloWorldApi diff --git a/python-restclient/vcell_client/api/export_resource_api.py b/python-restclient/vcell_client/api/export_resource_api.py new file mode 100644 index 0000000000..deafc31ab4 --- /dev/null +++ b/python-restclient/vcell_client/api/export_resource_api.py @@ -0,0 +1,596 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import warnings + +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Dict, List, Optional, Tuple, Union, Any + +try: + from typing import Annotated +except ImportError: + from typing_extensions import Annotated + +from typing import List, Optional + +from vcell_client.models.export_event import ExportEvent +from vcell_client.models.n5_export_request import N5ExportRequest + +from vcell_client.api_client import ApiClient +from vcell_client.api_response import ApiResponse +from vcell_client.rest import RESTResponseType + + +class ExportResourceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def export_n5( + self, + n5_export_request: Optional[N5ExportRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> int: + """export_n5 + + Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + + :param n5_export_request: + :type n5_export_request: N5ExportRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_n5_serialize( + n5_export_request=n5_export_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + '400': "VCellHTTPError", + '401': "VCellHTTPError", + '403': None, + '422': "VCellHTTPError", + '500': "VCellHTTPError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def export_n5_with_http_info( + self, + n5_export_request: Optional[N5ExportRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[int]: + """export_n5 + + Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + + :param n5_export_request: + :type n5_export_request: N5ExportRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_n5_serialize( + n5_export_request=n5_export_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + '400': "VCellHTTPError", + '401': "VCellHTTPError", + '403': None, + '422': "VCellHTTPError", + '500': "VCellHTTPError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def export_n5_without_preload_content( + self, + n5_export_request: Optional[N5ExportRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """export_n5 + + Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + + :param n5_export_request: + :type n5_export_request: N5ExportRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_n5_serialize( + n5_export_request=n5_export_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + '400': "VCellHTTPError", + '401': "VCellHTTPError", + '403': None, + '422': "VCellHTTPError", + '500': "VCellHTTPError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _export_n5_serialize( + self, + n5_export_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _host = None + + _collection_formats: Dict[str, str] = { + + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if n5_export_request is not None: + _body_params = n5_export_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'openId' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/export/N5', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def export_status( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ExportEvent]: + """export_status + + Get the status of your most recent export jobs. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ExportEvent]", + '401': "VCellHTTPError", + '403': None, + '404': "VCellHTTPError", + '500': "VCellHTTPError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def export_status_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ExportEvent]]: + """export_status + + Get the status of your most recent export jobs. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ExportEvent]", + '401': "VCellHTTPError", + '403': None, + '404': "VCellHTTPError", + '500': "VCellHTTPError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def export_status_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """export_status + + Get the status of your most recent export jobs. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ExportEvent]", + '401': "VCellHTTPError", + '403': None, + '404': "VCellHTTPError", + '500': "VCellHTTPError" + + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _export_status_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> Tuple: + + _host = None + + _collection_formats: Dict[str, str] = { + + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'openId' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/export/status', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/python-restclient/vcell_client/models/__init__.py b/python-restclient/vcell_client/models/__init__.py index 6e60972566..1069796e0a 100644 --- a/python-restclient/vcell_client/models/__init__.py +++ b/python-restclient/vcell_client/models/__init__.py @@ -16,22 +16,35 @@ # import models into model package from vcell_client.models.acces_token_representation_record import AccesTokenRepresentationRecord +from vcell_client.models.analytic_curve import AnalyticCurve +from vcell_client.models.annotated_function_dto import AnnotatedFunctionDTO from vcell_client.models.application_info import ApplicationInfo from vcell_client.models.batch_system_type import BatchSystemType from vcell_client.models.bio_model import BioModel from vcell_client.models.bio_model_child_summary import BioModelChildSummary from vcell_client.models.bio_model_summary import BioModelSummary from vcell_client.models.biomodel_ref import BiomodelRef +from vcell_client.models.composite_curve import CompositeCurve +from vcell_client.models.control_point_curve import ControlPointCurve +from vcell_client.models.coordinate import Coordinate +from vcell_client.models.curve import Curve +from vcell_client.models.curve_selection_info import CurveSelectionInfo from vcell_client.models.data_identifier import DataIdentifier from vcell_client.models.detailed_state import DetailedState from vcell_client.models.domain import Domain +from vcell_client.models.export_event import ExportEvent +from vcell_client.models.export_progress_type import ExportProgressType +from vcell_client.models.exportable_data_type import ExportableDataType from vcell_client.models.extent import Extent from vcell_client.models.external_data_identifier import ExternalDataIdentifier from vcell_client.models.field_data import FieldData from vcell_client.models.field_data_reference import FieldDataReference from vcell_client.models.field_data_saved_results import FieldDataSavedResults from vcell_client.models.field_data_shape import FieldDataShape +from vcell_client.models.function_category import FunctionCategory from vcell_client.models.gif_image import GIFImage +from vcell_client.models.geometry_mode import GeometryMode +from vcell_client.models.geometry_spec_dto import GeometrySpecDTO from vcell_client.models.geometry_summary import GeometrySummary from vcell_client.models.group_access import GroupAccess from vcell_client.models.group_access_all import GroupAccessAll @@ -39,6 +52,7 @@ from vcell_client.models.group_access_some import GroupAccessSome from vcell_client.models.hello_world_message import HelloWorldMessage from vcell_client.models.htc_job_id import HtcJobID +from vcell_client.models.human_readable_export_data import HumanReadableExportData from vcell_client.models.i_size import ISize from vcell_client.models.identity import Identity from vcell_client.models.math_model_child_summary import MathModelChildSummary @@ -46,10 +60,12 @@ from vcell_client.models.math_type import MathType from vcell_client.models.mathmodel_ref import MathmodelRef from vcell_client.models.model_type import ModelType +from vcell_client.models.n5_export_request import N5ExportRequest from vcell_client.models.origin import Origin from vcell_client.models.publication import Publication from vcell_client.models.publication_info import PublicationInfo from vcell_client.models.specialclaim import SPECIALCLAIM +from vcell_client.models.sampled_curve import SampledCurve from vcell_client.models.scheduler_status import SchedulerStatus from vcell_client.models.simulation_execution_status_record import SimulationExecutionStatusRecord from vcell_client.models.simulation_job_status_record import SimulationJobStatusRecord @@ -58,8 +74,16 @@ from vcell_client.models.simulation_queue_id import SimulationQueueID from vcell_client.models.simulation_status_persistent_record import SimulationStatusPersistentRecord from vcell_client.models.source_model import SourceModel +from vcell_client.models.spatial_selection import SpatialSelection +from vcell_client.models.spatial_selection_contour import SpatialSelectionContour +from vcell_client.models.spatial_selection_membrane import SpatialSelectionMembrane +from vcell_client.models.spatial_selection_volume import SpatialSelectionVolume +from vcell_client.models.spline import Spline +from vcell_client.models.standard_export_info import StandardExportInfo from vcell_client.models.status import Status from vcell_client.models.status_message import StatusMessage +from vcell_client.models.time_mode import TimeMode +from vcell_client.models.time_specs import TimeSpecs from vcell_client.models.user import User from vcell_client.models.user_identity_json_safe import UserIdentityJSONSafe from vcell_client.models.user_login_info_for_mapping import UserLoginInfoForMapping @@ -71,6 +95,8 @@ from vcell_client.models.v_cell_site import VCellSite from vcell_client.models.v_cell_software_version import VCellSoftwareVersion from vcell_client.models.variable_domain import VariableDomain +from vcell_client.models.variable_mode import VariableMode +from vcell_client.models.variable_specs import VariableSpecs from vcell_client.models.variable_type import VariableType from vcell_client.models.version import Version from vcell_client.models.version_flag import VersionFlag diff --git a/python-restclient/vcell_client/models/analytic_curve.py b/python-restclient/vcell_client/models/analytic_curve.py new file mode 100644 index 0000000000..f7112de21d --- /dev/null +++ b/python-restclient/vcell_client/models/analytic_curve.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import StrictBool, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.coordinate import Coordinate +from vcell_client.models.curve import Curve +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AnalyticCurve(Curve): + """ + AnalyticCurve + """ # noqa: E501 + type: StrictStr + exp_x: Optional[StrictStr] = Field(default=None, alias="expX") + exp_y: Optional[StrictStr] = Field(default=None, alias="expY") + exp_z: Optional[StrictStr] = Field(default=None, alias="expZ") + offset: Optional[Coordinate] = None + analytic_offset: Optional[Coordinate] = Field(default=None, alias="analyticOffset") + default_num_samples: Optional[StrictInt] = Field(default=None, alias="defaultNumSamples") + segment_count: Optional[StrictInt] = Field(default=None, alias="segmentCount") + valid: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["bClosed", "description", "type", "beginningCoordinate", "defaultNumSamples", "endingCoordinate", "numSamplePoints", "segmentCount", "spatialLength", "closed", "valid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AnalyticCurve from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of beginning_coordinate + if self.beginning_coordinate: + _dict['beginningCoordinate'] = self.beginning_coordinate.to_dict() + # override the default output from pydantic by calling `to_dict()` of ending_coordinate + if self.ending_coordinate: + _dict['endingCoordinate'] = self.ending_coordinate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AnalyticCurve from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in AnalyticCurve) in the input: " + _key) + + _obj = cls.model_validate({ + "bClosed": obj.get("bClosed"), + "description": obj.get("description"), + "type": obj.get("type") if obj.get("type") is not None else 'AnalyticCurve', + "beginningCoordinate": Coordinate.from_dict(obj.get("beginningCoordinate")) if obj.get("beginningCoordinate") is not None else None, + "defaultNumSamples": obj.get("defaultNumSamples"), + "endingCoordinate": Coordinate.from_dict(obj.get("endingCoordinate")) if obj.get("endingCoordinate") is not None else None, + "numSamplePoints": obj.get("numSamplePoints"), + "segmentCount": obj.get("segmentCount"), + "spatialLength": obj.get("spatialLength"), + "closed": obj.get("closed"), + "valid": obj.get("valid") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/annotated_function_dto.py b/python-restclient/vcell_client/models/annotated_function_dto.py new file mode 100644 index 0000000000..ca4746c33e --- /dev/null +++ b/python-restclient/vcell_client/models/annotated_function_dto.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from vcell_client.models.domain import Domain +from vcell_client.models.function_category import FunctionCategory +from vcell_client.models.variable_type import VariableType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class AnnotatedFunctionDTO(BaseModel): + """ + AnnotatedFunctionDTO + """ # noqa: E501 + function_name: Optional[StrictStr] = Field(default=None, alias="functionName") + function_expression: Optional[StrictStr] = Field(default=None, alias="functionExpression") + error: Optional[StrictStr] = None + domain: Optional[Domain] = None + function_type: Optional[VariableType] = Field(default=None, alias="functionType") + category: Optional[FunctionCategory] = None + __properties: ClassVar[List[str]] = ["functionName", "functionExpression", "error", "domain", "functionType", "category"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AnnotatedFunctionDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of domain + if self.domain: + _dict['domain'] = self.domain.to_dict() + # override the default output from pydantic by calling `to_dict()` of function_type + if self.function_type: + _dict['functionType'] = self.function_type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of AnnotatedFunctionDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in AnnotatedFunctionDTO) in the input: " + _key) + + _obj = cls.model_validate({ + "functionName": obj.get("functionName"), + "functionExpression": obj.get("functionExpression"), + "error": obj.get("error"), + "domain": Domain.from_dict(obj.get("domain")) if obj.get("domain") is not None else None, + "functionType": VariableType.from_dict(obj.get("functionType")) if obj.get("functionType") is not None else None, + "category": obj.get("category") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/composite_curve.py b/python-restclient/vcell_client/models/composite_curve.py new file mode 100644 index 0000000000..4990388b90 --- /dev/null +++ b/python-restclient/vcell_client/models/composite_curve.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import StrictBool, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.coordinate import Coordinate +from vcell_client.models.curve import Curve +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CompositeCurve(Curve): + """ + CompositeCurve + """ # noqa: E501 + type: StrictStr + field_curves: Optional[List[Any]] = Field(default=None, alias="fieldCurves") + curve_count: Optional[StrictInt] = Field(default=None, alias="curveCount") + default_num_samples: Optional[StrictInt] = Field(default=None, alias="defaultNumSamples") + segment_count: Optional[StrictInt] = Field(default=None, alias="segmentCount") + valid: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["bClosed", "description", "type", "beginningCoordinate", "defaultNumSamples", "endingCoordinate", "numSamplePoints", "segmentCount", "spatialLength", "closed", "valid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CompositeCurve from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of beginning_coordinate + if self.beginning_coordinate: + _dict['beginningCoordinate'] = self.beginning_coordinate.to_dict() + # override the default output from pydantic by calling `to_dict()` of ending_coordinate + if self.ending_coordinate: + _dict['endingCoordinate'] = self.ending_coordinate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CompositeCurve from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in CompositeCurve) in the input: " + _key) + + _obj = cls.model_validate({ + "bClosed": obj.get("bClosed"), + "description": obj.get("description"), + "type": obj.get("type") if obj.get("type") is not None else 'CompositeCurve', + "beginningCoordinate": Coordinate.from_dict(obj.get("beginningCoordinate")) if obj.get("beginningCoordinate") is not None else None, + "defaultNumSamples": obj.get("defaultNumSamples"), + "endingCoordinate": Coordinate.from_dict(obj.get("endingCoordinate")) if obj.get("endingCoordinate") is not None else None, + "numSamplePoints": obj.get("numSamplePoints"), + "segmentCount": obj.get("segmentCount"), + "spatialLength": obj.get("spatialLength"), + "closed": obj.get("closed"), + "valid": obj.get("valid") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/control_point_curve.py b/python-restclient/vcell_client/models/control_point_curve.py new file mode 100644 index 0000000000..64ac4716e3 --- /dev/null +++ b/python-restclient/vcell_client/models/control_point_curve.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import StrictBool, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.coordinate import Coordinate +from vcell_client.models.curve import Curve +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ControlPointCurve(Curve): + """ + ControlPointCurve + """ # noqa: E501 + type: StrictStr + control_points: Optional[List[Coordinate]] = Field(default=None, alias="controlPoints") + control_point_count: Optional[StrictInt] = Field(default=None, alias="controlPointCount") + control_points_vector: Optional[List[Coordinate]] = Field(default=None, alias="controlPointsVector") + max_control_points: Optional[StrictInt] = Field(default=None, alias="maxControlPoints") + min_control_points: Optional[StrictInt] = Field(default=None, alias="minControlPoints") + control_point_addable: Optional[StrictBool] = Field(default=None, alias="controlPointAddable") + valid: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["bClosed", "description", "type", "beginningCoordinate", "defaultNumSamples", "endingCoordinate", "numSamplePoints", "segmentCount", "spatialLength", "closed", "valid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[List[str]] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'SampledCurve': 'SampledCurve','Spline': 'Spline' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union[Self, Self]: + """Create an instance of ControlPointCurve from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of beginning_coordinate + if self.beginning_coordinate: + _dict['beginningCoordinate'] = self.beginning_coordinate.to_dict() + # override the default output from pydantic by calling `to_dict()` of ending_coordinate + if self.ending_coordinate: + _dict['endingCoordinate'] = self.ending_coordinate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Union[Self, Self]: + """Create an instance of ControlPointCurve from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("ControlPointCurve failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from vcell_client.models.sampled_curve import SampledCurve +from vcell_client.models.spline import Spline +# TODO: Rewrite to not use raise_errors +ControlPointCurve.model_rebuild(raise_errors=False) + diff --git a/python-restclient/vcell_client/models/coordinate.py b/python-restclient/vcell_client/models/coordinate.py new file mode 100644 index 0000000000..d621ca545c --- /dev/null +++ b/python-restclient/vcell_client/models/coordinate.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Coordinate(BaseModel): + """ + Coordinate + """ # noqa: E501 + x: Optional[Union[StrictFloat, StrictInt]] = None + y: Optional[Union[StrictFloat, StrictInt]] = None + z: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["x", "y", "z"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Coordinate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Coordinate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in Coordinate) in the input: " + _key) + + _obj = cls.model_validate({ + "x": obj.get("x"), + "y": obj.get("y"), + "z": obj.get("z") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/curve.py b/python-restclient/vcell_client/models/curve.py new file mode 100644 index 0000000000..52712d26e6 --- /dev/null +++ b/python-restclient/vcell_client/models/curve.py @@ -0,0 +1,129 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.coordinate import Coordinate +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Curve(BaseModel): + """ + Curve + """ # noqa: E501 + b_closed: Optional[StrictBool] = Field(default=None, alias="bClosed") + description: Optional[StrictStr] = None + type: StrictStr + beginning_coordinate: Optional[Coordinate] = Field(default=None, alias="beginningCoordinate") + default_num_samples: Optional[StrictInt] = Field(default=None, alias="defaultNumSamples") + ending_coordinate: Optional[Coordinate] = Field(default=None, alias="endingCoordinate") + num_sample_points: Optional[StrictInt] = Field(default=None, alias="numSamplePoints") + segment_count: Optional[StrictInt] = Field(default=None, alias="segmentCount") + spatial_length: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="spatialLength") + closed: Optional[StrictBool] = None + valid: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["bClosed", "description", "type", "beginningCoordinate", "defaultNumSamples", "endingCoordinate", "numSamplePoints", "segmentCount", "spatialLength", "closed", "valid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[List[str]] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'AnalyticCurve': 'AnalyticCurve','CompositeCurve': 'CompositeCurve','ControlPointCurve': 'ControlPointCurve','SampledCurve': 'SampledCurve','Spline': 'Spline' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union[Self, Self, Self]: + """Create an instance of Curve from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of beginning_coordinate + if self.beginning_coordinate: + _dict['beginningCoordinate'] = self.beginning_coordinate.to_dict() + # override the default output from pydantic by calling `to_dict()` of ending_coordinate + if self.ending_coordinate: + _dict['endingCoordinate'] = self.ending_coordinate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Union[Self, Self, Self]: + """Create an instance of Curve from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("Curve failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from vcell_client.models.analytic_curve import AnalyticCurve +from vcell_client.models.composite_curve import CompositeCurve +from vcell_client.models.control_point_curve import ControlPointCurve +from vcell_client.models.sampled_curve import SampledCurve +from vcell_client.models.spline import Spline +# TODO: Rewrite to not use raise_errors +Curve.model_rebuild(raise_errors=False) + diff --git a/python-restclient/vcell_client/models/curve_selection_info.py b/python-restclient/vcell_client/models/curve_selection_info.py new file mode 100644 index 0000000000..420845d042 --- /dev/null +++ b/python-restclient/vcell_client/models/curve_selection_info.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt +from pydantic import Field +from vcell_client.models.curve import Curve +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class CurveSelectionInfo(BaseModel): + """ + CurveSelectionInfo + """ # noqa: E501 + field_curve: Optional[Curve] = Field(default=None, alias="fieldCurve") + field_type: Optional[StrictInt] = Field(default=None, alias="fieldType") + field_control_point: Optional[StrictInt] = Field(default=None, alias="fieldControlPoint") + field_segment: Optional[StrictInt] = Field(default=None, alias="fieldSegment") + field_u: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="fieldU") + field_u_extended: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="fieldUExtended") + field_control_point_extended: Optional[StrictInt] = Field(default=None, alias="fieldControlPointExtended") + field_segment_extended: Optional[StrictInt] = Field(default=None, alias="fieldSegmentExtended") + field_direction_negative: Optional[StrictBool] = Field(default=None, alias="fieldDirectionNegative") + crossing: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["fieldCurve", "fieldType", "fieldControlPoint", "fieldSegment", "fieldU", "fieldUExtended", "fieldControlPointExtended", "fieldSegmentExtended", "fieldDirectionNegative", "crossing"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CurveSelectionInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of field_curve + if self.field_curve: + _dict['fieldCurve'] = self.field_curve.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of CurveSelectionInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in CurveSelectionInfo) in the input: " + _key) + + _obj = cls.model_validate({ + "fieldCurve": Curve.from_dict(obj.get("fieldCurve")) if obj.get("fieldCurve") is not None else None, + "fieldType": obj.get("fieldType"), + "fieldControlPoint": obj.get("fieldControlPoint"), + "fieldSegment": obj.get("fieldSegment"), + "fieldU": obj.get("fieldU"), + "fieldUExtended": obj.get("fieldUExtended"), + "fieldControlPointExtended": obj.get("fieldControlPointExtended"), + "fieldSegmentExtended": obj.get("fieldSegmentExtended"), + "fieldDirectionNegative": obj.get("fieldDirectionNegative"), + "crossing": obj.get("crossing") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/export_event.py b/python-restclient/vcell_client/models/export_event.py new file mode 100644 index 0000000000..fe8b02832f --- /dev/null +++ b/python-restclient/vcell_client/models/export_event.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.export_progress_type import ExportProgressType +from vcell_client.models.human_readable_export_data import HumanReadableExportData +from vcell_client.models.time_specs import TimeSpecs +from vcell_client.models.user import User +from vcell_client.models.variable_specs import VariableSpecs +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class ExportEvent(BaseModel): + """ + ExportEvent + """ # noqa: E501 + event_type: Optional[ExportProgressType] = Field(default=None, alias="eventType") + progress: Optional[Union[StrictFloat, StrictInt]] = None + format: Optional[StrictStr] = None + location: Optional[StrictStr] = None + user: Optional[User] = None + job_id: Optional[StrictInt] = Field(default=None, alias="jobID") + data_key: Optional[StrictStr] = Field(default=None, alias="dataKey") + data_id_string: Optional[StrictStr] = Field(default=None, alias="dataIdString") + time_specs: Optional[TimeSpecs] = Field(default=None, alias="timeSpecs") + variable_specs: Optional[VariableSpecs] = Field(default=None, alias="variableSpecs") + human_readable_data: Optional[HumanReadableExportData] = Field(default=None, alias="humanReadableData") + __properties: ClassVar[List[str]] = ["eventType", "progress", "format", "location", "user", "jobID", "dataKey", "dataIdString", "timeSpecs", "variableSpecs", "humanReadableData"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExportEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + # override the default output from pydantic by calling `to_dict()` of time_specs + if self.time_specs: + _dict['timeSpecs'] = self.time_specs.to_dict() + # override the default output from pydantic by calling `to_dict()` of variable_specs + if self.variable_specs: + _dict['variableSpecs'] = self.variable_specs.to_dict() + # override the default output from pydantic by calling `to_dict()` of human_readable_data + if self.human_readable_data: + _dict['humanReadableData'] = self.human_readable_data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of ExportEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in ExportEvent) in the input: " + _key) + + _obj = cls.model_validate({ + "eventType": obj.get("eventType"), + "progress": obj.get("progress"), + "format": obj.get("format"), + "location": obj.get("location"), + "user": User.from_dict(obj.get("user")) if obj.get("user") is not None else None, + "jobID": obj.get("jobID"), + "dataKey": obj.get("dataKey"), + "dataIdString": obj.get("dataIdString"), + "timeSpecs": TimeSpecs.from_dict(obj.get("timeSpecs")) if obj.get("timeSpecs") is not None else None, + "variableSpecs": VariableSpecs.from_dict(obj.get("variableSpecs")) if obj.get("variableSpecs") is not None else None, + "humanReadableData": HumanReadableExportData.from_dict(obj.get("humanReadableData")) if obj.get("humanReadableData") is not None else None + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/export_progress_type.py b/python-restclient/vcell_client/models/export_progress_type.py new file mode 100644 index 0000000000..d52f4337c8 --- /dev/null +++ b/python-restclient/vcell_client/models/export_progress_type.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self + + +class ExportProgressType(str, Enum): + """ + ExportProgressType + """ + + """ + allowed enum values + """ + EXPORT_START = 'EXPORT_START' + EXPORT_COMPLETE = 'EXPORT_COMPLETE' + EXPORT_FAILURE = 'EXPORT_FAILURE' + EXPORT_ASSEMBLING = 'EXPORT_ASSEMBLING' + EXPORT_PROGRESS = 'EXPORT_PROGRESS' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExportProgressType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/python-restclient/vcell_client/models/exportable_data_type.py b/python-restclient/vcell_client/models/exportable_data_type.py new file mode 100644 index 0000000000..0ae7db8269 --- /dev/null +++ b/python-restclient/vcell_client/models/exportable_data_type.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self + + +class ExportableDataType(str, Enum): + """ + ExportableDataType + """ + + """ + allowed enum values + """ + ODE_VARIABLE_DATA = 'ODE_VARIABLE_DATA' + PDE_VARIABLE_DATA = 'PDE_VARIABLE_DATA' + PDE_PARTICLE_DATA = 'PDE_PARTICLE_DATA' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExportableDataType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/python-restclient/vcell_client/models/function_category.py b/python-restclient/vcell_client/models/function_category.py new file mode 100644 index 0000000000..6f3ef21529 --- /dev/null +++ b/python-restclient/vcell_client/models/function_category.py @@ -0,0 +1,48 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self + + +class FunctionCategory(str, Enum): + """ + FunctionCategory + """ + + """ + allowed enum values + """ + PREDEFINED = 'PREDEFINED' + OLDUSERDEFINED = 'OLDUSERDEFINED' + OUTPUTFUNCTION = 'OUTPUTFUNCTION' + POSTPROCESSFUNCTION = 'POSTPROCESSFUNCTION' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FunctionCategory from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/python-restclient/vcell_client/models/geometry_mode.py b/python-restclient/vcell_client/models/geometry_mode.py new file mode 100644 index 0000000000..423a854cb0 --- /dev/null +++ b/python-restclient/vcell_client/models/geometry_mode.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self + + +class GeometryMode(str, Enum): + """ + GeometryMode + """ + + """ + allowed enum values + """ + GEOMETRY_SELECTIONS = 'GEOMETRY_SELECTIONS' + GEOMETRY_SLICE = 'GEOMETRY_SLICE' + GEOMETRY_FULL = 'GEOMETRY_FULL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GeometryMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/python-restclient/vcell_client/models/geometry_spec_dto.py b/python-restclient/vcell_client/models/geometry_spec_dto.py new file mode 100644 index 0000000000..1f3f1443b0 --- /dev/null +++ b/python-restclient/vcell_client/models/geometry_spec_dto.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictInt +from pydantic import Field +from vcell_client.models.geometry_mode import GeometryMode +from vcell_client.models.spatial_selection import SpatialSelection +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class GeometrySpecDTO(BaseModel): + """ + GeometrySpecDTO + """ # noqa: E501 + selections: Optional[List[SpatialSelection]] = None + axis: Optional[StrictInt] = None + slice_number: Optional[StrictInt] = Field(default=None, alias="sliceNumber") + geometry_mode: Optional[GeometryMode] = Field(default=None, alias="geometryMode") + __properties: ClassVar[List[str]] = ["selections", "axis", "sliceNumber", "geometryMode"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GeometrySpecDTO from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in selections (list) + _items = [] + if self.selections: + for _item in self.selections: + if _item: + _items.append(_item.to_dict()) + _dict['selections'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of GeometrySpecDTO from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in GeometrySpecDTO) in the input: " + _key) + + _obj = cls.model_validate({ + "selections": [SpatialSelection.from_dict(_item) for _item in obj.get("selections")] if obj.get("selections") is not None else None, + "axis": obj.get("axis"), + "sliceNumber": obj.get("sliceNumber"), + "geometryMode": obj.get("geometryMode") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/human_readable_export_data.py b/python-restclient/vcell_client/models/human_readable_export_data.py new file mode 100644 index 0000000000..d8b3b80707 --- /dev/null +++ b/python-restclient/vcell_client/models/human_readable_export_data.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from pydantic import Field +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class HumanReadableExportData(BaseModel): + """ + HumanReadableExportData + """ # noqa: E501 + simulation_name: Optional[StrictStr] = Field(default=None, alias="simulationName") + biomodel_name: Optional[StrictStr] = Field(default=None, alias="biomodelName") + application_name: Optional[StrictStr] = Field(default=None, alias="applicationName") + different_parameter_values: Optional[List[StrictStr]] = Field(default=None, alias="differentParameterValues") + application_type: Optional[StrictStr] = Field(default=None, alias="applicationType") + server_saved_file_name: Optional[StrictStr] = Field(default=None, alias="serverSavedFileName") + non_spatial: Optional[StrictBool] = Field(default=None, alias="nonSpatial") + sub_volume: Optional[Dict[str, StrictStr]] = Field(default=None, alias="subVolume") + z_slices: Optional[StrictInt] = Field(default=None, alias="zSlices") + t_slices: Optional[StrictInt] = Field(default=None, alias="tSlices") + num_channels: Optional[StrictInt] = Field(default=None, alias="numChannels") + __properties: ClassVar[List[str]] = ["simulationName", "biomodelName", "applicationName", "differentParameterValues", "applicationType", "serverSavedFileName", "nonSpatial", "subVolume", "zSlices", "tSlices", "numChannels"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of HumanReadableExportData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of HumanReadableExportData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in HumanReadableExportData) in the input: " + _key) + + _obj = cls.model_validate({ + "simulationName": obj.get("simulationName"), + "biomodelName": obj.get("biomodelName"), + "applicationName": obj.get("applicationName"), + "differentParameterValues": obj.get("differentParameterValues"), + "applicationType": obj.get("applicationType"), + "serverSavedFileName": obj.get("serverSavedFileName"), + "nonSpatial": obj.get("nonSpatial"), + "subVolume": obj.get("subVolume"), + "zSlices": obj.get("zSlices"), + "tSlices": obj.get("tSlices"), + "numChannels": obj.get("numChannels") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/n5_export_request.py b/python-restclient/vcell_client/models/n5_export_request.py new file mode 100644 index 0000000000..5e9c3a5845 --- /dev/null +++ b/python-restclient/vcell_client/models/n5_export_request.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from vcell_client.models.exportable_data_type import ExportableDataType +from vcell_client.models.standard_export_info import StandardExportInfo +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class N5ExportRequest(BaseModel): + """ + N5ExportRequest + """ # noqa: E501 + standard_export_information: Optional[StandardExportInfo] = Field(default=None, alias="standardExportInformation") + sub_volume: Optional[Dict[str, StrictStr]] = Field(default=None, alias="subVolume") + exportable_data_type: Optional[ExportableDataType] = Field(default=None, alias="exportableDataType") + dataset_name: Optional[StrictStr] = Field(default=None, alias="datasetName") + __properties: ClassVar[List[str]] = ["standardExportInformation", "subVolume", "exportableDataType", "datasetName"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of N5ExportRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of standard_export_information + if self.standard_export_information: + _dict['standardExportInformation'] = self.standard_export_information.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of N5ExportRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in N5ExportRequest) in the input: " + _key) + + _obj = cls.model_validate({ + "standardExportInformation": StandardExportInfo.from_dict(obj.get("standardExportInformation")) if obj.get("standardExportInformation") is not None else None, + "subVolume": obj.get("subVolume"), + "exportableDataType": obj.get("exportableDataType"), + "datasetName": obj.get("datasetName") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/sampled_curve.py b/python-restclient/vcell_client/models/sampled_curve.py new file mode 100644 index 0000000000..44d3302079 --- /dev/null +++ b/python-restclient/vcell_client/models/sampled_curve.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import StrictFloat, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.control_point_curve import ControlPointCurve +from vcell_client.models.coordinate import Coordinate +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SampledCurve(ControlPointCurve): + """ + SampledCurve + """ # noqa: E501 + type: StrictStr + default_num_samples: Optional[StrictInt] = Field(default=None, alias="defaultNumSamples") + max_control_points: Optional[StrictInt] = Field(default=None, alias="maxControlPoints") + min_control_points: Optional[StrictInt] = Field(default=None, alias="minControlPoints") + segment_count: Optional[StrictInt] = Field(default=None, alias="segmentCount") + spatial_length: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="spatialLength") + __properties: ClassVar[List[str]] = ["bClosed", "description", "type", "beginningCoordinate", "defaultNumSamples", "endingCoordinate", "numSamplePoints", "segmentCount", "spatialLength", "closed", "valid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SampledCurve from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of beginning_coordinate + if self.beginning_coordinate: + _dict['beginningCoordinate'] = self.beginning_coordinate.to_dict() + # override the default output from pydantic by calling `to_dict()` of ending_coordinate + if self.ending_coordinate: + _dict['endingCoordinate'] = self.ending_coordinate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SampledCurve from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in SampledCurve) in the input: " + _key) + + _obj = cls.model_validate({ + "bClosed": obj.get("bClosed"), + "description": obj.get("description"), + "type": obj.get("type") if obj.get("type") is not None else 'SampledCurve', + "beginningCoordinate": Coordinate.from_dict(obj.get("beginningCoordinate")) if obj.get("beginningCoordinate") is not None else None, + "defaultNumSamples": obj.get("defaultNumSamples"), + "endingCoordinate": Coordinate.from_dict(obj.get("endingCoordinate")) if obj.get("endingCoordinate") is not None else None, + "numSamplePoints": obj.get("numSamplePoints"), + "segmentCount": obj.get("segmentCount"), + "spatialLength": obj.get("spatialLength"), + "closed": obj.get("closed"), + "valid": obj.get("valid") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/spatial_selection.py b/python-restclient/vcell_client/models/spatial_selection.py new file mode 100644 index 0000000000..0d65b88a69 --- /dev/null +++ b/python-restclient/vcell_client/models/spatial_selection.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.curve_selection_info import CurveSelectionInfo +from vcell_client.models.variable_type import VariableType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SpatialSelection(BaseModel): + """ + SpatialSelection + """ # noqa: E501 + curve_selection_info: Optional[CurveSelectionInfo] = Field(default=None, alias="curveSelectionInfo") + var_type: Optional[VariableType] = Field(default=None, alias="varType") + type: StrictStr + smallest_mesh_cell_dimension_length: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="smallestMeshCellDimensionLength") + variable_type: Optional[VariableType] = Field(default=None, alias="variableType") + closed: Optional[StrictBool] = None + point: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["curveSelectionInfo", "varType", "type", "smallestMeshCellDimensionLength", "variableType", "closed", "point"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + # JSON field name that stores the object type + __discriminator_property_name: ClassVar[List[str]] = 'type' + + # discriminator mappings + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + 'Contour': 'SpatialSelectionContour','Membrane': 'SpatialSelectionMembrane','Volume': 'SpatialSelectionVolume' + } + + @classmethod + def get_discriminator_value(cls, obj: Dict) -> str: + """Returns the discriminator value (object type) of the data""" + discriminator_value = obj[cls.__discriminator_property_name] + if discriminator_value: + return cls.__discriminator_value_class_map.get(discriminator_value) + else: + return None + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Union[Self, Self, Self]: + """Create an instance of SpatialSelection from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of curve_selection_info + if self.curve_selection_info: + _dict['curveSelectionInfo'] = self.curve_selection_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of var_type + if self.var_type: + _dict['varType'] = self.var_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of variable_type + if self.variable_type: + _dict['variableType'] = self.variable_type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Union[Self, Self, Self]: + """Create an instance of SpatialSelection from a dict""" + # look up the object type based on discriminator mapping + object_type = cls.get_discriminator_value(obj) + if object_type: + klass = globals()[object_type] + return klass.from_dict(obj) + else: + raise ValueError("SpatialSelection failed to lookup discriminator value from " + + json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name + + ", mapping: " + json.dumps(cls.__discriminator_value_class_map)) + +from vcell_client.models.spatial_selection_contour import SpatialSelectionContour +from vcell_client.models.spatial_selection_membrane import SpatialSelectionMembrane +from vcell_client.models.spatial_selection_volume import SpatialSelectionVolume +# TODO: Rewrite to not use raise_errors +SpatialSelection.model_rebuild(raise_errors=False) + diff --git a/python-restclient/vcell_client/models/spatial_selection_contour.py b/python-restclient/vcell_client/models/spatial_selection_contour.py new file mode 100644 index 0000000000..338a4537ef --- /dev/null +++ b/python-restclient/vcell_client/models/spatial_selection_contour.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.curve_selection_info import CurveSelectionInfo +from vcell_client.models.spatial_selection import SpatialSelection +from vcell_client.models.variable_type import VariableType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SpatialSelectionContour(SpatialSelection): + """ + SpatialSelectionContour + """ # noqa: E501 + type: Optional[StrictStr] = 'Contour' + field_sampled_data_indexes: Optional[List[StrictInt]] = Field(default=None, alias="fieldSampledDataIndexes") + index_samples: Optional[List[StrictInt]] = Field(default=None, alias="indexSamples") + sampled_data_indexes: Optional[List[StrictInt]] = Field(default=None, alias="sampledDataIndexes") + __properties: ClassVar[List[str]] = ["curveSelectionInfo", "varType", "type", "smallestMeshCellDimensionLength", "variableType", "closed", "point"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpatialSelectionContour from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of curve_selection_info + if self.curve_selection_info: + _dict['curveSelectionInfo'] = self.curve_selection_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of var_type + if self.var_type: + _dict['varType'] = self.var_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of variable_type + if self.variable_type: + _dict['variableType'] = self.variable_type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SpatialSelectionContour from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in SpatialSelectionContour) in the input: " + _key) + + _obj = cls.model_validate({ + "curveSelectionInfo": CurveSelectionInfo.from_dict(obj.get("curveSelectionInfo")) if obj.get("curveSelectionInfo") is not None else None, + "varType": VariableType.from_dict(obj.get("varType")) if obj.get("varType") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'Contour', + "smallestMeshCellDimensionLength": obj.get("smallestMeshCellDimensionLength"), + "variableType": VariableType.from_dict(obj.get("variableType")) if obj.get("variableType") is not None else None, + "closed": obj.get("closed"), + "point": obj.get("point") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/spatial_selection_membrane.py b/python-restclient/vcell_client/models/spatial_selection_membrane.py new file mode 100644 index 0000000000..5941807e8b --- /dev/null +++ b/python-restclient/vcell_client/models/spatial_selection_membrane.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.curve_selection_info import CurveSelectionInfo +from vcell_client.models.sampled_curve import SampledCurve +from vcell_client.models.spatial_selection import SpatialSelection +from vcell_client.models.variable_type import VariableType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SpatialSelectionMembrane(SpatialSelection): + """ + SpatialSelectionMembrane + """ # noqa: E501 + type: StrictStr + field_sampled_data_indexes: Optional[List[StrictInt]] = Field(default=None, alias="fieldSampledDataIndexes") + selection_source: Optional[SampledCurve] = Field(default=None, alias="selectionSource") + __properties: ClassVar[List[str]] = ["curveSelectionInfo", "varType", "type", "smallestMeshCellDimensionLength", "variableType", "closed", "point"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpatialSelectionMembrane from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of curve_selection_info + if self.curve_selection_info: + _dict['curveSelectionInfo'] = self.curve_selection_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of var_type + if self.var_type: + _dict['varType'] = self.var_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of variable_type + if self.variable_type: + _dict['variableType'] = self.variable_type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SpatialSelectionMembrane from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in SpatialSelectionMembrane) in the input: " + _key) + + _obj = cls.model_validate({ + "curveSelectionInfo": CurveSelectionInfo.from_dict(obj.get("curveSelectionInfo")) if obj.get("curveSelectionInfo") is not None else None, + "varType": VariableType.from_dict(obj.get("varType")) if obj.get("varType") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'Membrane', + "smallestMeshCellDimensionLength": obj.get("smallestMeshCellDimensionLength"), + "variableType": VariableType.from_dict(obj.get("variableType")) if obj.get("variableType") is not None else None, + "closed": obj.get("closed"), + "point": obj.get("point") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/spatial_selection_volume.py b/python-restclient/vcell_client/models/spatial_selection_volume.py new file mode 100644 index 0000000000..fef784f943 --- /dev/null +++ b/python-restclient/vcell_client/models/spatial_selection_volume.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import StrictBool, StrictStr +from vcell_client.models.curve_selection_info import CurveSelectionInfo +from vcell_client.models.spatial_selection import SpatialSelection +from vcell_client.models.variable_type import VariableType +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class SpatialSelectionVolume(SpatialSelection): + """ + SpatialSelectionVolume + """ # noqa: E501 + type: Optional[StrictStr] = 'Volume' + symmetric: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["curveSelectionInfo", "varType", "type", "smallestMeshCellDimensionLength", "variableType", "closed", "point"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SpatialSelectionVolume from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of curve_selection_info + if self.curve_selection_info: + _dict['curveSelectionInfo'] = self.curve_selection_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of var_type + if self.var_type: + _dict['varType'] = self.var_type.to_dict() + # override the default output from pydantic by calling `to_dict()` of variable_type + if self.variable_type: + _dict['variableType'] = self.variable_type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of SpatialSelectionVolume from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in SpatialSelectionVolume) in the input: " + _key) + + _obj = cls.model_validate({ + "curveSelectionInfo": CurveSelectionInfo.from_dict(obj.get("curveSelectionInfo")) if obj.get("curveSelectionInfo") is not None else None, + "varType": VariableType.from_dict(obj.get("varType")) if obj.get("varType") is not None else None, + "type": obj.get("type") if obj.get("type") is not None else 'Volume', + "smallestMeshCellDimensionLength": obj.get("smallestMeshCellDimensionLength"), + "variableType": VariableType.from_dict(obj.get("variableType")) if obj.get("variableType") is not None else None, + "closed": obj.get("closed"), + "point": obj.get("point") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/spline.py b/python-restclient/vcell_client/models/spline.py new file mode 100644 index 0000000000..4fa624d176 --- /dev/null +++ b/python-restclient/vcell_client/models/spline.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.control_point_curve import ControlPointCurve +from vcell_client.models.coordinate import Coordinate +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class Spline(ControlPointCurve): + """ + Spline + """ # noqa: E501 + type: StrictStr + default_num_samples: Optional[StrictInt] = Field(default=None, alias="defaultNumSamples") + max_control_points: Optional[StrictInt] = Field(default=None, alias="maxControlPoints") + min_control_points: Optional[StrictInt] = Field(default=None, alias="minControlPoints") + segment_count: Optional[StrictInt] = Field(default=None, alias="segmentCount") + __properties: ClassVar[List[str]] = ["bClosed", "description", "type", "beginningCoordinate", "defaultNumSamples", "endingCoordinate", "numSamplePoints", "segmentCount", "spatialLength", "closed", "valid"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Spline from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of beginning_coordinate + if self.beginning_coordinate: + _dict['beginningCoordinate'] = self.beginning_coordinate.to_dict() + # override the default output from pydantic by calling `to_dict()` of ending_coordinate + if self.ending_coordinate: + _dict['endingCoordinate'] = self.ending_coordinate.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of Spline from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in Spline) in the input: " + _key) + + _obj = cls.model_validate({ + "bClosed": obj.get("bClosed"), + "description": obj.get("description"), + "type": obj.get("type") if obj.get("type") is not None else 'Spline', + "beginningCoordinate": Coordinate.from_dict(obj.get("beginningCoordinate")) if obj.get("beginningCoordinate") is not None else None, + "defaultNumSamples": obj.get("defaultNumSamples"), + "endingCoordinate": Coordinate.from_dict(obj.get("endingCoordinate")) if obj.get("endingCoordinate") is not None else None, + "numSamplePoints": obj.get("numSamplePoints"), + "segmentCount": obj.get("segmentCount"), + "spatialLength": obj.get("spatialLength"), + "closed": obj.get("closed"), + "valid": obj.get("valid") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/standard_export_info.py b/python-restclient/vcell_client/models/standard_export_info.py new file mode 100644 index 0000000000..3244390068 --- /dev/null +++ b/python-restclient/vcell_client/models/standard_export_info.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import Field +from vcell_client.models.annotated_function_dto import AnnotatedFunctionDTO +from vcell_client.models.geometry_spec_dto import GeometrySpecDTO +from vcell_client.models.time_specs import TimeSpecs +from vcell_client.models.variable_specs import VariableSpecs +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class StandardExportInfo(BaseModel): + """ + StandardExportInfo + """ # noqa: E501 + output_context: Optional[List[AnnotatedFunctionDTO]] = Field(default=None, alias="outputContext") + context_name: Optional[StrictStr] = Field(default=None, alias="contextName") + simulation_name: Optional[StrictStr] = Field(default=None, alias="simulationName") + simulation_key: Optional[StrictStr] = Field(default=None, alias="simulationKey") + simulation_job: Optional[StrictInt] = Field(default=None, alias="simulationJob") + geometry_specs: Optional[GeometrySpecDTO] = Field(default=None, alias="geometrySpecs") + time_specs: Optional[TimeSpecs] = Field(default=None, alias="timeSpecs") + variable_specs: Optional[VariableSpecs] = Field(default=None, alias="variableSpecs") + __properties: ClassVar[List[str]] = ["outputContext", "contextName", "simulationName", "simulationKey", "simulationJob", "geometrySpecs", "timeSpecs", "variableSpecs"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StandardExportInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in output_context (list) + _items = [] + if self.output_context: + for _item in self.output_context: + if _item: + _items.append(_item.to_dict()) + _dict['outputContext'] = _items + # override the default output from pydantic by calling `to_dict()` of geometry_specs + if self.geometry_specs: + _dict['geometrySpecs'] = self.geometry_specs.to_dict() + # override the default output from pydantic by calling `to_dict()` of time_specs + if self.time_specs: + _dict['timeSpecs'] = self.time_specs.to_dict() + # override the default output from pydantic by calling `to_dict()` of variable_specs + if self.variable_specs: + _dict['variableSpecs'] = self.variable_specs.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of StandardExportInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in StandardExportInfo) in the input: " + _key) + + _obj = cls.model_validate({ + "outputContext": [AnnotatedFunctionDTO.from_dict(_item) for _item in obj.get("outputContext")] if obj.get("outputContext") is not None else None, + "contextName": obj.get("contextName"), + "simulationName": obj.get("simulationName"), + "simulationKey": obj.get("simulationKey"), + "simulationJob": obj.get("simulationJob"), + "geometrySpecs": GeometrySpecDTO.from_dict(obj.get("geometrySpecs")) if obj.get("geometrySpecs") is not None else None, + "timeSpecs": TimeSpecs.from_dict(obj.get("timeSpecs")) if obj.get("timeSpecs") is not None else None, + "variableSpecs": VariableSpecs.from_dict(obj.get("variableSpecs")) if obj.get("variableSpecs") is not None else None + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/time_mode.py b/python-restclient/vcell_client/models/time_mode.py new file mode 100644 index 0000000000..a48833b782 --- /dev/null +++ b/python-restclient/vcell_client/models/time_mode.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self + + +class TimeMode(str, Enum): + """ + TimeMode + """ + + """ + allowed enum values + """ + TIME_POINT = 'TIME_POINT' + TIME_RANGE = 'TIME_RANGE' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TimeMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/python-restclient/vcell_client/models/time_specs.py b/python-restclient/vcell_client/models/time_specs.py new file mode 100644 index 0000000000..07aa80004b --- /dev/null +++ b/python-restclient/vcell_client/models/time_specs.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional, Union +from pydantic import BaseModel, StrictFloat, StrictInt +from pydantic import Field +from vcell_client.models.time_mode import TimeMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class TimeSpecs(BaseModel): + """ + TimeSpecs + """ # noqa: E501 + begin_time_index: Optional[StrictInt] = Field(default=None, alias="beginTimeIndex") + end_time_index: Optional[StrictInt] = Field(default=None, alias="endTimeIndex") + all_times: Optional[List[Union[StrictFloat, StrictInt]]] = Field(default=None, alias="allTimes") + mode: Optional[TimeMode] = None + __properties: ClassVar[List[str]] = ["beginTimeIndex", "endTimeIndex", "allTimes", "mode"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TimeSpecs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of TimeSpecs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in TimeSpecs) in the input: " + _key) + + _obj = cls.model_validate({ + "beginTimeIndex": obj.get("beginTimeIndex"), + "endTimeIndex": obj.get("endTimeIndex"), + "allTimes": obj.get("allTimes"), + "mode": obj.get("mode") + }) + return _obj + + diff --git a/python-restclient/vcell_client/models/variable_mode.py b/python-restclient/vcell_client/models/variable_mode.py new file mode 100644 index 0000000000..382683244f --- /dev/null +++ b/python-restclient/vcell_client/models/variable_mode.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +import re # noqa: F401 +from enum import Enum + + + +try: + from typing import Self +except ImportError: + from typing_extensions import Self + + +class VariableMode(str, Enum): + """ + VariableMode + """ + + """ + allowed enum values + """ + VARIABLE_ONE = 'VARIABLE_ONE' + VARIABLE_MULTI = 'VARIABLE_MULTI' + VARIABLE_ALL = 'VARIABLE_ALL' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of VariableMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/python-restclient/vcell_client/models/variable_specs.py b/python-restclient/vcell_client/models/variable_specs.py new file mode 100644 index 0000000000..87d167cfbc --- /dev/null +++ b/python-restclient/vcell_client/models/variable_specs.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + VCell API + + VCell API + + The version of the OpenAPI document: 1.0.1 + Contact: vcell_support@uchc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictStr +from pydantic import Field +from vcell_client.models.variable_mode import VariableMode +try: + from typing import Self +except ImportError: + from typing_extensions import Self + +class VariableSpecs(BaseModel): + """ + VariableSpecs + """ # noqa: E501 + variable_names: Optional[List[StrictStr]] = Field(default=None, alias="variableNames") + mode: Optional[VariableMode] = None + __properties: ClassVar[List[str]] = ["variableNames", "mode"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of VariableSpecs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + _dict = self.model_dump( + by_alias=True, + exclude={ + }, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Dict) -> Self: + """Create an instance of VariableSpecs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + # raise errors for additional fields in the input + for _key in obj.keys(): + if _key not in cls.__properties: + raise ValueError("Error due to additional fields (not defined in VariableSpecs) in the input: " + _key) + + _obj = cls.model_validate({ + "variableNames": obj.get("variableNames"), + "mode": obj.get("mode") + }) + return _obj + + diff --git a/tools/openapi.yaml b/tools/openapi.yaml index 806f2a9646..d12adac9d0 100644 --- a/tools/openapi.yaml +++ b/tools/openapi.yaml @@ -411,6 +411,95 @@ paths: application/json: schema: $ref: '#/components/schemas/VCellHTTPError' + /api/v1/export/N5: + post: + tags: + - Export Resource + description: "Create an N5 (ImageJ compatible) export. The request must contain\ + \ the standard export information, exportable data type, dataset name, and\ + \ sub-volume specifications." + operationId: exportN5 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N5ExportRequest' + responses: + "200": + description: OK + content: + application/json: + schema: + format: int64 + type: integer + "400": + description: Bad Request. + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + "401": + description: Not Authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + "403": + description: Not Allowed + "422": + description: Unprocessable content submitted + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + "500": + description: Data Access Exception + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + security: + - openId: + - user + /api/v1/export/status: + get: + tags: + - Export Resource + description: Get the status of your most recent export jobs. + operationId: exportStatus + responses: + "200": + description: OK + content: + application/json: + schema: + uniqueItems: true + type: array + items: + $ref: '#/components/schemas/ExportEvent' + "401": + description: Not Authenticated + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + "403": + description: Not Allowed + "404": + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + "500": + description: Data Access Exception + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + security: + - openId: + - user /api/v1/fieldData/IDs: get: tags: @@ -2005,6 +2094,49 @@ components: type: string userKey: type: string + AnalyticCurve: + required: + - type + type: object + allOf: + - $ref: '#/components/schemas/Curve' + properties: + type: + default: AnalyticCurve + type: string + expX: + $ref: '#/components/schemas/Expression' + expY: + $ref: '#/components/schemas/Expression' + expZ: + $ref: '#/components/schemas/Expression' + offset: + $ref: '#/components/schemas/Coordinate' + analyticOffset: + $ref: '#/components/schemas/Coordinate' + defaultNumSamples: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + valid: + type: boolean + AnnotatedFunctionDTO: + type: object + properties: + functionName: + type: string + functionExpression: + type: string + error: + type: string + domain: + $ref: '#/components/schemas/Domain' + functionType: + $ref: '#/components/schemas/VariableType' + category: + $ref: '#/components/schemas/FunctionCategory' Application: type: object ApplicationInfo: @@ -2146,6 +2278,145 @@ components: versionFlag: format: int32 type: integer + CompositeCurve: + required: + - type + type: object + allOf: + - $ref: '#/components/schemas/Curve' + properties: + type: + default: CompositeCurve + type: string + fieldCurves: + type: array + items: {} + curveCount: + format: int32 + type: integer + defaultNumSamples: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + valid: + type: boolean + ControlPointCurve: + required: + - type + type: object + allOf: + - $ref: '#/components/schemas/Curve' + properties: + type: + default: ControlPointCurve + type: string + controlPoints: + type: array + items: + $ref: '#/components/schemas/Coordinate' + controlPointCount: + format: int32 + type: integer + controlPointsVector: + type: array + items: + $ref: '#/components/schemas/Coordinate' + maxControlPoints: + format: int32 + type: integer + minControlPoints: + format: int32 + type: integer + controlPointAddable: + type: boolean + valid: + type: boolean + discriminator: + propertyName: type + mapping: + Spline: '#/components/schemas/Spline' + SampledCurve: '#/components/schemas/SampledCurve' + Coordinate: + type: object + properties: + x: + format: double + type: number + "y": + format: double + type: number + z: + format: double + type: number + Curve: + required: + - type + type: object + properties: + bClosed: + type: boolean + description: + type: string + type: + type: string + beginningCoordinate: + $ref: '#/components/schemas/Coordinate' + defaultNumSamples: + format: int32 + type: integer + endingCoordinate: + $ref: '#/components/schemas/Coordinate' + numSamplePoints: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + spatialLength: + format: double + type: number + closed: + type: boolean + valid: + type: boolean + discriminator: + propertyName: type + mapping: + AnalyticCurve: '#/components/schemas/AnalyticCurve' + CompositeCurve: '#/components/schemas/CompositeCurve' + ControlPointCurve: '#/components/schemas/ControlPointCurve' + CurveSelectionInfo: + type: object + properties: + fieldCurve: + $ref: '#/components/schemas/Curve' + fieldType: + format: int32 + type: integer + fieldControlPoint: + format: int32 + type: integer + fieldSegment: + format: int32 + type: integer + fieldU: + format: double + type: number + fieldUExtended: + format: double + type: number + fieldControlPointExtended: + format: int32 + type: integer + fieldSegmentExtended: + format: int32 + type: integer + fieldDirectionNegative: + type: boolean + crossing: + type: boolean DataIdentifier: type: object properties: @@ -2225,6 +2496,49 @@ components: properties: name: type: string + ExportEvent: + type: object + properties: + eventType: + $ref: '#/components/schemas/ExportProgressType' + progress: + format: double + type: number + format: + type: string + location: + type: string + user: + $ref: '#/components/schemas/User' + jobID: + format: int64 + type: integer + dataKey: + $ref: '#/components/schemas/KeyValue' + dataIdString: + type: string + timeSpecs: + $ref: '#/components/schemas/TimeSpecs' + variableSpecs: + $ref: '#/components/schemas/VariableSpecs' + humanReadableData: + $ref: '#/components/schemas/HumanReadableExportData' + ExportProgressType: + enum: + - EXPORT_START + - EXPORT_COMPLETE + - EXPORT_FAILURE + - EXPORT_ASSEMBLING + - EXPORT_PROGRESS + type: string + ExportableDataType: + enum: + - ODE_VARIABLE_DATA + - PDE_VARIABLE_DATA + - PDE_PARTICLE_DATA + type: string + Expression: + type: string Extent: type: object properties: @@ -2336,6 +2650,13 @@ components: items: format: double type: number + FunctionCategory: + enum: + - PREDEFINED + - OLDUSERDEFINED + - OUTPUTFUNCTION + - POSTPROCESSFUNCTION + type: string GIFImage: type: object properties: @@ -2344,6 +2665,27 @@ components: type: string size: $ref: '#/components/schemas/ISize' + GeometryMode: + enum: + - GEOMETRY_SELECTIONS + - GEOMETRY_SLICE + - GEOMETRY_FULL + type: string + GeometrySpecDTO: + type: object + properties: + selections: + type: array + items: + $ref: '#/components/schemas/SpatialSelection' + axis: + format: int32 + type: integer + sliceNumber: + format: int32 + type: integer + geometryMode: + $ref: '#/components/schemas/GeometryMode' GeometrySummary: type: object properties: @@ -2444,6 +2786,38 @@ components: type: string batchSystemType: $ref: '#/components/schemas/BatchSystemType' + HumanReadableExportData: + type: object + properties: + simulationName: + type: string + biomodelName: + type: string + applicationName: + type: string + differentParameterValues: + type: array + items: + type: string + applicationType: + type: string + serverSavedFileName: + type: string + nonSpatial: + type: boolean + subVolume: + type: object + additionalProperties: + type: string + zSlices: + format: int32 + type: integer + tSlices: + format: int32 + type: integer + numChannels: + format: int32 + type: integer ISize: type: object properties: @@ -2543,6 +2917,19 @@ components: - BIOMODEL - MATHMODEL type: string + N5ExportRequest: + type: object + properties: + standardExportInformation: + $ref: '#/components/schemas/StandardExportInfo' + subVolume: + type: object + additionalProperties: + type: string + exportableDataType: + $ref: '#/components/schemas/ExportableDataType' + datasetName: + type: string Origin: type: object properties: @@ -2637,6 +3024,31 @@ components: - publicationEditors - vcellSupport type: string + SampledCurve: + required: + - type + type: object + allOf: + - $ref: '#/components/schemas/ControlPointCurve' + properties: + type: + default: SampledCurve + type: string + defaultNumSamples: + format: int32 + type: integer + maxControlPoints: + format: int32 + type: integer + minControlPoints: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + spatialLength: + format: double + type: number SchedulerStatus: enum: - WAITING @@ -2730,6 +3142,126 @@ components: type: string modelType: $ref: '#/components/schemas/ModelType' + SpatialSelection: + required: + - type + type: object + properties: + curveSelectionInfo: + $ref: '#/components/schemas/CurveSelectionInfo' + varType: + $ref: '#/components/schemas/VariableType' + type: + type: string + smallestMeshCellDimensionLength: + format: double + type: number + variableType: + $ref: '#/components/schemas/VariableType' + closed: + type: boolean + point: + type: boolean + discriminator: + propertyName: type + mapping: + Membrane: '#/components/schemas/SpatialSelectionMembrane' + Contour: '#/components/schemas/SpatialSelectionContour' + Volume: '#/components/schemas/SpatialSelectionVolume' + SpatialSelectionContour: + type: object + allOf: + - $ref: '#/components/schemas/SpatialSelection' + properties: + type: + default: Contour + type: string + fieldSampledDataIndexes: + type: array + items: + format: int32 + type: integer + indexSamples: + type: array + items: + format: int32 + type: integer + sampledDataIndexes: + type: array + items: + format: int32 + type: integer + SpatialSelectionMembrane: + required: + - type + type: object + allOf: + - $ref: '#/components/schemas/SpatialSelection' + properties: + type: + default: Membrane + type: string + fieldSampledDataIndexes: + type: array + items: + format: int32 + type: integer + selectionSource: + $ref: '#/components/schemas/SampledCurve' + SpatialSelectionVolume: + type: object + allOf: + - $ref: '#/components/schemas/SpatialSelection' + properties: + type: + default: Volume + type: string + symmetric: + type: boolean + Spline: + required: + - type + type: object + allOf: + - $ref: '#/components/schemas/ControlPointCurve' + properties: + type: + default: Spline + type: string + defaultNumSamples: + format: int32 + type: integer + maxControlPoints: + format: int32 + type: integer + minControlPoints: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + StandardExportInfo: + type: object + properties: + outputContext: + type: array + items: + $ref: '#/components/schemas/AnnotatedFunctionDTO' + contextName: + type: string + simulationName: + type: string + simulationKey: + type: string + simulationJob: + format: int32 + type: integer + geometrySpecs: + $ref: '#/components/schemas/GeometrySpecDTO' + timeSpecs: + $ref: '#/components/schemas/TimeSpecs' + variableSpecs: + $ref: '#/components/schemas/VariableSpecs' Status: enum: - UNKNOWN @@ -2758,6 +3290,27 @@ components: timepoint: format: double type: number + TimeMode: + enum: + - TIME_POINT + - TIME_RANGE + type: string + TimeSpecs: + type: object + properties: + beginTimeIndex: + format: int32 + type: integer + endTimeIndex: + format: int32 + type: integer + allTimes: + type: array + items: + format: double + type: number + mode: + $ref: '#/components/schemas/TimeMode' User: type: object properties: @@ -2881,6 +3434,21 @@ components: - VARIABLEDOMAIN_NONSPATIAL - VARIABLEDOMAIN_POINT type: string + VariableMode: + enum: + - VARIABLE_ONE + - VARIABLE_MULTI + - VARIABLE_ALL + type: string + VariableSpecs: + type: object + properties: + variableNames: + type: array + items: + type: string + mode: + $ref: '#/components/schemas/VariableMode' VariableType: type: object properties: diff --git a/vcell-restclient/.openapi-generator/FILES b/vcell-restclient/.openapi-generator/FILES index baa17b7495..602361fc39 100644 --- a/vcell-restclient/.openapi-generator/FILES +++ b/vcell-restclient/.openapi-generator/FILES @@ -3,6 +3,8 @@ README.md api/openapi.yaml docs/AccesTokenRepresentationRecord.md docs/AdminResourceApi.md +docs/AnalyticCurve.md +docs/AnnotatedFunctionDTO.md docs/ApplicationInfo.md docs/BatchSystemType.md docs/BioModel.md @@ -10,9 +12,18 @@ docs/BioModelChildSummary.md docs/BioModelResourceApi.md docs/BioModelSummary.md docs/BiomodelRef.md +docs/CompositeCurve.md +docs/ControlPointCurve.md +docs/Coordinate.md +docs/Curve.md +docs/CurveSelectionInfo.md docs/DataIdentifier.md docs/DetailedState.md docs/Domain.md +docs/ExportEvent.md +docs/ExportProgressType.md +docs/ExportResourceApi.md +docs/ExportableDataType.md docs/Extent.md docs/ExternalDataIdentifier.md docs/FieldData.md @@ -20,8 +31,11 @@ docs/FieldDataReference.md docs/FieldDataResourceApi.md docs/FieldDataSavedResults.md docs/FieldDataShape.md +docs/FunctionCategory.md docs/GIFImage.md +docs/GeometryMode.md docs/GeometryResourceApi.md +docs/GeometrySpecDTO.md docs/GeometrySummary.md docs/GroupAccess.md docs/GroupAccessAll.md @@ -30,6 +44,7 @@ docs/GroupAccessSome.md docs/HelloWorldApi.md docs/HelloWorldMessage.md docs/HtcJobID.md +docs/HumanReadableExportData.md docs/ISize.md docs/Identity.md docs/MathModelChildSummary.md @@ -38,11 +53,13 @@ docs/MathModelSummary.md docs/MathType.md docs/MathmodelRef.md docs/ModelType.md +docs/N5ExportRequest.md docs/Origin.md docs/Publication.md docs/PublicationInfo.md docs/PublicationResourceApi.md docs/SPECIALCLAIM.md +docs/SampledCurve.md docs/SchedulerStatus.md docs/SimulationExecutionStatusRecord.md docs/SimulationJobStatusRecord.md @@ -53,8 +70,16 @@ docs/SimulationResourceApi.md docs/SimulationStatusPersistentRecord.md docs/SolverResourceApi.md docs/SourceModel.md +docs/SpatialSelection.md +docs/SpatialSelectionContour.md +docs/SpatialSelectionMembrane.md +docs/SpatialSelectionVolume.md +docs/Spline.md +docs/StandardExportInfo.md docs/Status.md docs/StatusMessage.md +docs/TimeMode.md +docs/TimeSpecs.md docs/User.md docs/UserIdentityJSONSafe.md docs/UserLoginInfoForMapping.md @@ -67,6 +92,8 @@ docs/VCellHTTPError.md docs/VCellSite.md docs/VCellSoftwareVersion.md docs/VariableDomain.md +docs/VariableMode.md +docs/VariableSpecs.md docs/VariableType.md docs/VcImageResourceApi.md docs/Version.md @@ -83,6 +110,7 @@ src/main/java/org/vcell/restclient/ServerConfiguration.java src/main/java/org/vcell/restclient/ServerVariable.java src/main/java/org/vcell/restclient/api/AdminResourceApi.java src/main/java/org/vcell/restclient/api/BioModelResourceApi.java +src/main/java/org/vcell/restclient/api/ExportResourceApi.java src/main/java/org/vcell/restclient/api/FieldDataResourceApi.java src/main/java/org/vcell/restclient/api/GeometryResourceApi.java src/main/java/org/vcell/restclient/api/HelloWorldApi.java @@ -94,22 +122,35 @@ src/main/java/org/vcell/restclient/api/UsersResourceApi.java src/main/java/org/vcell/restclient/api/VcImageResourceApi.java src/main/java/org/vcell/restclient/model/AbstractOpenApiSchema.java src/main/java/org/vcell/restclient/model/AccesTokenRepresentationRecord.java +src/main/java/org/vcell/restclient/model/AnalyticCurve.java +src/main/java/org/vcell/restclient/model/AnnotatedFunctionDTO.java src/main/java/org/vcell/restclient/model/ApplicationInfo.java src/main/java/org/vcell/restclient/model/BatchSystemType.java src/main/java/org/vcell/restclient/model/BioModel.java src/main/java/org/vcell/restclient/model/BioModelChildSummary.java src/main/java/org/vcell/restclient/model/BioModelSummary.java src/main/java/org/vcell/restclient/model/BiomodelRef.java +src/main/java/org/vcell/restclient/model/CompositeCurve.java +src/main/java/org/vcell/restclient/model/ControlPointCurve.java +src/main/java/org/vcell/restclient/model/Coordinate.java +src/main/java/org/vcell/restclient/model/Curve.java +src/main/java/org/vcell/restclient/model/CurveSelectionInfo.java src/main/java/org/vcell/restclient/model/DataIdentifier.java src/main/java/org/vcell/restclient/model/DetailedState.java src/main/java/org/vcell/restclient/model/Domain.java +src/main/java/org/vcell/restclient/model/ExportEvent.java +src/main/java/org/vcell/restclient/model/ExportProgressType.java +src/main/java/org/vcell/restclient/model/ExportableDataType.java src/main/java/org/vcell/restclient/model/Extent.java src/main/java/org/vcell/restclient/model/ExternalDataIdentifier.java src/main/java/org/vcell/restclient/model/FieldData.java src/main/java/org/vcell/restclient/model/FieldDataReference.java src/main/java/org/vcell/restclient/model/FieldDataSavedResults.java src/main/java/org/vcell/restclient/model/FieldDataShape.java +src/main/java/org/vcell/restclient/model/FunctionCategory.java src/main/java/org/vcell/restclient/model/GIFImage.java +src/main/java/org/vcell/restclient/model/GeometryMode.java +src/main/java/org/vcell/restclient/model/GeometrySpecDTO.java src/main/java/org/vcell/restclient/model/GeometrySummary.java src/main/java/org/vcell/restclient/model/GroupAccess.java src/main/java/org/vcell/restclient/model/GroupAccessAll.java @@ -117,6 +158,7 @@ src/main/java/org/vcell/restclient/model/GroupAccessNone.java src/main/java/org/vcell/restclient/model/GroupAccessSome.java src/main/java/org/vcell/restclient/model/HelloWorldMessage.java src/main/java/org/vcell/restclient/model/HtcJobID.java +src/main/java/org/vcell/restclient/model/HumanReadableExportData.java src/main/java/org/vcell/restclient/model/ISize.java src/main/java/org/vcell/restclient/model/Identity.java src/main/java/org/vcell/restclient/model/MathModelChildSummary.java @@ -124,10 +166,12 @@ src/main/java/org/vcell/restclient/model/MathModelSummary.java src/main/java/org/vcell/restclient/model/MathType.java src/main/java/org/vcell/restclient/model/MathmodelRef.java src/main/java/org/vcell/restclient/model/ModelType.java +src/main/java/org/vcell/restclient/model/N5ExportRequest.java src/main/java/org/vcell/restclient/model/Origin.java src/main/java/org/vcell/restclient/model/Publication.java src/main/java/org/vcell/restclient/model/PublicationInfo.java src/main/java/org/vcell/restclient/model/SPECIALCLAIM.java +src/main/java/org/vcell/restclient/model/SampledCurve.java src/main/java/org/vcell/restclient/model/SchedulerStatus.java src/main/java/org/vcell/restclient/model/SimulationExecutionStatusRecord.java src/main/java/org/vcell/restclient/model/SimulationJobStatusRecord.java @@ -136,8 +180,16 @@ src/main/java/org/vcell/restclient/model/SimulationQueueEntryStatusRecord.java src/main/java/org/vcell/restclient/model/SimulationQueueID.java src/main/java/org/vcell/restclient/model/SimulationStatusPersistentRecord.java src/main/java/org/vcell/restclient/model/SourceModel.java +src/main/java/org/vcell/restclient/model/SpatialSelection.java +src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java +src/main/java/org/vcell/restclient/model/SpatialSelectionMembrane.java +src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java +src/main/java/org/vcell/restclient/model/Spline.java +src/main/java/org/vcell/restclient/model/StandardExportInfo.java src/main/java/org/vcell/restclient/model/Status.java src/main/java/org/vcell/restclient/model/StatusMessage.java +src/main/java/org/vcell/restclient/model/TimeMode.java +src/main/java/org/vcell/restclient/model/TimeSpecs.java src/main/java/org/vcell/restclient/model/User.java src/main/java/org/vcell/restclient/model/UserIdentityJSONSafe.java src/main/java/org/vcell/restclient/model/UserLoginInfoForMapping.java @@ -149,6 +201,8 @@ src/main/java/org/vcell/restclient/model/VCellHTTPError.java src/main/java/org/vcell/restclient/model/VCellSite.java src/main/java/org/vcell/restclient/model/VCellSoftwareVersion.java src/main/java/org/vcell/restclient/model/VariableDomain.java +src/main/java/org/vcell/restclient/model/VariableMode.java +src/main/java/org/vcell/restclient/model/VariableSpecs.java src/main/java/org/vcell/restclient/model/VariableType.java src/main/java/org/vcell/restclient/model/Version.java src/main/java/org/vcell/restclient/model/VersionFlag.java diff --git a/vcell-restclient/README.md b/vcell-restclient/README.md index 54127a38b9..d176009a22 100644 --- a/vcell-restclient/README.md +++ b/vcell-restclient/README.md @@ -119,6 +119,10 @@ Class | Method | HTTP request | Description *BioModelResourceApi* | [**getBioModelVCMLWithHttpInfo**](docs/BioModelResourceApi.md#getBioModelVCMLWithHttpInfo) | **GET** /api/v1/bioModel/{bioModelID}/vcml_download | Get the BioModel in VCML format. *BioModelResourceApi* | [**saveBioModel**](docs/BioModelResourceApi.md#saveBioModel) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. *BioModelResourceApi* | [**saveBioModelWithHttpInfo**](docs/BioModelResourceApi.md#saveBioModelWithHttpInfo) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. +*ExportResourceApi* | [**exportN5**](docs/ExportResourceApi.md#exportN5) | **POST** /api/v1/export/N5 | +*ExportResourceApi* | [**exportN5WithHttpInfo**](docs/ExportResourceApi.md#exportN5WithHttpInfo) | **POST** /api/v1/export/N5 | +*ExportResourceApi* | [**exportStatus**](docs/ExportResourceApi.md#exportStatus) | **GET** /api/v1/export/status | +*ExportResourceApi* | [**exportStatusWithHttpInfo**](docs/ExportResourceApi.md#exportStatusWithHttpInfo) | **GET** /api/v1/export/status | *FieldDataResourceApi* | [**advancedCreate**](docs/FieldDataResourceApi.md#advancedCreate) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**advancedCreateWithHttpInfo**](docs/FieldDataResourceApi.md#advancedCreateWithHttpInfo) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**analyzeFile**](docs/FieldDataResourceApi.md#analyzeFile) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and return field data. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores. @@ -214,22 +218,35 @@ Class | Method | HTTP request | Description ## Documentation for Models - [AccesTokenRepresentationRecord](docs/AccesTokenRepresentationRecord.md) + - [AnalyticCurve](docs/AnalyticCurve.md) + - [AnnotatedFunctionDTO](docs/AnnotatedFunctionDTO.md) - [ApplicationInfo](docs/ApplicationInfo.md) - [BatchSystemType](docs/BatchSystemType.md) - [BioModel](docs/BioModel.md) - [BioModelChildSummary](docs/BioModelChildSummary.md) - [BioModelSummary](docs/BioModelSummary.md) - [BiomodelRef](docs/BiomodelRef.md) + - [CompositeCurve](docs/CompositeCurve.md) + - [ControlPointCurve](docs/ControlPointCurve.md) + - [Coordinate](docs/Coordinate.md) + - [Curve](docs/Curve.md) + - [CurveSelectionInfo](docs/CurveSelectionInfo.md) - [DataIdentifier](docs/DataIdentifier.md) - [DetailedState](docs/DetailedState.md) - [Domain](docs/Domain.md) + - [ExportEvent](docs/ExportEvent.md) + - [ExportProgressType](docs/ExportProgressType.md) + - [ExportableDataType](docs/ExportableDataType.md) - [Extent](docs/Extent.md) - [ExternalDataIdentifier](docs/ExternalDataIdentifier.md) - [FieldData](docs/FieldData.md) - [FieldDataReference](docs/FieldDataReference.md) - [FieldDataSavedResults](docs/FieldDataSavedResults.md) - [FieldDataShape](docs/FieldDataShape.md) + - [FunctionCategory](docs/FunctionCategory.md) - [GIFImage](docs/GIFImage.md) + - [GeometryMode](docs/GeometryMode.md) + - [GeometrySpecDTO](docs/GeometrySpecDTO.md) - [GeometrySummary](docs/GeometrySummary.md) - [GroupAccess](docs/GroupAccess.md) - [GroupAccessAll](docs/GroupAccessAll.md) @@ -237,6 +254,7 @@ Class | Method | HTTP request | Description - [GroupAccessSome](docs/GroupAccessSome.md) - [HelloWorldMessage](docs/HelloWorldMessage.md) - [HtcJobID](docs/HtcJobID.md) + - [HumanReadableExportData](docs/HumanReadableExportData.md) - [ISize](docs/ISize.md) - [Identity](docs/Identity.md) - [MathModelChildSummary](docs/MathModelChildSummary.md) @@ -244,10 +262,12 @@ Class | Method | HTTP request | Description - [MathType](docs/MathType.md) - [MathmodelRef](docs/MathmodelRef.md) - [ModelType](docs/ModelType.md) + - [N5ExportRequest](docs/N5ExportRequest.md) - [Origin](docs/Origin.md) - [Publication](docs/Publication.md) - [PublicationInfo](docs/PublicationInfo.md) - [SPECIALCLAIM](docs/SPECIALCLAIM.md) + - [SampledCurve](docs/SampledCurve.md) - [SchedulerStatus](docs/SchedulerStatus.md) - [SimulationExecutionStatusRecord](docs/SimulationExecutionStatusRecord.md) - [SimulationJobStatusRecord](docs/SimulationJobStatusRecord.md) @@ -256,8 +276,16 @@ Class | Method | HTTP request | Description - [SimulationQueueID](docs/SimulationQueueID.md) - [SimulationStatusPersistentRecord](docs/SimulationStatusPersistentRecord.md) - [SourceModel](docs/SourceModel.md) + - [SpatialSelection](docs/SpatialSelection.md) + - [SpatialSelectionContour](docs/SpatialSelectionContour.md) + - [SpatialSelectionMembrane](docs/SpatialSelectionMembrane.md) + - [SpatialSelectionVolume](docs/SpatialSelectionVolume.md) + - [Spline](docs/Spline.md) + - [StandardExportInfo](docs/StandardExportInfo.md) - [Status](docs/Status.md) - [StatusMessage](docs/StatusMessage.md) + - [TimeMode](docs/TimeMode.md) + - [TimeSpecs](docs/TimeSpecs.md) - [User](docs/User.md) - [UserIdentityJSONSafe](docs/UserIdentityJSONSafe.md) - [UserLoginInfoForMapping](docs/UserLoginInfoForMapping.md) @@ -269,6 +297,8 @@ Class | Method | HTTP request | Description - [VCellSite](docs/VCellSite.md) - [VCellSoftwareVersion](docs/VCellSoftwareVersion.md) - [VariableDomain](docs/VariableDomain.md) + - [VariableMode](docs/VariableMode.md) + - [VariableSpecs](docs/VariableSpecs.md) - [VariableType](docs/VariableType.md) - [Version](docs/Version.md) - [VersionFlag](docs/VersionFlag.md) diff --git a/vcell-restclient/api/openapi.yaml b/vcell-restclient/api/openapi.yaml index fcda717c56..2148555850 100644 --- a/vcell-restclient/api/openapi.yaml +++ b/vcell-restclient/api/openapi.yaml @@ -447,6 +447,98 @@ paths: tags: - Bio Model Resource x-accepts: application/json + /api/v1/export/N5: + post: + description: "Create an N5 (ImageJ compatible) export. The request must contain\ + \ the standard export information, exportable data type, dataset name, and\ + \ sub-volume specifications." + operationId: exportN5 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/N5ExportRequest' + responses: + "200": + content: + application/json: + schema: + format: int64 + type: integer + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Bad Request. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Not Authenticated + "403": + description: Not Allowed + "422": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Unprocessable content submitted + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Data Access Exception + security: + - openId: + - user + tags: + - Export Resource + x-content-type: application/json + x-accepts: application/json + /api/v1/export/status: + get: + description: Get the status of your most recent export jobs. + operationId: exportStatus + responses: + "200": + content: + application/json: + schema: + items: + $ref: '#/components/schemas/ExportEvent' + type: array + uniqueItems: true + description: OK + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Not Authenticated + "403": + description: Not Allowed + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Not found + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/VCellHTTPError' + description: Data Access Exception + security: + - openId: + - user + tags: + - Export Resource + x-accepts: application/json /api/v1/fieldData/IDs: get: operationId: getAllIDs @@ -2106,6 +2198,66 @@ components: userKey: type: string type: object + AnalyticCurve: + allOf: + - $ref: '#/components/schemas/Curve' + properties: + type: + default: AnalyticCurve + type: string + expX: + type: string + expY: + type: string + expZ: + type: string + offset: + $ref: '#/components/schemas/Coordinate' + analyticOffset: + $ref: '#/components/schemas/Coordinate' + defaultNumSamples: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + valid: + type: boolean + required: + - type + type: object + AnnotatedFunctionDTO: + example: + functionName: functionName + domain: + name: name + functionType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + error: error + category: null + functionExpression: functionExpression + properties: + functionName: + type: string + functionExpression: + type: string + error: + type: string + domain: + $ref: '#/components/schemas/Domain' + functionType: + $ref: '#/components/schemas/VariableType' + category: + $ref: '#/components/schemas/FunctionCategory' + type: object Application: type: object ApplicationInfo: @@ -2443,6 +2595,195 @@ components: format: int32 type: integer type: object + CompositeCurve: + allOf: + - $ref: '#/components/schemas/Curve' + properties: + type: + default: CompositeCurve + type: string + fieldCurves: + items: {} + type: array + curveCount: + format: int32 + type: integer + defaultNumSamples: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + valid: + type: boolean + required: + - type + type: object + ControlPointCurve: + allOf: + - $ref: '#/components/schemas/Curve' + discriminator: + mapping: + Spline: '#/components/schemas/Spline' + SampledCurve: '#/components/schemas/SampledCurve' + propertyName: type + properties: + type: + default: ControlPointCurve + type: string + controlPoints: + items: + $ref: '#/components/schemas/Coordinate' + type: array + controlPointCount: + format: int32 + type: integer + controlPointsVector: + items: + $ref: '#/components/schemas/Coordinate' + type: array + maxControlPoints: + format: int32 + type: integer + minControlPoints: + format: int32 + type: integer + controlPointAddable: + type: boolean + valid: + type: boolean + required: + - type + type: object + Coordinate: + example: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + properties: + x: + format: double + type: number + "y": + format: double + type: number + z: + format: double + type: number + type: object + Curve: + discriminator: + mapping: + AnalyticCurve: '#/components/schemas/AnalyticCurve' + CompositeCurve: '#/components/schemas/CompositeCurve' + ControlPointCurve: '#/components/schemas/ControlPointCurve' + propertyName: type + example: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + properties: + bClosed: + type: boolean + description: + type: string + type: + type: string + beginningCoordinate: + $ref: '#/components/schemas/Coordinate' + defaultNumSamples: + format: int32 + type: integer + endingCoordinate: + $ref: '#/components/schemas/Coordinate' + numSamplePoints: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + spatialLength: + format: double + type: number + closed: + type: boolean + valid: + type: boolean + required: + - type + type: object + CurveSelectionInfo: + example: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + properties: + fieldCurve: + $ref: '#/components/schemas/Curve' + fieldType: + format: int32 + type: integer + fieldControlPoint: + format: int32 + type: integer + fieldSegment: + format: int32 + type: integer + fieldU: + format: double + type: number + fieldUExtended: + format: double + type: number + fieldControlPointExtended: + format: int32 + type: integer + fieldSegmentExtended: + format: int32 + type: integer + fieldDirectionNegative: + type: boolean + crossing: + type: boolean + type: object DataIdentifier: example: variableType: @@ -2542,6 +2883,90 @@ components: name: type: string type: object + ExportEvent: + example: + dataKey: dataKey + jobID: 6 + variableSpecs: + mode: null + variableNames: + - variableNames + - variableNames + dataIdString: dataIdString + format: format + humanReadableData: + numChannels: 5 + applicationType: applicationType + differentParameterValues: + - differentParameterValues + - differentParameterValues + serverSavedFileName: serverSavedFileName + subVolume: + key: subVolume + zSlices: 1 + simulationName: simulationName + biomodelName: biomodelName + nonSpatial: true + tSlices: 5 + applicationName: applicationName + progress: 0.8008281904610115 + location: location + eventType: null + user: + mySpecials: + - null + - null + userName: userName + key: key + timeSpecs: + mode: null + endTimeIndex: 9 + beginTimeIndex: 5 + allTimes: + - 9.369310271410669 + - 9.369310271410669 + properties: + eventType: + $ref: '#/components/schemas/ExportProgressType' + progress: + format: double + type: number + format: + type: string + location: + type: string + user: + $ref: '#/components/schemas/User' + jobID: + format: int64 + type: integer + dataKey: + type: string + dataIdString: + type: string + timeSpecs: + $ref: '#/components/schemas/TimeSpecs' + variableSpecs: + $ref: '#/components/schemas/VariableSpecs' + humanReadableData: + $ref: '#/components/schemas/HumanReadableExportData' + type: object + ExportProgressType: + enum: + - EXPORT_START + - EXPORT_COMPLETE + - EXPORT_FAILURE + - EXPORT_ASSEMBLING + - EXPORT_PROGRESS + type: string + ExportableDataType: + enum: + - ODE_VARIABLE_DATA + - PDE_VARIABLE_DATA + - PDE_PARTICLE_DATA + type: string + Expression: + type: string Extent: example: x: 7.061401241503109 @@ -2719,8 +3144,8 @@ components: "y": 9.301444243932576 z: 3.616076749251911 times: - - 6.027456183070403 - - 6.027456183070403 + - 0.8008281904610115 + - 0.8008281904610115 origin: x: 5.962133916683182 "y": 5.637376656633329 @@ -2781,6 +3206,13 @@ components: type: number type: array type: object + FunctionCategory: + enum: + - PREDEFINED + - OLDUSERDEFINED + - OUTPUTFUNCTION + - POSTPROCESSFUNCTION + type: string GIFImage: example: size: @@ -2795,6 +3227,136 @@ components: size: $ref: '#/components/schemas/ISize' type: object + GeometryMode: + enum: + - GEOMETRY_SELECTIONS + - GEOMETRY_SLICE + - GEOMETRY_FULL + type: string + GeometrySpecDTO: + example: + selections: + - variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + - variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + sliceNumber: 4 + geometryMode: null + axis: 1 + properties: + selections: + items: + $ref: '#/components/schemas/SpatialSelection' + type: array + axis: + format: int32 + type: integer + sliceNumber: + format: int32 + type: integer + geometryMode: + $ref: '#/components/schemas/GeometryMode' + type: object GeometrySummary: example: extent: @@ -2947,6 +3509,53 @@ components: batchSystemType: $ref: '#/components/schemas/BatchSystemType' type: object + HumanReadableExportData: + example: + numChannels: 5 + applicationType: applicationType + differentParameterValues: + - differentParameterValues + - differentParameterValues + serverSavedFileName: serverSavedFileName + subVolume: + key: subVolume + zSlices: 1 + simulationName: simulationName + biomodelName: biomodelName + nonSpatial: true + tSlices: 5 + applicationName: applicationName + properties: + simulationName: + type: string + biomodelName: + type: string + applicationName: + type: string + differentParameterValues: + items: + type: string + type: array + applicationType: + type: string + serverSavedFileName: + type: string + nonSpatial: + type: boolean + subVolume: + additionalProperties: + type: string + type: object + zSlices: + format: int32 + type: integer + tSlices: + format: int32 + type: integer + numChannels: + format: int32 + type: integer + type: object ISize: example: x: 2 @@ -3161,6 +3770,183 @@ components: - BIOMODEL - MATHMODEL type: string + N5ExportRequest: + example: + subVolume: + key: subVolume + exportableDataType: null + datasetName: datasetName + standardExportInformation: + contextName: contextName + simulationKey: simulationKey + variableSpecs: + mode: null + variableNames: + - variableNames + - variableNames + simulationName: simulationName + geometrySpecs: + selections: + - variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + - variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + sliceNumber: 4 + geometryMode: null + axis: 1 + outputContext: + - functionName: functionName + domain: + name: name + functionType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + error: error + category: null + functionExpression: functionExpression + - functionName: functionName + domain: + name: name + functionType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + error: error + category: null + functionExpression: functionExpression + simulationJob: 6 + timeSpecs: + mode: null + endTimeIndex: 9 + beginTimeIndex: 5 + allTimes: + - 9.369310271410669 + - 9.369310271410669 + properties: + standardExportInformation: + $ref: '#/components/schemas/StandardExportInfo' + subVolume: + additionalProperties: + type: string + type: object + exportableDataType: + $ref: '#/components/schemas/ExportableDataType' + datasetName: + type: string + type: object Origin: example: x: 5.962133916683182 @@ -3319,6 +4105,31 @@ components: - publicationEditors - vcellSupport type: string + SampledCurve: + allOf: + - $ref: '#/components/schemas/ControlPointCurve' + properties: + type: + default: SampledCurve + type: string + defaultNumSamples: + format: int32 + type: integer + maxControlPoints: + format: int32 + type: integer + minControlPoints: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + spatialLength: + format: double + type: number + required: + - type + type: object SchedulerStatus: enum: - WAITING @@ -3491,6 +4302,338 @@ components: modelType: $ref: '#/components/schemas/ModelType' type: object + SpatialSelection: + discriminator: + mapping: + Membrane: '#/components/schemas/SpatialSelectionMembrane' + Contour: '#/components/schemas/SpatialSelectionContour' + Volume: '#/components/schemas/SpatialSelectionVolume' + propertyName: type + example: + variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + properties: + curveSelectionInfo: + $ref: '#/components/schemas/CurveSelectionInfo' + varType: + $ref: '#/components/schemas/VariableType' + type: + type: string + smallestMeshCellDimensionLength: + format: double + type: number + variableType: + $ref: '#/components/schemas/VariableType' + closed: + type: boolean + point: + type: boolean + required: + - type + type: object + SpatialSelectionContour: + allOf: + - $ref: '#/components/schemas/SpatialSelection' + properties: + type: + default: Contour + type: string + fieldSampledDataIndexes: + items: + format: int32 + type: integer + type: array + indexSamples: + items: + format: int32 + type: integer + type: array + sampledDataIndexes: + items: + format: int32 + type: integer + type: array + type: object + SpatialSelectionMembrane: + allOf: + - $ref: '#/components/schemas/SpatialSelection' + properties: + type: + default: Membrane + type: string + fieldSampledDataIndexes: + items: + format: int32 + type: integer + type: array + selectionSource: + $ref: '#/components/schemas/SampledCurve' + required: + - type + type: object + SpatialSelectionVolume: + allOf: + - $ref: '#/components/schemas/SpatialSelection' + properties: + type: + default: Volume + type: string + symmetric: + type: boolean + type: object + Spline: + allOf: + - $ref: '#/components/schemas/ControlPointCurve' + properties: + type: + default: Spline + type: string + defaultNumSamples: + format: int32 + type: integer + maxControlPoints: + format: int32 + type: integer + minControlPoints: + format: int32 + type: integer + segmentCount: + format: int32 + type: integer + required: + - type + type: object + StandardExportInfo: + example: + contextName: contextName + simulationKey: simulationKey + variableSpecs: + mode: null + variableNames: + - variableNames + - variableNames + simulationName: simulationName + geometrySpecs: + selections: + - variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + - variableType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + varType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + smallestMeshCellDimensionLength: 7.457744773683766 + closed: true + type: type + point: true + curveSelectionInfo: + fieldControlPoint: 4 + fieldCurve: + spatialLength: 3.616076749251911 + valid: true + bClosed: true + endingCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + description: description + beginningCoordinate: + x: 1.4658129805029452 + "y": 5.962133916683182 + z: 5.637376656633329 + numSamplePoints: 7 + closed: true + type: type + defaultNumSamples: 2 + segmentCount: 9 + fieldControlPointExtended: 1 + fieldDirectionNegative: true + fieldSegment: 7 + fieldUExtended: 1.0246457001441578 + fieldType: 2 + crossing: true + fieldU: 1.2315135367772556 + fieldSegmentExtended: 6 + sliceNumber: 4 + geometryMode: null + axis: 1 + outputContext: + - functionName: functionName + domain: + name: name + functionType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + error: error + category: null + functionExpression: functionExpression + - functionName: functionName + domain: + name: name + functionType: + defaultUnits: defaultUnits + name: name + typeName: typeName + defaultLabel: defaultLabel + units: units + label: label + type: 0 + variableDomain: null + legacyWarn: true + error: error + category: null + functionExpression: functionExpression + simulationJob: 6 + timeSpecs: + mode: null + endTimeIndex: 9 + beginTimeIndex: 5 + allTimes: + - 9.369310271410669 + - 9.369310271410669 + properties: + outputContext: + items: + $ref: '#/components/schemas/AnnotatedFunctionDTO' + type: array + contextName: + type: string + simulationName: + type: string + simulationKey: + type: string + simulationJob: + format: int32 + type: integer + geometrySpecs: + $ref: '#/components/schemas/GeometrySpecDTO' + timeSpecs: + $ref: '#/components/schemas/TimeSpecs' + variableSpecs: + $ref: '#/components/schemas/VariableSpecs' + type: object Status: enum: - UNKNOWN @@ -3561,6 +4704,34 @@ components: format: double type: number type: object + TimeMode: + enum: + - TIME_POINT + - TIME_RANGE + type: string + TimeSpecs: + example: + mode: null + endTimeIndex: 9 + beginTimeIndex: 5 + allTimes: + - 9.369310271410669 + - 9.369310271410669 + properties: + beginTimeIndex: + format: int32 + type: integer + endTimeIndex: + format: int32 + type: integer + allTimes: + items: + format: double + type: number + type: array + mode: + $ref: '#/components/schemas/TimeMode' + type: object User: example: mySpecials: @@ -3771,6 +4942,26 @@ components: - VARIABLEDOMAIN_NONSPATIAL - VARIABLEDOMAIN_POINT type: string + VariableMode: + enum: + - VARIABLE_ONE + - VARIABLE_MULTI + - VARIABLE_ALL + type: string + VariableSpecs: + example: + mode: null + variableNames: + - variableNames + - variableNames + properties: + variableNames: + items: + type: string + type: array + mode: + $ref: '#/components/schemas/VariableMode' + type: object VariableType: example: defaultUnits: defaultUnits diff --git a/vcell-restclient/docs/AnalyticCurve.md b/vcell-restclient/docs/AnalyticCurve.md new file mode 100644 index 0000000000..49608c992a --- /dev/null +++ b/vcell-restclient/docs/AnalyticCurve.md @@ -0,0 +1,21 @@ + + +# AnalyticCurve + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | | +|**expX** | **String** | | [optional] | +|**expY** | **String** | | [optional] | +|**expZ** | **String** | | [optional] | +|**offset** | [**Coordinate**](Coordinate.md) | | [optional] | +|**analyticOffset** | [**Coordinate**](Coordinate.md) | | [optional] | +|**defaultNumSamples** | **Integer** | | [optional] | +|**segmentCount** | **Integer** | | [optional] | +|**valid** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/AnnotatedFunctionDTO.md b/vcell-restclient/docs/AnnotatedFunctionDTO.md new file mode 100644 index 0000000000..db8b8139a7 --- /dev/null +++ b/vcell-restclient/docs/AnnotatedFunctionDTO.md @@ -0,0 +1,18 @@ + + +# AnnotatedFunctionDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**functionName** | **String** | | [optional] | +|**functionExpression** | **String** | | [optional] | +|**error** | **String** | | [optional] | +|**domain** | [**Domain**](Domain.md) | | [optional] | +|**functionType** | [**VariableType**](VariableType.md) | | [optional] | +|**category** | **FunctionCategory** | | [optional] | + + + diff --git a/vcell-restclient/docs/CompositeCurve.md b/vcell-restclient/docs/CompositeCurve.md new file mode 100644 index 0000000000..178d2a0888 --- /dev/null +++ b/vcell-restclient/docs/CompositeCurve.md @@ -0,0 +1,18 @@ + + +# CompositeCurve + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | | +|**fieldCurves** | **List<Object>** | | [optional] | +|**curveCount** | **Integer** | | [optional] | +|**defaultNumSamples** | **Integer** | | [optional] | +|**segmentCount** | **Integer** | | [optional] | +|**valid** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/ControlPointCurve.md b/vcell-restclient/docs/ControlPointCurve.md new file mode 100644 index 0000000000..3e92f4d05b --- /dev/null +++ b/vcell-restclient/docs/ControlPointCurve.md @@ -0,0 +1,20 @@ + + +# ControlPointCurve + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | | +|**controlPoints** | [**List<Coordinate>**](Coordinate.md) | | [optional] | +|**controlPointCount** | **Integer** | | [optional] | +|**controlPointsVector** | [**List<Coordinate>**](Coordinate.md) | | [optional] | +|**maxControlPoints** | **Integer** | | [optional] | +|**minControlPoints** | **Integer** | | [optional] | +|**controlPointAddable** | **Boolean** | | [optional] | +|**valid** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/Coordinate.md b/vcell-restclient/docs/Coordinate.md new file mode 100644 index 0000000000..99fb04df19 --- /dev/null +++ b/vcell-restclient/docs/Coordinate.md @@ -0,0 +1,15 @@ + + +# Coordinate + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**x** | **Double** | | [optional] | +|**y** | **Double** | | [optional] | +|**z** | **Double** | | [optional] | + + + diff --git a/vcell-restclient/docs/Curve.md b/vcell-restclient/docs/Curve.md new file mode 100644 index 0000000000..71cceb7f58 --- /dev/null +++ b/vcell-restclient/docs/Curve.md @@ -0,0 +1,23 @@ + + +# Curve + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**bClosed** | **Boolean** | | [optional] | +|**description** | **String** | | [optional] | +|**type** | **String** | | | +|**beginningCoordinate** | [**Coordinate**](Coordinate.md) | | [optional] | +|**defaultNumSamples** | **Integer** | | [optional] | +|**endingCoordinate** | [**Coordinate**](Coordinate.md) | | [optional] | +|**numSamplePoints** | **Integer** | | [optional] | +|**segmentCount** | **Integer** | | [optional] | +|**spatialLength** | **Double** | | [optional] | +|**closed** | **Boolean** | | [optional] | +|**valid** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/CurveSelectionInfo.md b/vcell-restclient/docs/CurveSelectionInfo.md new file mode 100644 index 0000000000..ba4a54796f --- /dev/null +++ b/vcell-restclient/docs/CurveSelectionInfo.md @@ -0,0 +1,22 @@ + + +# CurveSelectionInfo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**fieldCurve** | [**Curve**](Curve.md) | | [optional] | +|**fieldType** | **Integer** | | [optional] | +|**fieldControlPoint** | **Integer** | | [optional] | +|**fieldSegment** | **Integer** | | [optional] | +|**fieldU** | **Double** | | [optional] | +|**fieldUExtended** | **Double** | | [optional] | +|**fieldControlPointExtended** | **Integer** | | [optional] | +|**fieldSegmentExtended** | **Integer** | | [optional] | +|**fieldDirectionNegative** | **Boolean** | | [optional] | +|**crossing** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/ExportEvent.md b/vcell-restclient/docs/ExportEvent.md new file mode 100644 index 0000000000..7db15120d6 --- /dev/null +++ b/vcell-restclient/docs/ExportEvent.md @@ -0,0 +1,23 @@ + + +# ExportEvent + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**eventType** | **ExportProgressType** | | [optional] | +|**progress** | **Double** | | [optional] | +|**format** | **String** | | [optional] | +|**location** | **String** | | [optional] | +|**user** | [**User**](User.md) | | [optional] | +|**jobID** | **Long** | | [optional] | +|**dataKey** | **String** | | [optional] | +|**dataIdString** | **String** | | [optional] | +|**timeSpecs** | [**TimeSpecs**](TimeSpecs.md) | | [optional] | +|**variableSpecs** | [**VariableSpecs**](VariableSpecs.md) | | [optional] | +|**humanReadableData** | [**HumanReadableExportData**](HumanReadableExportData.md) | | [optional] | + + + diff --git a/vcell-restclient/docs/ExportProgressType.md b/vcell-restclient/docs/ExportProgressType.md new file mode 100644 index 0000000000..e075ece295 --- /dev/null +++ b/vcell-restclient/docs/ExportProgressType.md @@ -0,0 +1,19 @@ + + +# ExportProgressType + +## Enum + + +* `START` (value: `"EXPORT_START"`) + +* `COMPLETE` (value: `"EXPORT_COMPLETE"`) + +* `FAILURE` (value: `"EXPORT_FAILURE"`) + +* `ASSEMBLING` (value: `"EXPORT_ASSEMBLING"`) + +* `PROGRESS` (value: `"EXPORT_PROGRESS"`) + + + diff --git a/vcell-restclient/docs/ExportResourceApi.md b/vcell-restclient/docs/ExportResourceApi.md new file mode 100644 index 0000000000..2bc9a2d34f --- /dev/null +++ b/vcell-restclient/docs/ExportResourceApi.md @@ -0,0 +1,298 @@ +# ExportResourceApi + +All URIs are relative to *https://vcell.cam.uchc.edu* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**exportN5**](ExportResourceApi.md#exportN5) | **POST** /api/v1/export/N5 | | +| [**exportN5WithHttpInfo**](ExportResourceApi.md#exportN5WithHttpInfo) | **POST** /api/v1/export/N5 | | +| [**exportStatus**](ExportResourceApi.md#exportStatus) | **GET** /api/v1/export/status | | +| [**exportStatusWithHttpInfo**](ExportResourceApi.md#exportStatusWithHttpInfo) | **GET** /api/v1/export/status | | + + + +## exportN5 + +> Long exportN5(n5ExportRequest) + + + +Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + +### Example + +```java +// Import classes: +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.Configuration; +import org.vcell.restclient.auth.*; +import org.vcell.restclient.models.*; +import org.vcell.restclient.api.ExportResourceApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://vcell.cam.uchc.edu"); + + + ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); + N5ExportRequest n5ExportRequest = new N5ExportRequest(); // N5ExportRequest | + try { + Long result = apiInstance.exportN5(n5ExportRequest); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExportResourceApi#exportN5"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **n5ExportRequest** | [**N5ExportRequest**](N5ExportRequest.md)| | [optional] | + +### Return type + +**Long** + + +### Authorization + +[openId](../README.md#openId) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request. | - | +| **401** | Not Authenticated | - | +| **403** | Not Allowed | - | +| **422** | Unprocessable content submitted | - | +| **500** | Data Access Exception | - | + +## exportN5WithHttpInfo + +> ApiResponse exportN5 exportN5WithHttpInfo(n5ExportRequest) + + + +Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + +### Example + +```java +// Import classes: +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.ApiResponse; +import org.vcell.restclient.Configuration; +import org.vcell.restclient.auth.*; +import org.vcell.restclient.models.*; +import org.vcell.restclient.api.ExportResourceApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://vcell.cam.uchc.edu"); + + + ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); + N5ExportRequest n5ExportRequest = new N5ExportRequest(); // N5ExportRequest | + try { + ApiResponse response = apiInstance.exportN5WithHttpInfo(n5ExportRequest); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ExportResourceApi#exportN5"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **n5ExportRequest** | [**N5ExportRequest**](N5ExportRequest.md)| | [optional] | + +### Return type + +ApiResponse<**Long**> + + +### Authorization + +[openId](../README.md#openId) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request. | - | +| **401** | Not Authenticated | - | +| **403** | Not Allowed | - | +| **422** | Unprocessable content submitted | - | +| **500** | Data Access Exception | - | + + +## exportStatus + +> Set exportStatus() + + + +Get the status of your most recent export jobs. + +### Example + +```java +// Import classes: +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.Configuration; +import org.vcell.restclient.auth.*; +import org.vcell.restclient.models.*; +import org.vcell.restclient.api.ExportResourceApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://vcell.cam.uchc.edu"); + + + ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); + try { + Set result = apiInstance.exportStatus(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExportResourceApi#exportStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Set<ExportEvent>**](ExportEvent.md) + + +### Authorization + +[openId](../README.md#openId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Not Authenticated | - | +| **403** | Not Allowed | - | +| **404** | Not found | - | +| **500** | Data Access Exception | - | + +## exportStatusWithHttpInfo + +> ApiResponse> exportStatus exportStatusWithHttpInfo() + + + +Get the status of your most recent export jobs. + +### Example + +```java +// Import classes: +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.ApiResponse; +import org.vcell.restclient.Configuration; +import org.vcell.restclient.auth.*; +import org.vcell.restclient.models.*; +import org.vcell.restclient.api.ExportResourceApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://vcell.cam.uchc.edu"); + + + ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); + try { + ApiResponse> response = apiInstance.exportStatusWithHttpInfo(); + System.out.println("Status code: " + response.getStatusCode()); + System.out.println("Response headers: " + response.getHeaders()); + System.out.println("Response body: " + response.getData()); + } catch (ApiException e) { + System.err.println("Exception when calling ExportResourceApi#exportStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +ApiResponse<[**Set<ExportEvent>**](ExportEvent.md)> + + +### Authorization + +[openId](../README.md#openId) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Not Authenticated | - | +| **403** | Not Allowed | - | +| **404** | Not found | - | +| **500** | Data Access Exception | - | + diff --git a/vcell-restclient/docs/ExportableDataType.md b/vcell-restclient/docs/ExportableDataType.md new file mode 100644 index 0000000000..f4391ad620 --- /dev/null +++ b/vcell-restclient/docs/ExportableDataType.md @@ -0,0 +1,15 @@ + + +# ExportableDataType + +## Enum + + +* `ODE_VARIABLE_DATA` (value: `"ODE_VARIABLE_DATA"`) + +* `PDE_VARIABLE_DATA` (value: `"PDE_VARIABLE_DATA"`) + +* `PDE_PARTICLE_DATA` (value: `"PDE_PARTICLE_DATA"`) + + + diff --git a/vcell-restclient/docs/FunctionCategory.md b/vcell-restclient/docs/FunctionCategory.md new file mode 100644 index 0000000000..ced2f5707f --- /dev/null +++ b/vcell-restclient/docs/FunctionCategory.md @@ -0,0 +1,17 @@ + + +# FunctionCategory + +## Enum + + +* `PREDEFINED` (value: `"PREDEFINED"`) + +* `OLDUSERDEFINED` (value: `"OLDUSERDEFINED"`) + +* `OUTPUTFUNCTION` (value: `"OUTPUTFUNCTION"`) + +* `POSTPROCESSFUNCTION` (value: `"POSTPROCESSFUNCTION"`) + + + diff --git a/vcell-restclient/docs/GeometryMode.md b/vcell-restclient/docs/GeometryMode.md new file mode 100644 index 0000000000..cda5d2f5a6 --- /dev/null +++ b/vcell-restclient/docs/GeometryMode.md @@ -0,0 +1,15 @@ + + +# GeometryMode + +## Enum + + +* `SELECTIONS` (value: `"GEOMETRY_SELECTIONS"`) + +* `SLICE` (value: `"GEOMETRY_SLICE"`) + +* `FULL` (value: `"GEOMETRY_FULL"`) + + + diff --git a/vcell-restclient/docs/GeometrySpecDTO.md b/vcell-restclient/docs/GeometrySpecDTO.md new file mode 100644 index 0000000000..76bffa63c6 --- /dev/null +++ b/vcell-restclient/docs/GeometrySpecDTO.md @@ -0,0 +1,16 @@ + + +# GeometrySpecDTO + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**selections** | [**List<SpatialSelection>**](SpatialSelection.md) | | [optional] | +|**axis** | **Integer** | | [optional] | +|**sliceNumber** | **Integer** | | [optional] | +|**geometryMode** | **GeometryMode** | | [optional] | + + + diff --git a/vcell-restclient/docs/HumanReadableExportData.md b/vcell-restclient/docs/HumanReadableExportData.md new file mode 100644 index 0000000000..24b2297849 --- /dev/null +++ b/vcell-restclient/docs/HumanReadableExportData.md @@ -0,0 +1,23 @@ + + +# HumanReadableExportData + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**simulationName** | **String** | | [optional] | +|**biomodelName** | **String** | | [optional] | +|**applicationName** | **String** | | [optional] | +|**differentParameterValues** | **List<String>** | | [optional] | +|**applicationType** | **String** | | [optional] | +|**serverSavedFileName** | **String** | | [optional] | +|**nonSpatial** | **Boolean** | | [optional] | +|**subVolume** | **Map<String, String>** | | [optional] | +|**zSlices** | **Integer** | | [optional] | +|**tSlices** | **Integer** | | [optional] | +|**numChannels** | **Integer** | | [optional] | + + + diff --git a/vcell-restclient/docs/N5ExportRequest.md b/vcell-restclient/docs/N5ExportRequest.md new file mode 100644 index 0000000000..972a1d6645 --- /dev/null +++ b/vcell-restclient/docs/N5ExportRequest.md @@ -0,0 +1,16 @@ + + +# N5ExportRequest + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**standardExportInformation** | [**StandardExportInfo**](StandardExportInfo.md) | | [optional] | +|**subVolume** | **Map<String, String>** | | [optional] | +|**exportableDataType** | **ExportableDataType** | | [optional] | +|**datasetName** | **String** | | [optional] | + + + diff --git a/vcell-restclient/docs/SampledCurve.md b/vcell-restclient/docs/SampledCurve.md new file mode 100644 index 0000000000..9c5eadca4d --- /dev/null +++ b/vcell-restclient/docs/SampledCurve.md @@ -0,0 +1,18 @@ + + +# SampledCurve + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | | +|**defaultNumSamples** | **Integer** | | [optional] | +|**maxControlPoints** | **Integer** | | [optional] | +|**minControlPoints** | **Integer** | | [optional] | +|**segmentCount** | **Integer** | | [optional] | +|**spatialLength** | **Double** | | [optional] | + + + diff --git a/vcell-restclient/docs/SpatialSelection.md b/vcell-restclient/docs/SpatialSelection.md new file mode 100644 index 0000000000..dcf72a379f --- /dev/null +++ b/vcell-restclient/docs/SpatialSelection.md @@ -0,0 +1,19 @@ + + +# SpatialSelection + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**curveSelectionInfo** | [**CurveSelectionInfo**](CurveSelectionInfo.md) | | [optional] | +|**varType** | [**VariableType**](VariableType.md) | | [optional] | +|**type** | **String** | | | +|**smallestMeshCellDimensionLength** | **Double** | | [optional] | +|**variableType** | [**VariableType**](VariableType.md) | | [optional] | +|**closed** | **Boolean** | | [optional] | +|**point** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/SpatialSelectionContour.md b/vcell-restclient/docs/SpatialSelectionContour.md new file mode 100644 index 0000000000..b327357578 --- /dev/null +++ b/vcell-restclient/docs/SpatialSelectionContour.md @@ -0,0 +1,16 @@ + + +# SpatialSelectionContour + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | [optional] | +|**fieldSampledDataIndexes** | **List<Integer>** | | [optional] | +|**indexSamples** | **List<Integer>** | | [optional] | +|**sampledDataIndexes** | **List<Integer>** | | [optional] | + + + diff --git a/vcell-restclient/docs/SpatialSelectionMembrane.md b/vcell-restclient/docs/SpatialSelectionMembrane.md new file mode 100644 index 0000000000..ba2ed018ae --- /dev/null +++ b/vcell-restclient/docs/SpatialSelectionMembrane.md @@ -0,0 +1,15 @@ + + +# SpatialSelectionMembrane + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | | +|**fieldSampledDataIndexes** | **List<Integer>** | | [optional] | +|**selectionSource** | [**SampledCurve**](SampledCurve.md) | | [optional] | + + + diff --git a/vcell-restclient/docs/SpatialSelectionVolume.md b/vcell-restclient/docs/SpatialSelectionVolume.md new file mode 100644 index 0000000000..b55f1e3146 --- /dev/null +++ b/vcell-restclient/docs/SpatialSelectionVolume.md @@ -0,0 +1,14 @@ + + +# SpatialSelectionVolume + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | [optional] | +|**symmetric** | **Boolean** | | [optional] | + + + diff --git a/vcell-restclient/docs/Spline.md b/vcell-restclient/docs/Spline.md new file mode 100644 index 0000000000..c2424c1951 --- /dev/null +++ b/vcell-restclient/docs/Spline.md @@ -0,0 +1,17 @@ + + +# Spline + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**type** | **String** | | | +|**defaultNumSamples** | **Integer** | | [optional] | +|**maxControlPoints** | **Integer** | | [optional] | +|**minControlPoints** | **Integer** | | [optional] | +|**segmentCount** | **Integer** | | [optional] | + + + diff --git a/vcell-restclient/docs/StandardExportInfo.md b/vcell-restclient/docs/StandardExportInfo.md new file mode 100644 index 0000000000..42fbfc49cb --- /dev/null +++ b/vcell-restclient/docs/StandardExportInfo.md @@ -0,0 +1,20 @@ + + +# StandardExportInfo + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**outputContext** | [**List<AnnotatedFunctionDTO>**](AnnotatedFunctionDTO.md) | | [optional] | +|**contextName** | **String** | | [optional] | +|**simulationName** | **String** | | [optional] | +|**simulationKey** | **String** | | [optional] | +|**simulationJob** | **Integer** | | [optional] | +|**geometrySpecs** | [**GeometrySpecDTO**](GeometrySpecDTO.md) | | [optional] | +|**timeSpecs** | [**TimeSpecs**](TimeSpecs.md) | | [optional] | +|**variableSpecs** | [**VariableSpecs**](VariableSpecs.md) | | [optional] | + + + diff --git a/vcell-restclient/docs/TimeMode.md b/vcell-restclient/docs/TimeMode.md new file mode 100644 index 0000000000..f7525ec175 --- /dev/null +++ b/vcell-restclient/docs/TimeMode.md @@ -0,0 +1,13 @@ + + +# TimeMode + +## Enum + + +* `POINT` (value: `"TIME_POINT"`) + +* `RANGE` (value: `"TIME_RANGE"`) + + + diff --git a/vcell-restclient/docs/TimeSpecs.md b/vcell-restclient/docs/TimeSpecs.md new file mode 100644 index 0000000000..7b4b7980bb --- /dev/null +++ b/vcell-restclient/docs/TimeSpecs.md @@ -0,0 +1,16 @@ + + +# TimeSpecs + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**beginTimeIndex** | **Integer** | | [optional] | +|**endTimeIndex** | **Integer** | | [optional] | +|**allTimes** | **List<Double>** | | [optional] | +|**mode** | **TimeMode** | | [optional] | + + + diff --git a/vcell-restclient/docs/VariableMode.md b/vcell-restclient/docs/VariableMode.md new file mode 100644 index 0000000000..cb4ab26629 --- /dev/null +++ b/vcell-restclient/docs/VariableMode.md @@ -0,0 +1,15 @@ + + +# VariableMode + +## Enum + + +* `ONE` (value: `"VARIABLE_ONE"`) + +* `MULTI` (value: `"VARIABLE_MULTI"`) + +* `ALL` (value: `"VARIABLE_ALL"`) + + + diff --git a/vcell-restclient/docs/VariableSpecs.md b/vcell-restclient/docs/VariableSpecs.md new file mode 100644 index 0000000000..d13337af34 --- /dev/null +++ b/vcell-restclient/docs/VariableSpecs.md @@ -0,0 +1,14 @@ + + +# VariableSpecs + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**variableNames** | **List<String>** | | [optional] | +|**mode** | **VariableMode** | | [optional] | + + + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java b/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java new file mode 100644 index 0000000000..10c124b129 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java @@ -0,0 +1,225 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.vcell.restclient.api; + +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.ApiResponse; +import org.vcell.restclient.Pair; + +import org.vcell.restclient.model.ExportEvent; +import org.vcell.restclient.model.N5ExportRequest; +import java.util.Set; +import org.vcell.restclient.model.VCellHTTPError; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.InputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; +import java.net.http.HttpRequest; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import java.util.ArrayList; +import java.util.StringJoiner; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Consumer; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ExportResourceApi { + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; + + public ExportResourceApi() { + this(new ApiClient()); + } + + public ExportResourceApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } + + protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; + } + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * + * Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + * @param n5ExportRequest (optional) + * @return Long + * @throws ApiException if fails to make API call + */ + public Long exportN5(N5ExportRequest n5ExportRequest) throws ApiException { + ApiResponse localVarResponse = exportN5WithHttpInfo(n5ExportRequest); + return localVarResponse.getData(); + } + + /** + * + * Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + * @param n5ExportRequest (optional) + * @return ApiResponse<Long> + * @throws ApiException if fails to make API call + */ + public ApiResponse exportN5WithHttpInfo(N5ExportRequest n5ExportRequest) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = exportN5RequestBuilder(n5ExportRequest); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("exportN5", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder exportN5RequestBuilder(N5ExportRequest n5ExportRequest) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/export/N5"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(n5ExportRequest); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * + * Get the status of your most recent export jobs. + * @return Set<ExportEvent> + * @throws ApiException if fails to make API call + */ + public Set exportStatus() throws ApiException { + ApiResponse> localVarResponse = exportStatusWithHttpInfo(); + return localVarResponse.getData(); + } + + /** + * + * Get the status of your most recent export jobs. + * @return ApiResponse<Set<ExportEvent>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> exportStatusWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = exportStatusRequestBuilder(); + try { + HttpResponse localVarResponse = memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode()/ 100 != 2) { + throw getApiException("exportStatus", localVarResponse); + } + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } + catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder exportStatusRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/api/v1/export/status"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } +} diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/AnalyticCurve.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/AnalyticCurve.java new file mode 100644 index 0000000000..5b7e857bcb --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/AnalyticCurve.java @@ -0,0 +1,510 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Coordinate; +import org.vcell.restclient.model.Curve; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * AnalyticCurve + */ +@JsonPropertyOrder({ + AnalyticCurve.JSON_PROPERTY_TYPE, + AnalyticCurve.JSON_PROPERTY_EXP_X, + AnalyticCurve.JSON_PROPERTY_EXP_Y, + AnalyticCurve.JSON_PROPERTY_EXP_Z, + AnalyticCurve.JSON_PROPERTY_OFFSET, + AnalyticCurve.JSON_PROPERTY_ANALYTIC_OFFSET, + AnalyticCurve.JSON_PROPERTY_DEFAULT_NUM_SAMPLES, + AnalyticCurve.JSON_PROPERTY_SEGMENT_COUNT, + AnalyticCurve.JSON_PROPERTY_VALID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class AnalyticCurve extends Curve { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "AnalyticCurve"; + + public static final String JSON_PROPERTY_EXP_X = "expX"; + private String expX; + + public static final String JSON_PROPERTY_EXP_Y = "expY"; + private String expY; + + public static final String JSON_PROPERTY_EXP_Z = "expZ"; + private String expZ; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Coordinate offset; + + public static final String JSON_PROPERTY_ANALYTIC_OFFSET = "analyticOffset"; + private Coordinate analyticOffset; + + public static final String JSON_PROPERTY_DEFAULT_NUM_SAMPLES = "defaultNumSamples"; + private Integer defaultNumSamples; + + public static final String JSON_PROPERTY_SEGMENT_COUNT = "segmentCount"; + private Integer segmentCount; + + public static final String JSON_PROPERTY_VALID = "valid"; + private Boolean valid; + + public AnalyticCurve() { + } + + public AnalyticCurve type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public AnalyticCurve expX(String expX) { + this.expX = expX; + return this; + } + + /** + * Get expX + * @return expX + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXP_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExpX() { + return expX; + } + + + @JsonProperty(JSON_PROPERTY_EXP_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpX(String expX) { + this.expX = expX; + } + + + public AnalyticCurve expY(String expY) { + this.expY = expY; + return this; + } + + /** + * Get expY + * @return expY + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXP_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExpY() { + return expY; + } + + + @JsonProperty(JSON_PROPERTY_EXP_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpY(String expY) { + this.expY = expY; + } + + + public AnalyticCurve expZ(String expZ) { + this.expZ = expZ; + return this; + } + + /** + * Get expZ + * @return expZ + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXP_Z) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getExpZ() { + return expZ; + } + + + @JsonProperty(JSON_PROPERTY_EXP_Z) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpZ(String expZ) { + this.expZ = expZ; + } + + + public AnalyticCurve offset(Coordinate offset) { + this.offset = offset; + return this; + } + + /** + * Get offset + * @return offset + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Coordinate getOffset() { + return offset; + } + + + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOffset(Coordinate offset) { + this.offset = offset; + } + + + public AnalyticCurve analyticOffset(Coordinate analyticOffset) { + this.analyticOffset = analyticOffset; + return this; + } + + /** + * Get analyticOffset + * @return analyticOffset + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ANALYTIC_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Coordinate getAnalyticOffset() { + return analyticOffset; + } + + + @JsonProperty(JSON_PROPERTY_ANALYTIC_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAnalyticOffset(Coordinate analyticOffset) { + this.analyticOffset = analyticOffset; + } + + + public AnalyticCurve defaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + return this; + } + + /** + * Get defaultNumSamples + * @return defaultNumSamples + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultNumSamples() { + return defaultNumSamples; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + } + + + public AnalyticCurve segmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + return this; + } + + /** + * Get segmentCount + * @return segmentCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSegmentCount() { + return segmentCount; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + } + + + public AnalyticCurve valid(Boolean valid) { + this.valid = valid; + return this; + } + + /** + * Get valid + * @return valid + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValid() { + return valid; + } + + + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValid(Boolean valid) { + this.valid = valid; + } + + + @Override + public AnalyticCurve bClosed(Boolean bClosed) { + this.setbClosed(bClosed); + return this; + } + + @Override + public AnalyticCurve description(String description) { + this.setDescription(description); + return this; + } + + @Override + public AnalyticCurve beginningCoordinate(Coordinate beginningCoordinate) { + this.setBeginningCoordinate(beginningCoordinate); + return this; + } + + @Override + public AnalyticCurve endingCoordinate(Coordinate endingCoordinate) { + this.setEndingCoordinate(endingCoordinate); + return this; + } + + @Override + public AnalyticCurve numSamplePoints(Integer numSamplePoints) { + this.setNumSamplePoints(numSamplePoints); + return this; + } + + @Override + public AnalyticCurve spatialLength(Double spatialLength) { + this.setSpatialLength(spatialLength); + return this; + } + + @Override + public AnalyticCurve closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + /** + * Return true if this AnalyticCurve object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnalyticCurve analyticCurve = (AnalyticCurve) o; + return Objects.equals(this.type, analyticCurve.type) && + Objects.equals(this.expX, analyticCurve.expX) && + Objects.equals(this.expY, analyticCurve.expY) && + Objects.equals(this.expZ, analyticCurve.expZ) && + Objects.equals(this.offset, analyticCurve.offset) && + Objects.equals(this.analyticOffset, analyticCurve.analyticOffset) && + Objects.equals(this.defaultNumSamples, analyticCurve.defaultNumSamples) && + Objects.equals(this.segmentCount, analyticCurve.segmentCount) && + Objects.equals(this.valid, analyticCurve.valid) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, expX, expY, expZ, offset, analyticOffset, defaultNumSamples, segmentCount, valid, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnalyticCurve {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" expX: ").append(toIndentedString(expX)).append("\n"); + sb.append(" expY: ").append(toIndentedString(expY)).append("\n"); + sb.append(" expZ: ").append(toIndentedString(expZ)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" analyticOffset: ").append(toIndentedString(analyticOffset)).append("\n"); + sb.append(" defaultNumSamples: ").append(toIndentedString(defaultNumSamples)).append("\n"); + sb.append(" segmentCount: ").append(toIndentedString(segmentCount)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bClosed` to the URL query string + if (getbClosed() != null) { + joiner.add(String.format("%sbClosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getbClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `beginningCoordinate` to the URL query string + if (getBeginningCoordinate() != null) { + joiner.add(getBeginningCoordinate().toUrlQueryString(prefix + "beginningCoordinate" + suffix)); + } + + // add `defaultNumSamples` to the URL query string + if (getDefaultNumSamples() != null) { + joiner.add(String.format("%sdefaultNumSamples%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultNumSamples()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endingCoordinate` to the URL query string + if (getEndingCoordinate() != null) { + joiner.add(getEndingCoordinate().toUrlQueryString(prefix + "endingCoordinate" + suffix)); + } + + // add `numSamplePoints` to the URL query string + if (getNumSamplePoints() != null) { + joiner.add(String.format("%snumSamplePoints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumSamplePoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `segmentCount` to the URL query string + if (getSegmentCount() != null) { + joiner.add(String.format("%ssegmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegmentCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `spatialLength` to the URL query string + if (getSpatialLength() != null) { + joiner.add(String.format("%sspatialLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpatialLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `valid` to the URL query string + if (getValid() != null) { + joiner.add(String.format("%svalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("AnalyticCurve", AnalyticCurve.class); + JSON.registerDiscriminator(AnalyticCurve.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/AnnotatedFunctionDTO.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/AnnotatedFunctionDTO.java new file mode 100644 index 0000000000..1d340fee8d --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/AnnotatedFunctionDTO.java @@ -0,0 +1,333 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Domain; +import org.vcell.restclient.model.FunctionCategory; +import org.vcell.restclient.model.VariableType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * AnnotatedFunctionDTO + */ +@JsonPropertyOrder({ + AnnotatedFunctionDTO.JSON_PROPERTY_FUNCTION_NAME, + AnnotatedFunctionDTO.JSON_PROPERTY_FUNCTION_EXPRESSION, + AnnotatedFunctionDTO.JSON_PROPERTY_ERROR, + AnnotatedFunctionDTO.JSON_PROPERTY_DOMAIN, + AnnotatedFunctionDTO.JSON_PROPERTY_FUNCTION_TYPE, + AnnotatedFunctionDTO.JSON_PROPERTY_CATEGORY +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class AnnotatedFunctionDTO { + public static final String JSON_PROPERTY_FUNCTION_NAME = "functionName"; + private String functionName; + + public static final String JSON_PROPERTY_FUNCTION_EXPRESSION = "functionExpression"; + private String functionExpression; + + public static final String JSON_PROPERTY_ERROR = "error"; + private String error; + + public static final String JSON_PROPERTY_DOMAIN = "domain"; + private Domain domain; + + public static final String JSON_PROPERTY_FUNCTION_TYPE = "functionType"; + private VariableType functionType; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private FunctionCategory category; + + public AnnotatedFunctionDTO() { + } + + public AnnotatedFunctionDTO functionName(String functionName) { + this.functionName = functionName; + return this; + } + + /** + * Get functionName + * @return functionName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FUNCTION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFunctionName() { + return functionName; + } + + + @JsonProperty(JSON_PROPERTY_FUNCTION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunctionName(String functionName) { + this.functionName = functionName; + } + + + public AnnotatedFunctionDTO functionExpression(String functionExpression) { + this.functionExpression = functionExpression; + return this; + } + + /** + * Get functionExpression + * @return functionExpression + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FUNCTION_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFunctionExpression() { + return functionExpression; + } + + + @JsonProperty(JSON_PROPERTY_FUNCTION_EXPRESSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunctionExpression(String functionExpression) { + this.functionExpression = functionExpression; + } + + + public AnnotatedFunctionDTO error(String error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getError() { + return error; + } + + + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(String error) { + this.error = error; + } + + + public AnnotatedFunctionDTO domain(Domain domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Domain getDomain() { + return domain; + } + + + @JsonProperty(JSON_PROPERTY_DOMAIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDomain(Domain domain) { + this.domain = domain; + } + + + public AnnotatedFunctionDTO functionType(VariableType functionType) { + this.functionType = functionType; + return this; + } + + /** + * Get functionType + * @return functionType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FUNCTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public VariableType getFunctionType() { + return functionType; + } + + + @JsonProperty(JSON_PROPERTY_FUNCTION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFunctionType(VariableType functionType) { + this.functionType = functionType; + } + + + public AnnotatedFunctionDTO category(FunctionCategory category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public FunctionCategory getCategory() { + return category; + } + + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(FunctionCategory category) { + this.category = category; + } + + + /** + * Return true if this AnnotatedFunctionDTO object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnnotatedFunctionDTO annotatedFunctionDTO = (AnnotatedFunctionDTO) o; + return Objects.equals(this.functionName, annotatedFunctionDTO.functionName) && + Objects.equals(this.functionExpression, annotatedFunctionDTO.functionExpression) && + Objects.equals(this.error, annotatedFunctionDTO.error) && + Objects.equals(this.domain, annotatedFunctionDTO.domain) && + Objects.equals(this.functionType, annotatedFunctionDTO.functionType) && + Objects.equals(this.category, annotatedFunctionDTO.category); + } + + @Override + public int hashCode() { + return Objects.hash(functionName, functionExpression, error, domain, functionType, category); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnnotatedFunctionDTO {\n"); + sb.append(" functionName: ").append(toIndentedString(functionName)).append("\n"); + sb.append(" functionExpression: ").append(toIndentedString(functionExpression)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" functionType: ").append(toIndentedString(functionType)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `functionName` to the URL query string + if (getFunctionName() != null) { + joiner.add(String.format("%sfunctionName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFunctionName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `functionExpression` to the URL query string + if (getFunctionExpression() != null) { + joiner.add(String.format("%sfunctionExpression%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFunctionExpression()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `error` to the URL query string + if (getError() != null) { + joiner.add(String.format("%serror%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getError()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `domain` to the URL query string + if (getDomain() != null) { + joiner.add(getDomain().toUrlQueryString(prefix + "domain" + suffix)); + } + + // add `functionType` to the URL query string + if (getFunctionType() != null) { + joiner.add(getFunctionType().toUrlQueryString(prefix + "functionType" + suffix)); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(String.format("%scategory%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCategory()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/CompositeCurve.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/CompositeCurve.java new file mode 100644 index 0000000000..73f454d890 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/CompositeCurve.java @@ -0,0 +1,427 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.Coordinate; +import org.vcell.restclient.model.Curve; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * CompositeCurve + */ +@JsonPropertyOrder({ + CompositeCurve.JSON_PROPERTY_TYPE, + CompositeCurve.JSON_PROPERTY_FIELD_CURVES, + CompositeCurve.JSON_PROPERTY_CURVE_COUNT, + CompositeCurve.JSON_PROPERTY_DEFAULT_NUM_SAMPLES, + CompositeCurve.JSON_PROPERTY_SEGMENT_COUNT, + CompositeCurve.JSON_PROPERTY_VALID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class CompositeCurve extends Curve { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "CompositeCurve"; + + public static final String JSON_PROPERTY_FIELD_CURVES = "fieldCurves"; + private List fieldCurves; + + public static final String JSON_PROPERTY_CURVE_COUNT = "curveCount"; + private Integer curveCount; + + public static final String JSON_PROPERTY_DEFAULT_NUM_SAMPLES = "defaultNumSamples"; + private Integer defaultNumSamples; + + public static final String JSON_PROPERTY_SEGMENT_COUNT = "segmentCount"; + private Integer segmentCount; + + public static final String JSON_PROPERTY_VALID = "valid"; + private Boolean valid; + + public CompositeCurve() { + } + + public CompositeCurve type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public CompositeCurve fieldCurves(List fieldCurves) { + this.fieldCurves = fieldCurves; + return this; + } + + public CompositeCurve addFieldCurvesItem(Object fieldCurvesItem) { + if (this.fieldCurves == null) { + this.fieldCurves = new ArrayList<>(); + } + this.fieldCurves.add(fieldCurvesItem); + return this; + } + + /** + * Get fieldCurves + * @return fieldCurves + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_CURVES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFieldCurves() { + return fieldCurves; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_CURVES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldCurves(List fieldCurves) { + this.fieldCurves = fieldCurves; + } + + + public CompositeCurve curveCount(Integer curveCount) { + this.curveCount = curveCount; + return this; + } + + /** + * Get curveCount + * @return curveCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURVE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCurveCount() { + return curveCount; + } + + + @JsonProperty(JSON_PROPERTY_CURVE_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurveCount(Integer curveCount) { + this.curveCount = curveCount; + } + + + public CompositeCurve defaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + return this; + } + + /** + * Get defaultNumSamples + * @return defaultNumSamples + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultNumSamples() { + return defaultNumSamples; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + } + + + public CompositeCurve segmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + return this; + } + + /** + * Get segmentCount + * @return segmentCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSegmentCount() { + return segmentCount; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + } + + + public CompositeCurve valid(Boolean valid) { + this.valid = valid; + return this; + } + + /** + * Get valid + * @return valid + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValid() { + return valid; + } + + + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValid(Boolean valid) { + this.valid = valid; + } + + + @Override + public CompositeCurve bClosed(Boolean bClosed) { + this.setbClosed(bClosed); + return this; + } + + @Override + public CompositeCurve description(String description) { + this.setDescription(description); + return this; + } + + @Override + public CompositeCurve beginningCoordinate(Coordinate beginningCoordinate) { + this.setBeginningCoordinate(beginningCoordinate); + return this; + } + + @Override + public CompositeCurve endingCoordinate(Coordinate endingCoordinate) { + this.setEndingCoordinate(endingCoordinate); + return this; + } + + @Override + public CompositeCurve numSamplePoints(Integer numSamplePoints) { + this.setNumSamplePoints(numSamplePoints); + return this; + } + + @Override + public CompositeCurve spatialLength(Double spatialLength) { + this.setSpatialLength(spatialLength); + return this; + } + + @Override + public CompositeCurve closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + /** + * Return true if this CompositeCurve object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CompositeCurve compositeCurve = (CompositeCurve) o; + return Objects.equals(this.type, compositeCurve.type) && + Objects.equals(this.fieldCurves, compositeCurve.fieldCurves) && + Objects.equals(this.curveCount, compositeCurve.curveCount) && + Objects.equals(this.defaultNumSamples, compositeCurve.defaultNumSamples) && + Objects.equals(this.segmentCount, compositeCurve.segmentCount) && + Objects.equals(this.valid, compositeCurve.valid) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fieldCurves, curveCount, defaultNumSamples, segmentCount, valid, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CompositeCurve {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fieldCurves: ").append(toIndentedString(fieldCurves)).append("\n"); + sb.append(" curveCount: ").append(toIndentedString(curveCount)).append("\n"); + sb.append(" defaultNumSamples: ").append(toIndentedString(defaultNumSamples)).append("\n"); + sb.append(" segmentCount: ").append(toIndentedString(segmentCount)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bClosed` to the URL query string + if (getbClosed() != null) { + joiner.add(String.format("%sbClosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getbClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `beginningCoordinate` to the URL query string + if (getBeginningCoordinate() != null) { + joiner.add(getBeginningCoordinate().toUrlQueryString(prefix + "beginningCoordinate" + suffix)); + } + + // add `defaultNumSamples` to the URL query string + if (getDefaultNumSamples() != null) { + joiner.add(String.format("%sdefaultNumSamples%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultNumSamples()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endingCoordinate` to the URL query string + if (getEndingCoordinate() != null) { + joiner.add(getEndingCoordinate().toUrlQueryString(prefix + "endingCoordinate" + suffix)); + } + + // add `numSamplePoints` to the URL query string + if (getNumSamplePoints() != null) { + joiner.add(String.format("%snumSamplePoints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumSamplePoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `segmentCount` to the URL query string + if (getSegmentCount() != null) { + joiner.add(String.format("%ssegmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegmentCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `spatialLength` to the URL query string + if (getSpatialLength() != null) { + joiner.add(String.format("%sspatialLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpatialLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `valid` to the URL query string + if (getValid() != null) { + joiner.add(String.format("%svalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("CompositeCurve", CompositeCurve.class); + JSON.registerDiscriminator(CompositeCurve.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/ControlPointCurve.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/ControlPointCurve.java new file mode 100644 index 0000000000..4abb7331ba --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/ControlPointCurve.java @@ -0,0 +1,503 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.Coordinate; +import org.vcell.restclient.model.Curve; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * ControlPointCurve + */ +@JsonPropertyOrder({ + ControlPointCurve.JSON_PROPERTY_TYPE, + ControlPointCurve.JSON_PROPERTY_CONTROL_POINTS, + ControlPointCurve.JSON_PROPERTY_CONTROL_POINT_COUNT, + ControlPointCurve.JSON_PROPERTY_CONTROL_POINTS_VECTOR, + ControlPointCurve.JSON_PROPERTY_MAX_CONTROL_POINTS, + ControlPointCurve.JSON_PROPERTY_MIN_CONTROL_POINTS, + ControlPointCurve.JSON_PROPERTY_CONTROL_POINT_ADDABLE, + ControlPointCurve.JSON_PROPERTY_VALID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SampledCurve.class, name = "SampledCurve"), + @JsonSubTypes.Type(value = Spline.class, name = "Spline"), +}) + +public class ControlPointCurve extends Curve { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "ControlPointCurve"; + + public static final String JSON_PROPERTY_CONTROL_POINTS = "controlPoints"; + private List controlPoints; + + public static final String JSON_PROPERTY_CONTROL_POINT_COUNT = "controlPointCount"; + private Integer controlPointCount; + + public static final String JSON_PROPERTY_CONTROL_POINTS_VECTOR = "controlPointsVector"; + private List controlPointsVector; + + public static final String JSON_PROPERTY_MAX_CONTROL_POINTS = "maxControlPoints"; + private Integer maxControlPoints; + + public static final String JSON_PROPERTY_MIN_CONTROL_POINTS = "minControlPoints"; + private Integer minControlPoints; + + public static final String JSON_PROPERTY_CONTROL_POINT_ADDABLE = "controlPointAddable"; + private Boolean controlPointAddable; + + public static final String JSON_PROPERTY_VALID = "valid"; + private Boolean valid; + + public ControlPointCurve() { + } + + public ControlPointCurve type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public ControlPointCurve controlPoints(List controlPoints) { + this.controlPoints = controlPoints; + return this; + } + + public ControlPointCurve addControlPointsItem(Coordinate controlPointsItem) { + if (this.controlPoints == null) { + this.controlPoints = new ArrayList<>(); + } + this.controlPoints.add(controlPointsItem); + return this; + } + + /** + * Get controlPoints + * @return controlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getControlPoints() { + return controlPoints; + } + + + @JsonProperty(JSON_PROPERTY_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControlPoints(List controlPoints) { + this.controlPoints = controlPoints; + } + + + public ControlPointCurve controlPointCount(Integer controlPointCount) { + this.controlPointCount = controlPointCount; + return this; + } + + /** + * Get controlPointCount + * @return controlPointCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTROL_POINT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getControlPointCount() { + return controlPointCount; + } + + + @JsonProperty(JSON_PROPERTY_CONTROL_POINT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControlPointCount(Integer controlPointCount) { + this.controlPointCount = controlPointCount; + } + + + public ControlPointCurve controlPointsVector(List controlPointsVector) { + this.controlPointsVector = controlPointsVector; + return this; + } + + public ControlPointCurve addControlPointsVectorItem(Coordinate controlPointsVectorItem) { + if (this.controlPointsVector == null) { + this.controlPointsVector = new ArrayList<>(); + } + this.controlPointsVector.add(controlPointsVectorItem); + return this; + } + + /** + * Get controlPointsVector + * @return controlPointsVector + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTROL_POINTS_VECTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getControlPointsVector() { + return controlPointsVector; + } + + + @JsonProperty(JSON_PROPERTY_CONTROL_POINTS_VECTOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControlPointsVector(List controlPointsVector) { + this.controlPointsVector = controlPointsVector; + } + + + public ControlPointCurve maxControlPoints(Integer maxControlPoints) { + this.maxControlPoints = maxControlPoints; + return this; + } + + /** + * Get maxControlPoints + * @return maxControlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxControlPoints() { + return maxControlPoints; + } + + + @JsonProperty(JSON_PROPERTY_MAX_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxControlPoints(Integer maxControlPoints) { + this.maxControlPoints = maxControlPoints; + } + + + public ControlPointCurve minControlPoints(Integer minControlPoints) { + this.minControlPoints = minControlPoints; + return this; + } + + /** + * Get minControlPoints + * @return minControlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMinControlPoints() { + return minControlPoints; + } + + + @JsonProperty(JSON_PROPERTY_MIN_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinControlPoints(Integer minControlPoints) { + this.minControlPoints = minControlPoints; + } + + + public ControlPointCurve controlPointAddable(Boolean controlPointAddable) { + this.controlPointAddable = controlPointAddable; + return this; + } + + /** + * Get controlPointAddable + * @return controlPointAddable + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTROL_POINT_ADDABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getControlPointAddable() { + return controlPointAddable; + } + + + @JsonProperty(JSON_PROPERTY_CONTROL_POINT_ADDABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setControlPointAddable(Boolean controlPointAddable) { + this.controlPointAddable = controlPointAddable; + } + + + public ControlPointCurve valid(Boolean valid) { + this.valid = valid; + return this; + } + + /** + * Get valid + * @return valid + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValid() { + return valid; + } + + + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValid(Boolean valid) { + this.valid = valid; + } + + + @Override + public ControlPointCurve bClosed(Boolean bClosed) { + this.setbClosed(bClosed); + return this; + } + + @Override + public ControlPointCurve description(String description) { + this.setDescription(description); + return this; + } + + @Override + public ControlPointCurve beginningCoordinate(Coordinate beginningCoordinate) { + this.setBeginningCoordinate(beginningCoordinate); + return this; + } + + @Override + public ControlPointCurve endingCoordinate(Coordinate endingCoordinate) { + this.setEndingCoordinate(endingCoordinate); + return this; + } + + @Override + public ControlPointCurve numSamplePoints(Integer numSamplePoints) { + this.setNumSamplePoints(numSamplePoints); + return this; + } + + @Override + public ControlPointCurve spatialLength(Double spatialLength) { + this.setSpatialLength(spatialLength); + return this; + } + + @Override + public ControlPointCurve closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + /** + * Return true if this ControlPointCurve object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ControlPointCurve controlPointCurve = (ControlPointCurve) o; + return Objects.equals(this.type, controlPointCurve.type) && + Objects.equals(this.controlPoints, controlPointCurve.controlPoints) && + Objects.equals(this.controlPointCount, controlPointCurve.controlPointCount) && + Objects.equals(this.controlPointsVector, controlPointCurve.controlPointsVector) && + Objects.equals(this.maxControlPoints, controlPointCurve.maxControlPoints) && + Objects.equals(this.minControlPoints, controlPointCurve.minControlPoints) && + Objects.equals(this.controlPointAddable, controlPointCurve.controlPointAddable) && + Objects.equals(this.valid, controlPointCurve.valid) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, controlPoints, controlPointCount, controlPointsVector, maxControlPoints, minControlPoints, controlPointAddable, valid, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ControlPointCurve {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" controlPoints: ").append(toIndentedString(controlPoints)).append("\n"); + sb.append(" controlPointCount: ").append(toIndentedString(controlPointCount)).append("\n"); + sb.append(" controlPointsVector: ").append(toIndentedString(controlPointsVector)).append("\n"); + sb.append(" maxControlPoints: ").append(toIndentedString(maxControlPoints)).append("\n"); + sb.append(" minControlPoints: ").append(toIndentedString(minControlPoints)).append("\n"); + sb.append(" controlPointAddable: ").append(toIndentedString(controlPointAddable)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bClosed` to the URL query string + if (getbClosed() != null) { + joiner.add(String.format("%sbClosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getbClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `beginningCoordinate` to the URL query string + if (getBeginningCoordinate() != null) { + joiner.add(getBeginningCoordinate().toUrlQueryString(prefix + "beginningCoordinate" + suffix)); + } + + // add `defaultNumSamples` to the URL query string + if (getDefaultNumSamples() != null) { + joiner.add(String.format("%sdefaultNumSamples%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultNumSamples()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endingCoordinate` to the URL query string + if (getEndingCoordinate() != null) { + joiner.add(getEndingCoordinate().toUrlQueryString(prefix + "endingCoordinate" + suffix)); + } + + // add `numSamplePoints` to the URL query string + if (getNumSamplePoints() != null) { + joiner.add(String.format("%snumSamplePoints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumSamplePoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `segmentCount` to the URL query string + if (getSegmentCount() != null) { + joiner.add(String.format("%ssegmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegmentCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `spatialLength` to the URL query string + if (getSpatialLength() != null) { + joiner.add(String.format("%sspatialLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpatialLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `valid` to the URL query string + if (getValid() != null) { + joiner.add(String.format("%svalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("SampledCurve", SampledCurve.class); + mappings.put("Spline", Spline.class); + mappings.put("ControlPointCurve", ControlPointCurve.class); + JSON.registerDiscriminator(ControlPointCurve.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/Coordinate.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/Coordinate.java new file mode 100644 index 0000000000..bce1c5c840 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/Coordinate.java @@ -0,0 +1,222 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Coordinate + */ +@JsonPropertyOrder({ + Coordinate.JSON_PROPERTY_X, + Coordinate.JSON_PROPERTY_Y, + Coordinate.JSON_PROPERTY_Z +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Coordinate { + public static final String JSON_PROPERTY_X = "x"; + private Double x; + + public static final String JSON_PROPERTY_Y = "y"; + private Double y; + + public static final String JSON_PROPERTY_Z = "z"; + private Double z; + + public Coordinate() { + } + + public Coordinate x(Double x) { + this.x = x; + return this; + } + + /** + * Get x + * @return x + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getX() { + return x; + } + + + @JsonProperty(JSON_PROPERTY_X) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setX(Double x) { + this.x = x; + } + + + public Coordinate y(Double y) { + this.y = y; + return this; + } + + /** + * Get y + * @return y + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getY() { + return y; + } + + + @JsonProperty(JSON_PROPERTY_Y) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setY(Double y) { + this.y = y; + } + + + public Coordinate z(Double z) { + this.z = z; + return this; + } + + /** + * Get z + * @return z + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Z) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getZ() { + return z; + } + + + @JsonProperty(JSON_PROPERTY_Z) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setZ(Double z) { + this.z = z; + } + + + /** + * Return true if this Coordinate object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Coordinate coordinate = (Coordinate) o; + return Objects.equals(this.x, coordinate.x) && + Objects.equals(this.y, coordinate.y) && + Objects.equals(this.z, coordinate.z); + } + + @Override + public int hashCode() { + return Objects.hash(x, y, z); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Coordinate {\n"); + sb.append(" x: ").append(toIndentedString(x)).append("\n"); + sb.append(" y: ").append(toIndentedString(y)).append("\n"); + sb.append(" z: ").append(toIndentedString(z)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `x` to the URL query string + if (getX() != null) { + joiner.add(String.format("%sx%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getX()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `y` to the URL query string + if (getY() != null) { + joiner.add(String.format("%sy%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getY()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `z` to the URL query string + if (getZ() != null) { + joiner.add(String.format("%sz%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getZ()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/Curve.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/Curve.java new file mode 100644 index 0000000000..d71a424d47 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/Curve.java @@ -0,0 +1,539 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Coordinate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * Curve + */ +@JsonPropertyOrder({ + Curve.JSON_PROPERTY_B_CLOSED, + Curve.JSON_PROPERTY_DESCRIPTION, + Curve.JSON_PROPERTY_TYPE, + Curve.JSON_PROPERTY_BEGINNING_COORDINATE, + Curve.JSON_PROPERTY_DEFAULT_NUM_SAMPLES, + Curve.JSON_PROPERTY_ENDING_COORDINATE, + Curve.JSON_PROPERTY_NUM_SAMPLE_POINTS, + Curve.JSON_PROPERTY_SEGMENT_COUNT, + Curve.JSON_PROPERTY_SPATIAL_LENGTH, + Curve.JSON_PROPERTY_CLOSED, + Curve.JSON_PROPERTY_VALID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AnalyticCurve.class, name = "AnalyticCurve"), + @JsonSubTypes.Type(value = CompositeCurve.class, name = "CompositeCurve"), + @JsonSubTypes.Type(value = ControlPointCurve.class, name = "ControlPointCurve"), + @JsonSubTypes.Type(value = SampledCurve.class, name = "SampledCurve"), + @JsonSubTypes.Type(value = Spline.class, name = "Spline"), +}) + +public class Curve { + public static final String JSON_PROPERTY_B_CLOSED = "bClosed"; + private Boolean bClosed; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_BEGINNING_COORDINATE = "beginningCoordinate"; + private Coordinate beginningCoordinate; + + public static final String JSON_PROPERTY_DEFAULT_NUM_SAMPLES = "defaultNumSamples"; + private Integer defaultNumSamples; + + public static final String JSON_PROPERTY_ENDING_COORDINATE = "endingCoordinate"; + private Coordinate endingCoordinate; + + public static final String JSON_PROPERTY_NUM_SAMPLE_POINTS = "numSamplePoints"; + private Integer numSamplePoints; + + public static final String JSON_PROPERTY_SEGMENT_COUNT = "segmentCount"; + private Integer segmentCount; + + public static final String JSON_PROPERTY_SPATIAL_LENGTH = "spatialLength"; + private Double spatialLength; + + public static final String JSON_PROPERTY_CLOSED = "closed"; + private Boolean closed; + + public static final String JSON_PROPERTY_VALID = "valid"; + private Boolean valid; + + public Curve() { + } + + public Curve bClosed(Boolean bClosed) { + this.bClosed = bClosed; + return this; + } + + /** + * Get bClosed + * @return bClosed + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_B_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getbClosed() { + return bClosed; + } + + + @JsonProperty(JSON_PROPERTY_B_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setbClosed(Boolean bClosed) { + this.bClosed = bClosed; + } + + + public Curve description(String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + } + + + public Curve type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public Curve beginningCoordinate(Coordinate beginningCoordinate) { + this.beginningCoordinate = beginningCoordinate; + return this; + } + + /** + * Get beginningCoordinate + * @return beginningCoordinate + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BEGINNING_COORDINATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Coordinate getBeginningCoordinate() { + return beginningCoordinate; + } + + + @JsonProperty(JSON_PROPERTY_BEGINNING_COORDINATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBeginningCoordinate(Coordinate beginningCoordinate) { + this.beginningCoordinate = beginningCoordinate; + } + + + public Curve defaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + return this; + } + + /** + * Get defaultNumSamples + * @return defaultNumSamples + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultNumSamples() { + return defaultNumSamples; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + } + + + public Curve endingCoordinate(Coordinate endingCoordinate) { + this.endingCoordinate = endingCoordinate; + return this; + } + + /** + * Get endingCoordinate + * @return endingCoordinate + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENDING_COORDINATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Coordinate getEndingCoordinate() { + return endingCoordinate; + } + + + @JsonProperty(JSON_PROPERTY_ENDING_COORDINATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndingCoordinate(Coordinate endingCoordinate) { + this.endingCoordinate = endingCoordinate; + } + + + public Curve numSamplePoints(Integer numSamplePoints) { + this.numSamplePoints = numSamplePoints; + return this; + } + + /** + * Get numSamplePoints + * @return numSamplePoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_SAMPLE_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumSamplePoints() { + return numSamplePoints; + } + + + @JsonProperty(JSON_PROPERTY_NUM_SAMPLE_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumSamplePoints(Integer numSamplePoints) { + this.numSamplePoints = numSamplePoints; + } + + + public Curve segmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + return this; + } + + /** + * Get segmentCount + * @return segmentCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSegmentCount() { + return segmentCount; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + } + + + public Curve spatialLength(Double spatialLength) { + this.spatialLength = spatialLength; + return this; + } + + /** + * Get spatialLength + * @return spatialLength + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPATIAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getSpatialLength() { + return spatialLength; + } + + + @JsonProperty(JSON_PROPERTY_SPATIAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpatialLength(Double spatialLength) { + this.spatialLength = spatialLength; + } + + + public Curve closed(Boolean closed) { + this.closed = closed; + return this; + } + + /** + * Get closed + * @return closed + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getClosed() { + return closed; + } + + + @JsonProperty(JSON_PROPERTY_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClosed(Boolean closed) { + this.closed = closed; + } + + + public Curve valid(Boolean valid) { + this.valid = valid; + return this; + } + + /** + * Get valid + * @return valid + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getValid() { + return valid; + } + + + @JsonProperty(JSON_PROPERTY_VALID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValid(Boolean valid) { + this.valid = valid; + } + + + /** + * Return true if this Curve object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Curve curve = (Curve) o; + return Objects.equals(this.bClosed, curve.bClosed) && + Objects.equals(this.description, curve.description) && + Objects.equals(this.type, curve.type) && + Objects.equals(this.beginningCoordinate, curve.beginningCoordinate) && + Objects.equals(this.defaultNumSamples, curve.defaultNumSamples) && + Objects.equals(this.endingCoordinate, curve.endingCoordinate) && + Objects.equals(this.numSamplePoints, curve.numSamplePoints) && + Objects.equals(this.segmentCount, curve.segmentCount) && + Objects.equals(this.spatialLength, curve.spatialLength) && + Objects.equals(this.closed, curve.closed) && + Objects.equals(this.valid, curve.valid); + } + + @Override + public int hashCode() { + return Objects.hash(bClosed, description, type, beginningCoordinate, defaultNumSamples, endingCoordinate, numSamplePoints, segmentCount, spatialLength, closed, valid); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Curve {\n"); + sb.append(" bClosed: ").append(toIndentedString(bClosed)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" beginningCoordinate: ").append(toIndentedString(beginningCoordinate)).append("\n"); + sb.append(" defaultNumSamples: ").append(toIndentedString(defaultNumSamples)).append("\n"); + sb.append(" endingCoordinate: ").append(toIndentedString(endingCoordinate)).append("\n"); + sb.append(" numSamplePoints: ").append(toIndentedString(numSamplePoints)).append("\n"); + sb.append(" segmentCount: ").append(toIndentedString(segmentCount)).append("\n"); + sb.append(" spatialLength: ").append(toIndentedString(spatialLength)).append("\n"); + sb.append(" closed: ").append(toIndentedString(closed)).append("\n"); + sb.append(" valid: ").append(toIndentedString(valid)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bClosed` to the URL query string + if (getbClosed() != null) { + joiner.add(String.format("%sbClosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getbClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `beginningCoordinate` to the URL query string + if (getBeginningCoordinate() != null) { + joiner.add(getBeginningCoordinate().toUrlQueryString(prefix + "beginningCoordinate" + suffix)); + } + + // add `defaultNumSamples` to the URL query string + if (getDefaultNumSamples() != null) { + joiner.add(String.format("%sdefaultNumSamples%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultNumSamples()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endingCoordinate` to the URL query string + if (getEndingCoordinate() != null) { + joiner.add(getEndingCoordinate().toUrlQueryString(prefix + "endingCoordinate" + suffix)); + } + + // add `numSamplePoints` to the URL query string + if (getNumSamplePoints() != null) { + joiner.add(String.format("%snumSamplePoints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumSamplePoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `segmentCount` to the URL query string + if (getSegmentCount() != null) { + joiner.add(String.format("%ssegmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegmentCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `spatialLength` to the URL query string + if (getSpatialLength() != null) { + joiner.add(String.format("%sspatialLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpatialLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `valid` to the URL query string + if (getValid() != null) { + joiner.add(String.format("%svalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("AnalyticCurve", AnalyticCurve.class); + mappings.put("CompositeCurve", CompositeCurve.class); + mappings.put("ControlPointCurve", ControlPointCurve.class); + mappings.put("SampledCurve", SampledCurve.class); + mappings.put("Spline", Spline.class); + mappings.put("Curve", Curve.class); + JSON.registerDiscriminator(Curve.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/CurveSelectionInfo.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/CurveSelectionInfo.java new file mode 100644 index 0000000000..ded1dd0793 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/CurveSelectionInfo.java @@ -0,0 +1,475 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Curve; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * CurveSelectionInfo + */ +@JsonPropertyOrder({ + CurveSelectionInfo.JSON_PROPERTY_FIELD_CURVE, + CurveSelectionInfo.JSON_PROPERTY_FIELD_TYPE, + CurveSelectionInfo.JSON_PROPERTY_FIELD_CONTROL_POINT, + CurveSelectionInfo.JSON_PROPERTY_FIELD_SEGMENT, + CurveSelectionInfo.JSON_PROPERTY_FIELD_U, + CurveSelectionInfo.JSON_PROPERTY_FIELD_U_EXTENDED, + CurveSelectionInfo.JSON_PROPERTY_FIELD_CONTROL_POINT_EXTENDED, + CurveSelectionInfo.JSON_PROPERTY_FIELD_SEGMENT_EXTENDED, + CurveSelectionInfo.JSON_PROPERTY_FIELD_DIRECTION_NEGATIVE, + CurveSelectionInfo.JSON_PROPERTY_CROSSING +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class CurveSelectionInfo { + public static final String JSON_PROPERTY_FIELD_CURVE = "fieldCurve"; + private Curve fieldCurve; + + public static final String JSON_PROPERTY_FIELD_TYPE = "fieldType"; + private Integer fieldType; + + public static final String JSON_PROPERTY_FIELD_CONTROL_POINT = "fieldControlPoint"; + private Integer fieldControlPoint; + + public static final String JSON_PROPERTY_FIELD_SEGMENT = "fieldSegment"; + private Integer fieldSegment; + + public static final String JSON_PROPERTY_FIELD_U = "fieldU"; + private Double fieldU; + + public static final String JSON_PROPERTY_FIELD_U_EXTENDED = "fieldUExtended"; + private Double fieldUExtended; + + public static final String JSON_PROPERTY_FIELD_CONTROL_POINT_EXTENDED = "fieldControlPointExtended"; + private Integer fieldControlPointExtended; + + public static final String JSON_PROPERTY_FIELD_SEGMENT_EXTENDED = "fieldSegmentExtended"; + private Integer fieldSegmentExtended; + + public static final String JSON_PROPERTY_FIELD_DIRECTION_NEGATIVE = "fieldDirectionNegative"; + private Boolean fieldDirectionNegative; + + public static final String JSON_PROPERTY_CROSSING = "crossing"; + private Boolean crossing; + + public CurveSelectionInfo() { + } + + public CurveSelectionInfo fieldCurve(Curve fieldCurve) { + this.fieldCurve = fieldCurve; + return this; + } + + /** + * Get fieldCurve + * @return fieldCurve + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_CURVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Curve getFieldCurve() { + return fieldCurve; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_CURVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldCurve(Curve fieldCurve) { + this.fieldCurve = fieldCurve; + } + + + public CurveSelectionInfo fieldType(Integer fieldType) { + this.fieldType = fieldType; + return this; + } + + /** + * Get fieldType + * @return fieldType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFieldType() { + return fieldType; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldType(Integer fieldType) { + this.fieldType = fieldType; + } + + + public CurveSelectionInfo fieldControlPoint(Integer fieldControlPoint) { + this.fieldControlPoint = fieldControlPoint; + return this; + } + + /** + * Get fieldControlPoint + * @return fieldControlPoint + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_CONTROL_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFieldControlPoint() { + return fieldControlPoint; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_CONTROL_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldControlPoint(Integer fieldControlPoint) { + this.fieldControlPoint = fieldControlPoint; + } + + + public CurveSelectionInfo fieldSegment(Integer fieldSegment) { + this.fieldSegment = fieldSegment; + return this; + } + + /** + * Get fieldSegment + * @return fieldSegment + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_SEGMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFieldSegment() { + return fieldSegment; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_SEGMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldSegment(Integer fieldSegment) { + this.fieldSegment = fieldSegment; + } + + + public CurveSelectionInfo fieldU(Double fieldU) { + this.fieldU = fieldU; + return this; + } + + /** + * Get fieldU + * @return fieldU + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_U) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFieldU() { + return fieldU; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_U) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldU(Double fieldU) { + this.fieldU = fieldU; + } + + + public CurveSelectionInfo fieldUExtended(Double fieldUExtended) { + this.fieldUExtended = fieldUExtended; + return this; + } + + /** + * Get fieldUExtended + * @return fieldUExtended + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_U_EXTENDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFieldUExtended() { + return fieldUExtended; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_U_EXTENDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldUExtended(Double fieldUExtended) { + this.fieldUExtended = fieldUExtended; + } + + + public CurveSelectionInfo fieldControlPointExtended(Integer fieldControlPointExtended) { + this.fieldControlPointExtended = fieldControlPointExtended; + return this; + } + + /** + * Get fieldControlPointExtended + * @return fieldControlPointExtended + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_CONTROL_POINT_EXTENDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFieldControlPointExtended() { + return fieldControlPointExtended; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_CONTROL_POINT_EXTENDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldControlPointExtended(Integer fieldControlPointExtended) { + this.fieldControlPointExtended = fieldControlPointExtended; + } + + + public CurveSelectionInfo fieldSegmentExtended(Integer fieldSegmentExtended) { + this.fieldSegmentExtended = fieldSegmentExtended; + return this; + } + + /** + * Get fieldSegmentExtended + * @return fieldSegmentExtended + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_SEGMENT_EXTENDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getFieldSegmentExtended() { + return fieldSegmentExtended; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_SEGMENT_EXTENDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldSegmentExtended(Integer fieldSegmentExtended) { + this.fieldSegmentExtended = fieldSegmentExtended; + } + + + public CurveSelectionInfo fieldDirectionNegative(Boolean fieldDirectionNegative) { + this.fieldDirectionNegative = fieldDirectionNegative; + return this; + } + + /** + * Get fieldDirectionNegative + * @return fieldDirectionNegative + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_DIRECTION_NEGATIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getFieldDirectionNegative() { + return fieldDirectionNegative; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_DIRECTION_NEGATIVE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldDirectionNegative(Boolean fieldDirectionNegative) { + this.fieldDirectionNegative = fieldDirectionNegative; + } + + + public CurveSelectionInfo crossing(Boolean crossing) { + this.crossing = crossing; + return this; + } + + /** + * Get crossing + * @return crossing + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CROSSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getCrossing() { + return crossing; + } + + + @JsonProperty(JSON_PROPERTY_CROSSING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCrossing(Boolean crossing) { + this.crossing = crossing; + } + + + /** + * Return true if this CurveSelectionInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CurveSelectionInfo curveSelectionInfo = (CurveSelectionInfo) o; + return Objects.equals(this.fieldCurve, curveSelectionInfo.fieldCurve) && + Objects.equals(this.fieldType, curveSelectionInfo.fieldType) && + Objects.equals(this.fieldControlPoint, curveSelectionInfo.fieldControlPoint) && + Objects.equals(this.fieldSegment, curveSelectionInfo.fieldSegment) && + Objects.equals(this.fieldU, curveSelectionInfo.fieldU) && + Objects.equals(this.fieldUExtended, curveSelectionInfo.fieldUExtended) && + Objects.equals(this.fieldControlPointExtended, curveSelectionInfo.fieldControlPointExtended) && + Objects.equals(this.fieldSegmentExtended, curveSelectionInfo.fieldSegmentExtended) && + Objects.equals(this.fieldDirectionNegative, curveSelectionInfo.fieldDirectionNegative) && + Objects.equals(this.crossing, curveSelectionInfo.crossing); + } + + @Override + public int hashCode() { + return Objects.hash(fieldCurve, fieldType, fieldControlPoint, fieldSegment, fieldU, fieldUExtended, fieldControlPointExtended, fieldSegmentExtended, fieldDirectionNegative, crossing); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CurveSelectionInfo {\n"); + sb.append(" fieldCurve: ").append(toIndentedString(fieldCurve)).append("\n"); + sb.append(" fieldType: ").append(toIndentedString(fieldType)).append("\n"); + sb.append(" fieldControlPoint: ").append(toIndentedString(fieldControlPoint)).append("\n"); + sb.append(" fieldSegment: ").append(toIndentedString(fieldSegment)).append("\n"); + sb.append(" fieldU: ").append(toIndentedString(fieldU)).append("\n"); + sb.append(" fieldUExtended: ").append(toIndentedString(fieldUExtended)).append("\n"); + sb.append(" fieldControlPointExtended: ").append(toIndentedString(fieldControlPointExtended)).append("\n"); + sb.append(" fieldSegmentExtended: ").append(toIndentedString(fieldSegmentExtended)).append("\n"); + sb.append(" fieldDirectionNegative: ").append(toIndentedString(fieldDirectionNegative)).append("\n"); + sb.append(" crossing: ").append(toIndentedString(crossing)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `fieldCurve` to the URL query string + if (getFieldCurve() != null) { + joiner.add(getFieldCurve().toUrlQueryString(prefix + "fieldCurve" + suffix)); + } + + // add `fieldType` to the URL query string + if (getFieldType() != null) { + joiner.add(String.format("%sfieldType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldControlPoint` to the URL query string + if (getFieldControlPoint() != null) { + joiner.add(String.format("%sfieldControlPoint%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldControlPoint()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldSegment` to the URL query string + if (getFieldSegment() != null) { + joiner.add(String.format("%sfieldSegment%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldSegment()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldU` to the URL query string + if (getFieldU() != null) { + joiner.add(String.format("%sfieldU%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldU()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldUExtended` to the URL query string + if (getFieldUExtended() != null) { + joiner.add(String.format("%sfieldUExtended%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldUExtended()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldControlPointExtended` to the URL query string + if (getFieldControlPointExtended() != null) { + joiner.add(String.format("%sfieldControlPointExtended%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldControlPointExtended()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldSegmentExtended` to the URL query string + if (getFieldSegmentExtended() != null) { + joiner.add(String.format("%sfieldSegmentExtended%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldSegmentExtended()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `fieldDirectionNegative` to the URL query string + if (getFieldDirectionNegative() != null) { + joiner.add(String.format("%sfieldDirectionNegative%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFieldDirectionNegative()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `crossing` to the URL query string + if (getCrossing() != null) { + joiner.add(String.format("%scrossing%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCrossing()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java new file mode 100644 index 0000000000..aa5e08e5d2 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java @@ -0,0 +1,515 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.ExportProgressType; +import org.vcell.restclient.model.HumanReadableExportData; +import org.vcell.restclient.model.TimeSpecs; +import org.vcell.restclient.model.User; +import org.vcell.restclient.model.VariableSpecs; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * ExportEvent + */ +@JsonPropertyOrder({ + ExportEvent.JSON_PROPERTY_EVENT_TYPE, + ExportEvent.JSON_PROPERTY_PROGRESS, + ExportEvent.JSON_PROPERTY_FORMAT, + ExportEvent.JSON_PROPERTY_LOCATION, + ExportEvent.JSON_PROPERTY_USER, + ExportEvent.JSON_PROPERTY_JOB_I_D, + ExportEvent.JSON_PROPERTY_DATA_KEY, + ExportEvent.JSON_PROPERTY_DATA_ID_STRING, + ExportEvent.JSON_PROPERTY_TIME_SPECS, + ExportEvent.JSON_PROPERTY_VARIABLE_SPECS, + ExportEvent.JSON_PROPERTY_HUMAN_READABLE_DATA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ExportEvent { + public static final String JSON_PROPERTY_EVENT_TYPE = "eventType"; + private ExportProgressType eventType; + + public static final String JSON_PROPERTY_PROGRESS = "progress"; + private Double progress; + + public static final String JSON_PROPERTY_FORMAT = "format"; + private String format; + + public static final String JSON_PROPERTY_LOCATION = "location"; + private String location; + + public static final String JSON_PROPERTY_USER = "user"; + private User user; + + public static final String JSON_PROPERTY_JOB_I_D = "jobID"; + private Long jobID; + + public static final String JSON_PROPERTY_DATA_KEY = "dataKey"; + private String dataKey; + + public static final String JSON_PROPERTY_DATA_ID_STRING = "dataIdString"; + private String dataIdString; + + public static final String JSON_PROPERTY_TIME_SPECS = "timeSpecs"; + private TimeSpecs timeSpecs; + + public static final String JSON_PROPERTY_VARIABLE_SPECS = "variableSpecs"; + private VariableSpecs variableSpecs; + + public static final String JSON_PROPERTY_HUMAN_READABLE_DATA = "humanReadableData"; + private HumanReadableExportData humanReadableData; + + public ExportEvent() { + } + + public ExportEvent eventType(ExportProgressType eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get eventType + * @return eventType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ExportProgressType getEventType() { + return eventType; + } + + + @JsonProperty(JSON_PROPERTY_EVENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEventType(ExportProgressType eventType) { + this.eventType = eventType; + } + + + public ExportEvent progress(Double progress) { + this.progress = progress; + return this; + } + + /** + * Get progress + * @return progress + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROGRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getProgress() { + return progress; + } + + + @JsonProperty(JSON_PROPERTY_PROGRESS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProgress(Double progress) { + this.progress = progress; + } + + + public ExportEvent format(String format) { + this.format = format; + return this; + } + + /** + * Get format + * @return format + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFormat() { + return format; + } + + + @JsonProperty(JSON_PROPERTY_FORMAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFormat(String format) { + this.format = format; + } + + + public ExportEvent location(String location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLocation() { + return location; + } + + + @JsonProperty(JSON_PROPERTY_LOCATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLocation(String location) { + this.location = location; + } + + + public ExportEvent user(User user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public User getUser() { + return user; + } + + + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUser(User user) { + this.user = user; + } + + + public ExportEvent jobID(Long jobID) { + this.jobID = jobID; + return this; + } + + /** + * Get jobID + * @return jobID + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JOB_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getJobID() { + return jobID; + } + + + @JsonProperty(JSON_PROPERTY_JOB_I_D) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJobID(Long jobID) { + this.jobID = jobID; + } + + + public ExportEvent dataKey(String dataKey) { + this.dataKey = dataKey; + return this; + } + + /** + * Get dataKey + * @return dataKey + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDataKey() { + return dataKey; + } + + + @JsonProperty(JSON_PROPERTY_DATA_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDataKey(String dataKey) { + this.dataKey = dataKey; + } + + + public ExportEvent dataIdString(String dataIdString) { + this.dataIdString = dataIdString; + return this; + } + + /** + * Get dataIdString + * @return dataIdString + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_ID_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDataIdString() { + return dataIdString; + } + + + @JsonProperty(JSON_PROPERTY_DATA_ID_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDataIdString(String dataIdString) { + this.dataIdString = dataIdString; + } + + + public ExportEvent timeSpecs(TimeSpecs timeSpecs) { + this.timeSpecs = timeSpecs; + return this; + } + + /** + * Get timeSpecs + * @return timeSpecs + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TimeSpecs getTimeSpecs() { + return timeSpecs; + } + + + @JsonProperty(JSON_PROPERTY_TIME_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeSpecs(TimeSpecs timeSpecs) { + this.timeSpecs = timeSpecs; + } + + + public ExportEvent variableSpecs(VariableSpecs variableSpecs) { + this.variableSpecs = variableSpecs; + return this; + } + + /** + * Get variableSpecs + * @return variableSpecs + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VARIABLE_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public VariableSpecs getVariableSpecs() { + return variableSpecs; + } + + + @JsonProperty(JSON_PROPERTY_VARIABLE_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVariableSpecs(VariableSpecs variableSpecs) { + this.variableSpecs = variableSpecs; + } + + + public ExportEvent humanReadableData(HumanReadableExportData humanReadableData) { + this.humanReadableData = humanReadableData; + return this; + } + + /** + * Get humanReadableData + * @return humanReadableData + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HUMAN_READABLE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public HumanReadableExportData getHumanReadableData() { + return humanReadableData; + } + + + @JsonProperty(JSON_PROPERTY_HUMAN_READABLE_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHumanReadableData(HumanReadableExportData humanReadableData) { + this.humanReadableData = humanReadableData; + } + + + /** + * Return true if this ExportEvent object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExportEvent exportEvent = (ExportEvent) o; + return Objects.equals(this.eventType, exportEvent.eventType) && + Objects.equals(this.progress, exportEvent.progress) && + Objects.equals(this.format, exportEvent.format) && + Objects.equals(this.location, exportEvent.location) && + Objects.equals(this.user, exportEvent.user) && + Objects.equals(this.jobID, exportEvent.jobID) && + Objects.equals(this.dataKey, exportEvent.dataKey) && + Objects.equals(this.dataIdString, exportEvent.dataIdString) && + Objects.equals(this.timeSpecs, exportEvent.timeSpecs) && + Objects.equals(this.variableSpecs, exportEvent.variableSpecs) && + Objects.equals(this.humanReadableData, exportEvent.humanReadableData); + } + + @Override + public int hashCode() { + return Objects.hash(eventType, progress, format, location, user, jobID, dataKey, dataIdString, timeSpecs, variableSpecs, humanReadableData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExportEvent {\n"); + sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); + sb.append(" progress: ").append(toIndentedString(progress)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" jobID: ").append(toIndentedString(jobID)).append("\n"); + sb.append(" dataKey: ").append(toIndentedString(dataKey)).append("\n"); + sb.append(" dataIdString: ").append(toIndentedString(dataIdString)).append("\n"); + sb.append(" timeSpecs: ").append(toIndentedString(timeSpecs)).append("\n"); + sb.append(" variableSpecs: ").append(toIndentedString(variableSpecs)).append("\n"); + sb.append(" humanReadableData: ").append(toIndentedString(humanReadableData)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `eventType` to the URL query string + if (getEventType() != null) { + joiner.add(String.format("%seventType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEventType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `progress` to the URL query string + if (getProgress() != null) { + joiner.add(String.format("%sprogress%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProgress()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `format` to the URL query string + if (getFormat() != null) { + joiner.add(String.format("%sformat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFormat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `location` to the URL query string + if (getLocation() != null) { + joiner.add(String.format("%slocation%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLocation()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `user` to the URL query string + if (getUser() != null) { + joiner.add(getUser().toUrlQueryString(prefix + "user" + suffix)); + } + + // add `jobID` to the URL query string + if (getJobID() != null) { + joiner.add(String.format("%sjobID%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJobID()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `dataKey` to the URL query string + if (getDataKey() != null) { + joiner.add(String.format("%sdataKey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDataKey()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `dataIdString` to the URL query string + if (getDataIdString() != null) { + joiner.add(String.format("%sdataIdString%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDataIdString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `timeSpecs` to the URL query string + if (getTimeSpecs() != null) { + joiner.add(getTimeSpecs().toUrlQueryString(prefix + "timeSpecs" + suffix)); + } + + // add `variableSpecs` to the URL query string + if (getVariableSpecs() != null) { + joiner.add(getVariableSpecs().toUrlQueryString(prefix + "variableSpecs" + suffix)); + } + + // add `humanReadableData` to the URL query string + if (getHumanReadableData() != null) { + joiner.add(getHumanReadableData().toUrlQueryString(prefix + "humanReadableData" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportProgressType.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportProgressType.java new file mode 100644 index 0000000000..ff145bf70d --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportProgressType.java @@ -0,0 +1,84 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ExportProgressType + */ +public enum ExportProgressType { + + START("EXPORT_START"), + + COMPLETE("EXPORT_COMPLETE"), + + FAILURE("EXPORT_FAILURE"), + + ASSEMBLING("EXPORT_ASSEMBLING"), + + PROGRESS("EXPORT_PROGRESS"); + + private String value; + + ExportProgressType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ExportProgressType fromValue(String value) { + for (ExportProgressType b : ExportProgressType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } + +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportableDataType.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportableDataType.java new file mode 100644 index 0000000000..2254a4611c --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportableDataType.java @@ -0,0 +1,80 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ExportableDataType + */ +public enum ExportableDataType { + + ODE_VARIABLE_DATA("ODE_VARIABLE_DATA"), + + PDE_VARIABLE_DATA("PDE_VARIABLE_DATA"), + + PDE_PARTICLE_DATA("PDE_PARTICLE_DATA"); + + private String value; + + ExportableDataType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ExportableDataType fromValue(String value) { + for (ExportableDataType b : ExportableDataType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } + +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/FunctionCategory.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/FunctionCategory.java new file mode 100644 index 0000000000..95b5a2d7b1 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/FunctionCategory.java @@ -0,0 +1,82 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets FunctionCategory + */ +public enum FunctionCategory { + + PREDEFINED("PREDEFINED"), + + OLDUSERDEFINED("OLDUSERDEFINED"), + + OUTPUTFUNCTION("OUTPUTFUNCTION"), + + POSTPROCESSFUNCTION("POSTPROCESSFUNCTION"); + + private String value; + + FunctionCategory(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FunctionCategory fromValue(String value) { + for (FunctionCategory b : FunctionCategory.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } + +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/GeometryMode.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/GeometryMode.java new file mode 100644 index 0000000000..0366211ec4 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/GeometryMode.java @@ -0,0 +1,80 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets GeometryMode + */ +public enum GeometryMode { + + SELECTIONS("GEOMETRY_SELECTIONS"), + + SLICE("GEOMETRY_SLICE"), + + FULL("GEOMETRY_FULL"); + + private String value; + + GeometryMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static GeometryMode fromValue(String value) { + for (GeometryMode b : GeometryMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } + +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/GeometrySpecDTO.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/GeometrySpecDTO.java new file mode 100644 index 0000000000..c0e8aa93b4 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/GeometrySpecDTO.java @@ -0,0 +1,275 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.GeometryMode; +import org.vcell.restclient.model.SpatialSelection; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * GeometrySpecDTO + */ +@JsonPropertyOrder({ + GeometrySpecDTO.JSON_PROPERTY_SELECTIONS, + GeometrySpecDTO.JSON_PROPERTY_AXIS, + GeometrySpecDTO.JSON_PROPERTY_SLICE_NUMBER, + GeometrySpecDTO.JSON_PROPERTY_GEOMETRY_MODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class GeometrySpecDTO { + public static final String JSON_PROPERTY_SELECTIONS = "selections"; + private List selections; + + public static final String JSON_PROPERTY_AXIS = "axis"; + private Integer axis; + + public static final String JSON_PROPERTY_SLICE_NUMBER = "sliceNumber"; + private Integer sliceNumber; + + public static final String JSON_PROPERTY_GEOMETRY_MODE = "geometryMode"; + private GeometryMode geometryMode; + + public GeometrySpecDTO() { + } + + public GeometrySpecDTO selections(List selections) { + this.selections = selections; + return this; + } + + public GeometrySpecDTO addSelectionsItem(SpatialSelection selectionsItem) { + if (this.selections == null) { + this.selections = new ArrayList<>(); + } + this.selections.add(selectionsItem); + return this; + } + + /** + * Get selections + * @return selections + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSelections() { + return selections; + } + + + @JsonProperty(JSON_PROPERTY_SELECTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSelections(List selections) { + this.selections = selections; + } + + + public GeometrySpecDTO axis(Integer axis) { + this.axis = axis; + return this; + } + + /** + * Get axis + * @return axis + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AXIS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getAxis() { + return axis; + } + + + @JsonProperty(JSON_PROPERTY_AXIS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAxis(Integer axis) { + this.axis = axis; + } + + + public GeometrySpecDTO sliceNumber(Integer sliceNumber) { + this.sliceNumber = sliceNumber; + return this; + } + + /** + * Get sliceNumber + * @return sliceNumber + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SLICE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSliceNumber() { + return sliceNumber; + } + + + @JsonProperty(JSON_PROPERTY_SLICE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSliceNumber(Integer sliceNumber) { + this.sliceNumber = sliceNumber; + } + + + public GeometrySpecDTO geometryMode(GeometryMode geometryMode) { + this.geometryMode = geometryMode; + return this; + } + + /** + * Get geometryMode + * @return geometryMode + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEOMETRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GeometryMode getGeometryMode() { + return geometryMode; + } + + + @JsonProperty(JSON_PROPERTY_GEOMETRY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGeometryMode(GeometryMode geometryMode) { + this.geometryMode = geometryMode; + } + + + /** + * Return true if this GeometrySpecDTO object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GeometrySpecDTO geometrySpecDTO = (GeometrySpecDTO) o; + return Objects.equals(this.selections, geometrySpecDTO.selections) && + Objects.equals(this.axis, geometrySpecDTO.axis) && + Objects.equals(this.sliceNumber, geometrySpecDTO.sliceNumber) && + Objects.equals(this.geometryMode, geometrySpecDTO.geometryMode); + } + + @Override + public int hashCode() { + return Objects.hash(selections, axis, sliceNumber, geometryMode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GeometrySpecDTO {\n"); + sb.append(" selections: ").append(toIndentedString(selections)).append("\n"); + sb.append(" axis: ").append(toIndentedString(axis)).append("\n"); + sb.append(" sliceNumber: ").append(toIndentedString(sliceNumber)).append("\n"); + sb.append(" geometryMode: ").append(toIndentedString(geometryMode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `selections` to the URL query string + if (getSelections() != null) { + for (int i = 0; i < getSelections().size(); i++) { + if (getSelections().get(i) != null) { + joiner.add(getSelections().get(i).toUrlQueryString(String.format("%sselections%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `axis` to the URL query string + if (getAxis() != null) { + joiner.add(String.format("%saxis%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAxis()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `sliceNumber` to the URL query string + if (getSliceNumber() != null) { + joiner.add(String.format("%ssliceNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSliceNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `geometryMode` to the URL query string + if (getGeometryMode() != null) { + joiner.add(String.format("%sgeometryMode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getGeometryMode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/HumanReadableExportData.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/HumanReadableExportData.java new file mode 100644 index 0000000000..7137081d8e --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/HumanReadableExportData.java @@ -0,0 +1,538 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * HumanReadableExportData + */ +@JsonPropertyOrder({ + HumanReadableExportData.JSON_PROPERTY_SIMULATION_NAME, + HumanReadableExportData.JSON_PROPERTY_BIOMODEL_NAME, + HumanReadableExportData.JSON_PROPERTY_APPLICATION_NAME, + HumanReadableExportData.JSON_PROPERTY_DIFFERENT_PARAMETER_VALUES, + HumanReadableExportData.JSON_PROPERTY_APPLICATION_TYPE, + HumanReadableExportData.JSON_PROPERTY_SERVER_SAVED_FILE_NAME, + HumanReadableExportData.JSON_PROPERTY_NON_SPATIAL, + HumanReadableExportData.JSON_PROPERTY_SUB_VOLUME, + HumanReadableExportData.JSON_PROPERTY_Z_SLICES, + HumanReadableExportData.JSON_PROPERTY_T_SLICES, + HumanReadableExportData.JSON_PROPERTY_NUM_CHANNELS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class HumanReadableExportData { + public static final String JSON_PROPERTY_SIMULATION_NAME = "simulationName"; + private String simulationName; + + public static final String JSON_PROPERTY_BIOMODEL_NAME = "biomodelName"; + private String biomodelName; + + public static final String JSON_PROPERTY_APPLICATION_NAME = "applicationName"; + private String applicationName; + + public static final String JSON_PROPERTY_DIFFERENT_PARAMETER_VALUES = "differentParameterValues"; + private List differentParameterValues; + + public static final String JSON_PROPERTY_APPLICATION_TYPE = "applicationType"; + private String applicationType; + + public static final String JSON_PROPERTY_SERVER_SAVED_FILE_NAME = "serverSavedFileName"; + private String serverSavedFileName; + + public static final String JSON_PROPERTY_NON_SPATIAL = "nonSpatial"; + private Boolean nonSpatial; + + public static final String JSON_PROPERTY_SUB_VOLUME = "subVolume"; + private Map subVolume = new HashMap<>(); + + public static final String JSON_PROPERTY_Z_SLICES = "zSlices"; + private Integer zSlices; + + public static final String JSON_PROPERTY_T_SLICES = "tSlices"; + private Integer tSlices; + + public static final String JSON_PROPERTY_NUM_CHANNELS = "numChannels"; + private Integer numChannels; + + public HumanReadableExportData() { + } + + public HumanReadableExportData simulationName(String simulationName) { + this.simulationName = simulationName; + return this; + } + + /** + * Get simulationName + * @return simulationName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIMULATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSimulationName() { + return simulationName; + } + + + @JsonProperty(JSON_PROPERTY_SIMULATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSimulationName(String simulationName) { + this.simulationName = simulationName; + } + + + public HumanReadableExportData biomodelName(String biomodelName) { + this.biomodelName = biomodelName; + return this; + } + + /** + * Get biomodelName + * @return biomodelName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BIOMODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBiomodelName() { + return biomodelName; + } + + + @JsonProperty(JSON_PROPERTY_BIOMODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBiomodelName(String biomodelName) { + this.biomodelName = biomodelName; + } + + + public HumanReadableExportData applicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get applicationName + * @return applicationName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPLICATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApplicationName() { + return applicationName; + } + + + @JsonProperty(JSON_PROPERTY_APPLICATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + + + public HumanReadableExportData differentParameterValues(List differentParameterValues) { + this.differentParameterValues = differentParameterValues; + return this; + } + + public HumanReadableExportData addDifferentParameterValuesItem(String differentParameterValuesItem) { + if (this.differentParameterValues == null) { + this.differentParameterValues = new ArrayList<>(); + } + this.differentParameterValues.add(differentParameterValuesItem); + return this; + } + + /** + * Get differentParameterValues + * @return differentParameterValues + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIFFERENT_PARAMETER_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getDifferentParameterValues() { + return differentParameterValues; + } + + + @JsonProperty(JSON_PROPERTY_DIFFERENT_PARAMETER_VALUES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDifferentParameterValues(List differentParameterValues) { + this.differentParameterValues = differentParameterValues; + } + + + public HumanReadableExportData applicationType(String applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Get applicationType + * @return applicationType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPLICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getApplicationType() { + return applicationType; + } + + + @JsonProperty(JSON_PROPERTY_APPLICATION_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setApplicationType(String applicationType) { + this.applicationType = applicationType; + } + + + public HumanReadableExportData serverSavedFileName(String serverSavedFileName) { + this.serverSavedFileName = serverSavedFileName; + return this; + } + + /** + * Get serverSavedFileName + * @return serverSavedFileName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVER_SAVED_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getServerSavedFileName() { + return serverSavedFileName; + } + + + @JsonProperty(JSON_PROPERTY_SERVER_SAVED_FILE_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerSavedFileName(String serverSavedFileName) { + this.serverSavedFileName = serverSavedFileName; + } + + + public HumanReadableExportData nonSpatial(Boolean nonSpatial) { + this.nonSpatial = nonSpatial; + return this; + } + + /** + * Get nonSpatial + * @return nonSpatial + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NON_SPATIAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getNonSpatial() { + return nonSpatial; + } + + + @JsonProperty(JSON_PROPERTY_NON_SPATIAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNonSpatial(Boolean nonSpatial) { + this.nonSpatial = nonSpatial; + } + + + public HumanReadableExportData subVolume(Map subVolume) { + this.subVolume = subVolume; + return this; + } + + public HumanReadableExportData putSubVolumeItem(String key, String subVolumeItem) { + if (this.subVolume == null) { + this.subVolume = new HashMap<>(); + } + this.subVolume.put(key, subVolumeItem); + return this; + } + + /** + * Get subVolume + * @return subVolume + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_VOLUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getSubVolume() { + return subVolume; + } + + + @JsonProperty(JSON_PROPERTY_SUB_VOLUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubVolume(Map subVolume) { + this.subVolume = subVolume; + } + + + public HumanReadableExportData zSlices(Integer zSlices) { + this.zSlices = zSlices; + return this; + } + + /** + * Get zSlices + * @return zSlices + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_Z_SLICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getzSlices() { + return zSlices; + } + + + @JsonProperty(JSON_PROPERTY_Z_SLICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setzSlices(Integer zSlices) { + this.zSlices = zSlices; + } + + + public HumanReadableExportData tSlices(Integer tSlices) { + this.tSlices = tSlices; + return this; + } + + /** + * Get tSlices + * @return tSlices + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_T_SLICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer gettSlices() { + return tSlices; + } + + + @JsonProperty(JSON_PROPERTY_T_SLICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void settSlices(Integer tSlices) { + this.tSlices = tSlices; + } + + + public HumanReadableExportData numChannels(Integer numChannels) { + this.numChannels = numChannels; + return this; + } + + /** + * Get numChannels + * @return numChannels + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUM_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNumChannels() { + return numChannels; + } + + + @JsonProperty(JSON_PROPERTY_NUM_CHANNELS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumChannels(Integer numChannels) { + this.numChannels = numChannels; + } + + + /** + * Return true if this HumanReadableExportData object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HumanReadableExportData humanReadableExportData = (HumanReadableExportData) o; + return Objects.equals(this.simulationName, humanReadableExportData.simulationName) && + Objects.equals(this.biomodelName, humanReadableExportData.biomodelName) && + Objects.equals(this.applicationName, humanReadableExportData.applicationName) && + Objects.equals(this.differentParameterValues, humanReadableExportData.differentParameterValues) && + Objects.equals(this.applicationType, humanReadableExportData.applicationType) && + Objects.equals(this.serverSavedFileName, humanReadableExportData.serverSavedFileName) && + Objects.equals(this.nonSpatial, humanReadableExportData.nonSpatial) && + Objects.equals(this.subVolume, humanReadableExportData.subVolume) && + Objects.equals(this.zSlices, humanReadableExportData.zSlices) && + Objects.equals(this.tSlices, humanReadableExportData.tSlices) && + Objects.equals(this.numChannels, humanReadableExportData.numChannels); + } + + @Override + public int hashCode() { + return Objects.hash(simulationName, biomodelName, applicationName, differentParameterValues, applicationType, serverSavedFileName, nonSpatial, subVolume, zSlices, tSlices, numChannels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HumanReadableExportData {\n"); + sb.append(" simulationName: ").append(toIndentedString(simulationName)).append("\n"); + sb.append(" biomodelName: ").append(toIndentedString(biomodelName)).append("\n"); + sb.append(" applicationName: ").append(toIndentedString(applicationName)).append("\n"); + sb.append(" differentParameterValues: ").append(toIndentedString(differentParameterValues)).append("\n"); + sb.append(" applicationType: ").append(toIndentedString(applicationType)).append("\n"); + sb.append(" serverSavedFileName: ").append(toIndentedString(serverSavedFileName)).append("\n"); + sb.append(" nonSpatial: ").append(toIndentedString(nonSpatial)).append("\n"); + sb.append(" subVolume: ").append(toIndentedString(subVolume)).append("\n"); + sb.append(" zSlices: ").append(toIndentedString(zSlices)).append("\n"); + sb.append(" tSlices: ").append(toIndentedString(tSlices)).append("\n"); + sb.append(" numChannels: ").append(toIndentedString(numChannels)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `simulationName` to the URL query string + if (getSimulationName() != null) { + joiner.add(String.format("%ssimulationName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSimulationName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `biomodelName` to the URL query string + if (getBiomodelName() != null) { + joiner.add(String.format("%sbiomodelName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBiomodelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `applicationName` to the URL query string + if (getApplicationName() != null) { + joiner.add(String.format("%sapplicationName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getApplicationName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `differentParameterValues` to the URL query string + if (getDifferentParameterValues() != null) { + for (int i = 0; i < getDifferentParameterValues().size(); i++) { + joiner.add(String.format("%sdifferentParameterValues%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getDifferentParameterValues().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `applicationType` to the URL query string + if (getApplicationType() != null) { + joiner.add(String.format("%sapplicationType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getApplicationType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `serverSavedFileName` to the URL query string + if (getServerSavedFileName() != null) { + joiner.add(String.format("%sserverSavedFileName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getServerSavedFileName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `nonSpatial` to the URL query string + if (getNonSpatial() != null) { + joiner.add(String.format("%snonSpatial%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNonSpatial()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `subVolume` to the URL query string + if (getSubVolume() != null) { + for (String _key : getSubVolume().keySet()) { + joiner.add(String.format("%ssubVolume%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getSubVolume().get(_key), URLEncoder.encode(String.valueOf(getSubVolume().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `zSlices` to the URL query string + if (getzSlices() != null) { + joiner.add(String.format("%szSlices%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getzSlices()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `tSlices` to the URL query string + if (gettSlices() != null) { + joiner.add(String.format("%stSlices%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(gettSlices()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `numChannels` to the URL query string + if (getNumChannels() != null) { + joiner.add(String.format("%snumChannels%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumChannels()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/N5ExportRequest.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/N5ExportRequest.java new file mode 100644 index 0000000000..a687e3938a --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/N5ExportRequest.java @@ -0,0 +1,274 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.vcell.restclient.model.ExportableDataType; +import org.vcell.restclient.model.StandardExportInfo; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * N5ExportRequest + */ +@JsonPropertyOrder({ + N5ExportRequest.JSON_PROPERTY_STANDARD_EXPORT_INFORMATION, + N5ExportRequest.JSON_PROPERTY_SUB_VOLUME, + N5ExportRequest.JSON_PROPERTY_EXPORTABLE_DATA_TYPE, + N5ExportRequest.JSON_PROPERTY_DATASET_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class N5ExportRequest { + public static final String JSON_PROPERTY_STANDARD_EXPORT_INFORMATION = "standardExportInformation"; + private StandardExportInfo standardExportInformation; + + public static final String JSON_PROPERTY_SUB_VOLUME = "subVolume"; + private Map subVolume = new HashMap<>(); + + public static final String JSON_PROPERTY_EXPORTABLE_DATA_TYPE = "exportableDataType"; + private ExportableDataType exportableDataType; + + public static final String JSON_PROPERTY_DATASET_NAME = "datasetName"; + private String datasetName; + + public N5ExportRequest() { + } + + public N5ExportRequest standardExportInformation(StandardExportInfo standardExportInformation) { + this.standardExportInformation = standardExportInformation; + return this; + } + + /** + * Get standardExportInformation + * @return standardExportInformation + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STANDARD_EXPORT_INFORMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StandardExportInfo getStandardExportInformation() { + return standardExportInformation; + } + + + @JsonProperty(JSON_PROPERTY_STANDARD_EXPORT_INFORMATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStandardExportInformation(StandardExportInfo standardExportInformation) { + this.standardExportInformation = standardExportInformation; + } + + + public N5ExportRequest subVolume(Map subVolume) { + this.subVolume = subVolume; + return this; + } + + public N5ExportRequest putSubVolumeItem(String key, String subVolumeItem) { + if (this.subVolume == null) { + this.subVolume = new HashMap<>(); + } + this.subVolume.put(key, subVolumeItem); + return this; + } + + /** + * Get subVolume + * @return subVolume + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUB_VOLUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getSubVolume() { + return subVolume; + } + + + @JsonProperty(JSON_PROPERTY_SUB_VOLUME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubVolume(Map subVolume) { + this.subVolume = subVolume; + } + + + public N5ExportRequest exportableDataType(ExportableDataType exportableDataType) { + this.exportableDataType = exportableDataType; + return this; + } + + /** + * Get exportableDataType + * @return exportableDataType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPORTABLE_DATA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ExportableDataType getExportableDataType() { + return exportableDataType; + } + + + @JsonProperty(JSON_PROPERTY_EXPORTABLE_DATA_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExportableDataType(ExportableDataType exportableDataType) { + this.exportableDataType = exportableDataType; + } + + + public N5ExportRequest datasetName(String datasetName) { + this.datasetName = datasetName; + return this; + } + + /** + * Get datasetName + * @return datasetName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATASET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDatasetName() { + return datasetName; + } + + + @JsonProperty(JSON_PROPERTY_DATASET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDatasetName(String datasetName) { + this.datasetName = datasetName; + } + + + /** + * Return true if this N5ExportRequest object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + N5ExportRequest n5ExportRequest = (N5ExportRequest) o; + return Objects.equals(this.standardExportInformation, n5ExportRequest.standardExportInformation) && + Objects.equals(this.subVolume, n5ExportRequest.subVolume) && + Objects.equals(this.exportableDataType, n5ExportRequest.exportableDataType) && + Objects.equals(this.datasetName, n5ExportRequest.datasetName); + } + + @Override + public int hashCode() { + return Objects.hash(standardExportInformation, subVolume, exportableDataType, datasetName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class N5ExportRequest {\n"); + sb.append(" standardExportInformation: ").append(toIndentedString(standardExportInformation)).append("\n"); + sb.append(" subVolume: ").append(toIndentedString(subVolume)).append("\n"); + sb.append(" exportableDataType: ").append(toIndentedString(exportableDataType)).append("\n"); + sb.append(" datasetName: ").append(toIndentedString(datasetName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `standardExportInformation` to the URL query string + if (getStandardExportInformation() != null) { + joiner.add(getStandardExportInformation().toUrlQueryString(prefix + "standardExportInformation" + suffix)); + } + + // add `subVolume` to the URL query string + if (getSubVolume() != null) { + for (String _key : getSubVolume().keySet()) { + joiner.add(String.format("%ssubVolume%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), + getSubVolume().get(_key), URLEncoder.encode(String.valueOf(getSubVolume().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `exportableDataType` to the URL query string + if (getExportableDataType() != null) { + joiner.add(String.format("%sexportableDataType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getExportableDataType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `datasetName` to the URL query string + if (getDatasetName() != null) { + joiner.add(String.format("%sdatasetName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDatasetName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SampledCurve.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SampledCurve.java new file mode 100644 index 0000000000..99ed323684 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SampledCurve.java @@ -0,0 +1,405 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.ControlPointCurve; +import org.vcell.restclient.model.Coordinate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * SampledCurve + */ +@JsonPropertyOrder({ + SampledCurve.JSON_PROPERTY_TYPE, + SampledCurve.JSON_PROPERTY_DEFAULT_NUM_SAMPLES, + SampledCurve.JSON_PROPERTY_MAX_CONTROL_POINTS, + SampledCurve.JSON_PROPERTY_MIN_CONTROL_POINTS, + SampledCurve.JSON_PROPERTY_SEGMENT_COUNT, + SampledCurve.JSON_PROPERTY_SPATIAL_LENGTH +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class SampledCurve extends ControlPointCurve { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "SampledCurve"; + + public static final String JSON_PROPERTY_DEFAULT_NUM_SAMPLES = "defaultNumSamples"; + private Integer defaultNumSamples; + + public static final String JSON_PROPERTY_MAX_CONTROL_POINTS = "maxControlPoints"; + private Integer maxControlPoints; + + public static final String JSON_PROPERTY_MIN_CONTROL_POINTS = "minControlPoints"; + private Integer minControlPoints; + + public static final String JSON_PROPERTY_SEGMENT_COUNT = "segmentCount"; + private Integer segmentCount; + + public static final String JSON_PROPERTY_SPATIAL_LENGTH = "spatialLength"; + private Double spatialLength; + + public SampledCurve() { + } + + public SampledCurve type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public SampledCurve defaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + return this; + } + + /** + * Get defaultNumSamples + * @return defaultNumSamples + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultNumSamples() { + return defaultNumSamples; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + } + + + public SampledCurve maxControlPoints(Integer maxControlPoints) { + this.maxControlPoints = maxControlPoints; + return this; + } + + /** + * Get maxControlPoints + * @return maxControlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxControlPoints() { + return maxControlPoints; + } + + + @JsonProperty(JSON_PROPERTY_MAX_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxControlPoints(Integer maxControlPoints) { + this.maxControlPoints = maxControlPoints; + } + + + public SampledCurve minControlPoints(Integer minControlPoints) { + this.minControlPoints = minControlPoints; + return this; + } + + /** + * Get minControlPoints + * @return minControlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMinControlPoints() { + return minControlPoints; + } + + + @JsonProperty(JSON_PROPERTY_MIN_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinControlPoints(Integer minControlPoints) { + this.minControlPoints = minControlPoints; + } + + + public SampledCurve segmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + return this; + } + + /** + * Get segmentCount + * @return segmentCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSegmentCount() { + return segmentCount; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + } + + + public SampledCurve spatialLength(Double spatialLength) { + this.spatialLength = spatialLength; + return this; + } + + /** + * Get spatialLength + * @return spatialLength + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPATIAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getSpatialLength() { + return spatialLength; + } + + + @JsonProperty(JSON_PROPERTY_SPATIAL_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpatialLength(Double spatialLength) { + this.spatialLength = spatialLength; + } + + + @Override + public SampledCurve bClosed(Boolean bClosed) { + this.setbClosed(bClosed); + return this; + } + + @Override + public SampledCurve beginningCoordinate(Coordinate beginningCoordinate) { + this.setBeginningCoordinate(beginningCoordinate); + return this; + } + + @Override + public SampledCurve endingCoordinate(Coordinate endingCoordinate) { + this.setEndingCoordinate(endingCoordinate); + return this; + } + + @Override + public SampledCurve numSamplePoints(Integer numSamplePoints) { + this.setNumSamplePoints(numSamplePoints); + return this; + } + + @Override + public SampledCurve closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + /** + * Return true if this SampledCurve object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SampledCurve sampledCurve = (SampledCurve) o; + return Objects.equals(this.type, sampledCurve.type) && + Objects.equals(this.defaultNumSamples, sampledCurve.defaultNumSamples) && + Objects.equals(this.maxControlPoints, sampledCurve.maxControlPoints) && + Objects.equals(this.minControlPoints, sampledCurve.minControlPoints) && + Objects.equals(this.segmentCount, sampledCurve.segmentCount) && + Objects.equals(this.spatialLength, sampledCurve.spatialLength) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, defaultNumSamples, maxControlPoints, minControlPoints, segmentCount, spatialLength, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SampledCurve {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" defaultNumSamples: ").append(toIndentedString(defaultNumSamples)).append("\n"); + sb.append(" maxControlPoints: ").append(toIndentedString(maxControlPoints)).append("\n"); + sb.append(" minControlPoints: ").append(toIndentedString(minControlPoints)).append("\n"); + sb.append(" segmentCount: ").append(toIndentedString(segmentCount)).append("\n"); + sb.append(" spatialLength: ").append(toIndentedString(spatialLength)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bClosed` to the URL query string + if (getbClosed() != null) { + joiner.add(String.format("%sbClosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getbClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `beginningCoordinate` to the URL query string + if (getBeginningCoordinate() != null) { + joiner.add(getBeginningCoordinate().toUrlQueryString(prefix + "beginningCoordinate" + suffix)); + } + + // add `defaultNumSamples` to the URL query string + if (getDefaultNumSamples() != null) { + joiner.add(String.format("%sdefaultNumSamples%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultNumSamples()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endingCoordinate` to the URL query string + if (getEndingCoordinate() != null) { + joiner.add(getEndingCoordinate().toUrlQueryString(prefix + "endingCoordinate" + suffix)); + } + + // add `numSamplePoints` to the URL query string + if (getNumSamplePoints() != null) { + joiner.add(String.format("%snumSamplePoints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumSamplePoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `segmentCount` to the URL query string + if (getSegmentCount() != null) { + joiner.add(String.format("%ssegmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegmentCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `spatialLength` to the URL query string + if (getSpatialLength() != null) { + joiner.add(String.format("%sspatialLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpatialLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `valid` to the URL query string + if (getValid() != null) { + joiner.add(String.format("%svalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("SampledCurve", SampledCurve.class); + JSON.registerDiscriminator(SampledCurve.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelection.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelection.java new file mode 100644 index 0000000000..f979ef81e3 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelection.java @@ -0,0 +1,392 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.VariableType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * SpatialSelection + */ +@JsonPropertyOrder({ + SpatialSelection.JSON_PROPERTY_CURVE_SELECTION_INFO, + SpatialSelection.JSON_PROPERTY_VAR_TYPE, + SpatialSelection.JSON_PROPERTY_TYPE, + SpatialSelection.JSON_PROPERTY_SMALLEST_MESH_CELL_DIMENSION_LENGTH, + SpatialSelection.JSON_PROPERTY_VARIABLE_TYPE, + SpatialSelection.JSON_PROPERTY_CLOSED, + SpatialSelection.JSON_PROPERTY_POINT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = SpatialSelectionContour.class, name = "Contour"), + @JsonSubTypes.Type(value = SpatialSelectionMembrane.class, name = "Membrane"), + @JsonSubTypes.Type(value = SpatialSelectionVolume.class, name = "Volume"), +}) + +public class SpatialSelection { + public static final String JSON_PROPERTY_CURVE_SELECTION_INFO = "curveSelectionInfo"; + private CurveSelectionInfo curveSelectionInfo; + + public static final String JSON_PROPERTY_VAR_TYPE = "varType"; + private VariableType varType; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_SMALLEST_MESH_CELL_DIMENSION_LENGTH = "smallestMeshCellDimensionLength"; + private Double smallestMeshCellDimensionLength; + + public static final String JSON_PROPERTY_VARIABLE_TYPE = "variableType"; + private VariableType variableType; + + public static final String JSON_PROPERTY_CLOSED = "closed"; + private Boolean closed; + + public static final String JSON_PROPERTY_POINT = "point"; + private Boolean point; + + public SpatialSelection() { + } + + public SpatialSelection curveSelectionInfo(CurveSelectionInfo curveSelectionInfo) { + this.curveSelectionInfo = curveSelectionInfo; + return this; + } + + /** + * Get curveSelectionInfo + * @return curveSelectionInfo + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURVE_SELECTION_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public CurveSelectionInfo getCurveSelectionInfo() { + return curveSelectionInfo; + } + + + @JsonProperty(JSON_PROPERTY_CURVE_SELECTION_INFO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCurveSelectionInfo(CurveSelectionInfo curveSelectionInfo) { + this.curveSelectionInfo = curveSelectionInfo; + } + + + public SpatialSelection varType(VariableType varType) { + this.varType = varType; + return this; + } + + /** + * Get varType + * @return varType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VAR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public VariableType getVarType() { + return varType; + } + + + @JsonProperty(JSON_PROPERTY_VAR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVarType(VariableType varType) { + this.varType = varType; + } + + + public SpatialSelection type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public SpatialSelection smallestMeshCellDimensionLength(Double smallestMeshCellDimensionLength) { + this.smallestMeshCellDimensionLength = smallestMeshCellDimensionLength; + return this; + } + + /** + * Get smallestMeshCellDimensionLength + * @return smallestMeshCellDimensionLength + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMALLEST_MESH_CELL_DIMENSION_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getSmallestMeshCellDimensionLength() { + return smallestMeshCellDimensionLength; + } + + + @JsonProperty(JSON_PROPERTY_SMALLEST_MESH_CELL_DIMENSION_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallestMeshCellDimensionLength(Double smallestMeshCellDimensionLength) { + this.smallestMeshCellDimensionLength = smallestMeshCellDimensionLength; + } + + + public SpatialSelection variableType(VariableType variableType) { + this.variableType = variableType; + return this; + } + + /** + * Get variableType + * @return variableType + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VARIABLE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public VariableType getVariableType() { + return variableType; + } + + + @JsonProperty(JSON_PROPERTY_VARIABLE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVariableType(VariableType variableType) { + this.variableType = variableType; + } + + + public SpatialSelection closed(Boolean closed) { + this.closed = closed; + return this; + } + + /** + * Get closed + * @return closed + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getClosed() { + return closed; + } + + + @JsonProperty(JSON_PROPERTY_CLOSED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClosed(Boolean closed) { + this.closed = closed; + } + + + public SpatialSelection point(Boolean point) { + this.point = point; + return this; + } + + /** + * Get point + * @return point + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPoint() { + return point; + } + + + @JsonProperty(JSON_PROPERTY_POINT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPoint(Boolean point) { + this.point = point; + } + + + /** + * Return true if this SpatialSelection object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpatialSelection spatialSelection = (SpatialSelection) o; + return Objects.equals(this.curveSelectionInfo, spatialSelection.curveSelectionInfo) && + Objects.equals(this.varType, spatialSelection.varType) && + Objects.equals(this.type, spatialSelection.type) && + Objects.equals(this.smallestMeshCellDimensionLength, spatialSelection.smallestMeshCellDimensionLength) && + Objects.equals(this.variableType, spatialSelection.variableType) && + Objects.equals(this.closed, spatialSelection.closed) && + Objects.equals(this.point, spatialSelection.point); + } + + @Override + public int hashCode() { + return Objects.hash(curveSelectionInfo, varType, type, smallestMeshCellDimensionLength, variableType, closed, point); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpatialSelection {\n"); + sb.append(" curveSelectionInfo: ").append(toIndentedString(curveSelectionInfo)).append("\n"); + sb.append(" varType: ").append(toIndentedString(varType)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" smallestMeshCellDimensionLength: ").append(toIndentedString(smallestMeshCellDimensionLength)).append("\n"); + sb.append(" variableType: ").append(toIndentedString(variableType)).append("\n"); + sb.append(" closed: ").append(toIndentedString(closed)).append("\n"); + sb.append(" point: ").append(toIndentedString(point)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `curveSelectionInfo` to the URL query string + if (getCurveSelectionInfo() != null) { + joiner.add(getCurveSelectionInfo().toUrlQueryString(prefix + "curveSelectionInfo" + suffix)); + } + + // add `varType` to the URL query string + if (getVarType() != null) { + joiner.add(getVarType().toUrlQueryString(prefix + "varType" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `smallestMeshCellDimensionLength` to the URL query string + if (getSmallestMeshCellDimensionLength() != null) { + joiner.add(String.format("%ssmallestMeshCellDimensionLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallestMeshCellDimensionLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `variableType` to the URL query string + if (getVariableType() != null) { + joiner.add(getVariableType().toUrlQueryString(prefix + "variableType" + suffix)); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `point` to the URL query string + if (getPoint() != null) { + joiner.add(String.format("%spoint%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPoint()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Contour", SpatialSelectionContour.class); + mappings.put("Membrane", SpatialSelectionMembrane.class); + mappings.put("Volume", SpatialSelectionVolume.class); + mappings.put("SpatialSelection", SpatialSelection.class); + JSON.registerDiscriminator(SpatialSelection.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java new file mode 100644 index 0000000000..f01aa99b6e --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java @@ -0,0 +1,356 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.SpatialSelection; +import org.vcell.restclient.model.VariableType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * SpatialSelectionContour + */ +@JsonPropertyOrder({ + SpatialSelectionContour.JSON_PROPERTY_TYPE, + SpatialSelectionContour.JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES, + SpatialSelectionContour.JSON_PROPERTY_INDEX_SAMPLES, + SpatialSelectionContour.JSON_PROPERTY_SAMPLED_DATA_INDEXES +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class SpatialSelectionContour extends SpatialSelection { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "Contour"; + + public static final String JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES = "fieldSampledDataIndexes"; + private List fieldSampledDataIndexes; + + public static final String JSON_PROPERTY_INDEX_SAMPLES = "indexSamples"; + private List indexSamples; + + public static final String JSON_PROPERTY_SAMPLED_DATA_INDEXES = "sampledDataIndexes"; + private List sampledDataIndexes; + + public SpatialSelectionContour() { + } + + public SpatialSelectionContour type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + + public SpatialSelectionContour fieldSampledDataIndexes(List fieldSampledDataIndexes) { + this.fieldSampledDataIndexes = fieldSampledDataIndexes; + return this; + } + + public SpatialSelectionContour addFieldSampledDataIndexesItem(Integer fieldSampledDataIndexesItem) { + if (this.fieldSampledDataIndexes == null) { + this.fieldSampledDataIndexes = new ArrayList<>(); + } + this.fieldSampledDataIndexes.add(fieldSampledDataIndexesItem); + return this; + } + + /** + * Get fieldSampledDataIndexes + * @return fieldSampledDataIndexes + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFieldSampledDataIndexes() { + return fieldSampledDataIndexes; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldSampledDataIndexes(List fieldSampledDataIndexes) { + this.fieldSampledDataIndexes = fieldSampledDataIndexes; + } + + + public SpatialSelectionContour indexSamples(List indexSamples) { + this.indexSamples = indexSamples; + return this; + } + + public SpatialSelectionContour addIndexSamplesItem(Integer indexSamplesItem) { + if (this.indexSamples == null) { + this.indexSamples = new ArrayList<>(); + } + this.indexSamples.add(indexSamplesItem); + return this; + } + + /** + * Get indexSamples + * @return indexSamples + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDEX_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getIndexSamples() { + return indexSamples; + } + + + @JsonProperty(JSON_PROPERTY_INDEX_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndexSamples(List indexSamples) { + this.indexSamples = indexSamples; + } + + + public SpatialSelectionContour sampledDataIndexes(List sampledDataIndexes) { + this.sampledDataIndexes = sampledDataIndexes; + return this; + } + + public SpatialSelectionContour addSampledDataIndexesItem(Integer sampledDataIndexesItem) { + if (this.sampledDataIndexes == null) { + this.sampledDataIndexes = new ArrayList<>(); + } + this.sampledDataIndexes.add(sampledDataIndexesItem); + return this; + } + + /** + * Get sampledDataIndexes + * @return sampledDataIndexes + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SAMPLED_DATA_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getSampledDataIndexes() { + return sampledDataIndexes; + } + + + @JsonProperty(JSON_PROPERTY_SAMPLED_DATA_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSampledDataIndexes(List sampledDataIndexes) { + this.sampledDataIndexes = sampledDataIndexes; + } + + + @Override + public SpatialSelectionContour curveSelectionInfo(CurveSelectionInfo curveSelectionInfo) { + this.setCurveSelectionInfo(curveSelectionInfo); + return this; + } + + @Override + public SpatialSelectionContour varType(VariableType varType) { + this.setVarType(varType); + return this; + } + + @Override + public SpatialSelectionContour smallestMeshCellDimensionLength(Double smallestMeshCellDimensionLength) { + this.setSmallestMeshCellDimensionLength(smallestMeshCellDimensionLength); + return this; + } + + @Override + public SpatialSelectionContour variableType(VariableType variableType) { + this.setVariableType(variableType); + return this; + } + + @Override + public SpatialSelectionContour closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + @Override + public SpatialSelectionContour point(Boolean point) { + this.setPoint(point); + return this; + } + + /** + * Return true if this SpatialSelectionContour object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpatialSelectionContour spatialSelectionContour = (SpatialSelectionContour) o; + return Objects.equals(this.type, spatialSelectionContour.type) && + Objects.equals(this.fieldSampledDataIndexes, spatialSelectionContour.fieldSampledDataIndexes) && + Objects.equals(this.indexSamples, spatialSelectionContour.indexSamples) && + Objects.equals(this.sampledDataIndexes, spatialSelectionContour.sampledDataIndexes) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fieldSampledDataIndexes, indexSamples, sampledDataIndexes, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpatialSelectionContour {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fieldSampledDataIndexes: ").append(toIndentedString(fieldSampledDataIndexes)).append("\n"); + sb.append(" indexSamples: ").append(toIndentedString(indexSamples)).append("\n"); + sb.append(" sampledDataIndexes: ").append(toIndentedString(sampledDataIndexes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `curveSelectionInfo` to the URL query string + if (getCurveSelectionInfo() != null) { + joiner.add(getCurveSelectionInfo().toUrlQueryString(prefix + "curveSelectionInfo" + suffix)); + } + + // add `varType` to the URL query string + if (getVarType() != null) { + joiner.add(getVarType().toUrlQueryString(prefix + "varType" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `smallestMeshCellDimensionLength` to the URL query string + if (getSmallestMeshCellDimensionLength() != null) { + joiner.add(String.format("%ssmallestMeshCellDimensionLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallestMeshCellDimensionLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `variableType` to the URL query string + if (getVariableType() != null) { + joiner.add(getVariableType().toUrlQueryString(prefix + "variableType" + suffix)); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `point` to the URL query string + if (getPoint() != null) { + joiner.add(String.format("%spoint%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPoint()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("SpatialSelectionContour", SpatialSelectionContour.class); + JSON.registerDiscriminator(SpatialSelectionContour.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionMembrane.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionMembrane.java new file mode 100644 index 0000000000..e442500a0d --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionMembrane.java @@ -0,0 +1,310 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.SampledCurve; +import org.vcell.restclient.model.SpatialSelection; +import org.vcell.restclient.model.VariableType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * SpatialSelectionMembrane + */ +@JsonPropertyOrder({ + SpatialSelectionMembrane.JSON_PROPERTY_TYPE, + SpatialSelectionMembrane.JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES, + SpatialSelectionMembrane.JSON_PROPERTY_SELECTION_SOURCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class SpatialSelectionMembrane extends SpatialSelection { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "Membrane"; + + public static final String JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES = "fieldSampledDataIndexes"; + private List fieldSampledDataIndexes; + + public static final String JSON_PROPERTY_SELECTION_SOURCE = "selectionSource"; + private SampledCurve selectionSource; + + public SpatialSelectionMembrane() { + } + + public SpatialSelectionMembrane type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public SpatialSelectionMembrane fieldSampledDataIndexes(List fieldSampledDataIndexes) { + this.fieldSampledDataIndexes = fieldSampledDataIndexes; + return this; + } + + public SpatialSelectionMembrane addFieldSampledDataIndexesItem(Integer fieldSampledDataIndexesItem) { + if (this.fieldSampledDataIndexes == null) { + this.fieldSampledDataIndexes = new ArrayList<>(); + } + this.fieldSampledDataIndexes.add(fieldSampledDataIndexesItem); + return this; + } + + /** + * Get fieldSampledDataIndexes + * @return fieldSampledDataIndexes + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFieldSampledDataIndexes() { + return fieldSampledDataIndexes; + } + + + @JsonProperty(JSON_PROPERTY_FIELD_SAMPLED_DATA_INDEXES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFieldSampledDataIndexes(List fieldSampledDataIndexes) { + this.fieldSampledDataIndexes = fieldSampledDataIndexes; + } + + + public SpatialSelectionMembrane selectionSource(SampledCurve selectionSource) { + this.selectionSource = selectionSource; + return this; + } + + /** + * Get selectionSource + * @return selectionSource + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SELECTION_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public SampledCurve getSelectionSource() { + return selectionSource; + } + + + @JsonProperty(JSON_PROPERTY_SELECTION_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSelectionSource(SampledCurve selectionSource) { + this.selectionSource = selectionSource; + } + + + @Override + public SpatialSelectionMembrane curveSelectionInfo(CurveSelectionInfo curveSelectionInfo) { + this.setCurveSelectionInfo(curveSelectionInfo); + return this; + } + + @Override + public SpatialSelectionMembrane varType(VariableType varType) { + this.setVarType(varType); + return this; + } + + @Override + public SpatialSelectionMembrane smallestMeshCellDimensionLength(Double smallestMeshCellDimensionLength) { + this.setSmallestMeshCellDimensionLength(smallestMeshCellDimensionLength); + return this; + } + + @Override + public SpatialSelectionMembrane variableType(VariableType variableType) { + this.setVariableType(variableType); + return this; + } + + @Override + public SpatialSelectionMembrane closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + @Override + public SpatialSelectionMembrane point(Boolean point) { + this.setPoint(point); + return this; + } + + /** + * Return true if this SpatialSelectionMembrane object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpatialSelectionMembrane spatialSelectionMembrane = (SpatialSelectionMembrane) o; + return Objects.equals(this.type, spatialSelectionMembrane.type) && + Objects.equals(this.fieldSampledDataIndexes, spatialSelectionMembrane.fieldSampledDataIndexes) && + Objects.equals(this.selectionSource, spatialSelectionMembrane.selectionSource) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, fieldSampledDataIndexes, selectionSource, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpatialSelectionMembrane {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fieldSampledDataIndexes: ").append(toIndentedString(fieldSampledDataIndexes)).append("\n"); + sb.append(" selectionSource: ").append(toIndentedString(selectionSource)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `curveSelectionInfo` to the URL query string + if (getCurveSelectionInfo() != null) { + joiner.add(getCurveSelectionInfo().toUrlQueryString(prefix + "curveSelectionInfo" + suffix)); + } + + // add `varType` to the URL query string + if (getVarType() != null) { + joiner.add(getVarType().toUrlQueryString(prefix + "varType" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `smallestMeshCellDimensionLength` to the URL query string + if (getSmallestMeshCellDimensionLength() != null) { + joiner.add(String.format("%ssmallestMeshCellDimensionLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallestMeshCellDimensionLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `variableType` to the URL query string + if (getVariableType() != null) { + joiner.add(getVariableType().toUrlQueryString(prefix + "variableType" + suffix)); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `point` to the URL query string + if (getPoint() != null) { + joiner.add(String.format("%spoint%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPoint()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("SpatialSelectionMembrane", SpatialSelectionMembrane.class); + JSON.registerDiscriminator(SpatialSelectionMembrane.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java new file mode 100644 index 0000000000..3c154db88c --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java @@ -0,0 +1,268 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.SpatialSelection; +import org.vcell.restclient.model.VariableType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * SpatialSelectionVolume + */ +@JsonPropertyOrder({ + SpatialSelectionVolume.JSON_PROPERTY_TYPE, + SpatialSelectionVolume.JSON_PROPERTY_SYMMETRIC +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class SpatialSelectionVolume extends SpatialSelection { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "Volume"; + + public static final String JSON_PROPERTY_SYMMETRIC = "symmetric"; + private Boolean symmetric; + + public SpatialSelectionVolume() { + } + + public SpatialSelectionVolume type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + + public SpatialSelectionVolume symmetric(Boolean symmetric) { + this.symmetric = symmetric; + return this; + } + + /** + * Get symmetric + * @return symmetric + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SYMMETRIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getSymmetric() { + return symmetric; + } + + + @JsonProperty(JSON_PROPERTY_SYMMETRIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSymmetric(Boolean symmetric) { + this.symmetric = symmetric; + } + + + @Override + public SpatialSelectionVolume curveSelectionInfo(CurveSelectionInfo curveSelectionInfo) { + this.setCurveSelectionInfo(curveSelectionInfo); + return this; + } + + @Override + public SpatialSelectionVolume varType(VariableType varType) { + this.setVarType(varType); + return this; + } + + @Override + public SpatialSelectionVolume smallestMeshCellDimensionLength(Double smallestMeshCellDimensionLength) { + this.setSmallestMeshCellDimensionLength(smallestMeshCellDimensionLength); + return this; + } + + @Override + public SpatialSelectionVolume variableType(VariableType variableType) { + this.setVariableType(variableType); + return this; + } + + @Override + public SpatialSelectionVolume closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + @Override + public SpatialSelectionVolume point(Boolean point) { + this.setPoint(point); + return this; + } + + /** + * Return true if this SpatialSelectionVolume object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpatialSelectionVolume spatialSelectionVolume = (SpatialSelectionVolume) o; + return Objects.equals(this.type, spatialSelectionVolume.type) && + Objects.equals(this.symmetric, spatialSelectionVolume.symmetric) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, symmetric, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpatialSelectionVolume {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" symmetric: ").append(toIndentedString(symmetric)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `curveSelectionInfo` to the URL query string + if (getCurveSelectionInfo() != null) { + joiner.add(getCurveSelectionInfo().toUrlQueryString(prefix + "curveSelectionInfo" + suffix)); + } + + // add `varType` to the URL query string + if (getVarType() != null) { + joiner.add(getVarType().toUrlQueryString(prefix + "varType" + suffix)); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `smallestMeshCellDimensionLength` to the URL query string + if (getSmallestMeshCellDimensionLength() != null) { + joiner.add(String.format("%ssmallestMeshCellDimensionLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallestMeshCellDimensionLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `variableType` to the URL query string + if (getVariableType() != null) { + joiner.add(getVariableType().toUrlQueryString(prefix + "variableType" + suffix)); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `point` to the URL query string + if (getPoint() != null) { + joiner.add(String.format("%spoint%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPoint()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("SpatialSelectionVolume", SpatialSelectionVolume.class); + JSON.registerDiscriminator(SpatialSelectionVolume.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/Spline.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/Spline.java new file mode 100644 index 0000000000..a3b9d44496 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/Spline.java @@ -0,0 +1,374 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.ControlPointCurve; +import org.vcell.restclient.model.Coordinate; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import org.vcell.restclient.JSON; +/** + * Spline + */ +@JsonPropertyOrder({ + Spline.JSON_PROPERTY_TYPE, + Spline.JSON_PROPERTY_DEFAULT_NUM_SAMPLES, + Spline.JSON_PROPERTY_MAX_CONTROL_POINTS, + Spline.JSON_PROPERTY_MIN_CONTROL_POINTS, + Spline.JSON_PROPERTY_SEGMENT_COUNT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) + +public class Spline extends ControlPointCurve { + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "Spline"; + + public static final String JSON_PROPERTY_DEFAULT_NUM_SAMPLES = "defaultNumSamples"; + private Integer defaultNumSamples; + + public static final String JSON_PROPERTY_MAX_CONTROL_POINTS = "maxControlPoints"; + private Integer maxControlPoints; + + public static final String JSON_PROPERTY_MIN_CONTROL_POINTS = "minControlPoints"; + private Integer minControlPoints; + + public static final String JSON_PROPERTY_SEGMENT_COUNT = "segmentCount"; + private Integer segmentCount; + + public Spline() { + } + + public Spline type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(String type) { + this.type = type; + } + + + public Spline defaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + return this; + } + + /** + * Get defaultNumSamples + * @return defaultNumSamples + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getDefaultNumSamples() { + return defaultNumSamples; + } + + + @JsonProperty(JSON_PROPERTY_DEFAULT_NUM_SAMPLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDefaultNumSamples(Integer defaultNumSamples) { + this.defaultNumSamples = defaultNumSamples; + } + + + public Spline maxControlPoints(Integer maxControlPoints) { + this.maxControlPoints = maxControlPoints; + return this; + } + + /** + * Get maxControlPoints + * @return maxControlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxControlPoints() { + return maxControlPoints; + } + + + @JsonProperty(JSON_PROPERTY_MAX_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxControlPoints(Integer maxControlPoints) { + this.maxControlPoints = maxControlPoints; + } + + + public Spline minControlPoints(Integer minControlPoints) { + this.minControlPoints = minControlPoints; + return this; + } + + /** + * Get minControlPoints + * @return minControlPoints + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMinControlPoints() { + return minControlPoints; + } + + + @JsonProperty(JSON_PROPERTY_MIN_CONTROL_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinControlPoints(Integer minControlPoints) { + this.minControlPoints = minControlPoints; + } + + + public Spline segmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + return this; + } + + /** + * Get segmentCount + * @return segmentCount + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSegmentCount() { + return segmentCount; + } + + + @JsonProperty(JSON_PROPERTY_SEGMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSegmentCount(Integer segmentCount) { + this.segmentCount = segmentCount; + } + + + @Override + public Spline bClosed(Boolean bClosed) { + this.setbClosed(bClosed); + return this; + } + + @Override + public Spline beginningCoordinate(Coordinate beginningCoordinate) { + this.setBeginningCoordinate(beginningCoordinate); + return this; + } + + @Override + public Spline endingCoordinate(Coordinate endingCoordinate) { + this.setEndingCoordinate(endingCoordinate); + return this; + } + + @Override + public Spline numSamplePoints(Integer numSamplePoints) { + this.setNumSamplePoints(numSamplePoints); + return this; + } + + @Override + public Spline closed(Boolean closed) { + this.setClosed(closed); + return this; + } + + /** + * Return true if this Spline object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Spline spline = (Spline) o; + return Objects.equals(this.type, spline.type) && + Objects.equals(this.defaultNumSamples, spline.defaultNumSamples) && + Objects.equals(this.maxControlPoints, spline.maxControlPoints) && + Objects.equals(this.minControlPoints, spline.minControlPoints) && + Objects.equals(this.segmentCount, spline.segmentCount) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(type, defaultNumSamples, maxControlPoints, minControlPoints, segmentCount, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Spline {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" defaultNumSamples: ").append(toIndentedString(defaultNumSamples)).append("\n"); + sb.append(" maxControlPoints: ").append(toIndentedString(maxControlPoints)).append("\n"); + sb.append(" minControlPoints: ").append(toIndentedString(minControlPoints)).append("\n"); + sb.append(" segmentCount: ").append(toIndentedString(segmentCount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bClosed` to the URL query string + if (getbClosed() != null) { + joiner.add(String.format("%sbClosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getbClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `description` to the URL query string + if (getDescription() != null) { + joiner.add(String.format("%sdescription%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDescription()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `beginningCoordinate` to the URL query string + if (getBeginningCoordinate() != null) { + joiner.add(getBeginningCoordinate().toUrlQueryString(prefix + "beginningCoordinate" + suffix)); + } + + // add `defaultNumSamples` to the URL query string + if (getDefaultNumSamples() != null) { + joiner.add(String.format("%sdefaultNumSamples%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDefaultNumSamples()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endingCoordinate` to the URL query string + if (getEndingCoordinate() != null) { + joiner.add(getEndingCoordinate().toUrlQueryString(prefix + "endingCoordinate" + suffix)); + } + + // add `numSamplePoints` to the URL query string + if (getNumSamplePoints() != null) { + joiner.add(String.format("%snumSamplePoints%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumSamplePoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `segmentCount` to the URL query string + if (getSegmentCount() != null) { + joiner.add(String.format("%ssegmentCount%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSegmentCount()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `spatialLength` to the URL query string + if (getSpatialLength() != null) { + joiner.add(String.format("%sspatialLength%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpatialLength()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `closed` to the URL query string + if (getClosed() != null) { + joiner.add(String.format("%sclosed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClosed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `valid` to the URL query string + if (getValid() != null) { + joiner.add(String.format("%svalid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Spline", Spline.class); + JSON.registerDiscriminator(Spline.class, "type", mappings); +} +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/StandardExportInfo.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/StandardExportInfo.java new file mode 100644 index 0000000000..33cdf9aa5e --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/StandardExportInfo.java @@ -0,0 +1,421 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.AnnotatedFunctionDTO; +import org.vcell.restclient.model.GeometrySpecDTO; +import org.vcell.restclient.model.TimeSpecs; +import org.vcell.restclient.model.VariableSpecs; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * StandardExportInfo + */ +@JsonPropertyOrder({ + StandardExportInfo.JSON_PROPERTY_OUTPUT_CONTEXT, + StandardExportInfo.JSON_PROPERTY_CONTEXT_NAME, + StandardExportInfo.JSON_PROPERTY_SIMULATION_NAME, + StandardExportInfo.JSON_PROPERTY_SIMULATION_KEY, + StandardExportInfo.JSON_PROPERTY_SIMULATION_JOB, + StandardExportInfo.JSON_PROPERTY_GEOMETRY_SPECS, + StandardExportInfo.JSON_PROPERTY_TIME_SPECS, + StandardExportInfo.JSON_PROPERTY_VARIABLE_SPECS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class StandardExportInfo { + public static final String JSON_PROPERTY_OUTPUT_CONTEXT = "outputContext"; + private List outputContext; + + public static final String JSON_PROPERTY_CONTEXT_NAME = "contextName"; + private String contextName; + + public static final String JSON_PROPERTY_SIMULATION_NAME = "simulationName"; + private String simulationName; + + public static final String JSON_PROPERTY_SIMULATION_KEY = "simulationKey"; + private String simulationKey; + + public static final String JSON_PROPERTY_SIMULATION_JOB = "simulationJob"; + private Integer simulationJob; + + public static final String JSON_PROPERTY_GEOMETRY_SPECS = "geometrySpecs"; + private GeometrySpecDTO geometrySpecs; + + public static final String JSON_PROPERTY_TIME_SPECS = "timeSpecs"; + private TimeSpecs timeSpecs; + + public static final String JSON_PROPERTY_VARIABLE_SPECS = "variableSpecs"; + private VariableSpecs variableSpecs; + + public StandardExportInfo() { + } + + public StandardExportInfo outputContext(List outputContext) { + this.outputContext = outputContext; + return this; + } + + public StandardExportInfo addOutputContextItem(AnnotatedFunctionDTO outputContextItem) { + if (this.outputContext == null) { + this.outputContext = new ArrayList<>(); + } + this.outputContext.add(outputContextItem); + return this; + } + + /** + * Get outputContext + * @return outputContext + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getOutputContext() { + return outputContext; + } + + + @JsonProperty(JSON_PROPERTY_OUTPUT_CONTEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputContext(List outputContext) { + this.outputContext = outputContext; + } + + + public StandardExportInfo contextName(String contextName) { + this.contextName = contextName; + return this; + } + + /** + * Get contextName + * @return contextName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTEXT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getContextName() { + return contextName; + } + + + @JsonProperty(JSON_PROPERTY_CONTEXT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContextName(String contextName) { + this.contextName = contextName; + } + + + public StandardExportInfo simulationName(String simulationName) { + this.simulationName = simulationName; + return this; + } + + /** + * Get simulationName + * @return simulationName + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIMULATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSimulationName() { + return simulationName; + } + + + @JsonProperty(JSON_PROPERTY_SIMULATION_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSimulationName(String simulationName) { + this.simulationName = simulationName; + } + + + public StandardExportInfo simulationKey(String simulationKey) { + this.simulationKey = simulationKey; + return this; + } + + /** + * Get simulationKey + * @return simulationKey + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIMULATION_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSimulationKey() { + return simulationKey; + } + + + @JsonProperty(JSON_PROPERTY_SIMULATION_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSimulationKey(String simulationKey) { + this.simulationKey = simulationKey; + } + + + public StandardExportInfo simulationJob(Integer simulationJob) { + this.simulationJob = simulationJob; + return this; + } + + /** + * Get simulationJob + * @return simulationJob + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIMULATION_JOB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSimulationJob() { + return simulationJob; + } + + + @JsonProperty(JSON_PROPERTY_SIMULATION_JOB) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSimulationJob(Integer simulationJob) { + this.simulationJob = simulationJob; + } + + + public StandardExportInfo geometrySpecs(GeometrySpecDTO geometrySpecs) { + this.geometrySpecs = geometrySpecs; + return this; + } + + /** + * Get geometrySpecs + * @return geometrySpecs + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_GEOMETRY_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public GeometrySpecDTO getGeometrySpecs() { + return geometrySpecs; + } + + + @JsonProperty(JSON_PROPERTY_GEOMETRY_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setGeometrySpecs(GeometrySpecDTO geometrySpecs) { + this.geometrySpecs = geometrySpecs; + } + + + public StandardExportInfo timeSpecs(TimeSpecs timeSpecs) { + this.timeSpecs = timeSpecs; + return this; + } + + /** + * Get timeSpecs + * @return timeSpecs + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TimeSpecs getTimeSpecs() { + return timeSpecs; + } + + + @JsonProperty(JSON_PROPERTY_TIME_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimeSpecs(TimeSpecs timeSpecs) { + this.timeSpecs = timeSpecs; + } + + + public StandardExportInfo variableSpecs(VariableSpecs variableSpecs) { + this.variableSpecs = variableSpecs; + return this; + } + + /** + * Get variableSpecs + * @return variableSpecs + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VARIABLE_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public VariableSpecs getVariableSpecs() { + return variableSpecs; + } + + + @JsonProperty(JSON_PROPERTY_VARIABLE_SPECS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVariableSpecs(VariableSpecs variableSpecs) { + this.variableSpecs = variableSpecs; + } + + + /** + * Return true if this StandardExportInfo object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + StandardExportInfo standardExportInfo = (StandardExportInfo) o; + return Objects.equals(this.outputContext, standardExportInfo.outputContext) && + Objects.equals(this.contextName, standardExportInfo.contextName) && + Objects.equals(this.simulationName, standardExportInfo.simulationName) && + Objects.equals(this.simulationKey, standardExportInfo.simulationKey) && + Objects.equals(this.simulationJob, standardExportInfo.simulationJob) && + Objects.equals(this.geometrySpecs, standardExportInfo.geometrySpecs) && + Objects.equals(this.timeSpecs, standardExportInfo.timeSpecs) && + Objects.equals(this.variableSpecs, standardExportInfo.variableSpecs); + } + + @Override + public int hashCode() { + return Objects.hash(outputContext, contextName, simulationName, simulationKey, simulationJob, geometrySpecs, timeSpecs, variableSpecs); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class StandardExportInfo {\n"); + sb.append(" outputContext: ").append(toIndentedString(outputContext)).append("\n"); + sb.append(" contextName: ").append(toIndentedString(contextName)).append("\n"); + sb.append(" simulationName: ").append(toIndentedString(simulationName)).append("\n"); + sb.append(" simulationKey: ").append(toIndentedString(simulationKey)).append("\n"); + sb.append(" simulationJob: ").append(toIndentedString(simulationJob)).append("\n"); + sb.append(" geometrySpecs: ").append(toIndentedString(geometrySpecs)).append("\n"); + sb.append(" timeSpecs: ").append(toIndentedString(timeSpecs)).append("\n"); + sb.append(" variableSpecs: ").append(toIndentedString(variableSpecs)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `outputContext` to the URL query string + if (getOutputContext() != null) { + for (int i = 0; i < getOutputContext().size(); i++) { + if (getOutputContext().get(i) != null) { + joiner.add(getOutputContext().get(i).toUrlQueryString(String.format("%soutputContext%s%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + } + } + } + + // add `contextName` to the URL query string + if (getContextName() != null) { + joiner.add(String.format("%scontextName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getContextName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `simulationName` to the URL query string + if (getSimulationName() != null) { + joiner.add(String.format("%ssimulationName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSimulationName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `simulationKey` to the URL query string + if (getSimulationKey() != null) { + joiner.add(String.format("%ssimulationKey%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSimulationKey()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `simulationJob` to the URL query string + if (getSimulationJob() != null) { + joiner.add(String.format("%ssimulationJob%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSimulationJob()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `geometrySpecs` to the URL query string + if (getGeometrySpecs() != null) { + joiner.add(getGeometrySpecs().toUrlQueryString(prefix + "geometrySpecs" + suffix)); + } + + // add `timeSpecs` to the URL query string + if (getTimeSpecs() != null) { + joiner.add(getTimeSpecs().toUrlQueryString(prefix + "timeSpecs" + suffix)); + } + + // add `variableSpecs` to the URL query string + if (getVariableSpecs() != null) { + joiner.add(getVariableSpecs().toUrlQueryString(prefix + "variableSpecs" + suffix)); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/TimeMode.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/TimeMode.java new file mode 100644 index 0000000000..d6427e6e0f --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/TimeMode.java @@ -0,0 +1,78 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets TimeMode + */ +public enum TimeMode { + + POINT("TIME_POINT"), + + RANGE("TIME_RANGE"); + + private String value; + + TimeMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TimeMode fromValue(String value) { + for (TimeMode b : TimeMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } + +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/TimeSpecs.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/TimeSpecs.java new file mode 100644 index 0000000000..deae6d3b58 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/TimeSpecs.java @@ -0,0 +1,273 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.TimeMode; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * TimeSpecs + */ +@JsonPropertyOrder({ + TimeSpecs.JSON_PROPERTY_BEGIN_TIME_INDEX, + TimeSpecs.JSON_PROPERTY_END_TIME_INDEX, + TimeSpecs.JSON_PROPERTY_ALL_TIMES, + TimeSpecs.JSON_PROPERTY_MODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class TimeSpecs { + public static final String JSON_PROPERTY_BEGIN_TIME_INDEX = "beginTimeIndex"; + private Integer beginTimeIndex; + + public static final String JSON_PROPERTY_END_TIME_INDEX = "endTimeIndex"; + private Integer endTimeIndex; + + public static final String JSON_PROPERTY_ALL_TIMES = "allTimes"; + private List allTimes; + + public static final String JSON_PROPERTY_MODE = "mode"; + private TimeMode mode; + + public TimeSpecs() { + } + + public TimeSpecs beginTimeIndex(Integer beginTimeIndex) { + this.beginTimeIndex = beginTimeIndex; + return this; + } + + /** + * Get beginTimeIndex + * @return beginTimeIndex + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BEGIN_TIME_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getBeginTimeIndex() { + return beginTimeIndex; + } + + + @JsonProperty(JSON_PROPERTY_BEGIN_TIME_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBeginTimeIndex(Integer beginTimeIndex) { + this.beginTimeIndex = beginTimeIndex; + } + + + public TimeSpecs endTimeIndex(Integer endTimeIndex) { + this.endTimeIndex = endTimeIndex; + return this; + } + + /** + * Get endTimeIndex + * @return endTimeIndex + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_END_TIME_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getEndTimeIndex() { + return endTimeIndex; + } + + + @JsonProperty(JSON_PROPERTY_END_TIME_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEndTimeIndex(Integer endTimeIndex) { + this.endTimeIndex = endTimeIndex; + } + + + public TimeSpecs allTimes(List allTimes) { + this.allTimes = allTimes; + return this; + } + + public TimeSpecs addAllTimesItem(Double allTimesItem) { + if (this.allTimes == null) { + this.allTimes = new ArrayList<>(); + } + this.allTimes.add(allTimesItem); + return this; + } + + /** + * Get allTimes + * @return allTimes + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ALL_TIMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getAllTimes() { + return allTimes; + } + + + @JsonProperty(JSON_PROPERTY_ALL_TIMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAllTimes(List allTimes) { + this.allTimes = allTimes; + } + + + public TimeSpecs mode(TimeMode mode) { + this.mode = mode; + return this; + } + + /** + * Get mode + * @return mode + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public TimeMode getMode() { + return mode; + } + + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(TimeMode mode) { + this.mode = mode; + } + + + /** + * Return true if this TimeSpecs object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TimeSpecs timeSpecs = (TimeSpecs) o; + return Objects.equals(this.beginTimeIndex, timeSpecs.beginTimeIndex) && + Objects.equals(this.endTimeIndex, timeSpecs.endTimeIndex) && + Objects.equals(this.allTimes, timeSpecs.allTimes) && + Objects.equals(this.mode, timeSpecs.mode); + } + + @Override + public int hashCode() { + return Objects.hash(beginTimeIndex, endTimeIndex, allTimes, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TimeSpecs {\n"); + sb.append(" beginTimeIndex: ").append(toIndentedString(beginTimeIndex)).append("\n"); + sb.append(" endTimeIndex: ").append(toIndentedString(endTimeIndex)).append("\n"); + sb.append(" allTimes: ").append(toIndentedString(allTimes)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `beginTimeIndex` to the URL query string + if (getBeginTimeIndex() != null) { + joiner.add(String.format("%sbeginTimeIndex%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBeginTimeIndex()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `endTimeIndex` to the URL query string + if (getEndTimeIndex() != null) { + joiner.add(String.format("%sendTimeIndex%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEndTimeIndex()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + // add `allTimes` to the URL query string + if (getAllTimes() != null) { + for (int i = 0; i < getAllTimes().size(); i++) { + joiner.add(String.format("%sallTimes%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getAllTimes().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%smode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/VariableMode.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/VariableMode.java new file mode 100644 index 0000000000..9e2ac427d1 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/VariableMode.java @@ -0,0 +1,80 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets VariableMode + */ +public enum VariableMode { + + ONE("VARIABLE_ONE"), + + MULTI("VARIABLE_MULTI"), + + ALL("VARIABLE_ALL"); + + private String value; + + VariableMode(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VariableMode fromValue(String value) { + for (VariableMode b : VariableMode.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } + +} + diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/VariableSpecs.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/VariableSpecs.java new file mode 100644 index 0000000000..68761902c0 --- /dev/null +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/VariableSpecs.java @@ -0,0 +1,201 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.StringJoiner; +import java.util.Objects; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.VariableMode; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * VariableSpecs + */ +@JsonPropertyOrder({ + VariableSpecs.JSON_PROPERTY_VARIABLE_NAMES, + VariableSpecs.JSON_PROPERTY_MODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class VariableSpecs { + public static final String JSON_PROPERTY_VARIABLE_NAMES = "variableNames"; + private List variableNames; + + public static final String JSON_PROPERTY_MODE = "mode"; + private VariableMode mode; + + public VariableSpecs() { + } + + public VariableSpecs variableNames(List variableNames) { + this.variableNames = variableNames; + return this; + } + + public VariableSpecs addVariableNamesItem(String variableNamesItem) { + if (this.variableNames == null) { + this.variableNames = new ArrayList<>(); + } + this.variableNames.add(variableNamesItem); + return this; + } + + /** + * Get variableNames + * @return variableNames + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VARIABLE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getVariableNames() { + return variableNames; + } + + + @JsonProperty(JSON_PROPERTY_VARIABLE_NAMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVariableNames(List variableNames) { + this.variableNames = variableNames; + } + + + public VariableSpecs mode(VariableMode mode) { + this.mode = mode; + return this; + } + + /** + * Get mode + * @return mode + **/ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public VariableMode getMode() { + return mode; + } + + + @JsonProperty(JSON_PROPERTY_MODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMode(VariableMode mode) { + this.mode = mode; + } + + + /** + * Return true if this VariableSpecs object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VariableSpecs variableSpecs = (VariableSpecs) o; + return Objects.equals(this.variableNames, variableSpecs.variableNames) && + Objects.equals(this.mode, variableSpecs.mode); + } + + @Override + public int hashCode() { + return Objects.hash(variableNames, mode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VariableSpecs {\n"); + sb.append(" variableNames: ").append(toIndentedString(variableNames)).append("\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `variableNames` to the URL query string + if (getVariableNames() != null) { + for (int i = 0; i < getVariableNames().size(); i++) { + joiner.add(String.format("%svariableNames%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode(String.valueOf(getVariableNames().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + } + + // add `mode` to the URL query string + if (getMode() != null) { + joiner.add(String.format("%smode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} + diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java new file mode 100644 index 0000000000..9443c783d8 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java @@ -0,0 +1,73 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.api; + +import org.vcell.restclient.ApiException; +import org.vcell.restclient.model.ExportEvent; +import org.vcell.restclient.model.N5ExportRequest; +import java.util.Set; +import org.vcell.restclient.model.VCellHTTPError; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + + +/** + * API tests for ExportResourceApi + */ +@Ignore +public class ExportResourceApiTest { + + private final ExportResourceApi api = new ExportResourceApi(); + + + /** + * + * + * Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void exportN5Test() throws ApiException { + N5ExportRequest n5ExportRequest = null; + Long response = + api.exportN5(n5ExportRequest); + + // TODO: test validations + } + + /** + * + * + * Get the status of your most recent export jobs. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void exportStatusTest() throws ApiException { + Set response = + api.exportStatus(); + + // TODO: test validations + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/AnalyticCurveTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/AnalyticCurveTest.java new file mode 100644 index 0000000000..e906e2d26b --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/AnalyticCurveTest.java @@ -0,0 +1,133 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Coordinate; +import org.vcell.restclient.model.Curve; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for AnalyticCurve + */ +public class AnalyticCurveTest { + private final AnalyticCurve model = new AnalyticCurve(); + + /** + * Model tests for AnalyticCurve + */ + @Test + public void testAnalyticCurve() { + // TODO: test AnalyticCurve + } + + /** + * Test the property 'bClosed' + */ + @Test + public void bClosedTest() { + // TODO: test bClosed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'beginningCoordinate' + */ + @Test + public void beginningCoordinateTest() { + // TODO: test beginningCoordinate + } + + /** + * Test the property 'defaultNumSamples' + */ + @Test + public void defaultNumSamplesTest() { + // TODO: test defaultNumSamples + } + + /** + * Test the property 'endingCoordinate' + */ + @Test + public void endingCoordinateTest() { + // TODO: test endingCoordinate + } + + /** + * Test the property 'numSamplePoints' + */ + @Test + public void numSamplePointsTest() { + // TODO: test numSamplePoints + } + + /** + * Test the property 'segmentCount' + */ + @Test + public void segmentCountTest() { + // TODO: test segmentCount + } + + /** + * Test the property 'spatialLength' + */ + @Test + public void spatialLengthTest() { + // TODO: test spatialLength + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'valid' + */ + @Test + public void validTest() { + // TODO: test valid + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/AnnotatedFunctionDTOTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/AnnotatedFunctionDTOTest.java new file mode 100644 index 0000000000..6a19b57810 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/AnnotatedFunctionDTOTest.java @@ -0,0 +1,91 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Domain; +import org.vcell.restclient.model.FunctionCategory; +import org.vcell.restclient.model.VariableType; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for AnnotatedFunctionDTO + */ +public class AnnotatedFunctionDTOTest { + private final AnnotatedFunctionDTO model = new AnnotatedFunctionDTO(); + + /** + * Model tests for AnnotatedFunctionDTO + */ + @Test + public void testAnnotatedFunctionDTO() { + // TODO: test AnnotatedFunctionDTO + } + + /** + * Test the property 'functionName' + */ + @Test + public void functionNameTest() { + // TODO: test functionName + } + + /** + * Test the property 'functionExpression' + */ + @Test + public void functionExpressionTest() { + // TODO: test functionExpression + } + + /** + * Test the property 'error' + */ + @Test + public void errorTest() { + // TODO: test error + } + + /** + * Test the property 'domain' + */ + @Test + public void domainTest() { + // TODO: test domain + } + + /** + * Test the property 'functionType' + */ + @Test + public void functionTypeTest() { + // TODO: test functionType + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/CompositeCurveTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/CompositeCurveTest.java new file mode 100644 index 0000000000..f19ec304f6 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/CompositeCurveTest.java @@ -0,0 +1,135 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.Coordinate; +import org.vcell.restclient.model.Curve; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for CompositeCurve + */ +public class CompositeCurveTest { + private final CompositeCurve model = new CompositeCurve(); + + /** + * Model tests for CompositeCurve + */ + @Test + public void testCompositeCurve() { + // TODO: test CompositeCurve + } + + /** + * Test the property 'bClosed' + */ + @Test + public void bClosedTest() { + // TODO: test bClosed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'beginningCoordinate' + */ + @Test + public void beginningCoordinateTest() { + // TODO: test beginningCoordinate + } + + /** + * Test the property 'defaultNumSamples' + */ + @Test + public void defaultNumSamplesTest() { + // TODO: test defaultNumSamples + } + + /** + * Test the property 'endingCoordinate' + */ + @Test + public void endingCoordinateTest() { + // TODO: test endingCoordinate + } + + /** + * Test the property 'numSamplePoints' + */ + @Test + public void numSamplePointsTest() { + // TODO: test numSamplePoints + } + + /** + * Test the property 'segmentCount' + */ + @Test + public void segmentCountTest() { + // TODO: test segmentCount + } + + /** + * Test the property 'spatialLength' + */ + @Test + public void spatialLengthTest() { + // TODO: test spatialLength + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'valid' + */ + @Test + public void validTest() { + // TODO: test valid + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/ControlPointCurveTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/ControlPointCurveTest.java new file mode 100644 index 0000000000..8c7a30122c --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/ControlPointCurveTest.java @@ -0,0 +1,135 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.Coordinate; +import org.vcell.restclient.model.Curve; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for ControlPointCurve + */ +public class ControlPointCurveTest { + private final ControlPointCurve model = new ControlPointCurve(); + + /** + * Model tests for ControlPointCurve + */ + @Test + public void testControlPointCurve() { + // TODO: test ControlPointCurve + } + + /** + * Test the property 'bClosed' + */ + @Test + public void bClosedTest() { + // TODO: test bClosed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'beginningCoordinate' + */ + @Test + public void beginningCoordinateTest() { + // TODO: test beginningCoordinate + } + + /** + * Test the property 'defaultNumSamples' + */ + @Test + public void defaultNumSamplesTest() { + // TODO: test defaultNumSamples + } + + /** + * Test the property 'endingCoordinate' + */ + @Test + public void endingCoordinateTest() { + // TODO: test endingCoordinate + } + + /** + * Test the property 'numSamplePoints' + */ + @Test + public void numSamplePointsTest() { + // TODO: test numSamplePoints + } + + /** + * Test the property 'segmentCount' + */ + @Test + public void segmentCountTest() { + // TODO: test segmentCount + } + + /** + * Test the property 'spatialLength' + */ + @Test + public void spatialLengthTest() { + // TODO: test spatialLength + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'valid' + */ + @Test + public void validTest() { + // TODO: test valid + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/CoordinateTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/CoordinateTest.java new file mode 100644 index 0000000000..6bb06a0f4d --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/CoordinateTest.java @@ -0,0 +1,64 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for Coordinate + */ +public class CoordinateTest { + private final Coordinate model = new Coordinate(); + + /** + * Model tests for Coordinate + */ + @Test + public void testCoordinate() { + // TODO: test Coordinate + } + + /** + * Test the property 'x' + */ + @Test + public void xTest() { + // TODO: test x + } + + /** + * Test the property 'y' + */ + @Test + public void yTest() { + // TODO: test y + } + + /** + * Test the property 'z' + */ + @Test + public void zTest() { + // TODO: test z + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/CurveSelectionInfoTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/CurveSelectionInfoTest.java new file mode 100644 index 0000000000..36ff8de99b --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/CurveSelectionInfoTest.java @@ -0,0 +1,121 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Curve; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for CurveSelectionInfo + */ +public class CurveSelectionInfoTest { + private final CurveSelectionInfo model = new CurveSelectionInfo(); + + /** + * Model tests for CurveSelectionInfo + */ + @Test + public void testCurveSelectionInfo() { + // TODO: test CurveSelectionInfo + } + + /** + * Test the property 'fieldCurve' + */ + @Test + public void fieldCurveTest() { + // TODO: test fieldCurve + } + + /** + * Test the property 'fieldType' + */ + @Test + public void fieldTypeTest() { + // TODO: test fieldType + } + + /** + * Test the property 'fieldControlPoint' + */ + @Test + public void fieldControlPointTest() { + // TODO: test fieldControlPoint + } + + /** + * Test the property 'fieldSegment' + */ + @Test + public void fieldSegmentTest() { + // TODO: test fieldSegment + } + + /** + * Test the property 'fieldU' + */ + @Test + public void fieldUTest() { + // TODO: test fieldU + } + + /** + * Test the property 'fieldUExtended' + */ + @Test + public void fieldUExtendedTest() { + // TODO: test fieldUExtended + } + + /** + * Test the property 'fieldControlPointExtended' + */ + @Test + public void fieldControlPointExtendedTest() { + // TODO: test fieldControlPointExtended + } + + /** + * Test the property 'fieldSegmentExtended' + */ + @Test + public void fieldSegmentExtendedTest() { + // TODO: test fieldSegmentExtended + } + + /** + * Test the property 'fieldDirectionNegative' + */ + @Test + public void fieldDirectionNegativeTest() { + // TODO: test fieldDirectionNegative + } + + /** + * Test the property 'crossing' + */ + @Test + public void crossingTest() { + // TODO: test crossing + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/CurveTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/CurveTest.java new file mode 100644 index 0000000000..8a7d1a0d93 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/CurveTest.java @@ -0,0 +1,132 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.Coordinate; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for Curve + */ +public class CurveTest { + private final Curve model = new Curve(); + + /** + * Model tests for Curve + */ + @Test + public void testCurve() { + // TODO: test Curve + } + + /** + * Test the property 'bClosed' + */ + @Test + public void bClosedTest() { + // TODO: test bClosed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'beginningCoordinate' + */ + @Test + public void beginningCoordinateTest() { + // TODO: test beginningCoordinate + } + + /** + * Test the property 'defaultNumSamples' + */ + @Test + public void defaultNumSamplesTest() { + // TODO: test defaultNumSamples + } + + /** + * Test the property 'endingCoordinate' + */ + @Test + public void endingCoordinateTest() { + // TODO: test endingCoordinate + } + + /** + * Test the property 'numSamplePoints' + */ + @Test + public void numSamplePointsTest() { + // TODO: test numSamplePoints + } + + /** + * Test the property 'segmentCount' + */ + @Test + public void segmentCountTest() { + // TODO: test segmentCount + } + + /** + * Test the property 'spatialLength' + */ + @Test + public void spatialLengthTest() { + // TODO: test spatialLength + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'valid' + */ + @Test + public void validTest() { + // TODO: test valid + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportEventTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportEventTest.java new file mode 100644 index 0000000000..e459b82dea --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportEventTest.java @@ -0,0 +1,133 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.ExportProgressType; +import org.vcell.restclient.model.HumanReadableExportData; +import org.vcell.restclient.model.TimeSpecs; +import org.vcell.restclient.model.User; +import org.vcell.restclient.model.VariableSpecs; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for ExportEvent + */ +public class ExportEventTest { + private final ExportEvent model = new ExportEvent(); + + /** + * Model tests for ExportEvent + */ + @Test + public void testExportEvent() { + // TODO: test ExportEvent + } + + /** + * Test the property 'eventType' + */ + @Test + public void eventTypeTest() { + // TODO: test eventType + } + + /** + * Test the property 'progress' + */ + @Test + public void progressTest() { + // TODO: test progress + } + + /** + * Test the property 'format' + */ + @Test + public void formatTest() { + // TODO: test format + } + + /** + * Test the property 'location' + */ + @Test + public void locationTest() { + // TODO: test location + } + + /** + * Test the property 'user' + */ + @Test + public void userTest() { + // TODO: test user + } + + /** + * Test the property 'jobID' + */ + @Test + public void jobIDTest() { + // TODO: test jobID + } + + /** + * Test the property 'dataKey' + */ + @Test + public void dataKeyTest() { + // TODO: test dataKey + } + + /** + * Test the property 'dataIdString' + */ + @Test + public void dataIdStringTest() { + // TODO: test dataIdString + } + + /** + * Test the property 'timeSpecs' + */ + @Test + public void timeSpecsTest() { + // TODO: test timeSpecs + } + + /** + * Test the property 'variableSpecs' + */ + @Test + public void variableSpecsTest() { + // TODO: test variableSpecs + } + + /** + * Test the property 'humanReadableData' + */ + @Test + public void humanReadableDataTest() { + // TODO: test humanReadableData + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportProgressTypeTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportProgressTypeTest.java new file mode 100644 index 0000000000..384a0b06ae --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportProgressTypeTest.java @@ -0,0 +1,32 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for ExportProgressType + */ +public class ExportProgressTypeTest { + /** + * Model tests for ExportProgressType + */ + @Test + public void testExportProgressType() { + // TODO: test ExportProgressType + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportableDataTypeTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportableDataTypeTest.java new file mode 100644 index 0000000000..e88ea87177 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/ExportableDataTypeTest.java @@ -0,0 +1,32 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for ExportableDataType + */ +public class ExportableDataTypeTest { + /** + * Model tests for ExportableDataType + */ + @Test + public void testExportableDataType() { + // TODO: test ExportableDataType + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/FunctionCategoryTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/FunctionCategoryTest.java new file mode 100644 index 0000000000..0832bd9a96 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/FunctionCategoryTest.java @@ -0,0 +1,32 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for FunctionCategory + */ +public class FunctionCategoryTest { + /** + * Model tests for FunctionCategory + */ + @Test + public void testFunctionCategory() { + // TODO: test FunctionCategory + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/GeometryModeTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/GeometryModeTest.java new file mode 100644 index 0000000000..71ef828991 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/GeometryModeTest.java @@ -0,0 +1,32 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for GeometryMode + */ +public class GeometryModeTest { + /** + * Model tests for GeometryMode + */ + @Test + public void testGeometryMode() { + // TODO: test GeometryMode + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/GeometrySpecDTOTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/GeometrySpecDTOTest.java new file mode 100644 index 0000000000..9c4fe23c81 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/GeometrySpecDTOTest.java @@ -0,0 +1,76 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.GeometryMode; +import org.vcell.restclient.model.SpatialSelection; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for GeometrySpecDTO + */ +public class GeometrySpecDTOTest { + private final GeometrySpecDTO model = new GeometrySpecDTO(); + + /** + * Model tests for GeometrySpecDTO + */ + @Test + public void testGeometrySpecDTO() { + // TODO: test GeometrySpecDTO + } + + /** + * Test the property 'selections' + */ + @Test + public void selectionsTest() { + // TODO: test selections + } + + /** + * Test the property 'axis' + */ + @Test + public void axisTest() { + // TODO: test axis + } + + /** + * Test the property 'sliceNumber' + */ + @Test + public void sliceNumberTest() { + // TODO: test sliceNumber + } + + /** + * Test the property 'geometryMode' + */ + @Test + public void geometryModeTest() { + // TODO: test geometryMode + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/HumanReadableExportDataTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/HumanReadableExportDataTest.java new file mode 100644 index 0000000000..2328d28b5b --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/HumanReadableExportDataTest.java @@ -0,0 +1,132 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for HumanReadableExportData + */ +public class HumanReadableExportDataTest { + private final HumanReadableExportData model = new HumanReadableExportData(); + + /** + * Model tests for HumanReadableExportData + */ + @Test + public void testHumanReadableExportData() { + // TODO: test HumanReadableExportData + } + + /** + * Test the property 'simulationName' + */ + @Test + public void simulationNameTest() { + // TODO: test simulationName + } + + /** + * Test the property 'biomodelName' + */ + @Test + public void biomodelNameTest() { + // TODO: test biomodelName + } + + /** + * Test the property 'applicationName' + */ + @Test + public void applicationNameTest() { + // TODO: test applicationName + } + + /** + * Test the property 'differentParameterValues' + */ + @Test + public void differentParameterValuesTest() { + // TODO: test differentParameterValues + } + + /** + * Test the property 'applicationType' + */ + @Test + public void applicationTypeTest() { + // TODO: test applicationType + } + + /** + * Test the property 'serverSavedFileName' + */ + @Test + public void serverSavedFileNameTest() { + // TODO: test serverSavedFileName + } + + /** + * Test the property 'nonSpatial' + */ + @Test + public void nonSpatialTest() { + // TODO: test nonSpatial + } + + /** + * Test the property 'subVolume' + */ + @Test + public void subVolumeTest() { + // TODO: test subVolume + } + + /** + * Test the property 'zSlices' + */ + @Test + public void zSlicesTest() { + // TODO: test zSlices + } + + /** + * Test the property 'tSlices' + */ + @Test + public void tSlicesTest() { + // TODO: test tSlices + } + + /** + * Test the property 'numChannels' + */ + @Test + public void numChannelsTest() { + // TODO: test numChannels + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/N5ExportRequestTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/N5ExportRequestTest.java new file mode 100644 index 0000000000..63a2946281 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/N5ExportRequestTest.java @@ -0,0 +1,76 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.vcell.restclient.model.ExportableDataType; +import org.vcell.restclient.model.StandardExportInfo; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for N5ExportRequest + */ +public class N5ExportRequestTest { + private final N5ExportRequest model = new N5ExportRequest(); + + /** + * Model tests for N5ExportRequest + */ + @Test + public void testN5ExportRequest() { + // TODO: test N5ExportRequest + } + + /** + * Test the property 'standardExportInformation' + */ + @Test + public void standardExportInformationTest() { + // TODO: test standardExportInformation + } + + /** + * Test the property 'subVolume' + */ + @Test + public void subVolumeTest() { + // TODO: test subVolume + } + + /** + * Test the property 'exportableDataType' + */ + @Test + public void exportableDataTypeTest() { + // TODO: test exportableDataType + } + + /** + * Test the property 'datasetName' + */ + @Test + public void datasetNameTest() { + // TODO: test datasetName + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/SampledCurveTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/SampledCurveTest.java new file mode 100644 index 0000000000..d61c36dd29 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/SampledCurveTest.java @@ -0,0 +1,133 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.ControlPointCurve; +import org.vcell.restclient.model.Coordinate; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for SampledCurve + */ +public class SampledCurveTest { + private final SampledCurve model = new SampledCurve(); + + /** + * Model tests for SampledCurve + */ + @Test + public void testSampledCurve() { + // TODO: test SampledCurve + } + + /** + * Test the property 'bClosed' + */ + @Test + public void bClosedTest() { + // TODO: test bClosed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'beginningCoordinate' + */ + @Test + public void beginningCoordinateTest() { + // TODO: test beginningCoordinate + } + + /** + * Test the property 'defaultNumSamples' + */ + @Test + public void defaultNumSamplesTest() { + // TODO: test defaultNumSamples + } + + /** + * Test the property 'endingCoordinate' + */ + @Test + public void endingCoordinateTest() { + // TODO: test endingCoordinate + } + + /** + * Test the property 'numSamplePoints' + */ + @Test + public void numSamplePointsTest() { + // TODO: test numSamplePoints + } + + /** + * Test the property 'segmentCount' + */ + @Test + public void segmentCountTest() { + // TODO: test segmentCount + } + + /** + * Test the property 'spatialLength' + */ + @Test + public void spatialLengthTest() { + // TODO: test spatialLength + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'valid' + */ + @Test + public void validTest() { + // TODO: test valid + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionContourTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionContourTest.java new file mode 100644 index 0000000000..b2dd04c892 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionContourTest.java @@ -0,0 +1,104 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.SpatialSelection; +import org.vcell.restclient.model.VariableType; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for SpatialSelectionContour + */ +public class SpatialSelectionContourTest { + private final SpatialSelectionContour model = new SpatialSelectionContour(); + + /** + * Model tests for SpatialSelectionContour + */ + @Test + public void testSpatialSelectionContour() { + // TODO: test SpatialSelectionContour + } + + /** + * Test the property 'curveSelectionInfo' + */ + @Test + public void curveSelectionInfoTest() { + // TODO: test curveSelectionInfo + } + + /** + * Test the property 'varType' + */ + @Test + public void varTypeTest() { + // TODO: test varType + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'smallestMeshCellDimensionLength' + */ + @Test + public void smallestMeshCellDimensionLengthTest() { + // TODO: test smallestMeshCellDimensionLength + } + + /** + * Test the property 'variableType' + */ + @Test + public void variableTypeTest() { + // TODO: test variableType + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'point' + */ + @Test + public void pointTest() { + // TODO: test point + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionMembraneTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionMembraneTest.java new file mode 100644 index 0000000000..1d16861e37 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionMembraneTest.java @@ -0,0 +1,105 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.SampledCurve; +import org.vcell.restclient.model.SpatialSelection; +import org.vcell.restclient.model.VariableType; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for SpatialSelectionMembrane + */ +public class SpatialSelectionMembraneTest { + private final SpatialSelectionMembrane model = new SpatialSelectionMembrane(); + + /** + * Model tests for SpatialSelectionMembrane + */ + @Test + public void testSpatialSelectionMembrane() { + // TODO: test SpatialSelectionMembrane + } + + /** + * Test the property 'curveSelectionInfo' + */ + @Test + public void curveSelectionInfoTest() { + // TODO: test curveSelectionInfo + } + + /** + * Test the property 'varType' + */ + @Test + public void varTypeTest() { + // TODO: test varType + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'smallestMeshCellDimensionLength' + */ + @Test + public void smallestMeshCellDimensionLengthTest() { + // TODO: test smallestMeshCellDimensionLength + } + + /** + * Test the property 'variableType' + */ + @Test + public void variableTypeTest() { + // TODO: test variableType + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'point' + */ + @Test + public void pointTest() { + // TODO: test point + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionTest.java new file mode 100644 index 0000000000..1fe4040242 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionTest.java @@ -0,0 +1,101 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.VariableType; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for SpatialSelection + */ +public class SpatialSelectionTest { + private final SpatialSelection model = new SpatialSelection(); + + /** + * Model tests for SpatialSelection + */ + @Test + public void testSpatialSelection() { + // TODO: test SpatialSelection + } + + /** + * Test the property 'curveSelectionInfo' + */ + @Test + public void curveSelectionInfoTest() { + // TODO: test curveSelectionInfo + } + + /** + * Test the property 'varType' + */ + @Test + public void varTypeTest() { + // TODO: test varType + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'smallestMeshCellDimensionLength' + */ + @Test + public void smallestMeshCellDimensionLengthTest() { + // TODO: test smallestMeshCellDimensionLength + } + + /** + * Test the property 'variableType' + */ + @Test + public void variableTypeTest() { + // TODO: test variableType + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'point' + */ + @Test + public void pointTest() { + // TODO: test point + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionVolumeTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionVolumeTest.java new file mode 100644 index 0000000000..caf437eb34 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/SpatialSelectionVolumeTest.java @@ -0,0 +1,102 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.CurveSelectionInfo; +import org.vcell.restclient.model.SpatialSelection; +import org.vcell.restclient.model.VariableType; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for SpatialSelectionVolume + */ +public class SpatialSelectionVolumeTest { + private final SpatialSelectionVolume model = new SpatialSelectionVolume(); + + /** + * Model tests for SpatialSelectionVolume + */ + @Test + public void testSpatialSelectionVolume() { + // TODO: test SpatialSelectionVolume + } + + /** + * Test the property 'curveSelectionInfo' + */ + @Test + public void curveSelectionInfoTest() { + // TODO: test curveSelectionInfo + } + + /** + * Test the property 'varType' + */ + @Test + public void varTypeTest() { + // TODO: test varType + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'smallestMeshCellDimensionLength' + */ + @Test + public void smallestMeshCellDimensionLengthTest() { + // TODO: test smallestMeshCellDimensionLength + } + + /** + * Test the property 'variableType' + */ + @Test + public void variableTypeTest() { + // TODO: test variableType + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'point' + */ + @Test + public void pointTest() { + // TODO: test point + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/SplineTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/SplineTest.java new file mode 100644 index 0000000000..740fb23a76 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/SplineTest.java @@ -0,0 +1,133 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import org.vcell.restclient.model.ControlPointCurve; +import org.vcell.restclient.model.Coordinate; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for Spline + */ +public class SplineTest { + private final Spline model = new Spline(); + + /** + * Model tests for Spline + */ + @Test + public void testSpline() { + // TODO: test Spline + } + + /** + * Test the property 'bClosed' + */ + @Test + public void bClosedTest() { + // TODO: test bClosed + } + + /** + * Test the property 'description' + */ + @Test + public void descriptionTest() { + // TODO: test description + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'beginningCoordinate' + */ + @Test + public void beginningCoordinateTest() { + // TODO: test beginningCoordinate + } + + /** + * Test the property 'defaultNumSamples' + */ + @Test + public void defaultNumSamplesTest() { + // TODO: test defaultNumSamples + } + + /** + * Test the property 'endingCoordinate' + */ + @Test + public void endingCoordinateTest() { + // TODO: test endingCoordinate + } + + /** + * Test the property 'numSamplePoints' + */ + @Test + public void numSamplePointsTest() { + // TODO: test numSamplePoints + } + + /** + * Test the property 'segmentCount' + */ + @Test + public void segmentCountTest() { + // TODO: test segmentCount + } + + /** + * Test the property 'spatialLength' + */ + @Test + public void spatialLengthTest() { + // TODO: test spatialLength + } + + /** + * Test the property 'closed' + */ + @Test + public void closedTest() { + // TODO: test closed + } + + /** + * Test the property 'valid' + */ + @Test + public void validTest() { + // TODO: test valid + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/StandardExportInfoTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/StandardExportInfoTest.java new file mode 100644 index 0000000000..a069cf95a7 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/StandardExportInfoTest.java @@ -0,0 +1,110 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.AnnotatedFunctionDTO; +import org.vcell.restclient.model.GeometrySpecDTO; +import org.vcell.restclient.model.TimeSpecs; +import org.vcell.restclient.model.VariableSpecs; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for StandardExportInfo + */ +public class StandardExportInfoTest { + private final StandardExportInfo model = new StandardExportInfo(); + + /** + * Model tests for StandardExportInfo + */ + @Test + public void testStandardExportInfo() { + // TODO: test StandardExportInfo + } + + /** + * Test the property 'outputContext' + */ + @Test + public void outputContextTest() { + // TODO: test outputContext + } + + /** + * Test the property 'contextName' + */ + @Test + public void contextNameTest() { + // TODO: test contextName + } + + /** + * Test the property 'simulationName' + */ + @Test + public void simulationNameTest() { + // TODO: test simulationName + } + + /** + * Test the property 'simulationKey' + */ + @Test + public void simulationKeyTest() { + // TODO: test simulationKey + } + + /** + * Test the property 'simulationJob' + */ + @Test + public void simulationJobTest() { + // TODO: test simulationJob + } + + /** + * Test the property 'geometrySpecs' + */ + @Test + public void geometrySpecsTest() { + // TODO: test geometrySpecs + } + + /** + * Test the property 'timeSpecs' + */ + @Test + public void timeSpecsTest() { + // TODO: test timeSpecs + } + + /** + * Test the property 'variableSpecs' + */ + @Test + public void variableSpecsTest() { + // TODO: test variableSpecs + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/TimeModeTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/TimeModeTest.java new file mode 100644 index 0000000000..75732e05d6 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/TimeModeTest.java @@ -0,0 +1,32 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TimeMode + */ +public class TimeModeTest { + /** + * Model tests for TimeMode + */ + @Test + public void testTimeMode() { + // TODO: test TimeMode + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/TimeSpecsTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/TimeSpecsTest.java new file mode 100644 index 0000000000..a91f5a4761 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/TimeSpecsTest.java @@ -0,0 +1,75 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.TimeMode; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for TimeSpecs + */ +public class TimeSpecsTest { + private final TimeSpecs model = new TimeSpecs(); + + /** + * Model tests for TimeSpecs + */ + @Test + public void testTimeSpecs() { + // TODO: test TimeSpecs + } + + /** + * Test the property 'beginTimeIndex' + */ + @Test + public void beginTimeIndexTest() { + // TODO: test beginTimeIndex + } + + /** + * Test the property 'endTimeIndex' + */ + @Test + public void endTimeIndexTest() { + // TODO: test endTimeIndex + } + + /** + * Test the property 'allTimes' + */ + @Test + public void allTimesTest() { + // TODO: test allTimes + } + + /** + * Test the property 'mode' + */ + @Test + public void modeTest() { + // TODO: test mode + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/VariableModeTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/VariableModeTest.java new file mode 100644 index 0000000000..c5269b27f2 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/VariableModeTest.java @@ -0,0 +1,32 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for VariableMode + */ +public class VariableModeTest { + /** + * Model tests for VariableMode + */ + @Test + public void testVariableMode() { + // TODO: test VariableMode + } + +} diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/model/VariableSpecsTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/model/VariableSpecsTest.java new file mode 100644 index 0000000000..e88cd78a90 --- /dev/null +++ b/vcell-restclient/src/test/java/org/vcell/restclient/model/VariableSpecsTest.java @@ -0,0 +1,59 @@ +/* + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.vcell.restclient.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.vcell.restclient.model.VariableMode; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Model tests for VariableSpecs + */ +public class VariableSpecsTest { + private final VariableSpecs model = new VariableSpecs(); + + /** + * Model tests for VariableSpecs + */ + @Test + public void testVariableSpecs() { + // TODO: test VariableSpecs + } + + /** + * Test the property 'variableNames' + */ + @Test + public void variableNamesTest() { + // TODO: test variableNames + } + + /** + * Test the property 'mode' + */ + @Test + public void modeTest() { + // TODO: test mode + } + +} diff --git a/webapp-ng/src/app/core/modules/openapi/.openapi-generator/FILES b/webapp-ng/src/app/core/modules/openapi/.openapi-generator/FILES index 942d70cde1..1787f0845d 100644 --- a/webapp-ng/src/app/core/modules/openapi/.openapi-generator/FILES +++ b/webapp-ng/src/app/core/modules/openapi/.openapi-generator/FILES @@ -6,6 +6,8 @@ api/admin-resource.serviceInterface.ts api/api.ts api/bio-model-resource.service.ts api/bio-model-resource.serviceInterface.ts +api/export-resource.service.ts +api/export-resource.serviceInterface.ts api/field-data-resource.service.ts api/field-data-resource.serviceInterface.ts api/geometry-resource.service.ts @@ -29,21 +31,34 @@ encoder.ts git_push.sh index.ts model/acces-token-representation-record.ts +model/analytic-curve.ts +model/annotated-function-dto.ts model/application-info.ts model/batch-system-type.ts model/bio-model-child-summary.ts model/bio-model-summary.ts model/bio-model.ts model/biomodel-ref.ts +model/composite-curve.ts +model/control-point-curve.ts +model/coordinate.ts +model/curve-selection-info.ts +model/curve.ts model/data-identifier.ts model/detailed-state.ts model/domain.ts +model/export-event.ts +model/export-progress-type.ts +model/exportable-data-type.ts model/extent.ts model/external-data-identifier.ts model/field-data-reference.ts model/field-data-saved-results.ts model/field-data-shape.ts model/field-data.ts +model/function-category.ts +model/geometry-mode.ts +model/geometry-spec-dto.ts model/geometry-summary.ts model/gif-image.ts model/group-access-all.ts @@ -52,6 +67,7 @@ model/group-access-some.ts model/group-access.ts model/hello-world-message.ts model/htc-job-id.ts +model/human-readable-export-data.ts model/i-size.ts model/identity.ts model/math-model-child-summary.ts @@ -60,9 +76,11 @@ model/math-type.ts model/mathmodel-ref.ts model/model-type.ts model/models.ts +model/n5-export-request.ts model/origin.ts model/publication-info.ts model/publication.ts +model/sampled-curve.ts model/scheduler-status.ts model/simulation-execution-status-record.ts model/simulation-job-status-record.ts @@ -71,9 +89,17 @@ model/simulation-queue-entry-status-record.ts model/simulation-queue-id.ts model/simulation-status-persistent-record.ts model/source-model.ts +model/spatial-selection-contour.ts +model/spatial-selection-membrane.ts +model/spatial-selection-volume.ts +model/spatial-selection.ts model/specialclaim.ts +model/spline.ts +model/standard-export-info.ts model/status-message.ts model/status.ts +model/time-mode.ts +model/time-specs.ts model/user-identity-json-safe.ts model/user-login-info-for-mapping.ts model/user-registration-info.ts @@ -82,6 +108,8 @@ model/v-cell-http-error.ts model/v-cell-site.ts model/v-cell-software-version.ts model/variable-domain.ts +model/variable-mode.ts +model/variable-specs.ts model/variable-type.ts model/vc-document-type.ts model/vc-image-summary.ts diff --git a/webapp-ng/src/app/core/modules/openapi/api/api.ts b/webapp-ng/src/app/core/modules/openapi/api/api.ts index 415c3e6f3e..633957d44d 100644 --- a/webapp-ng/src/app/core/modules/openapi/api/api.ts +++ b/webapp-ng/src/app/core/modules/openapi/api/api.ts @@ -4,6 +4,9 @@ export * from './admin-resource.serviceInterface'; export * from './bio-model-resource.service'; import { BioModelResourceService } from './bio-model-resource.service'; export * from './bio-model-resource.serviceInterface'; +export * from './export-resource.service'; +import { ExportResourceService } from './export-resource.service'; +export * from './export-resource.serviceInterface'; export * from './field-data-resource.service'; import { FieldDataResourceService } from './field-data-resource.service'; export * from './field-data-resource.serviceInterface'; @@ -31,4 +34,4 @@ export * from './users-resource.serviceInterface'; export * from './vc-image-resource.service'; import { VCImageResourceService } from './vc-image-resource.service'; export * from './vc-image-resource.serviceInterface'; -export const APIS = [AdminResourceService, BioModelResourceService, FieldDataResourceService, GeometryResourceService, HelloWorldService, MathModelResourceService, PublicationResourceService, SimulationResourceService, SolverResourceService, UsersResourceService, VCImageResourceService]; +export const APIS = [AdminResourceService, BioModelResourceService, ExportResourceService, FieldDataResourceService, GeometryResourceService, HelloWorldService, MathModelResourceService, PublicationResourceService, SimulationResourceService, SolverResourceService, UsersResourceService, VCImageResourceService]; diff --git a/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts b/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts new file mode 100644 index 0000000000..1a54804fb5 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts @@ -0,0 +1,232 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { ExportEvent } from '../model/export-event'; +// @ts-ignore +import { N5ExportRequest } from '../model/n5-export-request'; +// @ts-ignore +import { VCellHTTPError } from '../model/v-cell-http-error'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { + ExportResourceServiceInterface +} from './export-resource.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ExportResourceService implements ExportResourceServiceInterface { + + protected basePath = 'https://vcell.cam.uchc.edu'; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + public encoder: HttpParameterCodec; + + constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { + if (configuration) { + this.configuration = configuration; + } + if (typeof this.configuration.basePath !== 'string') { + if (Array.isArray(basePath) && basePath.length > 0) { + basePath = basePath[0]; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + + // @ts-ignore + private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { + if (typeof value === "object" && value instanceof Date === false) { + httpParams = this.addToHttpParamsRecursive(httpParams, value); + } else { + httpParams = this.addToHttpParamsRecursive(httpParams, value, key); + } + return httpParams; + } + + private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { + if (value == null) { + return httpParams; + } + + if (typeof value === "object") { + if (Array.isArray(value)) { + (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( + httpParams, value[k], key != null ? `${key}.${k}` : k)); + } + } else if (key != null) { + httpParams = httpParams.append(key, value); + } else { + throw Error("key may not be null if value is not object or array"); + } + return httpParams; + } + + /** + * Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + * @param n5ExportRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public exportN5(n5ExportRequest?: N5ExportRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable; + public exportN5(n5ExportRequest?: N5ExportRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public exportN5(n5ExportRequest?: N5ExportRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public exportN5(n5ExportRequest?: N5ExportRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (openId) required + localVarCredential = this.configuration.lookupCredential('openId'); + if (localVarCredential) { + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/export/N5`; + return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: n5ExportRequest, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Get the status of your most recent export jobs. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public exportStatus(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public exportStatus(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public exportStatus(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public exportStatus(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarCredential: string | undefined; + // authentication (openId) required + localVarCredential = this.configuration.lookupCredential('openId'); + if (localVarCredential) { + } + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + 'application/json' + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + let localVarHttpContext: HttpContext | undefined = options && options.context; + if (localVarHttpContext === undefined) { + localVarHttpContext = new HttpContext(); + } + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v1/export/status`; + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts b/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts new file mode 100644 index 0000000000..c2d92e7576 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts @@ -0,0 +1,42 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { HttpHeaders } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { ExportEvent } from '../model/models'; +import { N5ExportRequest } from '../model/models'; +import { VCellHTTPError } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface ExportResourceServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * + * Create an N5 (ImageJ compatible) export. The request must contain the standard export information, exportable data type, dataset name, and sub-volume specifications. + * @param n5ExportRequest + */ + exportN5(n5ExportRequest?: N5ExportRequest, extraHttpRequestParams?: any): Observable; + + /** + * + * Get the status of your most recent export jobs. + */ + exportStatus(extraHttpRequestParams?: any): Observable>; + +} diff --git a/webapp-ng/src/app/core/modules/openapi/model/analytic-curve.ts b/webapp-ng/src/app/core/modules/openapi/model/analytic-curve.ts new file mode 100644 index 0000000000..0440436af7 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/analytic-curve.ts @@ -0,0 +1,27 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Coordinate } from './coordinate'; +import { Curve } from './curve'; + + +export interface AnalyticCurve extends Curve { + type: string; + expX?: string; + expY?: string; + expZ?: string; + offset?: Coordinate; + analyticOffset?: Coordinate; + defaultNumSamples?: number; + segmentCount?: number; + valid?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/annotated-function-dto.ts b/webapp-ng/src/app/core/modules/openapi/model/annotated-function-dto.ts new file mode 100644 index 0000000000..598989dc95 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/annotated-function-dto.ts @@ -0,0 +1,28 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { VariableType } from './variable-type'; +import { Domain } from './domain'; +import { FunctionCategory } from './function-category'; + + +export interface AnnotatedFunctionDTO { + functionName?: string; + functionExpression?: string; + error?: string; + domain?: Domain; + functionType?: VariableType; + category?: FunctionCategory; +} +export namespace AnnotatedFunctionDTO { +} + + diff --git a/webapp-ng/src/app/core/modules/openapi/model/composite-curve.ts b/webapp-ng/src/app/core/modules/openapi/model/composite-curve.ts new file mode 100644 index 0000000000..3313934e76 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/composite-curve.ts @@ -0,0 +1,24 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Coordinate } from './coordinate'; +import { Curve } from './curve'; + + +export interface CompositeCurve extends Curve { + type: string; + fieldCurves?: Array; + curveCount?: number; + defaultNumSamples?: number; + segmentCount?: number; + valid?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/control-point-curve.ts b/webapp-ng/src/app/core/modules/openapi/model/control-point-curve.ts new file mode 100644 index 0000000000..aef0e4a5ee --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/control-point-curve.ts @@ -0,0 +1,26 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Coordinate } from './coordinate'; +import { Curve } from './curve'; + + +export interface ControlPointCurve extends Curve { + type: string; + controlPoints?: Array; + controlPointCount?: number; + controlPointsVector?: Array; + maxControlPoints?: number; + minControlPoints?: number; + controlPointAddable?: boolean; + valid?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/coordinate.ts b/webapp-ng/src/app/core/modules/openapi/model/coordinate.ts new file mode 100644 index 0000000000..d91314ddc1 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/coordinate.ts @@ -0,0 +1,19 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface Coordinate { + x?: number; + y?: number; + z?: number; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/curve-selection-info.ts b/webapp-ng/src/app/core/modules/openapi/model/curve-selection-info.ts new file mode 100644 index 0000000000..457a553a05 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/curve-selection-info.ts @@ -0,0 +1,27 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Curve } from './curve'; + + +export interface CurveSelectionInfo { + fieldCurve?: Curve; + fieldType?: number; + fieldControlPoint?: number; + fieldSegment?: number; + fieldU?: number; + fieldUExtended?: number; + fieldControlPointExtended?: number; + fieldSegmentExtended?: number; + fieldDirectionNegative?: boolean; + crossing?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/curve.ts b/webapp-ng/src/app/core/modules/openapi/model/curve.ts new file mode 100644 index 0000000000..b3942bafe9 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/curve.ts @@ -0,0 +1,28 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Coordinate } from './coordinate'; + + +export interface Curve { + bClosed?: boolean; + description?: string; + type: string; + beginningCoordinate?: Coordinate; + defaultNumSamples?: number; + endingCoordinate?: Coordinate; + numSamplePoints?: number; + segmentCount?: number; + spatialLength?: number; + closed?: boolean; + valid?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/export-event.ts b/webapp-ng/src/app/core/modules/openapi/model/export-event.ts new file mode 100644 index 0000000000..f1433b927b --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/export-event.ts @@ -0,0 +1,35 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { VariableSpecs } from './variable-specs'; +import { ExportProgressType } from './export-progress-type'; +import { User } from './user'; +import { TimeSpecs } from './time-specs'; +import { HumanReadableExportData } from './human-readable-export-data'; + + +export interface ExportEvent { + eventType?: ExportProgressType; + progress?: number; + format?: string; + location?: string; + user?: User; + jobID?: number; + dataKey?: string; + dataIdString?: string; + timeSpecs?: TimeSpecs; + variableSpecs?: VariableSpecs; + humanReadableData?: HumanReadableExportData; +} +export namespace ExportEvent { +} + + diff --git a/webapp-ng/src/app/core/modules/openapi/model/export-progress-type.ts b/webapp-ng/src/app/core/modules/openapi/model/export-progress-type.ts new file mode 100644 index 0000000000..3905d6859a --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/export-progress-type.ts @@ -0,0 +1,23 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type ExportProgressType = 'EXPORT_START' | 'EXPORT_COMPLETE' | 'EXPORT_FAILURE' | 'EXPORT_ASSEMBLING' | 'EXPORT_PROGRESS'; + +export const ExportProgressType = { + Start: 'EXPORT_START' as ExportProgressType, + Complete: 'EXPORT_COMPLETE' as ExportProgressType, + Failure: 'EXPORT_FAILURE' as ExportProgressType, + Assembling: 'EXPORT_ASSEMBLING' as ExportProgressType, + Progress: 'EXPORT_PROGRESS' as ExportProgressType +}; + diff --git a/webapp-ng/src/app/core/modules/openapi/model/exportable-data-type.ts b/webapp-ng/src/app/core/modules/openapi/model/exportable-data-type.ts new file mode 100644 index 0000000000..10159c369a --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/exportable-data-type.ts @@ -0,0 +1,21 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type ExportableDataType = 'ODE_VARIABLE_DATA' | 'PDE_VARIABLE_DATA' | 'PDE_PARTICLE_DATA'; + +export const ExportableDataType = { + OdeVariableData: 'ODE_VARIABLE_DATA' as ExportableDataType, + PdeVariableData: 'PDE_VARIABLE_DATA' as ExportableDataType, + PdeParticleData: 'PDE_PARTICLE_DATA' as ExportableDataType +}; + diff --git a/webapp-ng/src/app/core/modules/openapi/model/function-category.ts b/webapp-ng/src/app/core/modules/openapi/model/function-category.ts new file mode 100644 index 0000000000..3a1e7c9652 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/function-category.ts @@ -0,0 +1,22 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type FunctionCategory = 'PREDEFINED' | 'OLDUSERDEFINED' | 'OUTPUTFUNCTION' | 'POSTPROCESSFUNCTION'; + +export const FunctionCategory = { + Predefined: 'PREDEFINED' as FunctionCategory, + Olduserdefined: 'OLDUSERDEFINED' as FunctionCategory, + Outputfunction: 'OUTPUTFUNCTION' as FunctionCategory, + Postprocessfunction: 'POSTPROCESSFUNCTION' as FunctionCategory +}; + diff --git a/webapp-ng/src/app/core/modules/openapi/model/geometry-mode.ts b/webapp-ng/src/app/core/modules/openapi/model/geometry-mode.ts new file mode 100644 index 0000000000..2d4f4c23e0 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/geometry-mode.ts @@ -0,0 +1,21 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type GeometryMode = 'GEOMETRY_SELECTIONS' | 'GEOMETRY_SLICE' | 'GEOMETRY_FULL'; + +export const GeometryMode = { + Selections: 'GEOMETRY_SELECTIONS' as GeometryMode, + Slice: 'GEOMETRY_SLICE' as GeometryMode, + Full: 'GEOMETRY_FULL' as GeometryMode +}; + diff --git a/webapp-ng/src/app/core/modules/openapi/model/geometry-spec-dto.ts b/webapp-ng/src/app/core/modules/openapi/model/geometry-spec-dto.ts new file mode 100644 index 0000000000..9cde3d677f --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/geometry-spec-dto.ts @@ -0,0 +1,25 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { SpatialSelection } from './spatial-selection'; +import { GeometryMode } from './geometry-mode'; + + +export interface GeometrySpecDTO { + selections?: Array; + axis?: number; + sliceNumber?: number; + geometryMode?: GeometryMode; +} +export namespace GeometrySpecDTO { +} + + diff --git a/webapp-ng/src/app/core/modules/openapi/model/human-readable-export-data.ts b/webapp-ng/src/app/core/modules/openapi/model/human-readable-export-data.ts new file mode 100644 index 0000000000..dae9f03882 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/human-readable-export-data.ts @@ -0,0 +1,27 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface HumanReadableExportData { + simulationName?: string; + biomodelName?: string; + applicationName?: string; + differentParameterValues?: Array; + applicationType?: string; + serverSavedFileName?: string; + nonSpatial?: boolean; + subVolume?: { [key: string]: string; }; + zSlices?: number; + tSlices?: number; + numChannels?: number; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/models.ts b/webapp-ng/src/app/core/modules/openapi/model/models.ts index 3a5b369b5d..e3cb4a1eef 100644 --- a/webapp-ng/src/app/core/modules/openapi/model/models.ts +++ b/webapp-ng/src/app/core/modules/openapi/model/models.ts @@ -1,20 +1,33 @@ export * from './acces-token-representation-record'; +export * from './analytic-curve'; +export * from './annotated-function-dto'; export * from './application-info'; export * from './batch-system-type'; export * from './bio-model'; export * from './bio-model-child-summary'; export * from './bio-model-summary'; export * from './biomodel-ref'; +export * from './composite-curve'; +export * from './control-point-curve'; +export * from './coordinate'; +export * from './curve'; +export * from './curve-selection-info'; export * from './data-identifier'; export * from './detailed-state'; export * from './domain'; +export * from './export-event'; +export * from './export-progress-type'; +export * from './exportable-data-type'; export * from './extent'; export * from './external-data-identifier'; export * from './field-data'; export * from './field-data-reference'; export * from './field-data-saved-results'; export * from './field-data-shape'; +export * from './function-category'; export * from './gif-image'; +export * from './geometry-mode'; +export * from './geometry-spec-dto'; export * from './geometry-summary'; export * from './group-access'; export * from './group-access-all'; @@ -22,6 +35,7 @@ export * from './group-access-none'; export * from './group-access-some'; export * from './hello-world-message'; export * from './htc-job-id'; +export * from './human-readable-export-data'; export * from './i-size'; export * from './identity'; export * from './math-model-child-summary'; @@ -29,10 +43,12 @@ export * from './math-model-summary'; export * from './math-type'; export * from './mathmodel-ref'; export * from './model-type'; +export * from './n5-export-request'; export * from './origin'; export * from './publication'; export * from './publication-info'; export * from './specialclaim'; +export * from './sampled-curve'; export * from './scheduler-status'; export * from './simulation-execution-status-record'; export * from './simulation-job-status-record'; @@ -41,8 +57,16 @@ export * from './simulation-queue-entry-status-record'; export * from './simulation-queue-id'; export * from './simulation-status-persistent-record'; export * from './source-model'; +export * from './spatial-selection'; +export * from './spatial-selection-contour'; +export * from './spatial-selection-membrane'; +export * from './spatial-selection-volume'; +export * from './spline'; +export * from './standard-export-info'; export * from './status'; export * from './status-message'; +export * from './time-mode'; +export * from './time-specs'; export * from './user'; export * from './user-identity-json-safe'; export * from './user-login-info-for-mapping'; @@ -54,6 +78,8 @@ export * from './v-cell-http-error'; export * from './v-cell-site'; export * from './v-cell-software-version'; export * from './variable-domain'; +export * from './variable-mode'; +export * from './variable-specs'; export * from './variable-type'; export * from './version'; export * from './version-flag'; diff --git a/webapp-ng/src/app/core/modules/openapi/model/n5-export-request.ts b/webapp-ng/src/app/core/modules/openapi/model/n5-export-request.ts new file mode 100644 index 0000000000..e22420cebc --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/n5-export-request.ts @@ -0,0 +1,25 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ExportableDataType } from './exportable-data-type'; +import { StandardExportInfo } from './standard-export-info'; + + +export interface N5ExportRequest { + standardExportInformation?: StandardExportInfo; + subVolume?: { [key: string]: string; }; + exportableDataType?: ExportableDataType; + datasetName?: string; +} +export namespace N5ExportRequest { +} + + diff --git a/webapp-ng/src/app/core/modules/openapi/model/sampled-curve.ts b/webapp-ng/src/app/core/modules/openapi/model/sampled-curve.ts new file mode 100644 index 0000000000..12a3096e4a --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/sampled-curve.ts @@ -0,0 +1,24 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Coordinate } from './coordinate'; +import { ControlPointCurve } from './control-point-curve'; + + +export interface SampledCurve extends ControlPointCurve { + type: string; + defaultNumSamples?: number; + maxControlPoints?: number; + minControlPoints?: number; + segmentCount?: number; + spatialLength?: number; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts new file mode 100644 index 0000000000..dca0644d3c --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts @@ -0,0 +1,23 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { SpatialSelection } from './spatial-selection'; +import { VariableType } from './variable-type'; +import { CurveSelectionInfo } from './curve-selection-info'; + + +export interface SpatialSelectionContour extends SpatialSelection { + type?: string; + fieldSampledDataIndexes?: Array; + indexSamples?: Array; + sampledDataIndexes?: Array; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-membrane.ts b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-membrane.ts new file mode 100644 index 0000000000..505e6c25ba --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-membrane.ts @@ -0,0 +1,23 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { SampledCurve } from './sampled-curve'; +import { SpatialSelection } from './spatial-selection'; +import { VariableType } from './variable-type'; +import { CurveSelectionInfo } from './curve-selection-info'; + + +export interface SpatialSelectionMembrane extends SpatialSelection { + type: string; + fieldSampledDataIndexes?: Array; + selectionSource?: SampledCurve; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts new file mode 100644 index 0000000000..a69f56efab --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts @@ -0,0 +1,21 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { SpatialSelection } from './spatial-selection'; +import { VariableType } from './variable-type'; +import { CurveSelectionInfo } from './curve-selection-info'; + + +export interface SpatialSelectionVolume extends SpatialSelection { + type?: string; + symmetric?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection.ts b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection.ts new file mode 100644 index 0000000000..69f1e84da0 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection.ts @@ -0,0 +1,25 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { VariableType } from './variable-type'; +import { CurveSelectionInfo } from './curve-selection-info'; + + +export interface SpatialSelection { + curveSelectionInfo?: CurveSelectionInfo; + varType?: VariableType; + type: string; + smallestMeshCellDimensionLength?: number; + variableType?: VariableType; + closed?: boolean; + point?: boolean; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/spline.ts b/webapp-ng/src/app/core/modules/openapi/model/spline.ts new file mode 100644 index 0000000000..3fa5694f6a --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/spline.ts @@ -0,0 +1,23 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Coordinate } from './coordinate'; +import { ControlPointCurve } from './control-point-curve'; + + +export interface Spline extends ControlPointCurve { + type: string; + defaultNumSamples?: number; + maxControlPoints?: number; + minControlPoints?: number; + segmentCount?: number; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/standard-export-info.ts b/webapp-ng/src/app/core/modules/openapi/model/standard-export-info.ts new file mode 100644 index 0000000000..868436953c --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/standard-export-info.ts @@ -0,0 +1,28 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { VariableSpecs } from './variable-specs'; +import { AnnotatedFunctionDTO } from './annotated-function-dto'; +import { GeometrySpecDTO } from './geometry-spec-dto'; +import { TimeSpecs } from './time-specs'; + + +export interface StandardExportInfo { + outputContext?: Array; + contextName?: string; + simulationName?: string; + simulationKey?: string; + simulationJob?: number; + geometrySpecs?: GeometrySpecDTO; + timeSpecs?: TimeSpecs; + variableSpecs?: VariableSpecs; +} + diff --git a/webapp-ng/src/app/core/modules/openapi/model/time-mode.ts b/webapp-ng/src/app/core/modules/openapi/model/time-mode.ts new file mode 100644 index 0000000000..3fd04041c5 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/time-mode.ts @@ -0,0 +1,20 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type TimeMode = 'TIME_POINT' | 'TIME_RANGE'; + +export const TimeMode = { + Point: 'TIME_POINT' as TimeMode, + Range: 'TIME_RANGE' as TimeMode +}; + diff --git a/webapp-ng/src/app/core/modules/openapi/model/time-specs.ts b/webapp-ng/src/app/core/modules/openapi/model/time-specs.ts new file mode 100644 index 0000000000..71c916baef --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/time-specs.ts @@ -0,0 +1,24 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { TimeMode } from './time-mode'; + + +export interface TimeSpecs { + beginTimeIndex?: number; + endTimeIndex?: number; + allTimes?: Array; + mode?: TimeMode; +} +export namespace TimeSpecs { +} + + diff --git a/webapp-ng/src/app/core/modules/openapi/model/variable-mode.ts b/webapp-ng/src/app/core/modules/openapi/model/variable-mode.ts new file mode 100644 index 0000000000..69b0a5a999 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/variable-mode.ts @@ -0,0 +1,21 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export type VariableMode = 'VARIABLE_ONE' | 'VARIABLE_MULTI' | 'VARIABLE_ALL'; + +export const VariableMode = { + One: 'VARIABLE_ONE' as VariableMode, + Multi: 'VARIABLE_MULTI' as VariableMode, + All: 'VARIABLE_ALL' as VariableMode +}; + diff --git a/webapp-ng/src/app/core/modules/openapi/model/variable-specs.ts b/webapp-ng/src/app/core/modules/openapi/model/variable-specs.ts new file mode 100644 index 0000000000..c655b565d8 --- /dev/null +++ b/webapp-ng/src/app/core/modules/openapi/model/variable-specs.ts @@ -0,0 +1,22 @@ +/** + * VCell API + * VCell API + * + * The version of the OpenAPI document: 1.0.1 + * Contact: vcell_support@uchc.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { VariableMode } from './variable-mode'; + + +export interface VariableSpecs { + variableNames?: Array; + mode?: VariableMode; +} +export namespace VariableSpecs { +} + + From dc4700c4021204175f1bfd0b3242f8746e665673 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Mon, 28 Jul 2025 11:37:39 -0400 Subject: [PATCH 22/41] Client Uses New Export Endpoint --- .../vcell/api/client/ExceptionHandler.java | 2 +- .../org/vcell/api/client/VCellApiClient.java | 2 + .../LocalDataSetControllerMessaging.java | 29 ++- .../api/server/AsynchMessageManager.java | 17 ++ .../api/server/ClientExportController.java | 1 + .../restclient/utils/DtoModelTransforms.java | 234 +++++++++++++++++- 6 files changed, 274 insertions(+), 11 deletions(-) diff --git a/vcell-apiclient/src/main/java/org/vcell/api/client/ExceptionHandler.java b/vcell-apiclient/src/main/java/org/vcell/api/client/ExceptionHandler.java index 7ab35fb1b0..08ce330b1e 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/client/ExceptionHandler.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/client/ExceptionHandler.java @@ -13,7 +13,7 @@ public class ExceptionHandler { private static final Logger logger = LogManager.getLogger(ExceptionHandler.class); - protected static Exception getProperException(ApiException e){ + public static Exception getProperException(ApiException e){ int httpCode = e.getCode(); String message = e.getResponseBody() == null ? e.getMessage() : e.getResponseBody(); String originalExceptionClassName = e.getClass().getSimpleName(); diff --git a/vcell-apiclient/src/main/java/org/vcell/api/client/VCellApiClient.java b/vcell-apiclient/src/main/java/org/vcell/api/client/VCellApiClient.java index 27c15a3234..ce2d07adc6 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/client/VCellApiClient.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/client/VCellApiClient.java @@ -348,6 +348,8 @@ public MathModelResourceApi getMathModelApi(){ public VcImageResourceApi getVcImageApi(){return new VcImageResourceApi(apiClient);} + public ExportResourceApi getExportApi(){return new ExportResourceApi(apiClient);} + public String getVCellUserNameFromAuth0Mapping() throws ApiException { try { UsersResourceApi usersResourceApi = new UsersResourceApi(apiClient); diff --git a/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java b/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java index af7c28c54c..f8b3dadd65 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java @@ -13,6 +13,8 @@ import cbit.plot.PlotData; import cbit.rmi.event.ExportEvent; import cbit.vcell.export.server.ExportSpecs; +import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.N5Specs; import cbit.vcell.field.io.FieldData; import cbit.vcell.field.io.FieldDataSpec; import cbit.vcell.message.server.bootstrap.client.RemoteProxyException; @@ -302,14 +304,25 @@ public org.vcell.util.document.TimeSeriesJobResults getTimeSeriesValues(OutputCo */ public ExportEvent makeRemoteFile(OutputContext outputContext,ExportSpecs exportSpecs) throws DataAccessException, RemoteProxyException { if (lg.isTraceEnabled()) lg.trace("LocalDataSetControllerMessaging.makeRemoteFile(vcdID=" + exportSpecs.getVCDataIdentifier() + ")"); - try { - return dataServerProxy.makeRemoteFile(outputContext,exportSpecs); - } catch (DataAccessException e){ - lg.error(e.getMessage(),e); - throw e; - } catch (Throwable e){ - lg.error(e.getMessage(),e); - throw new RuntimeException(e.getMessage()); + if (exportSpecs.getFormatSpecificSpecs() instanceof N5Specs){ + // N5 export is handled by the N5ExportService + try { + long jobID = vCellApiClient.getExportApi().exportN5(DtoModelTransforms.n5ExportRequestFromExportSpecs(exportSpecs)); + return new ExportEvent(this, jobID, null, exportSpecs.getVCDataIdentifier(), ExportSpecss.ExportProgressType.EXPORT_START, exportSpecs.getFormat().toString(), "", 0.0, exportSpecs.getTimeSpecs(), exportSpecs.getVariableSpecs()); + } catch (ApiException e) { + ExceptionHandler.onlyDataAccessOrPermissionException(e); + throw new RuntimeException("Error should not reach here: " + e.getMessage(), e); + } + } else { + try { + return dataServerProxy.makeRemoteFile(outputContext,exportSpecs); + } catch (DataAccessException e){ + lg.error(e.getMessage(),e); + throw e; + } catch (Throwable e){ + lg.error(e.getMessage(),e); + throw new RuntimeException(e.getMessage()); + } } } diff --git a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java index c0c33c17f1..9f0e87be32 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java @@ -9,11 +9,14 @@ */ package org.vcell.api.server; +import java.util.List; +import java.util.Set; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.locks.ReentrantLock; +import java.util.stream.Stream; import javax.swing.SwingUtilities; import javax.swing.event.EventListenerList; @@ -23,6 +26,9 @@ import cbit.vcell.client.server.SimStatusListener; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.vcell.api.client.ExceptionHandler; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.utils.DtoModelTransforms; import org.vcell.util.DataAccessException; import cbit.rmi.event.DataJobEvent; @@ -40,6 +46,7 @@ import cbit.vcell.resource.VCellExecutorService; import cbit.vcell.server.VCellConnection; import edu.uchc.connjur.wb.ExecutionTrace; +import org.vcell.util.ObjectNotFoundException; /** * {@link AsynchMessageManager} polls from {@link VCellConnection} to get remote messages. Remote Messages include the following: @@ -132,6 +139,16 @@ private void poll( ) { } pollTime = BASE_POLL_SECONDS; queuedEvents = clientServerManager.getMessageEvents(); + try{ + Set setOfExports = clientServerManager.getVCellApiClient().getExportApi().exportStatus(); + List exportEvents = setOfExports.stream().map(DtoModelTransforms::dtoToExportEvent).toList(); + queuedEvents = Stream.concat(exportEvents.stream(), Stream.of(queuedEvents)).toArray(MessageEvent[]::new); + } catch (ApiException ex){ + boolean isObjectNotFoundException = ex.getCode() == 404; + if (!isObjectNotFoundException){ + throw ExceptionHandler.getProperException(ex); + } + } } if (report) { end = System.currentTimeMillis(); diff --git a/vcell-apiclient/src/main/java/org/vcell/api/server/ClientExportController.java b/vcell-apiclient/src/main/java/org/vcell/api/server/ClientExportController.java index ba9fa753c0..2cd157f125 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/server/ClientExportController.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/server/ClientExportController.java @@ -72,6 +72,7 @@ public void setClientServerManager(ClientServerManager newClientServerManager) { public void startExport(OutputContext outputContext,ExportSpecs exportSpecs) throws RemoteProxyException { try { ExportEvent event = getClientServerManager().getDataSetController().makeRemoteFile(outputContext,exportSpecs); + getClientServerManager().getAsynchMessageManager().fireExportEvent(event); // ignore; we'll get two downloads otherwise... getClientServerManager().getAsynchMessageManager().fireExportEvent(event); } catch (DataAccessException exc) { throw new RemoteProxyException(exc.getMessage(), exc); diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java b/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java index e20ab366ff..1aa71b1784 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java @@ -4,13 +4,19 @@ import cbit.image.GIFImage; import cbit.image.GifParsingException; import cbit.image.VCImageInfo; +import cbit.rmi.event.ExportEvent; +import cbit.rmi.event.ExportStatusEventCreator; +import cbit.vcell.export.server.*; +import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.field.FieldDataAllDBEntries; import cbit.vcell.field.io.FieldData; import cbit.vcell.geometry.GeometryInfo; import cbit.vcell.math.Variable; import cbit.vcell.math.VariableType; import cbit.vcell.simdata.DataIdentifier; +import cbit.vcell.solver.VCSimulationDataIdentifier; import org.vcell.restclient.model.*; +import org.vcell.restclient.model.VariableSpecs; import org.vcell.util.Extent; import org.vcell.util.Origin; import org.vcell.util.document.BioModelChildSummary; @@ -28,9 +34,7 @@ import org.vcell.util.document.*; import java.io.IOException; -import java.math.BigDecimal; import java.nio.file.Files; - import java.util.*; import java.util.stream.Collectors; @@ -306,4 +310,230 @@ public static VCImageInfo imageSummaryToVCImageInfo(org.vcell.restclient.model.V } } + public static TimeSpecs dtoToTimeSpecs(org.vcell.restclient.model.TimeSpecs dto){ + return new TimeSpecs(dto.getBeginTimeIndex(), dto.getEndTimeIndex(), dto.getAllTimes().stream().mapToDouble(Double::doubleValue).toArray(), + ExportSpecss.TimeMode.valueOf(dto.getMode().getValue())); + } + + public static cbit.vcell.export.server.VariableSpecs dtoToVariableSpecs(org.vcell.restclient.model.VariableSpecs dto){ + return new cbit.vcell.export.server.VariableSpecs(dto.getVariableNames(), ExportSpecss.VariableMode.valueOf(dto.getMode().getValue())); + } + + public static org.vcell.restclient.model.TimeSpecs timeSpecsToDTO(cbit.vcell.export.server.TimeSpecs timeSpecs) { + org.vcell.restclient.model.TimeSpecs dto = new org.vcell.restclient.model.TimeSpecs(); + dto.setBeginTimeIndex(timeSpecs.getBeginTimeIndex()); + dto.setEndTimeIndex(timeSpecs.getEndTimeIndex()); + dto.setAllTimes(Arrays.stream(timeSpecs.getAllTimes()).boxed().collect(Collectors.toList())); + dto.setMode(org.vcell.restclient.model.TimeMode.fromValue(timeSpecs.getMode().name())); + return dto; + } + + // File: vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java + + public static org.vcell.restclient.model.Curve toRestCurve(cbit.vcell.geometry.Curve coreCurve) { + if (coreCurve instanceof cbit.vcell.geometry.AnalyticCurve ac) { + org.vcell.restclient.model.AnalyticCurve restAc = new org.vcell.restclient.model.AnalyticCurve(); + restAc.setType("AnalyticCurve"); + restAc.setExpX(ac.getExpressionX().infix()); + restAc.setExpY(ac.getExpressionY().infix()); + restAc.setExpZ(ac.getExpressionZ().infix()); + restAc.setOffset(toRestCoordinate(ac.getAnalyticOffset())); + restAc.setValid(ac.isValid()); + return restAc; + } else if (coreCurve instanceof cbit.vcell.geometry.CompositeCurve cc) { + org.vcell.restclient.model.CompositeCurve restCc = new org.vcell.restclient.model.CompositeCurve(); + restCc.setType("CompositeCurve"); + List restCurves = new ArrayList<>(); + for (int i = 0; i < cc.getCurveCount(); i++) { + restCurves.add(toRestCurve(cc.getCurve(i))); + } + restCc.setFieldCurves(restCurves); + restCc.setCurveCount(cc.getCurveCount()); + restCc.setValid(cc.isValid()); + return restCc; + } else if (coreCurve instanceof cbit.vcell.geometry.ControlPointCurve cpc) { + return toRestControlPointCurve(cpc); + } + throw new IllegalArgumentException("Unknown curve type: " + coreCurve.getClass().getName()); + } + + // Helper function for coordinate conversion + private static org.vcell.restclient.model.Coordinate toRestCoordinate(org.vcell.util.Coordinate coreCoord) { + org.vcell.restclient.model.Coordinate dto = new org.vcell.restclient.model.Coordinate(); + dto.setX(coreCoord.getX()); + dto.setY(coreCoord.getY()); + dto.setZ(coreCoord.getZ()); + return dto; + } + + public static org.vcell.restclient.model.ControlPointCurve toRestControlPointCurve(cbit.vcell.geometry.ControlPointCurve curve) { + java.util.List restControlPoints = new java.util.ArrayList<>(); + if (curve.getControlPointsVector() != null){ + for (org.vcell.util.Coordinate cp : curve.getControlPointsVector()) { + restControlPoints.add(new org.vcell.restclient.model.Coordinate() + .x(cp.getX()) + .y(cp.getY()) + .z(cp.getZ())); + } + } + if (curve instanceof cbit.vcell.geometry.Spline spline) { + org.vcell.restclient.model.Spline restSpline = new org.vcell.restclient.model.Spline(); + restSpline.setType("Spline"); + restSpline.setControlPoints(restControlPoints); + restSpline.setControlPointCount(spline.getControlPointCount()); + restSpline.setControlPointsVector(restControlPoints); + restSpline.setMaxControlPoints(spline.getMaxControlPoints()); + restSpline.setMinControlPoints(spline.getMinControlPoints()); + restSpline.setControlPointAddable(spline.isControlPointAddable()); + restSpline.setValid(spline.isValid()); + restSpline.setSegmentCount(spline.getSegmentCount()); + restSpline.setNumSamplePoints(spline.getNumSamplePoints()); + restSpline.setSpatialLength(spline.getSpatialLength()); + restSpline.setClosed(spline.isClosed()); + return restSpline; + } else if (curve instanceof cbit.vcell.geometry.SampledCurve sampledCurve) { + org.vcell.restclient.model.SampledCurve restSampledCurve = new org.vcell.restclient.model.SampledCurve(); + restSampledCurve.setType("SampledCurve"); + restSampledCurve.setControlPoints(restControlPoints); + restSampledCurve.setControlPointCount(sampledCurve.getControlPointCount()); + restSampledCurve.setControlPointsVector(restControlPoints); + restSampledCurve.setMaxControlPoints(sampledCurve.getMaxControlPoints()); + restSampledCurve.setMinControlPoints(sampledCurve.getMinControlPoints()); + restSampledCurve.setControlPointAddable(sampledCurve.isControlPointAddable()); + restSampledCurve.setValid(sampledCurve.isValid()); + restSampledCurve.setSegmentCount(sampledCurve.getSegmentCount()); + restSampledCurve.setNumSamplePoints(sampledCurve.getNumSamplePoints()); + restSampledCurve.setSpatialLength(sampledCurve.getSpatialLength()); + restSampledCurve.setClosed(sampledCurve.isClosed()); + return restSampledCurve; + } else { + throw new IllegalArgumentException("Unsupported curve type: " + curve.getClass().getName()); + } + } + + public static org.vcell.restclient.model.CurveSelectionInfo curveSelectionInfoToDTO(cbit.vcell.geometry.CurveSelectionInfo core) { + if (core == null) return null; + org.vcell.restclient.model.CurveSelectionInfo dto = new org.vcell.restclient.model.CurveSelectionInfo(); + + dto.setFieldCurve(toRestCurve(core.getCurve())); + dto.setFieldType(core.getType()); + dto.setFieldControlPoint(core.getControlPoint()); + dto.setFieldSegment(core.getSegment()); + dto.setFieldU(core.getU()); + dto.setFieldUExtended(core.getUExtended()); + dto.setFieldControlPointExtended(core.getControlPointExtended()); + dto.setFieldSegmentExtended(core.getSegmentExtended()); + dto.setFieldDirectionNegative(core.getDirectionNegative()); + + return dto; + } + + + public static org.vcell.restclient.model.SpatialSelection spacialSelectionToDTO(cbit.vcell.simdata.SpatialSelection coreSelection) { + if (coreSelection instanceof cbit.vcell.simdata.SpatialSelectionMembrane core) { + org.vcell.restclient.model.SpatialSelectionMembrane rest = new org.vcell.restclient.model.SpatialSelectionMembrane(); + rest.selectionSource(core.getSelectionSource() != null ? (SampledCurve) toRestControlPointCurve(core.getSelectionSource()) : null); + rest.fieldSampledDataIndexes(core.getFieldSampledDataIndexes() != null ? + java.util.Arrays.stream(core.getFieldSampledDataIndexes()).boxed().toList() : null); + rest.curveSelectionInfo(curveSelectionInfoToDTO(core.getCurveSelectionInfo())); + rest.variableType(variableTypeToDTO(core.getVariableType())); + rest.type("Membrane"); + return rest; + } else if (coreSelection instanceof cbit.vcell.simdata.SpatialSelectionContour core) { + org.vcell.restclient.model.SpatialSelectionContour rest = new org.vcell.restclient.model.SpatialSelectionContour(); + rest.fieldSampledDataIndexes(core.getSampledDataIndexes() != null ? + java.util.Arrays.stream(core.getSampledDataIndexes()).boxed().toList() : null); + rest.curveSelectionInfo(curveSelectionInfoToDTO(core.getCurveSelectionInfo())); + rest.variableType(variableTypeToDTO(core.getVariableType())); + rest.type("Contour"); + return rest; + } else if (coreSelection instanceof cbit.vcell.simdata.SpatialSelectionVolume core) { + org.vcell.restclient.model.SpatialSelectionVolume rest = new org.vcell.restclient.model.SpatialSelectionVolume(); + rest.curveSelectionInfo(curveSelectionInfoToDTO(core.getCurveSelectionInfo())); + rest.variableType(variableTypeToDTO(core.getVariableType())); + rest.type("Volume"); + return rest; + } + throw new IllegalArgumentException("Unsupported SpatialSelection type: " + coreSelection.getClass()); + } + + public static GeometrySpecDTO geometrySpecToDTO(GeometrySpecs geometrySpec) { + GeometrySpecDTO dto = new GeometrySpecDTO(); + dto.selections(geometrySpec.getSelections() == null ? null : Arrays.stream(geometrySpec.getSelections()) + .map(DtoModelTransforms::spacialSelectionToDTO).collect(Collectors.toList())); + dto.axis(geometrySpec.getAxis()); + dto.geometryMode(org.vcell.restclient.model.GeometryMode.fromValue(geometrySpec.getMode().name())); + dto.sliceNumber(geometrySpec.getSliceNumber()); + return dto; + } + + public static org.vcell.restclient.model.VariableSpecs variableSpecsToDTO(cbit.vcell.export.server.VariableSpecs variableSpecs) { + org.vcell.restclient.model.VariableSpecs dto = new org.vcell.restclient.model.VariableSpecs(); + dto.setVariableNames(new ArrayList<>(Arrays.asList(variableSpecs.getVariableNames()))); + dto.setMode(org.vcell.restclient.model.VariableMode.fromValue(variableSpecs.getMode().name())); + return dto; + } + + public static StandardExportInfo exportRequestFromExportSpecs(ExportSpecs exportSpecs) { + if (exportSpecs.getVCDataIdentifier() instanceof VCSimulationDataIdentifier vcd){ + StandardExportInfo exportRequest = new StandardExportInfo(); + exportRequest.setSimulationKey(exportSpecs.getVCDataIdentifier().getDataKey().toString()); + exportRequest.setSimulationJob(vcd.getJobIndex()); + exportRequest.setContextName(exportSpecs.getContextName()); + exportRequest.setVariableSpecs(variableSpecsToDTO(exportSpecs.getVariableSpecs())); + exportRequest.setTimeSpecs(timeSpecsToDTO(exportSpecs.getTimeSpecs())); + exportRequest.geometrySpecs(exportSpecs.getGeometrySpecs() == null ? null : geometrySpecToDTO(exportSpecs.getGeometrySpecs())); + return exportRequest; + } else { + throw new IllegalArgumentException("Expected VCSimulationDataIdentifier but got: " + exportSpecs.getVCDataIdentifier().getClass().getName()); + } + } + + public static N5ExportRequest n5ExportRequestFromExportSpecs(ExportSpecs exportSpecs) { + if (exportSpecs.getFormatSpecificSpecs() instanceof N5Specs n5Specs){ + N5ExportRequest n5ExportRequest = new N5ExportRequest(); + HashMap subVolumeMapping = new HashMap<>(); + for (Map.Entry entry : n5Specs.getSubVolumeMapping().entrySet()) { + subVolumeMapping.put(entry.getKey().toString(), entry.getValue()); + } + n5ExportRequest.subVolume(subVolumeMapping); + n5ExportRequest.datasetName(n5Specs.dataSetName); + n5ExportRequest.exportableDataType(ExportableDataType.fromValue(n5Specs.getDataType().name())); + n5ExportRequest.standardExportInformation(DtoModelTransforms.exportRequestFromExportSpecs(exportSpecs)); + return n5ExportRequest; + } else { + throw new IllegalArgumentException("Expected N5Specs but got: " + exportSpecs.getFormatSpecificSpecs().getClass().getName()); + } + } + + public static ExportEvent dtoToExportEvent(org.vcell.restclient.model.ExportEvent restEvent) { + if (restEvent == null) return null; + + // Convert fields + ExportSpecss.ExportProgressType eventType = ExportSpecss.ExportProgressType.valueOf(restEvent.getEventType().getValue()); + Double progress = restEvent.getProgress(); + String format = restEvent.getFormat(); + String location = restEvent.getLocation(); + org.vcell.util.document.User user = restEvent.getUser() == null ? null : dtoToUser(restEvent.getUser()); + long jobID = restEvent.getJobID() != null ? restEvent.getJobID() : 0L; + org.vcell.util.document.KeyValue dataKey = restEvent.getDataKey() != null ? new org.vcell.util.document.KeyValue(restEvent.getDataKey()) : null; + String dataIdString = restEvent.getDataIdString(); + cbit.vcell.export.server.TimeSpecs timeSpecs = restEvent.getTimeSpecs() == null ? null : dtoToTimeSpecs(restEvent.getTimeSpecs()); + cbit.vcell.export.server.VariableSpecs variableSpecs = restEvent.getVariableSpecs() == null ? null : dtoToVariableSpecs(restEvent.getVariableSpecs()); + + // Construct ExportEvent + return new cbit.rmi.event.ExportEvent( + ExportStatusEventCreator.class, // source (set as needed) + jobID, + user, + dataIdString, + dataKey, + eventType, + format, + location, + progress, + timeSpecs, + variableSpecs + ); + } } From c67751304c60ab353c2f4e99beccc58eb79dfc7c Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 30 Jul 2025 08:32:22 -0400 Subject: [PATCH 23/41] Specify Required Objects for Spatial Selection --- python-restclient/docs/SpatialSelectionContour.md | 2 +- python-restclient/docs/SpatialSelectionVolume.md | 2 +- .../vcell_client/models/spatial_selection_contour.py | 2 +- .../vcell_client/models/spatial_selection_volume.py | 2 +- tools/openapi.yaml | 4 ++++ .../java/cbit/vcell/simdata/SpatialSelectionContour.java | 2 +- .../java/cbit/vcell/simdata/SpatialSelectionVolume.java | 2 +- vcell-restclient/api/openapi.yaml | 4 ++++ vcell-restclient/docs/SpatialSelectionContour.md | 2 +- vcell-restclient/docs/SpatialSelectionVolume.md | 2 +- .../org/vcell/restclient/model/SpatialSelectionContour.java | 6 +++--- .../org/vcell/restclient/model/SpatialSelectionVolume.java | 6 +++--- .../core/modules/openapi/model/spatial-selection-contour.ts | 2 +- .../core/modules/openapi/model/spatial-selection-volume.ts | 2 +- 14 files changed, 24 insertions(+), 16 deletions(-) diff --git a/python-restclient/docs/SpatialSelectionContour.md b/python-restclient/docs/SpatialSelectionContour.md index 6072fdab58..38e974c428 100644 --- a/python-restclient/docs/SpatialSelectionContour.md +++ b/python-restclient/docs/SpatialSelectionContour.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | | [optional] [default to 'Contour'] +**type** | **str** | | [default to 'Contour'] **field_sampled_data_indexes** | **List[int]** | | [optional] **index_samples** | **List[int]** | | [optional] **sampled_data_indexes** | **List[int]** | | [optional] diff --git a/python-restclient/docs/SpatialSelectionVolume.md b/python-restclient/docs/SpatialSelectionVolume.md index 5a128afc3b..e5d1ed7ea0 100644 --- a/python-restclient/docs/SpatialSelectionVolume.md +++ b/python-restclient/docs/SpatialSelectionVolume.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | | [optional] [default to 'Volume'] +**type** | **str** | | [default to 'Volume'] **symmetric** | **bool** | | [optional] ## Example diff --git a/python-restclient/vcell_client/models/spatial_selection_contour.py b/python-restclient/vcell_client/models/spatial_selection_contour.py index 338a4537ef..c68fc825b6 100644 --- a/python-restclient/vcell_client/models/spatial_selection_contour.py +++ b/python-restclient/vcell_client/models/spatial_selection_contour.py @@ -34,7 +34,7 @@ class SpatialSelectionContour(SpatialSelection): """ SpatialSelectionContour """ # noqa: E501 - type: Optional[StrictStr] = 'Contour' + type: StrictStr field_sampled_data_indexes: Optional[List[StrictInt]] = Field(default=None, alias="fieldSampledDataIndexes") index_samples: Optional[List[StrictInt]] = Field(default=None, alias="indexSamples") sampled_data_indexes: Optional[List[StrictInt]] = Field(default=None, alias="sampledDataIndexes") diff --git a/python-restclient/vcell_client/models/spatial_selection_volume.py b/python-restclient/vcell_client/models/spatial_selection_volume.py index fef784f943..2ae96f539d 100644 --- a/python-restclient/vcell_client/models/spatial_selection_volume.py +++ b/python-restclient/vcell_client/models/spatial_selection_volume.py @@ -33,7 +33,7 @@ class SpatialSelectionVolume(SpatialSelection): """ SpatialSelectionVolume """ # noqa: E501 - type: Optional[StrictStr] = 'Volume' + type: StrictStr symmetric: Optional[StrictBool] = None __properties: ClassVar[List[str]] = ["curveSelectionInfo", "varType", "type", "smallestMeshCellDimensionLength", "variableType", "closed", "point"] diff --git a/tools/openapi.yaml b/tools/openapi.yaml index d12adac9d0..2daeb461f5 100644 --- a/tools/openapi.yaml +++ b/tools/openapi.yaml @@ -3169,6 +3169,8 @@ components: Contour: '#/components/schemas/SpatialSelectionContour' Volume: '#/components/schemas/SpatialSelectionVolume' SpatialSelectionContour: + required: + - type type: object allOf: - $ref: '#/components/schemas/SpatialSelection' @@ -3209,6 +3211,8 @@ components: selectionSource: $ref: '#/components/schemas/SampledCurve' SpatialSelectionVolume: + required: + - type type: object allOf: - $ref: '#/components/schemas/SpatialSelection' diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java index eea773ea60..43cd106ef9 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionContour.java @@ -21,7 +21,7 @@ * Creation date: (7/18/2001 2:39:54 PM) * @author: Frank Morgan */ -@Schema(allOf = {SpatialSelection.class}, properties = {@SchemaProperty(name = "type", defaultValue = "Contour", type = SchemaType.STRING)}) +@Schema(allOf = {SpatialSelection.class}, requiredProperties = "type", properties = {@SchemaProperty(name = "type", defaultValue = "Contour", type = SchemaType.STRING)}) public class SpatialSelectionContour extends SpatialSelection { private int[] fieldSampledDataIndexes = null; /** diff --git a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java index e8422ebd28..73ff607862 100644 --- a/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java +++ b/vcell-core/src/main/java/cbit/vcell/simdata/SpatialSelectionVolume.java @@ -29,7 +29,7 @@ * Creation date: (7/18/2001 2:39:21 PM) * @author: Frank Morgan */ -@Schema(allOf = {SpatialSelection.class}, properties = {@SchemaProperty(name = "type", defaultValue = "Volume", type = SchemaType.STRING)}) +@Schema(allOf = {SpatialSelection.class}, requiredProperties = "type", properties = {@SchemaProperty(name = "type", defaultValue = "Volume", type = SchemaType.STRING)}) public class SpatialSelectionVolume extends SpatialSelection { public SpatialSelectionVolume(cbit.vcell.geometry.CurveSelectionInfo argCurveSelectionInfo, cbit.vcell.math.VariableType argVarType, cbit.vcell.solvers.CartesianMesh argMesh) { diff --git a/vcell-restclient/api/openapi.yaml b/vcell-restclient/api/openapi.yaml index 2148555850..2a09d75332 100644 --- a/vcell-restclient/api/openapi.yaml +++ b/vcell-restclient/api/openapi.yaml @@ -4403,6 +4403,8 @@ components: format: int32 type: integer type: array + required: + - type type: object SpatialSelectionMembrane: allOf: @@ -4430,6 +4432,8 @@ components: type: string symmetric: type: boolean + required: + - type type: object Spline: allOf: diff --git a/vcell-restclient/docs/SpatialSelectionContour.md b/vcell-restclient/docs/SpatialSelectionContour.md index b327357578..53d68c8146 100644 --- a/vcell-restclient/docs/SpatialSelectionContour.md +++ b/vcell-restclient/docs/SpatialSelectionContour.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**type** | **String** | | [optional] | +|**type** | **String** | | | |**fieldSampledDataIndexes** | **List<Integer>** | | [optional] | |**indexSamples** | **List<Integer>** | | [optional] | |**sampledDataIndexes** | **List<Integer>** | | [optional] | diff --git a/vcell-restclient/docs/SpatialSelectionVolume.md b/vcell-restclient/docs/SpatialSelectionVolume.md index b55f1e3146..3ad5db8a34 100644 --- a/vcell-restclient/docs/SpatialSelectionVolume.md +++ b/vcell-restclient/docs/SpatialSelectionVolume.md @@ -7,7 +7,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**type** | **String** | | [optional] | +|**type** | **String** | | | |**symmetric** | **Boolean** | | [optional] | diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java index f01aa99b6e..128657b3ed 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionContour.java @@ -78,9 +78,9 @@ public SpatialSelectionContour type(String type) { * Get type * @return type **/ - @javax.annotation.Nullable + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getType() { return type; @@ -88,7 +88,7 @@ public String getType() { @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setType(String type) { this.type = type; } diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java index 3c154db88c..4d5ba90898 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/SpatialSelectionVolume.java @@ -68,9 +68,9 @@ public SpatialSelectionVolume type(String type) { * Get type * @return type **/ - @javax.annotation.Nullable + @javax.annotation.Nonnull @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getType() { return type; @@ -78,7 +78,7 @@ public String getType() { @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setType(String type) { this.type = type; } diff --git a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts index dca0644d3c..f6550de307 100644 --- a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts +++ b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-contour.ts @@ -15,7 +15,7 @@ import { CurveSelectionInfo } from './curve-selection-info'; export interface SpatialSelectionContour extends SpatialSelection { - type?: string; + type: string; fieldSampledDataIndexes?: Array; indexSamples?: Array; sampledDataIndexes?: Array; diff --git a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts index a69f56efab..9233cfb186 100644 --- a/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts +++ b/webapp-ng/src/app/core/modules/openapi/model/spatial-selection-volume.ts @@ -15,7 +15,7 @@ import { CurveSelectionInfo } from './curve-selection-info'; export interface SpatialSelectionVolume extends SpatialSelection { - type?: string; + type: string; symmetric?: boolean; } From 444563db6e3b0e16e04cdfa33040da1c7b4a8d4a Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 30 Jul 2025 08:35:21 -0400 Subject: [PATCH 24/41] Proper Name of Format for Client --- .../vcell/api/messaging/LocalDataSetControllerMessaging.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java b/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java index f8b3dadd65..1194da7f3f 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java @@ -308,7 +308,7 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,ExportSpecs export // N5 export is handled by the N5ExportService try { long jobID = vCellApiClient.getExportApi().exportN5(DtoModelTransforms.n5ExportRequestFromExportSpecs(exportSpecs)); - return new ExportEvent(this, jobID, null, exportSpecs.getVCDataIdentifier(), ExportSpecss.ExportProgressType.EXPORT_START, exportSpecs.getFormat().toString(), "", 0.0, exportSpecs.getTimeSpecs(), exportSpecs.getVariableSpecs()); + return new ExportEvent(this, jobID, null, exportSpecs.getVCDataIdentifier(), ExportSpecss.ExportProgressType.EXPORT_START, exportSpecs.getFormat().name(), "", 0.0, exportSpecs.getTimeSpecs(), exportSpecs.getVariableSpecs()); } catch (ApiException e) { ExceptionHandler.onlyDataAccessOrPermissionException(e); throw new RuntimeException("Error should not reach here: " + e.getMessage(), e); From 8e9bd6c720c7d5fc634f452e9ebad0a63a72c8fb Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 30 Jul 2025 15:22:08 -0400 Subject: [PATCH 25/41] Separate Image for Export --- docker/build/build.sh | 13 ++++++ .../restq/activemq/ExportMQInterface.java | 14 +++++++ .../activemq/ExportRequestListenerMQ.java | 42 ++++++++++++++++++- .../vcell/restq/handlers/ExportResource.java | 8 +++- .../restq/services/Exports/ExportService.java | 11 ++--- .../src/main/resources/application.properties | 13 +++--- .../vcell/restq/exports/ExportServerTest.java | 13 +++--- 7 files changed, 94 insertions(+), 20 deletions(-) create mode 100644 vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java diff --git a/docker/build/build.sh b/docker/build/build.sh index f1cd4fb905..d8c30547da 100755 --- a/docker/build/build.sh +++ b/docker/build/build.sh @@ -102,6 +102,7 @@ build_api() { build_rest() { echo "building $repo/vcell-rest:$tag" echo "$SUDO_CMD docker buildx build --platform=linux/amd64 -f ../../vcell-rest/src/main/docker/Dockerfile.jvm --tag $repo/vcell-rest:$tag ../../vcell-rest" + mvn clean install -DskipTests -Dvcell.exporter=false -f ../../vcell-rest/pom.xml $SUDO_CMD docker buildx build --platform=linux/amd64 -f ../../vcell-rest/src/main/docker/Dockerfile.jvm --tag $repo/vcell-rest:$tag ../../vcell-rest if [[ $? -ne 0 ]]; then echo "docker buildx build --platform=linux/amd64 failed"; exit 1; fi if [ "$skip_push" == "false" ]; then @@ -109,6 +110,17 @@ build_rest() { fi } +build_exporter() { + echo "building $repo/vcell-rest:$tag" + echo "$SUDO_CMD docker buildx build --platform=linux/amd64 -f ../../vcell-rest/src/main/docker/Dockerfile.jvm --tag $repo/vcell-exporter:$tag ../../vcell-rest" + mvn clean install -DskipTests -Dvcell.exporter=true -f ../../vcell-rest/pom.xml + $SUDO_CMD docker buildx build --platform=linux/amd64 -f ../../vcell-rest/src/main/docker/Dockerfile.jvm --tag $repo/vcell-exporter:$tag ../../vcell-rest + if [[ $? -ne 0 ]]; then echo "docker buildx build --platform=linux/amd64 failed"; exit 1; fi + if [ "$skip_push" == "false" ]; then + $SUDO_CMD docker push $repo/vcell-exporter:$tag + fi +} + build_webapp_common() { config=$1 @@ -251,6 +263,7 @@ case $target in ;; rest) build_rest + build_exporter exit $? ;; webapp) diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java new file mode 100644 index 0000000000..57d56b03e5 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java @@ -0,0 +1,14 @@ +package org.vcell.restq.activemq; + +import com.fasterxml.jackson.core.JsonProcessingException; +import org.eclipse.microprofile.reactive.messaging.Message; +import org.vcell.restq.handlers.ExportResource; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +public interface ExportMQInterface { + void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException; + CompletionStage consumeExportRequest(Message message); + CompletableFuture startJob(ExportResource.ExportJob exportJob); +} diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index 5a10674fa7..d735846c74 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -5,12 +5,19 @@ import cbit.vcell.simdata.DataServerImpl; import cbit.vcell.simdata.DataSetControllerImpl; import cbit.vcell.simdata.OutputContext; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.arc.DefaultBean; +import io.quarkus.arc.lookup.LookupIfProperty; +import io.quarkus.arc.properties.IfBuildProperty; +import io.smallrye.mutiny.Uni; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.eclipse.microprofile.reactive.messaging.Channel; +import org.eclipse.microprofile.reactive.messaging.Emitter; import org.eclipse.microprofile.reactive.messaging.Incoming; import org.eclipse.microprofile.reactive.messaging.Message; import org.vcell.restq.db.AgroalConnectionFactory; @@ -27,8 +34,31 @@ import java.util.Map; import java.util.concurrent.*; + + +@ApplicationScoped +@IfBuildProperty(name = "vcell.exporter", stringValue = "false") +class DummyExportRequestListenerMQ implements ExportMQInterface { + + @Override + public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException { + throw new IllegalCallerException("ExportRequestListenerMQ is not enabled, cannot consume export request"); + } + + @Override + public CompletionStage consumeExportRequest(Message message) { + throw new IllegalCallerException("ExportRequestListenerMQ is not enabled, cannot consume export request"); + } + + @Override + public CompletableFuture startJob(ExportResource.ExportJob exportJob) { + throw new IllegalCallerException("ExportRequestListenerMQ is not enabled, cannot consume export request"); + } +} + @ApplicationScoped -public class ExportRequestListenerMQ { +@IfBuildProperty(name = "vcell.exporter", stringValue = "true") +public class ExportRequestListenerMQ implements ExportMQInterface { private static final Logger logger = LogManager.getLogger(ExportRequestListenerMQ.class); private final ExportResource.ExportJob[] acceptedJobs = new ExportResource.ExportJob[100]; private final ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); @@ -45,6 +75,10 @@ public class ExportRequestListenerMQ { @Inject AgroalConnectionFactory connectionFactory; + @Inject + @Channel("export-request") + Emitter exportJobEmitter; + @PostConstruct void init() throws FileNotFoundException { String primarySimDataDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, "/simdata"); @@ -53,10 +87,16 @@ void init() throws FileNotFoundException { new ExportServiceImpl()); } + public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException { + logger.debug("Export job added to queue: {} for user: {}", exportJob.id(), exportJob.user().getName()); + exportStatusCreator.addServerExportListener(exportJob.user(), exportJob.id()); + exportJobEmitter.send(mapper.writeValueAsString(exportJob)); + } @Incoming("processed-export-request") public CompletionStage consumeExportRequest(Message message) { try { + logger.debug("Received export request: {}", message.getPayload()); String exportJobJSON = message.getPayload(); ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); startJob(exportJob); diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index 7f3fd6ae47..8633cffdf0 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -10,11 +10,14 @@ import io.quarkus.security.identity.SecurityIdentity; import io.smallrye.mutiny.Multi; import jakarta.annotation.security.RolesAllowed; +import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; import org.eclipse.microprofile.openapi.annotations.Operation; import org.jboss.resteasy.reactive.RestStreamElementType; +import org.vcell.restq.activemq.ExportMQInterface; +import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.restq.errors.exceptions.*; import org.vcell.restq.services.Exports.ExportService; import org.vcell.restq.services.SimulationRestService; @@ -27,6 +30,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Map; +import java.util.Optional; import java.util.Set; @Path("/api/v1/export") @@ -39,6 +43,8 @@ public class ExportResource { @Inject ExportService exportService; @Inject + Instance exportRequestListenerMQ; + @Inject SimulationRestService simulationRestService; @Path("/history") @@ -108,7 +114,7 @@ public long createN5Export(N5ExportRequest er) throws DataAccessWebException, No try{ N5Specs n5Specs = new N5Specs(er.exportableDataType(), ExportFormat.N5, er.datasetName, er.subVolume); ExportJob exportJob = exportService.createExportJobFromRequest(user, er.standardExportInformation, n5Specs, ExportFormat.N5); - exportService.addExportJobToQueue(exportJob); + exportRequestListenerMQ.get().addExportJobToQueue(exportJob); return exportJob.id(); } catch ( JsonProcessingException e) { throw new UnprocessableContentWebException(e.getMessage(), e); diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index a4fa301689..019279b932 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -13,6 +13,7 @@ import cbit.vcell.solver.VCSimulationIdentifier; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.arc.properties.IfBuildProperty; import io.smallrye.mutiny.Multi; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -20,6 +21,7 @@ import org.apache.logging.log4j.Logger; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; +import org.eclipse.microprofile.reactive.messaging.Outgoing; import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.restq.errors.exceptions.RuntimeWebException; import org.vcell.restq.handlers.ExportResource; @@ -46,9 +48,7 @@ public class ExportService { @Inject ObjectMapper jsonMapper; - @Inject - @Channel("export-request") - Emitter exportJobEmitter; + private final static Logger lg = LogManager.getLogger(ExportService.class); @@ -66,11 +66,6 @@ public void addExportHistory(User user, ExportResource.ExportHistory history) th databaseServer.addExportHistory(user, history.exportHistory()); } - public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException { - exportStatusCreator.addServerExportListener(exportJob.user(), exportJob.id()); - exportJobEmitter.send(jsonMapper.writeValueAsString(exportJob)); - } - public Multi getExportStatuses(User user, long jobID) throws ObjectNotFoundException { return exportStatusCreator.getUsersExportStatus(user, jobID); } diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 2a7befe08d..5cc82ef75a 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -1,10 +1,8 @@ quarkus.http.port=9000 quarkus.http.cors=true #%prod.quarkus.http.cors.origins=https://vcell.cam.uchc.edu,https://vcell-dev.cam.uchc.edu,https://vcell-stage.cam.uchc.edu,https://minikube.island,https://minikube.remote,http://localhost:4200 -%prod.quarkus.http.cors.origins=/.*/ -%prod.quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS -%dev.quarkus.http.cors.origins=/.*/ -%dev.quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS +quarkus.http.cors.origins=/.*/ +quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS quarkus.log.level=INFO %dev.quarkus.log.level=TRACE @@ -149,8 +147,13 @@ quarkus.swagger-ui.always-include=true %test.mp.messaging.incoming.processed-export-request.connector=smallrye-amqp %test.mp.messaging.incoming.processed-export-request.address=export-request +%test.amqp.devservices.port=2300 +%test.quarkus.amqp.devservices.enabled=true +%test.vcell.exporter=true +quarkus.amqp.devservices.enabled=false + +vcell.exporter=false -amqp.devservices.port=2300 ## VCell properties %dev,test.vcell.softwareVersion=8.0.0 diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java index 54e573a2dd..bf722c66a6 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java @@ -12,10 +12,12 @@ import io.quarkus.test.junit.QuarkusTest; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.helpers.BlockingIterable; +import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; import jakarta.jms.JMSException; import org.junit.jupiter.api.*; import org.vcell.restq.TestEndpointUtils; +import org.vcell.restq.activemq.ExportMQInterface; import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.restq.config.CDIVCellConfigProvider; import org.vcell.restq.db.AgroalConnectionFactory; @@ -41,7 +43,7 @@ public class ExportServerTest { AgroalConnectionFactory agroalConnectionFactory; @Inject - ExportRequestListenerMQ requestListenerMQ; + Instance requestListenerMQ; @Inject ExportStatusCreator statusCreator; @Inject @@ -133,7 +135,7 @@ public void testInvalidInputException() throws Exception { CompletableFuture future = CompletableFuture.runAsync(() -> { ExportResource.ExportJob exportJob = new ExportResource.ExportJob(badJobID, TestEndpointUtils.administratorUser, new AnnotatedFunction[]{}, exportSpecs.getVCDataIdentifier(), null, null, null, null, null,"TestSim", null); - CompletableFuture job = requestListenerMQ.startJob(exportJob); + CompletableFuture job = requestListenerMQ.get().startJob(exportJob); job.exceptionally(ex -> { Assertions.assertEquals(NullPointerException.class, ex.getCause().getCause().getCause().getClass()); return null; @@ -152,8 +154,9 @@ public void testLongRunningThread() throws Exception { ExportResource.ExportJob exportJob = exportService.createExportJobFromRequest(TestEndpointUtils.administratorUser, getValidExportRequest(0, 3).standardExportInformation(), new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, "TestDataset", dummyMaskInfo), ExportFormat.N5); statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); - requestListenerMQ.setThreadWaitTimeUnit(TimeUnit.MILLISECONDS); - CompletableFuture job = requestListenerMQ.startJob(exportJob); + + ((ExportRequestListenerMQ) requestListenerMQ.get()).setThreadWaitTimeUnit(TimeUnit.MILLISECONDS); + CompletableFuture job = requestListenerMQ.get().startJob(exportJob); try{ job.join(); Assertions.fail(); @@ -161,7 +164,7 @@ public void testLongRunningThread() throws Exception { Assertions.assertEquals(TimeoutException.class, e.getCause().getCause().getClass()); } Assertions.assertTrue(job.isCompletedExceptionally()); - requestListenerMQ.setThreadWaitTimeUnit(TimeUnit.MINUTES); + ((ExportRequestListenerMQ) requestListenerMQ.get()).setThreadWaitTimeUnit(TimeUnit.MINUTES); } From 6bf0fd6044f222dc51f0cb0586b9bc604406c729 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Fri, 1 Aug 2025 10:48:51 -0400 Subject: [PATCH 26/41] Update Logging Verbosity for Test/Dev --- .../src/main/resources/application.properties | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 5cc82ef75a..82fc7eeef2 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -5,7 +5,7 @@ quarkus.http.cors.origins=/.*/ quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS quarkus.log.level=INFO -%dev.quarkus.log.level=TRACE +%dev.quarkus.log.level=DEBUG %test.quarkus.log.level=DEBUG quarkus.log.category."io.agr".level=INFO quarkus.log.category."net.java.ssl".level=INFO @@ -16,8 +16,18 @@ quarkus.log.json.fields.logger-name.enabled=true quarkus.log.json.fields.stack-trace.enabled=true quarkus.log.json.fields.hostname.enabled=true quarkus.log.json.log-format=ecs + +%test.quarkus.log.category."io.jhdf".level=ERROR +%test.quarkus.log.category."org.postgresql".level=INFO +%test.quarkus.log.category."cbit.vcell.solver".level=INFO +%test.quarkus.log.category."proton.trace".level=INFO #%dev,test.quarkus.log.json.console.enable=false +%dev.quarkus.log.category."io.jhdf".level=ERROR +%dev.quarkus.log.category."org.postgresql".level=INFO +%dev.quarkus.log.category."cbit.vcell.solver".level=INFO +%dev.quarkus.log.category."proton.trace".level=INFO + quarkus.datasource.metrics.enabled=true quarkus.datasource.jdbc.enable-metrics=true quarkus.config.log.values=true @@ -147,7 +157,7 @@ quarkus.swagger-ui.always-include=true %test.mp.messaging.incoming.processed-export-request.connector=smallrye-amqp %test.mp.messaging.incoming.processed-export-request.address=export-request -%test.amqp.devservices.port=2300 +%test.quarkus.amqp.devservices.port=2300 %test.quarkus.amqp.devservices.enabled=true %test.vcell.exporter=true quarkus.amqp.devservices.enabled=false From 33269eeab7298634425637bcdc725a97f056a461 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Fri, 1 Aug 2025 10:51:23 -0400 Subject: [PATCH 27/41] Update How Jobs are Handled --- .../restq/activemq/ExportMQInterface.java | 5 +-- .../activemq/ExportRequestListenerMQ.java | 31 ++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java index 57d56b03e5..804c9df42a 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java @@ -1,6 +1,7 @@ package org.vcell.restq.activemq; import com.fasterxml.jackson.core.JsonProcessingException; +import io.smallrye.mutiny.Uni; import org.eclipse.microprofile.reactive.messaging.Message; import org.vcell.restq.handlers.ExportResource; @@ -9,6 +10,6 @@ public interface ExportMQInterface { void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException; - CompletionStage consumeExportRequest(Message message); - CompletableFuture startJob(ExportResource.ExportJob exportJob); + Uni consumeExportRequest(Message message); + CompletableFuture startJob(Message exportJob) throws JsonProcessingException; } diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index d735846c74..653f22f8cc 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -10,6 +10,8 @@ import io.quarkus.arc.DefaultBean; import io.quarkus.arc.lookup.LookupIfProperty; import io.quarkus.arc.properties.IfBuildProperty; +import io.smallrye.common.annotation.Blocking; +import io.smallrye.common.annotation.NonBlocking; import io.smallrye.mutiny.Uni; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; @@ -46,12 +48,12 @@ public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonP } @Override - public CompletionStage consumeExportRequest(Message message) { + public Uni consumeExportRequest(Message message) { throw new IllegalCallerException("ExportRequestListenerMQ is not enabled, cannot consume export request"); } @Override - public CompletableFuture startJob(ExportResource.ExportJob exportJob) { + public CompletableFuture startJob(Message exportJob) { throw new IllegalCallerException("ExportRequestListenerMQ is not enabled, cannot consume export request"); } } @@ -60,9 +62,7 @@ public CompletableFuture startJob(ExportResource.ExportJob exportJob) { @IfBuildProperty(name = "vcell.exporter", stringValue = "true") public class ExportRequestListenerMQ implements ExportMQInterface { private static final Logger logger = LogManager.getLogger(ExportRequestListenerMQ.class); - private final ExportResource.ExportJob[] acceptedJobs = new ExportResource.ExportJob[100]; private final ExecutorService threadPoolExecutor = Executors.newFixedThreadPool(10); - private final ScheduledExecutorService canceller = Executors.newSingleThreadScheduledExecutor(); private DataServerImpl dataServer; private TimeUnit waitUnit = TimeUnit.MINUTES; @@ -94,20 +94,22 @@ public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonP } @Incoming("processed-export-request") - public CompletionStage consumeExportRequest(Message message) { + public Uni consumeExportRequest(Message message) { try { logger.debug("Received export request: {}", message.getPayload()); - String exportJobJSON = message.getPayload(); - ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); - startJob(exportJob); - return message.ack(); + return Uni.createFrom().completionStage(startJob(message)).onFailure().recoverWithUni(() -> { + logger.error("Failed to process export request: {}", message.getPayload()); + return Uni.createFrom().completionStage(message.nack(new RuntimeException("Failed to process export request"))); + }); } catch (Exception e) { logger.error(e); - return message.nack(e); + return Uni.createFrom().completionStage(message.nack(e)); } } - public CompletableFuture startJob(ExportResource.ExportJob exportJob) { + public CompletableFuture startJob(Message message) throws JsonProcessingException { + String exportJobJSON = message.getPayload(); + ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); CompletableFuture future = CompletableFuture.runAsync(() -> { try { ExportSpecs exportSpecs = getExportSpecs(exportJob); @@ -116,13 +118,14 @@ public CompletableFuture startJob(ExportResource.ExportJob exportJob) { throw new RuntimeException(e); } }, threadPoolExecutor) + .thenRun(message::ack) .orTimeout(15, waitUnit) .exceptionally(ex -> { + logger.error("Error thrown when trying to start export job", ex); exportStatusCreator.fireExportFailed(exportJob.id(), exportJob.vcdID(), exportJob.format() == null ? null : exportJob.format().toString(), ex.getMessage()); - logger.error("Error thrown when trying to start export job", ex); - throw new RuntimeException(ex); - }); + return null; + }); return future; } From 1a02940b4ad7e3678afc192a1adec84fa8b79c96 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Tue, 5 Aug 2025 10:53:57 -0400 Subject: [PATCH 28/41] Manual Test for Queue Overflow --- .../vcell/restq/exports/ManualTestExport.java | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java new file mode 100644 index 0000000000..7901339446 --- /dev/null +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java @@ -0,0 +1,78 @@ +package org.vcell.restq.exports; + +import com.nimbusds.oauth2.sdk.ParseException; +import org.vcell.restclient.ApiClient; +import org.vcell.restclient.ApiException; +import org.vcell.restclient.api.ExportResourceApi; +import org.vcell.restclient.auth.InteractiveLogin; +import org.vcell.restclient.model.*; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.Set; + +public class ManualTestExport { + public static void main(String[] args) throws URISyntaxException, IOException, ParseException, ApiException, InterruptedException { + int numOfExports = 12; + + ApiClient apiClient = InteractiveLogin.login(new URI(InteractiveLogin.authDomain), + new URI("https://minikube.remote"), true); + System.setProperty("jdk.internal.httpclient.disableHostnameVerification", "true"); + ExportResourceApi exportResourceApi = new ExportResourceApi(apiClient); + StandardExportInfo standardExportInformation = new StandardExportInfo(); + standardExportInformation.simulationJob(0); + standardExportInformation.simulationKey("264891976"); + standardExportInformation.simulationName("Frap"); + standardExportInformation.timeSpecs(new TimeSpecs() + .mode(TimeMode.RANGE) + .beginTimeIndex(0) + .endTimeIndex(1) + .allTimes(new ArrayList<>(){{add(0.0); add(0.05); add(0.1);}} )); + standardExportInformation.variableSpecs(new VariableSpecs() + .variableNames(new ArrayList<>(){{add("Dex");}}) + .mode(VariableMode.ONE) + ); + standardExportInformation.geometrySpecs(new GeometrySpecDTO().geometryMode(GeometryMode.FULL)); + + N5ExportRequest n5ExportRequest = new N5ExportRequest(); + n5ExportRequest.standardExportInformation(standardExportInformation); + n5ExportRequest.exportableDataType(ExportableDataType.PDE_VARIABLE_DATA); + n5ExportRequest.subVolume(new java.util.HashMap<>()); + + + for (int i = 0; i < numOfExports; i++) { + n5ExportRequest.datasetName("testExport_" + i); + System.out.println("Starting export " + (i + 1)); + exportResourceApi.exportN5(n5ExportRequest); + } + + while (true){ + int numOfExportsCompleted = 0; + try { + Thread.sleep(1000); + System.out.println("---------Checking export status...---------"); + Set exportStatus = exportResourceApi.exportStatus(); + for (ExportEvent exportEvent : exportStatus) { + if (exportEvent.getEventType() == ExportProgressType.COMPLETE) { + numOfExportsCompleted++; + System.out.println("Export completed: " + exportEvent.getDataIdString()); + } else if (exportEvent.getEventType() == ExportProgressType.START || exportEvent.getEventType() == ExportProgressType.PROGRESS || exportEvent.getEventType() == ExportProgressType.ASSEMBLING) { + System.out.println("Export in progress: " + exportEvent.getProgress()); + } + else if (exportEvent.getEventType() == ExportProgressType.FAILURE) { + System.err.println("Export failed: " + exportEvent.getDataKey()); + } + if (numOfExportsCompleted == numOfExports) { + System.out.println("All exports completed successfully."); + return; + } + } + } catch (ApiException e) { + System.err.println("API Exception: " + e.getMessage()); + } + } + + } +} From 92ef364fa490daa74b18d1534624a8586c2f2038 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Tue, 5 Aug 2025 10:59:10 -0400 Subject: [PATCH 29/41] Export Queue Error Handling and Jobs Update the properties for jobs submitted and how the export channel handles errors. --- .../vcell/util/document/VCDataIdentifier.java | 12 ++-- .../restq/activemq/ExportMQInterface.java | 4 +- .../activemq/ExportRequestListenerMQ.java | 67 ++++++++++++------- .../vcell/restq/handlers/ExportResource.java | 15 +---- .../restq/services/Exports/ExportService.java | 11 +-- .../vcell/restq/exports/ExportServerTest.java | 36 ++++++---- 6 files changed, 75 insertions(+), 70 deletions(-) diff --git a/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java b/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java index 040088f1b6..d2b91a3b0a 100644 --- a/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java +++ b/vcell-core/src/main/java/org/vcell/util/document/VCDataIdentifier.java @@ -29,16 +29,12 @@ @Schema( // Including One of destroys inheritance, and instead generates a factory class discriminatorMapping = { @DiscriminatorMapping(value = "VCSimulationDataIdentifier", schema = VCSimulationDataIdentifier.class), + @DiscriminatorMapping(value = "MergedDataInfo", schema = MergedDataInfo.class), + @DiscriminatorMapping(value = "VCSimulationDataIdentifierOldStyle", schema = VCSimulationDataIdentifierOldStyle.class) }, - discriminatorProperty = "type", - oneOf = {VCSimulationDataIdentifier.class, ExternalDataIdentifier.class, MergedDataInfo.class, VCSimulationDataIdentifierOldStyle.class} + discriminatorProperty = "vcDataIdentifierType", + oneOf = {VCSimulationDataIdentifier.class, MergedDataInfo.class, VCSimulationDataIdentifierOldStyle.class} ) -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - property = "type", // Discriminator field - visible = true -) -@JsonSubTypes({@JsonSubTypes.Type(value = VCSimulationDataIdentifier.class, name = "VCSimulationDataIdentifier")}) public interface VCDataIdentifier { /** * Insert the method's description here. diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java index 804c9df42a..3c7fa2f4bf 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportMQInterface.java @@ -3,13 +3,11 @@ import com.fasterxml.jackson.core.JsonProcessingException; import io.smallrye.mutiny.Uni; import org.eclipse.microprofile.reactive.messaging.Message; -import org.vcell.restq.handlers.ExportResource; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; public interface ExportMQInterface { - void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException; + void addExportJobToQueue(ExportRequestListenerMQ.ExportJob exportJob) throws JsonProcessingException; Uni consumeExportRequest(Message message); CompletableFuture startJob(Message exportJob) throws JsonProcessingException; } diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index 653f22f8cc..ae8d39f057 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -5,13 +5,12 @@ import cbit.vcell.simdata.DataServerImpl; import cbit.vcell.simdata.DataSetControllerImpl; import cbit.vcell.simdata.OutputContext; +import cbit.vcell.solver.AnnotatedFunction; +import cbit.vcell.solver.VCSimulationDataIdentifier; +import cbit.vcell.solver.VCSimulationIdentifier; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.quarkus.arc.DefaultBean; -import io.quarkus.arc.lookup.LookupIfProperty; import io.quarkus.arc.properties.IfBuildProperty; -import io.smallrye.common.annotation.Blocking; -import io.smallrye.common.annotation.NonBlocking; import io.smallrye.mutiny.Uni; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; @@ -27,12 +26,14 @@ import org.vcell.restq.services.Exports.ExportService; import org.vcell.restq.services.Exports.ExportStatusCreator; import org.vcell.util.DataAccessException; +import org.vcell.util.document.ExternalDataIdentifier; +import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; +import org.vcell.util.document.VCDataIdentifier; import java.io.File; import java.io.FileNotFoundException; import java.sql.SQLException; -import java.util.HashMap; import java.util.Map; import java.util.concurrent.*; @@ -43,7 +44,7 @@ class DummyExportRequestListenerMQ implements ExportMQInterface { @Override - public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException { + public void addExportJobToQueue(ExportRequestListenerMQ.ExportJob exportJob) throws JsonProcessingException { throw new IllegalCallerException("ExportRequestListenerMQ is not enabled, cannot consume export request"); } @@ -87,7 +88,7 @@ void init() throws FileNotFoundException { new ExportServiceImpl()); } - public void addExportJobToQueue(ExportResource.ExportJob exportJob) throws JsonProcessingException { + public void addExportJobToQueue(ExportJob exportJob) throws JsonProcessingException { logger.debug("Export job added to queue: {} for user: {}", exportJob.id(), exportJob.user().getName()); exportStatusCreator.addServerExportListener(exportJob.user(), exportJob.id()); exportJobEmitter.send(mapper.writeValueAsString(exportJob)); @@ -108,35 +109,42 @@ public Uni consumeExportRequest(Message message) { } public CompletableFuture startJob(Message message) throws JsonProcessingException { + return startJob(message, true); + } + + public CompletableFuture startJob(Message message, boolean handleFailure) throws JsonProcessingException { String exportJobJSON = message.getPayload(); - ExportResource.ExportJob exportJob = mapper.readValue(exportJobJSON, ExportResource.ExportJob.class); + ExportJob exportJob = mapper.readValue(exportJobJSON, ExportJob.class); CompletableFuture future = CompletableFuture.runAsync(() -> { - try { - ExportSpecs exportSpecs = getExportSpecs(exportJob); - ExportServiceImpl.makeRemoteFile(new OutputContext(exportJob.outputContext()), exportJob.user(), dataServer, exportSpecs, exportStatusCreator, exportJob.id()); - } catch (SQLException | DataAccessException e) { - throw new RuntimeException(e); - } - }, threadPoolExecutor) + try { + ExportSpecs exportSpecs = getExportSpecs(exportJob); + ExportServiceImpl.makeRemoteFile(new OutputContext(exportJob.outputContext()), exportJob.user(), dataServer, exportSpecs, exportStatusCreator, exportJob.id()); + } catch (SQLException | DataAccessException e) { + throw new RuntimeException(e); + } + }, threadPoolExecutor) .thenRun(message::ack) - .orTimeout(15, waitUnit) - .exceptionally(ex -> { - logger.error("Error thrown when trying to start export job", ex); - exportStatusCreator.fireExportFailed(exportJob.id(), exportJob.vcdID(), - exportJob.format() == null ? null : exportJob.format().toString(), ex.getMessage()); - return null; - }); + .orTimeout(15, waitUnit); + + if (handleFailure){ + future = future.exceptionally(ex -> { + logger.error("Error thrown when trying to start export job", ex); + exportStatusCreator.fireExportFailed(exportJob.id(), new VCSimulationDataIdentifier(exportJob.simulationIdentifier(), exportJob.simulationJob()), + exportJob.format() == null ? null : exportJob.format().toString(), ex.getMessage()); + return null; + }); + } return future; } - private ExportSpecs getExportSpecs(ExportResource.ExportJob exportJob) throws SQLException, DataAccessException { + private ExportSpecs getExportSpecs(ExportJob exportJob) throws SQLException, DataAccessException { GeometrySpecs geometrySpecs = new GeometrySpecs(exportJob.geometrySpecs().selections(), exportJob.geometrySpecs().axis(), exportJob.geometrySpecs().sliceNumber(), exportJob.geometrySpecs().geometryMode()); Map subVolume = exportJob.formatSpecificSpecs() instanceof N5Specs n5ExportRequest ? n5ExportRequest.getSubVolumeMapping() : null; HumanReadableExportData humanReadableExportData = new HumanReadableExportData(null, null, null, null, null, null, false, subVolume); - return new ExportSpecs(exportJob.vcdID(), exportJob.format(), exportJob.variableSpecs(), exportJob.timeSpecs(), + return new ExportSpecs(new VCSimulationDataIdentifier(exportJob.simulationIdentifier(), exportJob.simulationJob()), exportJob.format(), exportJob.variableSpecs(), exportJob.timeSpecs(), geometrySpecs, exportJob.formatSpecificSpecs(), exportJob.simulationName(), exportJob.contextName(), humanReadableExportData); } @@ -144,4 +152,15 @@ public void setThreadWaitTimeUnit(TimeUnit timeUnit) { waitUnit = timeUnit; } + public record ExportJob( + long id, + User user, + AnnotatedFunction[] outputContext, + VCSimulationIdentifier simulationIdentifier, + int simulationJob, + ExportFormat format, + VariableSpecs variableSpecs, TimeSpecs timeSpecs, + ExportResource.GeometrySpecDTO geometrySpecs, FormatSpecificSpecs formatSpecificSpecs, + String simulationName, String contextName + ){ } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index 8633cffdf0..db8a5724c9 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -25,12 +25,10 @@ import org.vcell.util.DataAccessException; import org.vcell.util.ObjectNotFoundException; import org.vcell.util.document.User; -import org.vcell.util.document.VCDataIdentifier; import java.sql.SQLException; import java.util.ArrayList; import java.util.Map; -import java.util.Optional; import java.util.Set; @Path("/api/v1/export") @@ -113,7 +111,7 @@ public long createN5Export(N5ExportRequest er) throws DataAccessWebException, No User user = userRestService.getUserFromIdentity(securityIdentity); try{ N5Specs n5Specs = new N5Specs(er.exportableDataType(), ExportFormat.N5, er.datasetName, er.subVolume); - ExportJob exportJob = exportService.createExportJobFromRequest(user, er.standardExportInformation, n5Specs, ExportFormat.N5); + ExportRequestListenerMQ.ExportJob exportJob = exportService.createExportJobFromRequest(user, er.standardExportInformation, n5Specs, ExportFormat.N5); exportRequestListenerMQ.get().addExportJobToQueue(exportJob); return exportJob.id(); } catch ( JsonProcessingException e) { @@ -152,17 +150,6 @@ public record ExportHistory( String exportHistory ){ } - public record ExportJob( - long id, - User user, - AnnotatedFunction[] outputContext, - VCDataIdentifier vcdID, - ExportFormat format, - VariableSpecs variableSpecs, TimeSpecs timeSpecs, - GeometrySpecDTO geometrySpecs, FormatSpecificSpecs formatSpecificSpecs, - String simulationName,String contextName - ){ } - public record GeometrySpecDTO( SpatialSelection[] selections, int axis, int sliceNumber, ExportSpecss.GeometryMode geometryMode ){ } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index 019279b932..0a28eed810 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -11,17 +11,13 @@ import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.quarkus.arc.properties.IfBuildProperty; import io.smallrye.mutiny.Multi; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.eclipse.microprofile.reactive.messaging.Channel; -import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.eclipse.microprofile.reactive.messaging.Outgoing; +import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.restq.errors.exceptions.RuntimeWebException; import org.vcell.restq.handlers.ExportResource; @@ -74,10 +70,9 @@ public Set getMostRecentExportStatus(User user) throws ObjectNotFou return exportStatusCreator.getMostRecentExportStatus(user); } - public ExportResource.ExportJob createExportJobFromRequest(User user, ExportResource.StandardExportInfo request, FormatSpecificSpecs formatSpecificSpecs, ExportFormat format) throws DataAccessException, SQLException { + public ExportRequestListenerMQ.ExportJob createExportJobFromRequest(User user, ExportResource.StandardExportInfo request, FormatSpecificSpecs formatSpecificSpecs, ExportFormat format) throws DataAccessException, SQLException { SimulationRep simulationRep = simulationRestService.getSimulationRep(new KeyValue(request.simulationKey())); VCSimulationIdentifier simulationIdentifier = new VCSimulationIdentifier(simulationRep.getKey(), simulationRep.getOwner()); - VCSimulationDataIdentifier dataIdentifier = new VCSimulationDataIdentifier(simulationIdentifier, request.simulationJob()); JobRequest newExportJob = JobRequest.createExportJobRequest(user); long exportID = newExportJob.getExportJobID(); AnnotatedFunction[] annotatedFunctions = {}; @@ -93,7 +88,7 @@ public ExportResource.ExportJob createExportJobFromRequest(User user, ExportReso } ).toArray(AnnotatedFunction[]::new); } - return new ExportResource.ExportJob(exportID, user, annotatedFunctions, dataIdentifier, format, + return new ExportRequestListenerMQ.ExportJob(exportID, user, annotatedFunctions, simulationIdentifier, request.simulationJob(), format, request.variableSpecs(), request.timeSpecs(), request.geometrySpecs(), formatSpecificSpecs, request.simulationName(), request.contextName()); } diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java index bf722c66a6..6a47f69be2 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java @@ -9,12 +9,15 @@ import cbit.vcell.solver.AnnotatedFunction; import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; import io.quarkus.test.junit.QuarkusTest; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.helpers.BlockingIterable; import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; import jakarta.jms.JMSException; +import org.eclipse.microprofile.reactive.messaging.Message; import org.junit.jupiter.api.*; import org.vcell.restq.TestEndpointUtils; import org.vcell.restq.activemq.ExportMQInterface; @@ -48,6 +51,8 @@ public class ExportServerTest { ExportStatusCreator statusCreator; @Inject ExportService exportService; + @Inject + ObjectMapper mapper; private DataServerImpl dataServer; private final String simulationID = "597714292"; @@ -133,14 +138,17 @@ public void testInvalidInputException() throws Exception { new GeometrySpecs(new SpatialSelection[]{}, 1, 1, ExportSpecss.GeometryMode.GEOMETRY_SLICE), null, "TestSim", null); Multi status = createExportListener(badExportSpecs, badJobID); CompletableFuture future = CompletableFuture.runAsync(() -> { - ExportResource.ExportJob exportJob = new ExportResource.ExportJob(badJobID, TestEndpointUtils.administratorUser, - new AnnotatedFunction[]{}, exportSpecs.getVCDataIdentifier(), null, null, null, null, null,"TestSim", null); - CompletableFuture job = requestListenerMQ.get().startJob(exportJob); - job.exceptionally(ex -> { - Assertions.assertEquals(NullPointerException.class, ex.getCause().getCause().getCause().getClass()); - return null; - }).join(); - Assertions.assertTrue(job.isCompletedExceptionally()); + VCSimulationDataIdentifier vcSimulationDataIdentifier = (VCSimulationDataIdentifier) exportSpecs.getVCDataIdentifier(); + ExportRequestListenerMQ.ExportJob exportJob = new ExportRequestListenerMQ.ExportJob(badJobID, TestEndpointUtils.administratorUser, + new AnnotatedFunction[]{}, vcSimulationDataIdentifier.getVcSimID(), vcSimulationDataIdentifier.getJobIndex(), null, null, null, null, null,"TestSim", null); + CompletableFuture job = null; + try { + job = requestListenerMQ.get().startJob(Message.of(mapper.writeValueAsString(exportJob))); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + job.join(); + Assertions.assertTrue(job.isDone()); }); BlockingIterable blockingIterable = status.subscribe().asIterable(); for (ExportEvent exportEvent : blockingIterable) { @@ -151,17 +159,17 @@ public void testInvalidInputException() throws Exception { @Test public void testLongRunningThread() throws Exception { - ExportResource.ExportJob exportJob = exportService.createExportJobFromRequest(TestEndpointUtils.administratorUser, getValidExportRequest(0, 3).standardExportInformation(), + ExportRequestListenerMQ.ExportJob exportJob = exportService.createExportJobFromRequest(TestEndpointUtils.administratorUser, getValidExportRequest(0, 3).standardExportInformation(), new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, "TestDataset", dummyMaskInfo), ExportFormat.N5); statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); ((ExportRequestListenerMQ) requestListenerMQ.get()).setThreadWaitTimeUnit(TimeUnit.MILLISECONDS); - CompletableFuture job = requestListenerMQ.get().startJob(exportJob); + CompletableFuture job = ((ExportRequestListenerMQ) requestListenerMQ.get()).startJob(Message.of(mapper.writeValueAsString(exportJob)), false); try{ job.join(); Assertions.fail(); } catch (CompletionException e) { - Assertions.assertEquals(TimeoutException.class, e.getCause().getCause().getClass()); + Assertions.assertEquals(TimeoutException.class, e.getCause().getClass()); } Assertions.assertTrue(job.isCompletedExceptionally()); ((ExportRequestListenerMQ) requestListenerMQ.get()).setThreadWaitTimeUnit(TimeUnit.MINUTES); @@ -215,8 +223,10 @@ private Multi createExportListener(ExportSpecs exportSpecs, long jo exportSpecs.setExportMetaData(new HumanReadableExportData("", "", "", new ArrayList<>(), "", "", false, dummyMaskInfo)); ExportResource.GeometrySpecDTO geometrySpecDTO = new ExportResource.GeometrySpecDTO(exportSpecs.getGeometrySpecs().getSelections(), exportSpecs.getGeometrySpecs().getAxis(), exportSpecs.getGeometrySpecs().getSliceNumber(), exportSpecs.getGeometrySpecs().getMode()); - ExportResource.ExportJob exportJob = new ExportResource.ExportJob(jobID, TestEndpointUtils.administratorUser, - new AnnotatedFunction[]{}, exportSpecs.getVCDataIdentifier(), exportSpecs.getFormat(), exportSpecs.getVariableSpecs(), exportSpecs.getTimeSpecs(), + + VCSimulationDataIdentifier vcSimulationDataIdentifier = (VCSimulationDataIdentifier) exportSpecs.getVCDataIdentifier(); + ExportRequestListenerMQ.ExportJob exportJob = new ExportRequestListenerMQ.ExportJob(jobID, TestEndpointUtils.administratorUser, + new AnnotatedFunction[]{}, vcSimulationDataIdentifier.getVcSimID(), vcSimulationDataIdentifier.getJobIndex(), exportSpecs.getFormat(), exportSpecs.getVariableSpecs(), exportSpecs.getTimeSpecs(), geometrySpecDTO, exportSpecs.getFormatSpecificSpecs(), exportSpecs.getSimulationName(), exportSpecs.getContextName()); statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); From d886f4911b0c1af545a398a07100fe76982a4c8a Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Tue, 5 Aug 2025 10:59:32 -0400 Subject: [PATCH 30/41] Everything Synchronized --- .../services/Exports/ExportStatusCreator.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java index df1711ff71..63357bbfa9 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java @@ -36,8 +36,6 @@ protected ExportSpecs exportExists(ExportSpecs exportSpecs) { } public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { - User user = jobRequestToUser.get(jobID); - String key = entryKey(user, jobID); TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); @@ -49,14 +47,18 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin }else { throw new RuntimeException("unexpected VCDataIdentifier"); } - ExportEvent event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportSpecss.ExportProgressType.EXPORT_COMPLETE, - format, location, null, timeSpecs, varSpecs); - event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); - event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); - + ExportEvent event = null; synchronized (this){ + User user = jobRequestToUser.get(jobID); + String key = entryKey(user, jobID); + + event = new ExportEvent( + this, jobID, user, vcdID.getID(), dataKey, ExportSpecss.ExportProgressType.EXPORT_COMPLETE, + format, location, null, timeSpecs, varSpecs); + event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); + event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); + if (!listeners.containsKey(key)) { throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); } @@ -103,7 +105,7 @@ public synchronized void addServerExportListener(User user, long exportJobID){ mostRecentExportEvents.get(user).add(event); } - public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { + public synchronized void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { User user = jobRequestToUser.get(jobID); ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); fireExportEvent(event); @@ -134,21 +136,21 @@ public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, St jobRequestToUser.remove(jobID); } - public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { + public synchronized void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { User user = jobRequestToUser.get(jobID); ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_PROGRESS, format, null, progress, null, null); fireExportEvent(event); } - public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { + public synchronized void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { User user = jobRequestToUser.get(jobID); ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_START, format, null, null, null, null); fireExportEvent(event); } - public void removeServerExportListener(User user, long exportJobID){ + public synchronized void removeServerExportListener(User user, long exportJobID){ listeners.remove(user.getName() + exportJobID); } @@ -156,7 +158,7 @@ private String entryKey(User user, long jobID){ return user.getName() + jobID; } - private void replaceSetEntry(User user, ExportEvent newEvent){ + private synchronized void replaceSetEntry(User user, ExportEvent newEvent){ mostRecentExportEvents.get(user).remove(newEvent); mostRecentExportEvents.get(user).add(newEvent); } From 1b83de10e3aeea8f49d91f00a791a415c1068406 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Tue, 5 Aug 2025 11:00:13 -0400 Subject: [PATCH 31/41] Specify Log Categories --- vcell-rest/src/main/resources/application.properties | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 82fc7eeef2..2053c8458c 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -12,6 +12,8 @@ quarkus.log.category."net.java.ssl".level=INFO quarkus.log.category."sun.security".level=INFO quarkus.log.category."io.smallrye.config".level=INFO quarkus.log.category."org.sbml.jsbml".level=INFO +quarkus.log.category."io.quarkus.oidc".level=INFO +quarkus.log.category."jakarta.json".level=INFO quarkus.log.json.fields.logger-name.enabled=true quarkus.log.json.fields.stack-trace.enabled=true quarkus.log.json.fields.hostname.enabled=true @@ -21,6 +23,10 @@ quarkus.log.json.log-format=ecs %test.quarkus.log.category."org.postgresql".level=INFO %test.quarkus.log.category."cbit.vcell.solver".level=INFO %test.quarkus.log.category."proton.trace".level=INFO +%test.quarkus.log.category."io.quarkus.oidc".level=INFO +%test.quarkus.log.category."jakarta.json".level=INFO +%test.quarkus.log.category."cbit.vcell.modeldb".level=INFO +%test.quarkus.log.category."jdk.internal".level=INFO #%dev,test.quarkus.log.json.console.enable=false %dev.quarkus.log.category."io.jhdf".level=ERROR From 429b8bcf58983d6bffb4063a13cf0b514e4be809 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Tue, 5 Aug 2025 13:37:22 -0400 Subject: [PATCH 32/41] Fix Python Client Generation --- .../test/test_spatial_selection_contour.py | 3 +- .../test/test_spatial_selection_membrane.py | 4 +- .../test/test_spatial_selection_volume.py | 3 +- .../test/test_vc_image_summary.py | 12 +- .../vcell_client/models/__init__.py | 6 +- .../vcell_client/models/analyzed_file.py | 122 ------------------ .../analyzed_results_from_field_data.py | 120 ----------------- .../vcell_client/models/bio_model_context.py | 120 ----------------- .../vcell_client/models/copy_field_data.py | 97 -------------- .../create_field_data_from_simulation.py | 102 --------------- .../models/field_data_save_results.py | 96 -------------- .../vcell_client/models/key_value.py | 93 ------------- .../vcell_client/models/save_bio_model.py | 116 ----------------- .../vcell_client/models/saved_results.py | 96 -------------- .../vcell_client/models/shape.py | 122 ------------------ tools/generate.sh | 2 + tools/python-fix.sh | 17 +++ 17 files changed, 38 insertions(+), 1093 deletions(-) delete mode 100644 python-restclient/vcell_client/models/analyzed_file.py delete mode 100644 python-restclient/vcell_client/models/analyzed_results_from_field_data.py delete mode 100644 python-restclient/vcell_client/models/bio_model_context.py delete mode 100644 python-restclient/vcell_client/models/copy_field_data.py delete mode 100644 python-restclient/vcell_client/models/create_field_data_from_simulation.py delete mode 100644 python-restclient/vcell_client/models/field_data_save_results.py delete mode 100644 python-restclient/vcell_client/models/key_value.py delete mode 100644 python-restclient/vcell_client/models/save_bio_model.py delete mode 100644 python-restclient/vcell_client/models/saved_results.py delete mode 100644 python-restclient/vcell_client/models/shape.py create mode 100755 tools/python-fix.sh diff --git a/python-restclient/test/test_spatial_selection_contour.py b/python-restclient/test/test_spatial_selection_contour.py index 27f1af63b7..fec10703f1 100644 --- a/python-restclient/test/test_spatial_selection_contour.py +++ b/python-restclient/test/test_spatial_selection_contour.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> SpatialSelectionContour: model = SpatialSelectionContour() if include_optional: return SpatialSelectionContour( - type = None, + type = 'Contour', field_sampled_data_indexes = [ 56 ], @@ -50,6 +50,7 @@ def make_instance(self, include_optional) -> SpatialSelectionContour: ) else: return SpatialSelectionContour( + type = 'Contour', ) """ diff --git a/python-restclient/test/test_spatial_selection_membrane.py b/python-restclient/test/test_spatial_selection_membrane.py index a1a3b91f17..6e2d97a54f 100644 --- a/python-restclient/test/test_spatial_selection_membrane.py +++ b/python-restclient/test/test_spatial_selection_membrane.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> SpatialSelectionMembrane: model = SpatialSelectionMembrane() if include_optional: return SpatialSelectionMembrane( - type = None, + type = 'Membrane', field_sampled_data_indexes = [ 56 ], @@ -51,7 +51,7 @@ def make_instance(self, include_optional) -> SpatialSelectionMembrane: ) else: return SpatialSelectionMembrane( - type = None, + type = 'Membrane', ) """ diff --git a/python-restclient/test/test_spatial_selection_volume.py b/python-restclient/test/test_spatial_selection_volume.py index ae44c7f098..3b285bdfe0 100644 --- a/python-restclient/test/test_spatial_selection_volume.py +++ b/python-restclient/test/test_spatial_selection_volume.py @@ -37,11 +37,12 @@ def make_instance(self, include_optional) -> SpatialSelectionVolume: model = SpatialSelectionVolume() if include_optional: return SpatialSelectionVolume( - type = None, + type = 'Volume', symmetric = True ) else: return SpatialSelectionVolume( + type = 'Volume', ) """ diff --git a/python-restclient/test/test_vc_image_summary.py b/python-restclient/test/test_vc_image_summary.py index 78f10e30a6..0456c37813 100644 --- a/python-restclient/test/test_vc_image_summary.py +++ b/python-restclient/test/test_vc_image_summary.py @@ -63,8 +63,16 @@ def make_instance(self, include_optional) -> VCImageSummary: name = '', owner = vcell_client.models.user.User( user_name = '', - key = '', ), ), - preview = None, + key = '', + my_specials = [ + 'admins' + ], ), ), + preview = vcell_client.models.gif_image.GIFImage( + gif_encoded_data = bytes(b'blah'), + size = vcell_client.models.i_size.ISize( + x = 56, + y = 56, + z = 56, ), ), software_version = vcell_client.models.v_cell_software_version.VCellSoftwareVersion( software_version_string = '', vcell_site = 'alpha', diff --git a/python-restclient/vcell_client/models/__init__.py b/python-restclient/vcell_client/models/__init__.py index 1069796e0a..5690747f2e 100644 --- a/python-restclient/vcell_client/models/__init__.py +++ b/python-restclient/vcell_client/models/__init__.py @@ -16,7 +16,6 @@ # import models into model package from vcell_client.models.acces_token_representation_record import AccesTokenRepresentationRecord -from vcell_client.models.analytic_curve import AnalyticCurve from vcell_client.models.annotated_function_dto import AnnotatedFunctionDTO from vcell_client.models.application_info import ApplicationInfo from vcell_client.models.batch_system_type import BatchSystemType @@ -24,8 +23,6 @@ from vcell_client.models.bio_model_child_summary import BioModelChildSummary from vcell_client.models.bio_model_summary import BioModelSummary from vcell_client.models.biomodel_ref import BiomodelRef -from vcell_client.models.composite_curve import CompositeCurve -from vcell_client.models.control_point_curve import ControlPointCurve from vcell_client.models.coordinate import Coordinate from vcell_client.models.curve import Curve from vcell_client.models.curve_selection_info import CurveSelectionInfo @@ -100,3 +97,6 @@ from vcell_client.models.variable_type import VariableType from vcell_client.models.version import Version from vcell_client.models.version_flag import VersionFlag +from vcell_client.models.analytic_curve import AnalyticCurve +from vcell_client.models.composite_curve import CompositeCurve +from vcell_client.models.control_point_curve import ControlPointCurve diff --git a/python-restclient/vcell_client/models/analyzed_file.py b/python-restclient/vcell_client/models/analyzed_file.py deleted file mode 100644 index 416b66a2f4..0000000000 --- a/python-restclient/vcell_client/models/analyzed_file.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr -from pydantic import Field -from vcell_client.models.extent import Extent -from vcell_client.models.i_size import ISize -from vcell_client.models.origin import Origin -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class AnalyzedFile(BaseModel): - """ - AnalyzedFile - """ # noqa: E501 - short_spec_data: Optional[List[List[List[StrictInt]]]] = Field(default=None, alias="shortSpecData") - double_spec_data: Optional[List[List[List[Union[StrictFloat, StrictInt]]]]] = Field(default=None, alias="doubleSpecData") - var_names: Optional[List[StrictStr]] = Field(default=None, alias="varNames") - times: Optional[List[Union[StrictFloat, StrictInt]]] = None - origin: Optional[Origin] = None - extent: Optional[Extent] = None - isize: Optional[ISize] = None - annotation: Optional[StrictStr] = None - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["shortSpecData", "doubleSpecData", "varNames", "times", "origin", "extent", "isize", "annotation", "name"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of AnalyzedFile from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of origin - if self.origin: - _dict['origin'] = self.origin.to_dict() - # override the default output from pydantic by calling `to_dict()` of extent - if self.extent: - _dict['extent'] = self.extent.to_dict() - # override the default output from pydantic by calling `to_dict()` of isize - if self.isize: - _dict['isize'] = self.isize.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of AnalyzedFile from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AnalyzedFile) in the input: " + _key) - - _obj = cls.model_validate({ - "shortSpecData": obj.get("shortSpecData"), - "doubleSpecData": obj.get("doubleSpecData"), - "varNames": obj.get("varNames"), - "times": obj.get("times"), - "origin": Origin.from_dict(obj.get("origin")) if obj.get("origin") is not None else None, - "extent": Extent.from_dict(obj.get("extent")) if obj.get("extent") is not None else None, - "isize": ISize.from_dict(obj.get("isize")) if obj.get("isize") is not None else None, - "annotation": obj.get("annotation"), - "name": obj.get("name") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/analyzed_results_from_field_data.py b/python-restclient/vcell_client/models/analyzed_results_from_field_data.py deleted file mode 100644 index 4403bd72a6..0000000000 --- a/python-restclient/vcell_client/models/analyzed_results_from_field_data.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr -from pydantic import Field -from vcell_client.models.extent import Extent -from vcell_client.models.i_size import ISize -from vcell_client.models.origin import Origin -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class AnalyzedResultsFromFieldData(BaseModel): - """ - AnalyzedResultsFromFieldData - """ # noqa: E501 - short_spec_data: Optional[List[List[List[StrictInt]]]] = Field(default=None, alias="shortSpecData") - var_names: Optional[List[StrictStr]] = Field(default=None, alias="varNames") - times: Optional[List[Union[StrictFloat, StrictInt]]] = None - origin: Optional[Origin] = None - extent: Optional[Extent] = None - isize: Optional[ISize] = None - annotation: Optional[StrictStr] = None - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["shortSpecData", "varNames", "times", "origin", "extent", "isize", "annotation", "name"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of AnalyzedResultsFromFieldData from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of origin - if self.origin: - _dict['origin'] = self.origin.to_dict() - # override the default output from pydantic by calling `to_dict()` of extent - if self.extent: - _dict['extent'] = self.extent.to_dict() - # override the default output from pydantic by calling `to_dict()` of isize - if self.isize: - _dict['isize'] = self.isize.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of AnalyzedResultsFromFieldData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in AnalyzedResultsFromFieldData) in the input: " + _key) - - _obj = cls.model_validate({ - "shortSpecData": obj.get("shortSpecData"), - "varNames": obj.get("varNames"), - "times": obj.get("times"), - "origin": Origin.from_dict(obj.get("origin")) if obj.get("origin") is not None else None, - "extent": Extent.from_dict(obj.get("extent")) if obj.get("extent") is not None else None, - "isize": ISize.from_dict(obj.get("isize")) if obj.get("isize") is not None else None, - "annotation": obj.get("annotation"), - "name": obj.get("name") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/bio_model_context.py b/python-restclient/vcell_client/models/bio_model_context.py deleted file mode 100644 index 9c57bcaebb..0000000000 --- a/python-restclient/vcell_client/models/bio_model_context.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from pydantic import Field -from vcell_client.models.bio_model_child_summary import BioModelChildSummary -from vcell_client.models.publication_info import PublicationInfo -from vcell_client.models.v_cell_software_version import VCellSoftwareVersion -from vcell_client.models.version import Version -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class BioModelContext(BaseModel): - """ - BioModelContext - """ # noqa: E501 - version: Optional[Version] = None - summary: Optional[BioModelChildSummary] = None - publication_information: Optional[List[PublicationInfo]] = Field(default=None, alias="publicationInformation") - v_cell_software_version: Optional[VCellSoftwareVersion] = Field(default=None, alias="vCellSoftwareVersion") - __properties: ClassVar[List[str]] = ["version", "summary", "publicationInformation", "vCellSoftwareVersion"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of BioModelContext from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of version - if self.version: - _dict['version'] = self.version.to_dict() - # override the default output from pydantic by calling `to_dict()` of summary - if self.summary: - _dict['summary'] = self.summary.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in publication_information (list) - _items = [] - if self.publication_information: - for _item in self.publication_information: - if _item: - _items.append(_item.to_dict()) - _dict['publicationInformation'] = _items - # override the default output from pydantic by calling `to_dict()` of v_cell_software_version - if self.v_cell_software_version: - _dict['vCellSoftwareVersion'] = self.v_cell_software_version.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of BioModelContext from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in BioModelContext) in the input: " + _key) - - _obj = cls.model_validate({ - "version": Version.from_dict(obj.get("version")) if obj.get("version") is not None else None, - "summary": BioModelChildSummary.from_dict(obj.get("summary")) if obj.get("summary") is not None else None, - "publicationInformation": [PublicationInfo.from_dict(_item) for _item in obj.get("publicationInformation")] if obj.get("publicationInformation") is not None else None, - "vCellSoftwareVersion": VCellSoftwareVersion.from_dict(obj.get("vCellSoftwareVersion")) if obj.get("vCellSoftwareVersion") is not None else None - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/copy_field_data.py b/python-restclient/vcell_client/models/copy_field_data.py deleted file mode 100644 index 37926bfec8..0000000000 --- a/python-restclient/vcell_client/models/copy_field_data.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field -from vcell_client.models.model_type import ModelType -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class CopyFieldData(BaseModel): - """ - CopyFieldData - """ # noqa: E501 - model_id: Optional[StrictStr] = Field(default=None, alias="modelID") - model_type: Optional[ModelType] = Field(default=None, alias="modelType") - __properties: ClassVar[List[str]] = ["modelID", "modelType"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of CopyFieldData from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of CopyFieldData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in CopyFieldData) in the input: " + _key) - - _obj = cls.model_validate({ - "modelID": obj.get("modelID"), - "modelType": obj.get("modelType") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/create_field_data_from_simulation.py b/python-restclient/vcell_client/models/create_field_data_from_simulation.py deleted file mode 100644 index ff6c190c15..0000000000 --- a/python-restclient/vcell_client/models/create_field_data_from_simulation.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from pydantic import Field -from vcell_client.models.key_value import KeyValue -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class CreateFieldDataFromSimulation(BaseModel): - """ - CreateFieldDataFromSimulation - """ # noqa: E501 - sim_reference: Optional[KeyValue] = Field(default=None, alias="simReference") - job_index: Optional[StrictInt] = Field(default=None, alias="jobIndex") - new_field_data_name: Optional[StrictStr] = Field(default=None, alias="newFieldDataName") - __properties: ClassVar[List[str]] = ["simReference", "jobIndex", "newFieldDataName"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of CreateFieldDataFromSimulation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of sim_reference - if self.sim_reference: - _dict['simReference'] = self.sim_reference.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of CreateFieldDataFromSimulation from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in CreateFieldDataFromSimulation) in the input: " + _key) - - _obj = cls.model_validate({ - "simReference": KeyValue.from_dict(obj.get("simReference")) if obj.get("simReference") is not None else None, - "jobIndex": obj.get("jobIndex"), - "newFieldDataName": obj.get("newFieldDataName") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/field_data_save_results.py b/python-restclient/vcell_client/models/field_data_save_results.py deleted file mode 100644 index 6c996dd60f..0000000000 --- a/python-restclient/vcell_client/models/field_data_save_results.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class FieldDataSaveResults(BaseModel): - """ - FieldDataSaveResults - """ # noqa: E501 - field_data_name: Optional[StrictStr] = Field(default=None, alias="fieldDataName") - field_data_id: Optional[StrictStr] = Field(default=None, alias="fieldDataID") - __properties: ClassVar[List[str]] = ["fieldDataName", "fieldDataID"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of FieldDataSaveResults from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of FieldDataSaveResults from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in FieldDataSaveResults) in the input: " + _key) - - _obj = cls.model_validate({ - "fieldDataName": obj.get("fieldDataName"), - "fieldDataID": obj.get("fieldDataID") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/key_value.py b/python-restclient/vcell_client/models/key_value.py deleted file mode 100644 index f26e4be0eb..0000000000 --- a/python-restclient/vcell_client/models/key_value.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class KeyValue(BaseModel): - """ - KeyValue - """ # noqa: E501 - value: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["value"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of KeyValue from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of KeyValue from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in KeyValue) in the input: " + _key) - - _obj = cls.model_validate({ - "value": obj.get("value") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/save_bio_model.py b/python-restclient/vcell_client/models/save_bio_model.py deleted file mode 100644 index 7b5b96b15a..0000000000 --- a/python-restclient/vcell_client/models/save_bio_model.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -from pydantic import Field -from typing_extensions import Annotated -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class SaveBioModel(BaseModel): - """ - SaveBioModel - """ # noqa: E501 - bio_model_xml: Annotated[str, Field(strict=True)] = Field(alias="bioModelXML") - name: Optional[StrictStr] = None - sims_requiring_updates: Optional[List[StrictStr]] = Field(default=None, alias="simsRequiringUpdates") - __properties: ClassVar[List[str]] = ["bioModelXML", "name", "simsRequiringUpdates"] - - @field_validator('bio_model_xml') - def bio_model_xml_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"\S", value): - raise ValueError(r"must validate the regular expression /\S/") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SaveBioModel from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # set to None if name (nullable) is None - # and model_fields_set contains the field - if self.name is None and "name" in self.model_fields_set: - _dict['name'] = None - - # set to None if sims_requiring_updates (nullable) is None - # and model_fields_set contains the field - if self.sims_requiring_updates is None and "sims_requiring_updates" in self.model_fields_set: - _dict['simsRequiringUpdates'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of SaveBioModel from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in SaveBioModel) in the input: " + _key) - - _obj = cls.model_validate({ - "bioModelXML": obj.get("bioModelXML"), - "name": obj.get("name"), - "simsRequiringUpdates": obj.get("simsRequiringUpdates") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/saved_results.py b/python-restclient/vcell_client/models/saved_results.py deleted file mode 100644 index cdc7217686..0000000000 --- a/python-restclient/vcell_client/models/saved_results.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class SavedResults(BaseModel): - """ - SavedResults - """ # noqa: E501 - field_data_name: Optional[StrictStr] = Field(default=None, alias="fieldDataName") - field_data_key: Optional[StrictStr] = Field(default=None, alias="fieldDataKey") - __properties: ClassVar[List[str]] = ["fieldDataName", "fieldDataKey"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SavedResults from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of SavedResults from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in SavedResults) in the input: " + _key) - - _obj = cls.model_validate({ - "fieldDataName": obj.get("fieldDataName"), - "fieldDataKey": obj.get("fieldDataKey") - }) - return _obj - - diff --git a/python-restclient/vcell_client/models/shape.py b/python-restclient/vcell_client/models/shape.py deleted file mode 100644 index 0ce36f0c06..0000000000 --- a/python-restclient/vcell_client/models/shape.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - VCell API - - VCell API - - The version of the OpenAPI document: 1.0.1 - Contact: vcell_support@uchc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt -from pydantic import Field -from vcell_client.models.data_identifier import DataIdentifier -from vcell_client.models.extent import Extent -from vcell_client.models.i_size import ISize -from vcell_client.models.origin import Origin -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class Shape(BaseModel): - """ - Shape - """ # noqa: E501 - extent: Optional[Extent] = None - origin: Optional[Origin] = None - isize: Optional[ISize] = None - data_identifier: Optional[List[DataIdentifier]] = Field(default=None, alias="dataIdentifier") - times: Optional[List[Union[StrictFloat, StrictInt]]] = None - __properties: ClassVar[List[str]] = ["extent", "origin", "isize", "dataIdentifier", "times"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of Shape from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of extent - if self.extent: - _dict['extent'] = self.extent.to_dict() - # override the default output from pydantic by calling `to_dict()` of origin - if self.origin: - _dict['origin'] = self.origin.to_dict() - # override the default output from pydantic by calling `to_dict()` of isize - if self.isize: - _dict['isize'] = self.isize.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in data_identifier (list) - _items = [] - if self.data_identifier: - for _item in self.data_identifier: - if _item: - _items.append(_item.to_dict()) - _dict['dataIdentifier'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of Shape from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - # raise errors for additional fields in the input - for _key in obj.keys(): - if _key not in cls.__properties: - raise ValueError("Error due to additional fields (not defined in Shape) in the input: " + _key) - - _obj = cls.model_validate({ - "extent": Extent.from_dict(obj.get("extent")) if obj.get("extent") is not None else None, - "origin": Origin.from_dict(obj.get("origin")) if obj.get("origin") is not None else None, - "isize": ISize.from_dict(obj.get("isize")) if obj.get("isize") is not None else None, - "dataIdentifier": [DataIdentifier.from_dict(_item) for _item in obj.get("dataIdentifier")] if obj.get("dataIdentifier") is not None else None, - "times": obj.get("times") - }) - return _obj - - diff --git a/tools/generate.sh b/tools/generate.sh index a7b1b12763..80fde3b732 100755 --- a/tools/generate.sh +++ b/tools/generate.sh @@ -38,6 +38,8 @@ ${generatorCliImage} generate \ -o /vcell/python-restclient \ -c /vcell/tools/python-config.yaml +./python-fix.sh + docker run --rm -v ${parentDir}:/vcell \ ${generatorCliImage} generate \ -g typescript-angular \ diff --git a/tools/python-fix.sh b/tools/python-fix.sh new file mode 100755 index 0000000000..4441aab046 --- /dev/null +++ b/tools/python-fix.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# This script is used to fix the generated Python REST client code + +# Order of operations matters here, so we need to ensure that the imports are correctly handled. +INIT_FILE="../python-restclient/vcell_client/models/__init__.py" + +sed -i '' '/^from vcell_client.models.analytic_curve import AnalyticCurve$/d' $INIT_FILE && \ +echo 'from vcell_client.models.analytic_curve import AnalyticCurve' >> $INIT_FILE + +sed -i '' '/^from vcell_client.models.composite_curve import CompositeCurve$/d' $INIT_FILE && \ +echo 'from vcell_client.models.composite_curve import CompositeCurve' >> $INIT_FILE + +sed -i '' '/^from vcell_client.models.control_point_curve import ControlPointCurve$/d' $INIT_FILE && \ +echo 'from vcell_client.models.control_point_curve import ControlPointCurve' >> $INIT_FILE + + From 8b6756dc593223fe1f806d3558a5dde787cae268 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Tue, 5 Aug 2025 13:51:54 -0400 Subject: [PATCH 33/41] Required Sim Files --- .../Administrator/SimID_597714292_0_.log | 5 +++++ .../Administrator/SimID_597714292_0_00.zip | Bin 0 -> 13482 bytes 2 files changed, 5 insertions(+) create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.log create mode 100644 vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_00.zip diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.log b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.log new file mode 100644 index 0000000000..a9279b347e --- /dev/null +++ b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_.log @@ -0,0 +1,5 @@ + 0 SimID_597714292_0_0000.sim SimID_597714292_0_00.zip 0 + 1 SimID_597714292_0_0001.sim SimID_597714292_0_00.zip 0.5 + 2 SimID_597714292_0_0002.sim SimID_597714292_0_00.zip 1 + 3 SimID_597714292_0_0003.sim SimID_597714292_0_00.zip 1.5 + 4 SimID_597714292_0_0004.sim SimID_597714292_0_00.zip 2 diff --git a/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_00.zip b/vcell-rest/src/test/resources/simdata/Administrator/SimID_597714292_0_00.zip new file mode 100644 index 0000000000000000000000000000000000000000..f489f7f17559b768e2b1c0c8891ad230bc7f9598 GIT binary patch literal 13482 zcmeHOdsvO>7T;w%GfauD-|nKAFfI`y!to-P5NVV_7bG;H2BArrh8d@Ezr@HjoJ5x) zx5ni-;xL&^k;bh;!;CS~7}pwR&idB7zIyt0`}ubL(aay^+0SczYrX6DuC;#a+iQQd zy+$-ro2$g1g+2qvb(nlFUfoos5?|JE?fsBh9`1oXdb_%Ib?Mf-TcC5GGyHU(8#2px zQ1Hx|4(^lZO?GgPm=&(-*4eppR|f~tQDb;@f|m)s3cU3CG ztMh}rgQtgt&GrqO88Iuk-jAXNL_?LTNuhL(0ds;U*ZV1WeIO@I9!clm`3QtE)$3_Q zo`~moCOgOALG^kJc z`{Z`|`jOj7vfQ7(vb0~m%J<9lk}S8=SC;n6SNVRqUXtZ@`pVLN`6}Np*Gsb8PG4Et zFJI;R<$6h$+vzJy`{k>y{rcMJ+Am$Ns~`Eky2{cyYP;4qp8S0J;>-8_-DEa3J)r5F zUjx|O2YD6emzA*5=U>~Np0TS^CcRg+*)hS%|E1#W*tKDHtW&icX2T!>cp`6p&7xjlG4OVodrvbD1p~9qm$!2Ej;!=Jw zFpt@`P+#!ha+KM;+UwNf(kzsHht5a+8Q~e)zj|w`p6<2Gm~~;)V*4{0%zDv|#lZ_) zndVBtuJEjuOw;9J&yuBTCX_yp?HKzT%0V;vVLzJy9V z;r!PJCwcB=R%Xj?7bY!W7J0`OmB#Pq1l^=o>esF^pIF}kR|wCa*FVmMp?&N+ z&i{kA(O-6_#aQ1{rbTjGNv8grR@o1npIx}Wol`37hkP!{rue?7#6$i+GQ<7T$Mr;i z6{p8Y{*_khKYQv2(@K7d{VVbX`xokm{S5g;{vRwRydJpU@$4lf99?>;|EM2giJu{r ze8KxylW@vsOl{-Sg)3c``j7g-miYM_@x_AbS18&4UDvwJj)vR&zEGSUyEV*?b*g&9 z>{vZ*4YOnQd?-rH+VrbG+`IqCtWDGv;T=9?)z!6J;rceS9&WKHuWaLs`f1mnp?#W<8uxFD z)B9O|ReXpyjR`q^hW_h}m@wJizLl#D6Plmwc`PoTS^akF?X)vraru85)Y}ElMEhyU z-*fyicX|A3Gp)er0@d#)%I5=$Z!qCGFsqa2_iUcOidhYHii^5#&8%$adB42z0OiFW z?L_@1V}Fi6I+4f!$eQOr`6aKv?J7Aw@g&KTUl`>xo8rqQyc5iFRKK;c zZwp*r9E18-T{dug&&_;)dJy*~wB`J_U#*P`{SkU{1@ZGO;>%oq{&UYMpBE^;vxK)6 z;wL-n{@#FrM8K}c*C9!(8h)S^l+X?{g6fcyh?oelIquq@;Qa# zn?rbgP@mxEhV~9#@R|-A2UG- zN0*-ZuQAX6K4ao1+)u>&l`xR%H=XkNZ;H=Nm%rLxr~ZTcu*knOL*gfw!=8Fj{e;^3 zt#A9f&5joB9@s0+j@=t($2wKBVRo#ZwuafUdOj2-rm;V@W?xz))3huaGE(>&R(31* zh~_? za{`aALPdBmI}cm#cr$1?6Z&j_wEX27ly6*v*#gd!7Xh;cv+G5-ZW@%_WfxW75K zx&H-PvkgB_Iy~P3z9#2K5nq5e;`u`WUyLU-m*Rt&2Jymq{3AE=e8jZn`6+;NiTryC zpP5Ad+w4dGBOBXk#|!z@$Do$s0-*_e*F*ULl(@C zBL64Z^Zx5q$ob=4D#w*%>c7s^4-hBt`OZ00;tTl0`UO%xf1vo*5ngZ3|C}`54|`z0 z*#8%gNdA>p>c73z55O-tf5r|t59F^;H1JET|FGwjPv8T_*SZQ%?Ej*=fA-}42cLDt z`;qy(#Lr#C7swyhFOBkftG4ke#xLHVlO~9~EE?ju2R{3X_vZ!ui7!w`@&4`oSjo>{ zt*_hc_~z*vSH;=UrD1lgQ*|3=$LeWom>sLb;!UChFK^FlzoQ!Wf2VR z_utm}+)W9V3Ez+1(&C#|Ot|{$O_B{fFS!!a{DWnFOvp1z{-*&v@5(h+$K`ZH*)4ZI z>H|#SI@s@C1hXdWZ+>Z?5{{&&_$077e2M{Sq->Zk&!Fj`<)5@O^Cl7 z5AW$9uWkdg1?auJ;Cx_zAq{2{5r00s_d~w+-z|~+%U7&V=96N|C-}wqU^YWMm_1K9 z_l@j%lL<$@n|EV8yoVpMfAd||rzl^W3NrxcqbEX~BL2W69>3!=p8ue9UjMVtYrrMG zVEtfL#C*amit)W9yaP-~{obVG!=X&r_vO9#C!J7svViBJaGq=4P+u|rfpdBOlN<5+ zmoMe~8*5bquEWruK^e075f3=4Jcboe2J#|t)YC{QG5`W7;iDe3GsI_F6H^?XvFgqxE1&J zyC~uU|BpdDV*e#-%>X?AhsRJq3?hDBBEB4>`lV1lM^b!|glEF*A0EN^5Y&tF<2Zaq z5c@A1K2wSPpVCYouOw6d0Z*_WjuStJ5MQ9aSicV`pT-p5X2Nqr`!hpN^M0^hiT+Ys zX+77K@Z>A?-(Knmn3;j!0gjMQ;G0`AoL}tUa)=Y;eiv;hzP?p>(7&e57s&nUD^vg7 zrG7Zf>t7D_2mY-ua-jM_T`->zKlE#AE3N1B`r^s$c>T{pKZ^VqYYnT&&vsl+EJJ-} zim`m(-%Zwkb~G?FZ>0O%GE!VeW5xgJ{_c#|i0Xdie>qv@r!RaDr$#^cca(BJ^53FY z`B?~uuF((vPF?Ot{zSFP&tdrcs2cs?^HsSY`E*_7=hydi_`zA*YeeIJh_;R4-wXrz JGEsL?`akhGw?F^@ literal 0 HcmV?d00001 From 23ebe7892f26b2ece9bc765c49ac39c4eb638e8d Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 6 Aug 2025 08:08:56 -0400 Subject: [PATCH 34/41] Remove Unused DB Files --- .../restq/services/Exports/ExportService.java | 13 +----- .../java/cbit/vcell/modeldb/DBTopLevel.java | 25 ----------- .../vcell/modeldb/DatabaseServerImpl.java | 8 ---- .../vcell/modeldb/ExportHistoryDBDriver.java | 41 ------------------- .../vcell/modeldb/ExportHistoryTable.java | 22 ---------- 5 files changed, 1 insertion(+), 108 deletions(-) delete mode 100644 vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java delete mode 100644 vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index 0a28eed810..69064141e7 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -33,8 +33,6 @@ @ApplicationScoped public class ExportService { - private final DatabaseServerImpl databaseServer; - @Inject ExportStatusCreator exportStatusCreator; @@ -44,13 +42,8 @@ public class ExportService { @Inject ObjectMapper jsonMapper; - - - private final static Logger lg = LogManager.getLogger(ExportService.class); - @Inject - public ExportService(AgroalConnectionFactory connectionFactory, ExportStatusCreator exportStatusCreator) throws DataAccessException, FileNotFoundException { - this.databaseServer = new DatabaseServerImpl(connectionFactory, connectionFactory.getKeyFactory()); + public ExportService(ExportStatusCreator exportStatusCreator) throws DataAccessException, FileNotFoundException { this.exportStatusCreator = exportStatusCreator; } @@ -58,10 +51,6 @@ public ExportResource.ExportHistory getExportHistory(User user) throws DataAcces return new ExportResource.ExportHistory("Hello"); } - public void addExportHistory(User user, ExportResource.ExportHistory history) throws DataAccessException { - databaseServer.addExportHistory(user, history.exportHistory()); - } - public Multi getExportStatuses(User user, long jobID) throws ObjectNotFoundException { return exportStatusCreator.getUsersExportStatus(user, jobID); } diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java index a85ea9d438..f00a579010 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DBTopLevel.java @@ -53,7 +53,6 @@ public class DBTopLevel extends AbstractDBTopLevel{ private final BioModelDbDriver bioModelDB; private final MathModelDbDriver mathModelDB; private final UserDbDriver userDB; - private final ExportHistoryDBDriver exportHistoryDB; // private DBCacheTable dbCacheTable = null; private static final int SQL_ERROR_CODE_BADCONNECTION = 1010; //?????????????????????????????????????? @@ -76,7 +75,6 @@ public class DBTopLevel extends AbstractDBTopLevel{ this.userDB = new UserDbDriver(); this.bioModelDB = new BioModelDbDriver(databaseSyntax,keyFactory); this.mathModelDB = new MathModelDbDriver(databaseSyntax, keyFactory); - this.exportHistoryDB = new ExportHistoryDBDriver(databaseSyntax, keyFactory); } @@ -2257,27 +2255,4 @@ public SimulationRep getSimulationRep(KeyValue simKey, boolean bEnableRetry) thr } } - public void insertExportHistory(User user, String exportHistoryValues, boolean bEnableRetry) throws SQLException, DataAccessException { - Object lock = new Object(); - Connection con = conFactory.getConnection(lock); - try { - exportHistoryDB.addExportHistory(con, user, exportHistoryValues); - } catch (Throwable e) { - lg.error(e.getMessage(),e); - try { - con.rollback(); - }catch (Throwable rbe){ - lg.error("exception during rollback, bEnableRetry = "+bEnableRetry, rbe); - } - if (bEnableRetry && isBadConnection(con)) { - conFactory.failed(con,lock); - insertExportHistory(user, exportHistoryValues, false); - }else{ - handle_DataAccessException_SQLException(e); - } - }finally{ - conFactory.release(con,lock); - } - } - } diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java index fcb2e0abca..a131f8f40c 100644 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java +++ b/vcell-server/src/main/java/cbit/vcell/modeldb/DatabaseServerImpl.java @@ -1355,12 +1355,4 @@ public BigString saveVCImageAs(User user, BigString vcImageXML, java.lang.String } } -public void addExportHistory(User user, String exportHistory) throws DataAccessException { - try { - dbTop.insertExportHistory(user, exportHistory, true); - } catch (SQLException e) { - throw new DataAccessException(e); - } -} - } diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java b/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java deleted file mode 100644 index 9e8e5a79d9..0000000000 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryDBDriver.java +++ /dev/null @@ -1,41 +0,0 @@ -package cbit.vcell.modeldb; - -import org.vcell.db.DatabaseSyntax; -import org.vcell.db.KeyFactory; -import org.vcell.util.DataAccessException; -import org.vcell.util.DependencyException; -import org.vcell.util.ObjectNotFoundException; -import org.vcell.util.PermissionException; -import org.vcell.util.document.KeyValue; -import org.vcell.util.document.User; -import org.vcell.util.document.VersionableType; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -public class ExportHistoryDBDriver{ - public static final ExportHistoryTable exportHistoryTable = ExportHistoryTable.table; - public static final BioModelTable bioModelTable = BioModelTable.table; - public static final PublicationTable publicationTable = PublicationTable.table; - public static final UserTable userTable = UserTable.table; - public static final BioModelSimulationLinkTable bioModelSimLinkTable = BioModelSimulationLinkTable.table; - public static final BioModelSimContextLinkTable bioModelSimContextLinkTable = BioModelSimContextLinkTable.table; - public static final SimulationTable simTable = SimulationTable.table; - public static final SimContextTable simContextTable = SimContextTable.table; - - /** - * LocalDBManager constructor comment. - */ - public ExportHistoryDBDriver(DatabaseSyntax dbSyntax, KeyFactory keyFactory) { - - } - - - public void addExportHistory(Connection con, User user, String values) - throws SQLException, DependencyException, PermissionException, DataAccessException, ObjectNotFoundException { - PreparedStatement statement = con.prepareStatement("INSERT INTO F VALUES (?, ?, ?, ?)"); - statement.setString(1, values); - statement.execute(); - } -} diff --git a/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java b/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java deleted file mode 100644 index ea47e63b4e..0000000000 --- a/vcell-server/src/main/java/cbit/vcell/modeldb/ExportHistoryTable.java +++ /dev/null @@ -1,22 +0,0 @@ -package cbit.vcell.modeldb; - -import cbit.sql.Field; -import cbit.sql.Table; - -public class ExportHistoryTable extends Table{ - private static final String TABLE_NAME = "vc_exporthistory"; - - public final Field modelRef = new Field("modelRef", Field.SQLDataType.integer, "NOT NULL "+ModelTable.REF_TYPE); - public final Field childSummaryLarge = new Field("childSummaryLRG", Field.SQLDataType.clob_text, ""); - public final Field childSummarySmall = new Field("childSummarySML", Field.SQLDataType.varchar2_4000, ""); - - private final Field fields[] = {modelRef,childSummaryLarge,childSummarySmall}; - - public static final ExportHistoryTable table = new ExportHistoryTable(); - - private ExportHistoryTable() { - super(TABLE_NAME); - addFields(fields); - } - -} From 32fa6f8f740cebd36f8daa3a667657385be37c5b Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 7 Aug 2025 08:34:36 -0400 Subject: [PATCH 35/41] Rename Several Classes --- ...OldAPI.java => DTOModelTransformerV0.java} | 10 +++--- .../vcell/rest/admin/AdminJobsRestlet.java | 4 +-- .../vcell/rest/events/RestEventService.java | 14 ++++----- .../org/vcell/rest/health/HealthService.java | 4 +-- .../java/org/vcell/rest/rpc/RpcRestlet.java | 6 ++-- .../org/vcell/rest/users/NewUserRestlet.java | 4 +-- .../org/vcell/api/client/VCellApiClient.java | 13 ++------ .../LocalDataSetControllerMessaging.java | 4 +-- .../RemoteProxyVCellConnectionFactory.java | 8 ++--- .../main/java/org/vcell/cli/run/RunUtils.java | 10 +++--- .../vcell/client/ClientRequestManager.java | 2 +- .../vcell/client/data/ExportSettings.java | 8 ++--- .../vcell/client/data/PDEExportDataPanel.java | 18 +++++------ .../vcell/export/gui/ASCIISettingsPanel.java | 28 ++++++++--------- .../export/gui/ExportMonitorPanelTest.java | 6 ++-- .../export/gui/ExportMonitorTableModel.java | 1 - .../vcell/export/gui/MediaSettingsPanel.java | 8 ++--- .../vcell/export/gui/N5SettingsPanel.java | 2 +- .../vcell/export/gui/RasterSettingsPanel.java | 10 +++--- .../vcell/microscopy/gui/FRAPStudyPanel.java | 8 ++--- .../gui/VirtualFrapWindowManager.java | 4 +-- .../main/java/cbit/rmi/event/ExportEvent.java | 26 ++++------------ ...reator.java => ExportEventController.java} | 2 +- .../vcell/export/server/ASCIIExporter.java | 12 +++---- .../cbit/vcell/export/server/ASCIISpecs.java | 12 +++---- ....java => ClientExportEventController.java} | 15 ++++----- .../{ExportSpecss.java => ExportEnums.java} | 2 +- .../export/server/ExportServiceImpl.java | 26 ++++++++-------- .../cbit/vcell/export/server/ExportUtils.java | 2 +- .../export/server/FormatSpecificSpecs.java | 10 ++---- .../vcell/export/server/GeometrySpecs.java | 6 ++-- .../cbit/vcell/export/server/IMGExporter.java | 31 +++++++++---------- .../cbit/vcell/export/server/ImageSpecs.java | 14 ++++----- .../cbit/vcell/export/server/MovieSpecs.java | 8 ++--- .../cbit/vcell/export/server/N5Exporter.java | 6 ++-- .../cbit/vcell/export/server/N5Specs.java | 15 ++++----- .../vcell/export/server/RasterExporter.java | 8 ++--- .../cbit/vcell/export/server/RasterSpecs.java | 6 ++-- .../cbit/vcell/export/server/TimeSpecs.java | 6 ++-- .../vcell/export/server/VariableSpecs.java | 8 ++--- .../cbit/vcell/export/N5ExporterTest.java | 10 +++--- .../activemq/ExportRequestListenerMQ.java | 17 +++------- .../vcell/restq/handlers/ExportResource.java | 4 +-- .../restq/services/Exports/ExportService.java | 9 ++---- .../org/vcell/restq/TestEndpointUtils.java | 2 ++ .../restq/exports/ExportRequestTest.java | 6 ++-- .../vcell/restq/exports/ExportServerTest.java | 26 ++++++++-------- .../restclient/utils/DtoModelTransforms.java | 11 +++---- .../bootstrap/LocalVCellConnection.java | 2 +- .../message/server/data/SimDataServer.java | 2 +- 50 files changed, 216 insertions(+), 260 deletions(-) rename vcell-api-types/src/main/java/org/vcell/api/types/utils/{DTOOldAPI.java => DTOModelTransformerV0.java} (98%) rename vcell-core/src/main/java/cbit/rmi/event/{ExportStatusEventCreator.java => ExportEventController.java} (94%) rename vcell-core/src/main/java/cbit/vcell/export/server/{OldExportEventCreator.java => ClientExportEventController.java} (87%) rename vcell-core/src/main/java/cbit/vcell/export/server/{ExportSpecss.java => ExportEnums.java} (99%) diff --git a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java similarity index 98% rename from vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java rename to vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java index 6d29f743bc..4c4612ef70 100644 --- a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOOldAPI.java +++ b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java @@ -3,7 +3,7 @@ import cbit.rmi.event.DataJobEvent; import cbit.rmi.event.ExportEvent; import cbit.rmi.event.SimulationJobStatusEvent; -import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.ExportEnums; import cbit.vcell.export.server.HumanReadableExportData; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; @@ -26,7 +26,7 @@ import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; -public class DTOOldAPI { +public class DTOModelTransformerV0 { public static DataJobEventRepresentation dataJobRepToJsonRep(DataJobEvent dataJobEvent) { int eventType = dataJobEvent.getEventTypeID(); Double progress = dataJobEvent.getProgress(); @@ -69,7 +69,7 @@ public static ExportEvent exportEventFromJsonRep(Object eventSource, ExportEvent } ExportEvent event = new ExportEvent( eventSource, rep.jobid, user, - rep.dataIdString, new KeyValue(rep.dataKey), ExportSpecss.ExportProgressType.getExportProgressType(rep.eventType), + rep.dataIdString, new KeyValue(rep.dataKey), ExportEnums.ExportProgressType.getExportProgressType(rep.eventType), rep.format, rep.location, rep.progress, timeSpecs, variableSpecs); event.setHumanReadableExportData(humanReadableExportData1); @@ -104,7 +104,7 @@ public static ExportTimeSpecs exportTimeSpecsToJsonRep(TimeSpecs timeSpecs) { } public static TimeSpecs timeSpecsFromJsonRep(ExportTimeSpecs rep) { TimeSpecs timeSpecs = new TimeSpecs(rep.beginTimeIndex, rep.endTimeIndex, rep.allTimes, - ExportSpecss.TimeMode.getTimeMode(rep.modeID)); + ExportEnums.TimeMode.getTimeMode(rep.modeID)); return timeSpecs; } @@ -115,7 +115,7 @@ public static ExportVariableSpecs variableSpecsToJsonRep(VariableSpecs variableS } public static VariableSpecs variableSpecsFromJsonRep(ExportVariableSpecs rep) { - VariableSpecs variableSpecs = new VariableSpecs(rep.variableNames, ExportSpecss.VariableMode.getVariableMode(rep.modeID)); + VariableSpecs variableSpecs = new VariableSpecs(rep.variableNames, ExportEnums.VariableMode.getVariableMode(rep.modeID)); return variableSpecs; } diff --git a/vcell-api/src/main/java/org/vcell/rest/admin/AdminJobsRestlet.java b/vcell-api/src/main/java/org/vcell/rest/admin/AdminJobsRestlet.java index 357119d65f..ff0049c533 100644 --- a/vcell-api/src/main/java/org/vcell/rest/admin/AdminJobsRestlet.java +++ b/vcell-api/src/main/java/org/vcell/rest/admin/AdminJobsRestlet.java @@ -19,7 +19,7 @@ import cbit.vcell.server.SimpleJobStatusQuerySpec; import cbit.vcell.server.SimulationJobStatus; -import org.vcell.api.types.utils.DTOOldAPI; +import org.vcell.api.types.utils.DTOModelTransformerV0; public final class AdminJobsRestlet extends Restlet { private final static Logger lg = LogManager.getLogger(AdminJobsRestlet.class); @@ -105,7 +105,7 @@ public void handle(Request req, Response response) { SimulationJobStatus[] jobStatusArray = adminService.query(querySpec); SimpleJobStatusRepresentation[] reps = new SimpleJobStatusRepresentation[jobStatusArray.length]; for (int i=0;i exportOutputs; FileDataContainerManager fileDataContainerManager = new FileDataContainerManager(); - ASCIIExporter asciiExporter = new ASCIIExporter(exportServiceImpl.getEventCreator()); + ASCIIExporter asciiExporter = new ASCIIExporter(exportServiceImpl.getEventController()); JobRequest jobRequest = JobRequest.createExportJobRequest(vcId.getOwner()); try { @@ -443,15 +443,15 @@ private static ExportSpecs getExportSpecs(OutputContext outputContext, User user VariableSpecs variableSpecs = new VariableSpecs(variableNames, VARIABLE_MULTI); double[] dataSetTimes = dsControllerImpl.getDataSetTimes(vcId); - TimeSpecs timeSpecs = new TimeSpecs(0,dataSetTimes.length-1, dataSetTimes, ExportSpecss.TimeMode.TIME_RANGE); - GeometrySpecs geometrySpecs = new GeometrySpecs(null, 2, 0, ExportSpecss.GeometryMode.GEOMETRY_FULL); + TimeSpecs timeSpecs = new TimeSpecs(0,dataSetTimes.length-1, dataSetTimes, ExportEnums.TimeMode.TIME_RANGE); + GeometrySpecs geometrySpecs = new GeometrySpecs(null, 2, 0, ExportEnums.GeometryMode.GEOMETRY_FULL); // String simulationName,VCSimulationIdentifier vcSimulationIdentifier,ExportParamScanInfo exportParamScanInfo ExportParamScanInfo exportParamScanInfo = ExportParamScanInfo.getParamScanInfo(vcellSim,jobIndex); SimNameSimDataID snsdi= new SimNameSimDataID(vcellSim.getName(), vcSimID, exportParamScanInfo); SimNameSimDataID[] simNameSimDataIDs = { snsdi }; - FormatSpecificSpecs formatSpecificSpecs = new ASCIISpecs(simNameSimDataIDs, ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, + FormatSpecificSpecs formatSpecificSpecs = new ASCIISpecs(simNameSimDataIDs, ExportEnums.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.CSV, ASCIISpecs.CsvRoiLayout.var_time_val, true, false); return new ExportSpecs(vcId, ExportFormat.HDF5, variableSpecs, timeSpecs, geometrySpecs, diff --git a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java index 99245b4cfa..295dc571ce 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java @@ -2816,7 +2816,7 @@ public void exportDocument(TopLevelWindowManager manager, FileFilter forceFilefi } public void exportMessage(ExportEvent event) { - if (event.getEventType() == ExportSpecss.ExportProgressType.EXPORT_COMPLETE) { + if (event.getEventType() == ExportEnums.ExportProgressType.EXPORT_COMPLETE) { // try to download the thing if(!Objects.equals(event.getFormat(), ExportFormat.N5.name())){ downloadExportedData(getMdiManager().getFocusedWindowManager().getComponent(), getUserPreferences(), event); diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java b/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java index 4c24831334..a43d542bdb 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/ExportSettings.java @@ -33,7 +33,7 @@ public class ExportSettings implements ASCIISettingsPanelListener, RasterSetting protected transient java.beans.PropertyChangeSupport propertyChange; private ExportFormat fieldSelectedFormat; private cbit.vcell.export.server.FormatSpecificSpecs fieldFormatSpecificSpecs = null; - private ExportSpecss.SimulationDataType fieldSimDataType = ExportSpecss.SimulationDataType.NO_DATA_AVAILABLE; + private ExportEnums.SimulationDataType fieldSimDataType = ExportEnums.SimulationDataType.NO_DATA_AVAILABLE; private JPanel ivjJDialogContentPane = null; private JDialog ivjJDialogASCIISettings = null; private JDialog ivjJDialogMediaSettings = null; @@ -370,7 +370,7 @@ public ExportFormat getSelectedFormat() { * @return The simDataType property value. * @see #setSimDataType */ -public ExportSpecss.SimulationDataType getSimDataType() { +public ExportEnums.SimulationDataType getSimDataType() { return fieldSimDataType; } @@ -573,8 +573,8 @@ public void setSelectedFormat(ExportFormat selectedFormat) { * @param simDataType The new value for the property. * @see #getSimDataType */ -public void setSimDataType(ExportSpecss.SimulationDataType simDataType) { - ExportSpecss.SimulationDataType oldValue = fieldSimDataType; +public void setSimDataType(ExportEnums.SimulationDataType simDataType) { + ExportEnums.SimulationDataType oldValue = fieldSimDataType; fieldSimDataType = simDataType; firePropertyChange("simDataType", oldValue, simDataType); } diff --git a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java index 4f6b8cbec0..16b715f228 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/client/data/PDEExportDataPanel.java @@ -502,11 +502,11 @@ private void connPtoP3SetTarget() { /** * Comment */ -public ExportSpecss.SimulationDataType dataType() { +public ExportEnums.SimulationDataType dataType() { if (getPdeDataContext().hasParticleData()) { - return ExportSpecss.SimulationDataType.PDE_SIMULATION_WITH_PARTICLES; + return ExportEnums.SimulationDataType.PDE_SIMULATION_WITH_PARTICLES; } else { - return ExportSpecss.SimulationDataType.PDE_SIMULATION_NO_PARTICLES; + return ExportEnums.SimulationDataType.PDE_SIMULATION_NO_PARTICLES; } } @@ -634,13 +634,13 @@ private ExportSpecs getExportSpecs() { for (int i = 0; i < variableSelections.length; i++){ variableNames[i] = (String)variableSelections[i]; } - VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportSpecss.VariableMode.VARIABLE_MULTI); - TimeSpecs timeSpecs = new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportSpecss.TimeMode.TIME_RANGE); - ExportSpecss.GeometryMode geoMode = ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS; + VariableSpecs variableSpecs = new VariableSpecs(variableNames, ExportEnums.VariableMode.VARIABLE_MULTI); + TimeSpecs timeSpecs = new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportEnums.TimeMode.TIME_RANGE); + ExportEnums.GeometryMode geoMode = ExportEnums.GeometryMode.GEOMETRY_SELECTIONS; if (getJRadioButtonSlice().isSelected()) { - geoMode = ExportSpecss.GeometryMode.GEOMETRY_SLICE; + geoMode = ExportEnums.GeometryMode.GEOMETRY_SLICE; } else if (getJRadioButtonFull().isSelected()) { - geoMode = ExportSpecss.GeometryMode.GEOMETRY_FULL; + geoMode = ExportEnums.GeometryMode.GEOMETRY_FULL; } Object[] selectionsArr = getROISelections().getSelectedValuesList().toArray(); SpatialSelection[] selections = new SpatialSelection[selectionsArr.length]; @@ -2083,7 +2083,7 @@ private void startExport() { PopupGenerator.showErrorDialog(this, "To export selections, you must select at least one item from the ROI selection list"); } - getExportSettings1().setTimeSpecs(new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportSpecss.TimeMode.TIME_RANGE)); + getExportSettings1().setTimeSpecs(new TimeSpecs(getJSlider1().getValue(), getJSlider2().getValue(), getPdeDataContext().getTimePoints(), ExportEnums.TimeMode.TIME_RANGE)); getExportSettings1().setDisplayPreferences(displayPreferences,Arrays.asList(variableSelections).toArray(new String[0]),viewZoom); getExportSettings1().setSliceCount(FormatSpecificSpecs.getSliceCount(getJRadioButtonFull().isSelected(), getNormalAxis(), getPdeDataContext().getCartesianMesh())); getExportSettings1().setImageSizeCalculationInfo(getPdeDataContext().getCartesianMesh(),getNormalAxis()); diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java index baef497470..ab68535a36 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ASCIISettingsPanel.java @@ -36,8 +36,8 @@ public class ASCIISettingsPanel extends javax.swing.JPanel implements java.awt.e private javax.swing.JCheckBox ivjJCheckBoxSwitch = null; private javax.swing.JLabel ivjJLabelAdditional = null; private boolean fieldSwitchRowsColumns = false; - private ExportSpecss.SimulationDataType fieldSimDataType = null; - private ExportSpecss.ExportableDataType fieldExportDataType; + private ExportEnums.SimulationDataType fieldSimDataType = null; + private ExportEnums.ExportableDataType fieldExportDataType; private javax.swing.JButton ivjCancelJButton = null; private javax.swing.JPanel ivjJPanel1 = null; /** @@ -293,7 +293,7 @@ private javax.swing.JButton getCancelJButton() { * @return The exportDataType property value. * @see #setExportDataType */ -private ExportSpecss.ExportableDataType getExportDataType() { +private ExportEnums.ExportableDataType getExportDataType() { return fieldExportDataType; } /** @@ -464,7 +464,7 @@ private javax.swing.JRadioButton getJRadioButtonVariables() { * @return The simDataType property value. * @see #setSimDataType */ -private ExportSpecss.SimulationDataType getSimDataType() { +private ExportEnums.SimulationDataType getSimDataType() { return fieldSimDataType; } /** @@ -639,8 +639,8 @@ public void propertyChange(java.beans.PropertyChangeEvent evt) { * @param odeVariableData The new value for the property. * @see #getExportDataType */ -private void setExportDataType(ExportSpecss.ExportableDataType odeVariableData) { - ExportSpecss.ExportableDataType oldValue = fieldExportDataType; +private void setExportDataType(ExportEnums.ExportableDataType odeVariableData) { + ExportEnums.ExportableDataType oldValue = fieldExportDataType; fieldExportDataType = odeVariableData; firePropertyChange("exportDataType", oldValue, odeVariableData); } @@ -649,8 +649,8 @@ private void setExportDataType(ExportSpecss.ExportableDataType odeVariableData) * @param simDataType The new value for the property. * @see #getSimDataType */ -public void setSimDataType(ExportSpecss.SimulationDataType simDataType) { - ExportSpecss.SimulationDataType oldValue = fieldSimDataType; +public void setSimDataType(ExportEnums.SimulationDataType simDataType) { + ExportEnums.SimulationDataType oldValue = fieldSimDataType; fieldSimDataType = simDataType; firePropertyChange("simDataType", oldValue, simDataType); } @@ -686,22 +686,22 @@ public void stateChanged(javax.swing.event.ChangeEvent e) { /** * Comment */ -private void updateChoices(ExportSpecss.SimulationDataType dataType) { +private void updateChoices(ExportEnums.SimulationDataType dataType) { switch (dataType) { case ODE_SIMULATION: getJRadioButtonParticles().setEnabled(false); getJRadioButtonVariables().setSelected(true); - setExportDataType(ExportSpecss.ExportableDataType.ODE_VARIABLE_DATA); + setExportDataType(ExportEnums.ExportableDataType.ODE_VARIABLE_DATA); break; case PDE_SIMULATION_NO_PARTICLES: getJRadioButtonParticles().setEnabled(false); getJRadioButtonVariables().setSelected(true); - setExportDataType(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA); + setExportDataType(ExportEnums.ExportableDataType.PDE_VARIABLE_DATA); break; case PDE_SIMULATION_WITH_PARTICLES: getJRadioButtonParticles().setEnabled(true); getJRadioButtonParticles().setSelected(true); - setExportDataType(ExportSpecss.ExportableDataType.PDE_PARTICLE_DATA); + setExportDataType(ExportEnums.ExportableDataType.PDE_PARTICLE_DATA); break; } return; @@ -710,8 +710,8 @@ private void updateChoices(ExportSpecss.SimulationDataType dataType) { * Comment */ private void updateExportDataType() { - if (getJRadioButtonVariables().isSelected()) setExportDataType(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA); - if (getJRadioButtonParticles().isSelected()) setExportDataType(ExportSpecss.ExportableDataType.PDE_PARTICLE_DATA); + if (getJRadioButtonVariables().isSelected()) setExportDataType(ExportEnums.ExportableDataType.PDE_VARIABLE_DATA); + if (getJRadioButtonParticles().isSelected()) setExportDataType(ExportEnums.ExportableDataType.PDE_PARTICLE_DATA); return; } diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java index 56ef54de72..0636b0d5b7 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java @@ -16,7 +16,7 @@ */ import javax.swing.JFrame; -import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.ExportEnums; import org.vcell.util.document.KeyValue; import cbit.rmi.event.ExportEvent; @@ -46,13 +46,13 @@ public void windowClosing(java.awt.event.WindowEvent e) { VCSimulationDataIdentifier vcSimDataId = new VCSimulationDataIdentifier(new VCSimulationIdentifier(new KeyValue("234"), null),1); aExportMonitorPanel.addExportEvent(new ExportEvent( aExportMonitorPanel, 123456789L, null, - vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportSpecss.ExportProgressType.EXPORT_PROGRESS, + vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEnums.ExportProgressType.EXPORT_PROGRESS, "CSV", "", new Double(0.47), null, null), "bogus [application: model]"); aExportMonitorPanel.addExportEvent(new ExportEvent( aExportMonitorPanel, 987654321L, null, - vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportSpecss.ExportProgressType.EXPORT_COMPLETE, + vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEnums.ExportProgressType.EXPORT_COMPLETE, "GIF", "http://nrcam.uchc.edu/export/987654321.zip", new Double(1), null, null), "simulation [application: model]"); diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java index 9ce9088988..fbed800453 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorTableModel.java @@ -17,7 +17,6 @@ import cbit.rmi.event.ExportEvent; import cbit.vcell.export.ExportStatus; -import cbit.vcell.export.server.ExportSpecss.ExportProgressType; /** * Insert the type's description here. diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java index 4bbbd91989..9c602c6395 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/MediaSettingsPanel.java @@ -445,7 +445,7 @@ public void actionPerformed(ActionEvent e) { meshMode = (scalingCombobox.getSelectedItem().equals(MESH_MODE_TEXT)?ImagePaneModel.MESH_MODE:ImagePaneModel.NORMAL_MODE); imageScale = (meshMode == ImagePaneModel.MESH_MODE?viewZoom:Integer.valueOf((String)scalingCombobox.getSelectedItem())); imageDim = FormatSpecificSpecs.getImageDimension(meshMode, imageScale, mesh, normalAxis); - imageDim = FormatSpecificSpecs.getMirrorDimension(ExportSpecss.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), imageDim.width, imageDim.height); + imageDim = FormatSpecificSpecs.getMirrorDimension(ExportEnums.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), imageDim.width, imageDim.height); imageDim.height = (bSeparate?imageDim.height:imageDim.height*variableNames.length); } String finalFileDescription = null; @@ -769,7 +769,7 @@ public FormatSpecificSpecs getSpecs() { bOverLay, displayPreferences, (encodeFormatGIF.isSelected()?ExportFormat.GIF:ExportFormat.FORMAT_JPEG), - ExportSpecss.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), + ExportEnums.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), volVarMembrOutlineThickness, imageScaling, membrScaling, @@ -783,8 +783,8 @@ public FormatSpecificSpecs getSpecs() { return new ImageSpecs( displayPreferences, mediaType, - (encodeFormatGIF.isSelected()? ExportSpecss.CompressionFormats.COMPRESSED_GIF_DEFAULT:ExportSpecss.CompressionFormats.COMPRESSED_JPEG_DEFAULT), - ExportSpecss.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), + (encodeFormatGIF.isSelected()? ExportEnums.CompressionFormats.COMPRESSED_GIF_DEFAULT: ExportEnums.CompressionFormats.COMPRESSED_JPEG_DEFAULT), + ExportEnums.MirroringMethod.getMirroringMethod(mirrorComboBox.getSelectedIndex()), duration, 0/*Infinite*/, volVarMembrOutlineThickness, diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java index c87cfc0222..793db5fe8a 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/N5SettingsPanel.java @@ -264,7 +264,7 @@ public N5Specs getN5Specs(){ int[] paramScanIndexes = simulationSelector == null ? null : simulationSelector.getselectedParamScanIndexes(); String dataSetName = getJTextFieldDataSetName().getText(); - return new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, N5Specs.CompressionLevel.GZIP, dataSetName); + return new N5Specs(ExportEnums.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, N5Specs.CompressionLevel.GZIP, dataSetName); } private JLabel lblSeeVcellHelp; diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java b/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java index 9e2e428216..14e4f57f2a 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/RasterSettingsPanel.java @@ -10,7 +10,7 @@ package cbit.vcell.export.gui; -import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.ExportEnums; import cbit.vcell.export.server.RasterSpecs; /** * This type was created in VisualAge. @@ -420,10 +420,10 @@ private javax.swing.JRadioButton getJRadioButtonSingle() { */ public RasterSpecs getRasterSpecs() { // nrrd raster format - ExportSpecss.RasterFormats format = null; - if (getJRadioButtonSingle().isSelected()) {format = ExportSpecss.RasterFormats.NRRD_SINGLE;} - if (getJRadioButtonByTime().isSelected()) {format = ExportSpecss.RasterFormats.NRRD_BY_TIME;} - if (getJRadioButtonByVariable().isSelected()) {format = ExportSpecss.RasterFormats.NRRD_BY_VARIABLE;} + ExportEnums.RasterFormats format = null; + if (getJRadioButtonSingle().isSelected()) {format = ExportEnums.RasterFormats.NRRD_SINGLE;} + if (getJRadioButtonByTime().isSelected()) {format = ExportEnums.RasterFormats.NRRD_BY_TIME;} + if (getJRadioButtonByVariable().isSelected()) {format = ExportEnums.RasterFormats.NRRD_BY_VARIABLE;} return new RasterSpecs(format, getJCheckBoxSeparateHeader().isSelected()); } /** diff --git a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java index c3a6ab084b..5184191cb0 100644 --- a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java +++ b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/FRAPStudyPanel.java @@ -127,7 +127,7 @@ import cbit.vcell.solver.SimulationModelInfo; import cbit.vcell.solver.SimulationSymbolTable; -import static cbit.vcell.export.server.ExportSpecss.VariableMode.VARIABLE_MULTI; +import static cbit.vcell.export.server.ExportEnums.VariableMode.VARIABLE_MULTI; @SuppressWarnings("serial") public class FRAPStudyPanel extends JPanel implements PropertyChangeListener{ @@ -1367,8 +1367,8 @@ public void run(Hashtable hashTable) throws Exception // int endTimeIndex = (int)Math.round(sim.getSolverTaskDescription().getTimeBounds().getEndingTime()/((UniformOutputTimeSpec)sim.getSolverTaskDescription().getOutputTimeSpec()).getOutputTimeStep()); int endTimeIndex = getFRAPSimDataViewerPanel().getOriginalDataViewer().getPdeDataContext().getTimePoints().length - 1; - TimeSpecs timeSpecs = new TimeSpecs(0, endTimeIndex, pdeDataContext.getTimePoints(), ExportSpecss.TimeMode.TIME_RANGE); - ExportSpecss.GeometryMode geoMode = ExportSpecss.GeometryMode.GEOMETRY_SLICE; + TimeSpecs timeSpecs = new TimeSpecs(0, endTimeIndex, pdeDataContext.getTimePoints(), ExportEnums.TimeMode.TIME_RANGE); + ExportEnums.GeometryMode geoMode = ExportEnums.GeometryMode.GEOMETRY_SLICE; GeometrySpecs geometrySpecs = new GeometrySpecs(null, Coordinate.Z_AXIS, 0, geoMode); double duration = 10000; //10s @@ -1383,7 +1383,7 @@ public void run(Hashtable hashTable) throws Exception true, displayPref, ExportFormat.QUICKTIME, - ExportSpecss.MirroringMethod.NO_MIRRORING, + ExportEnums.MirroringMethod.NO_MIRRORING, volVarMemOutlineThickness, imageScale, membraneScale, diff --git a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java index e3314e20c1..071d880645 100644 --- a/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java +++ b/vcell-client/src/main/java/cbit/vcell/microscopy/gui/VirtualFrapWindowManager.java @@ -150,7 +150,7 @@ public void startExport(Component requester,OutputContext outContext, ExportSpec try { ExportServiceImpl exportServiceImpl = new ExportServiceImpl(); DataServerImpl dataServerImpl = new DataServerImpl(localWorkSpace.getDataSetControllerImpl(),exportServiceImpl); - exportServiceImpl.getEventCreator().addExportListener(new ExportListener() { + exportServiceImpl.getEventController().addExportListener(new ExportListener() { public void exportMessage(ExportEvent event) { System.out.println(event.toString()); } @@ -170,7 +170,7 @@ public ExportEvent startExportMovie(ExportSpecs exportSpecs, OutputContext outpu ExportServiceImpl exportServiceImpl = new ExportServiceImpl(); DataServerImpl dataServerImpl = new DataServerImpl(localWorkSpace.getDataSetControllerImpl(),exportServiceImpl); - exportServiceImpl.getEventCreator().addExportListener(new ExportListener() { + exportServiceImpl.getEventController().addExportListener(new ExportListener() { public void exportMessage(ExportEvent event) { System.out.println(event.toString()); } diff --git a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java index feadcd02e6..26300caad0 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java @@ -10,7 +10,7 @@ package cbit.rmi.event; -import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.ExportEnums; import cbit.vcell.export.server.HumanReadableExportData; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; @@ -20,14 +20,12 @@ import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; -import java.util.Objects; - /** * This is the event class to support the cbit.vcell.desktop.controls.ExportListener interface. */ public class ExportEvent extends MessageEvent { @JsonProperty(value = "eventType") - private final ExportSpecss.ExportProgressType eventType; + private final ExportEnums.ExportProgressType eventType; @JsonProperty(value = "progress") private final Double progress; @JsonProperty(value = "format") @@ -51,7 +49,7 @@ public class ExportEvent extends MessageEvent { private HumanReadableExportData humanReadableExportData = null; public ExportEvent(Object source, long jobID, User user, - VCDataIdentifier vcDataId, ExportSpecss.ExportProgressType argEventType, + VCDataIdentifier vcDataId, ExportEnums.ExportProgressType argEventType, String format, String location, Double argProgress, TimeSpecs timeSpecs, VariableSpecs variableSpecs) { @@ -61,7 +59,7 @@ public ExportEvent(Object source, long jobID, User user, } public ExportEvent(Object source, long jobID, User user, - String dataIdString, KeyValue dataKey, ExportSpecss.ExportProgressType argEventType, + String dataIdString, KeyValue dataKey, ExportEnums.ExportProgressType argEventType, String format, String location, Double argProgress, TimeSpecs timeSpecs, VariableSpecs variableSpecs) { super(source, new MessageSource(source, dataIdString), new MessageData(argProgress)); @@ -88,7 +86,7 @@ public int getEventTypeID() { return eventType.intValue; } -public ExportSpecss.ExportProgressType getEventType() { +public ExportEnums.ExportProgressType getEventType() { return eventType; } @@ -162,7 +160,7 @@ public boolean isSupercededBy(MessageEvent messageEvent) { if (messageEvent instanceof ExportEvent){ ExportEvent exportEvent = (ExportEvent)messageEvent; - if (eventType == ExportSpecss.ExportProgressType.EXPORT_PROGRESS && exportEvent.eventType == ExportSpecss.ExportProgressType.EXPORT_PROGRESS){ + if (eventType == ExportEnums.ExportProgressType.EXPORT_PROGRESS && exportEvent.eventType == ExportEnums.ExportProgressType.EXPORT_PROGRESS){ if (getProgress() < exportEvent.getProgress()){ return true; } @@ -199,18 +197,6 @@ public String toString() { + dataIdString; } - @Override - public boolean equals(Object obj) { - if (obj instanceof ExportEvent ex){ - return ex.getJobID() == getJobID() && ex.getUser().compareEqual(getUser()); - } - return false; - } - - public int hashCode(){ - return Objects.hash(getJobID(), getUser().getName()); - } - public void setHumanReadableExportData(HumanReadableExportData humanReadableExportData){ this.humanReadableExportData = humanReadableExportData; } diff --git a/vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java b/vcell-core/src/main/java/cbit/rmi/event/ExportEventController.java similarity index 94% rename from vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java rename to vcell-core/src/main/java/cbit/rmi/event/ExportEventController.java index ce5ea1aa44..66a234d60a 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/ExportStatusEventCreator.java +++ b/vcell-core/src/main/java/cbit/rmi/event/ExportEventController.java @@ -3,7 +3,7 @@ import cbit.vcell.export.server.ExportSpecs; import org.vcell.util.document.VCDataIdentifier; -public interface ExportStatusEventCreator { +public interface ExportEventController { ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs); void addExportListener(ExportListener listener); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java index a3120121ba..ce91a7e7a8 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIIExporter.java @@ -10,7 +10,7 @@ package cbit.vcell.export.server; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import cbit.vcell.export.server.FileDataContainerManager.FileDataContainerID; import cbit.vcell.geometry.SinglePoint; import cbit.vcell.math.VariableType; @@ -44,7 +44,7 @@ public class ASCIIExporter { private final static Logger lg = LogManager.getLogger(ASCIIExporter.class); - private ExportStatusEventCreator exportServiceImpl = null; + private ExportEventController exportServiceImpl = null; /** * Insert the method's description here. @@ -52,7 +52,7 @@ public class ASCIIExporter { * * @param exportServiceImpl cbit.vcell.export.server.ExportServiceImpl */ - public ASCIIExporter(ExportStatusEventCreator exportServiceImpl){ + public ASCIIExporter(ExportEventController exportServiceImpl){ this.exportServiceImpl = exportServiceImpl; } @@ -185,7 +185,7 @@ private List exportODEData(OutputContext outputContext, long jobID SimulationDescription simulationDescription = new SimulationDescription(outputContext, user, dataServerImpl, vcdID, true, null); fileDataContainerManager.append(exportOutput.getFileDataContainerID(), simulationDescription.getHeader(dataType)); fileDataContainerManager.append(exportOutput.getFileDataContainerID(), getODEDataValues(jobID, user, dataServerImpl, vcdID, variableSpecs.getVariableNames(), timeSpecs.getBeginTimeIndex(), timeSpecs.getEndTimeIndex(), asciiSpecs.getSwitchRowsColumns(), fileDataContainerManager)); - dataID += variableSpecs.getMode() == ExportSpecss.VariableMode.VARIABLE_ONE ? variableSpecs.getVariableNames()[0] : "ManyVars"; + dataID += variableSpecs.getMode() == ExportEnums.VariableMode.VARIABLE_ONE ? variableSpecs.getVariableNames()[0] : "ManyVars"; return Arrays.asList(exportOutput); } @@ -429,7 +429,7 @@ private ExportOutput sofyaFormat(OutputContext outputContext, long jobID, User u final int SIM_COUNT = simNameSimDataIDs.length; final int PARAMSCAN_COUNT = (asciiSpecs.getExportMultipleParamScans() != null ? asciiSpecs.getExportMultipleParamScans().length : 1); final int TIME_COUNT = timeSpecs.getEndTimeIndex() - timeSpecs.getBeginTimeIndex() + 1; - if(PARAMSCAN_COUNT > 1 || geometrySpecs.getMode() != ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS/* || geometrySpecs.getCurves().length != 0*/){ + if(PARAMSCAN_COUNT > 1 || geometrySpecs.getMode() != ExportEnums.GeometryMode.GEOMETRY_SELECTIONS/* || geometrySpecs.getCurves().length != 0*/){ throw new DataAccessException("Alternate csv format cannot have parameter scans and must be 'point selection' type"); } final long MESSAGE_LIMIT = 5000;//millisecodns @@ -736,7 +736,7 @@ private List exportPDEData(OutputContext outputContext, long jobID case GEOMETRY_SLICE: case GEOMETRY_FULL:{ int sliceNumber = geometrySpecs.getSliceNumber(); - if(geometrySpecs.getMode() == ExportSpecss.GeometryMode.GEOMETRY_FULL){ + if(geometrySpecs.getMode() == ExportEnums.GeometryMode.GEOMETRY_FULL){ sliceNumber = -1; } String dataID = "_Slice_" + Coordinate.getNormalAxisPlaneName(geometrySpecs.getAxis()) + "_" + sliceNumber + "_"; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java index 8e1ac39971..dc2b68f983 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ASCIISpecs.java @@ -23,7 +23,7 @@ public class ASCIISpecs extends FormatSpecificSpecs implements Serializable { public static enum CsvRoiLayout {var_time_val,time_sim_var} private boolean switchRowsColumns; private ExportFormat format; - private ExportSpecss.ExportableDataType dataType; + private ExportEnums.ExportableDataType dataType; private SimNameSimDataID[] simNameSimDataIDs; private int[] exportMultipleParamScans; private CsvRoiLayout csvLayout; @@ -31,8 +31,8 @@ public static enum CsvRoiLayout {var_time_val,time_sim_var} /** * TextSpecs constructor comment. */ -public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, - int[] exportMultipleParamScans, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns) { +public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportEnums.ExportableDataType dataType, ExportFormat format, + int[] exportMultipleParamScans, CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns) { super("ASCIISpecs"); this.format = format; this.dataType = dataType; @@ -43,8 +43,8 @@ public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableD this.isHDF5 = isHDF5; } -public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportSpecss.ExportableDataType dataType, ExportFormat format, - CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns){ +public ASCIISpecs(SimNameSimDataID[] simNameSimDataIDs, ExportEnums.ExportableDataType dataType, ExportFormat format, + CsvRoiLayout csvLayout, boolean isHDF5, boolean switchRowsColumns){ this(simNameSimDataIDs, dataType, format, null, csvLayout, isHDF5, switchRowsColumns); } @@ -86,7 +86,7 @@ public SimNameSimDataID[] getSimNameSimDataIDs(){ * This method was created in VisualAge. * @return int */ -public ExportSpecss.ExportableDataType getDataType() { +public ExportEnums.ExportableDataType getDataType() { return dataType; } /** diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java b/vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java similarity index 87% rename from vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java rename to vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java index 51b9a44824..b65397b1eb 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/OldExportEventCreator.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java @@ -2,7 +2,7 @@ import cbit.rmi.event.ExportEvent; import cbit.rmi.event.ExportListener; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import cbit.vcell.solver.VCSimulationDataIdentifier; import org.vcell.util.document.ExternalDataIdentifier; import org.vcell.util.document.KeyValue; @@ -11,7 +11,8 @@ import java.util.Hashtable; -public class OldExportEventCreator implements ExportStatusEventCreator { +// Old implementation of ExportServiceImpl's event controller. +public class ClientExportEventController implements ExportEventController { private javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList(); private Hashtable jobRequestIDs = new Hashtable(); @@ -42,7 +43,7 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin throw new RuntimeException("unexpected VCDataIdentifier"); } ExportEvent event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportSpecss.ExportProgressType.EXPORT_COMPLETE, + this, jobID, user, vcdID.getID(), dataKey, ExportEnums.ExportProgressType.EXPORT_COMPLETE, format, location, null, timeSpecs, varSpecs); event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); fireExportEvent(event); @@ -56,7 +57,7 @@ public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String form if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); fireExportEvent(event); } @@ -80,7 +81,7 @@ public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); fireExportEvent(event); } @@ -90,7 +91,7 @@ public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_PROGRESS, format, null, new Double(progress), null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_PROGRESS, format, null, new Double(progress), null, null); fireExportEvent(event); } @@ -101,7 +102,7 @@ public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_START, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_START, format, null, null, null, null); fireExportEvent(event); } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportEnums.java similarity index 99% rename from vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java rename to vcell-core/src/main/java/cbit/vcell/export/server/ExportEnums.java index 0b643d34a9..f5c485f689 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportSpecss.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportEnums.java @@ -2,7 +2,7 @@ import org.vcell.util.document.VCDataIdentifier; -public abstract class ExportSpecss { +public abstract class ExportEnums { public record ExportRequest( VCDataIdentifier dataIdentifier, diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java index 26927caf1a..b9c0957871 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportServiceImpl.java @@ -22,7 +22,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.vcell.util.ClientTaskStatusSupport; @@ -45,10 +45,10 @@ public class ExportServiceImpl implements ExportService { public static final Logger lg = LogManager.getLogger(ExportServiceImpl.class); - private final OldExportEventCreator eventCreator = new OldExportEventCreator(); + private final ClientExportEventController eventController = new ClientExportEventController(); - public ExportStatusEventCreator getEventCreator() { - return eventCreator; + public ExportEventController getEventController() { + return eventController; } @@ -57,24 +57,24 @@ public ExportServiceImpl() { public ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs)throws DataAccessException { - return makeRemoteFile(outputContext,user, dataServerImpl, exportSpecs, eventCreator, JobRequest.createExportJobRequest(user).getExportJobID()); + return makeRemoteFile(outputContext,user, dataServerImpl, exportSpecs, eventController, JobRequest.createExportJobRequest(user).getExportJobID()); } public ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, boolean zip, ClientTaskStatusSupport clientTaskStatusSupport)throws DataAccessException { - return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, zip, clientTaskStatusSupport, JobRequest.createExportJobRequest(user).getExportJobID()); + return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventController, zip, clientTaskStatusSupport, JobRequest.createExportJobRequest(user).getExportJobID()); } -public static ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator, long jobRequestID) throws DataAccessException{ +public static ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServer, ExportSpecs exportSpecs, ExportEventController eventCreator, long jobRequestID) throws DataAccessException{ return makeRemoteFile(outputContext, user, dataServer, exportSpecs, eventCreator, true, null, jobRequestID); } -private static ExportEvent makeRemoteFile(OutputContext outputContext,User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, ExportStatusEventCreator eventCreator, boolean bSaveAsZip, ClientTaskStatusSupport clientTaskStatusSupport, long jobRequestID) throws DataAccessException { +private static ExportEvent makeRemoteFile(OutputContext outputContext, User user, DataServerImpl dataServerImpl, ExportSpecs exportSpecs, ExportEventController eventCreator, boolean bSaveAsZip, ClientTaskStatusSupport clientTaskStatusSupport, long jobRequestID) throws DataAccessException { // if export completes successfully, we return the generated event for logging if (user == null) { throw new DataAccessException("ERROR: user is null"); } JobRequest newExportJob = JobRequest.createExportJobRequest(user, jobRequestID); - if (eventCreator instanceof OldExportEventCreator evc){ + if (eventCreator instanceof ClientExportEventController evc){ evc.putJobRequest(newExportJob.getExportJobID(), user); } if (lg.isTraceEnabled()) lg.trace("ExportServiceImpl.makeRemoteFile(): " + newExportJob + ", " + exportSpecs); @@ -192,7 +192,7 @@ private static ExportEvent makeRemoteFile(OutputContext outputContext,User user, private static ExportEvent makeRemoteFile(String fileFormat, String exportBaseDir, String exportBaseURL, NrrdInfo[] nrrdInfos, ExportSpecs exportSpecs, JobRequest newExportJob, FileDataContainerManager fileDataContainerManager, - ExportStatusEventCreator eventCreator) throws DataFormatException, IOException, MalformedURLException { + ExportEventController eventCreator) throws DataFormatException, IOException, MalformedURLException { boolean exportValid = true; // check outputs and package into zip file @@ -242,7 +242,7 @@ private static ExportEvent saveResultsToRemoteFile(String fileFormat, String exp String exportBaseURL, ExportOutput[] exportOutputs, ExportSpecs exportSpecs, JobRequest newExportJob, FileDataContainerManager fileDataContainerManager, - ExportStatusEventCreator eventCreator) throws DataFormatException, IOException, MalformedURLException { + ExportEventController eventCreator) throws DataFormatException, IOException, MalformedURLException { boolean exportValid = true; eventCreator.fireExportAssembling(newExportJob.getExportJobID(), exportSpecs.getVCDataIdentifier(), fileFormat); @@ -285,7 +285,7 @@ private static ExportEvent makeRemoteFile_Unzipped(String fileFormat, String exp String exportBaseURL, ExportOutput[] exportOutputs, ExportSpecs exportSpecs, JobRequest newExportJob, FileDataContainerManager fileDataContainerManager, - ExportStatusEventCreator eventCreator) throws DataFormatException, IOException, MalformedURLException + ExportEventController eventCreator) throws DataFormatException, IOException, MalformedURLException { boolean exportValid = true; String fileNames = ""; @@ -335,7 +335,7 @@ private static ExportEvent makeRemoteFile_Unzipped(String fileFormat, String exp private static ExportEvent makeRemoteN5File(String fileFormat, String fileName, ExportOutput exportOutput, ExportSpecs exportSpecs, JobRequest newExportJob, String pathSuffix, - ExportStatusEventCreator eventCreator) throws DataFormatException, IOException{ + ExportEventController eventCreator) throws DataFormatException, IOException{ if (exportOutput.isValid()) { String url = PropertyLoader.getRequiredProperty(PropertyLoader.s3ExportBaseURLProperty); url += "/" + pathSuffix; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java b/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java index e2b30d1bab..de888a81fb 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ExportUtils.java @@ -21,7 +21,7 @@ public class ExportUtils { * @return int[] * @param pixels int[] */ -public static int[] extendMirrorPixels(int[] pixels, int width, int height, ExportSpecss.MirroringMethod mode) throws DataFormatException { +public static int[] extendMirrorPixels(int[] pixels, int width, int height, ExportEnums.MirroringMethod mode) throws DataFormatException { if (pixels.length != width * height) throw new DataFormatException("Pixel number incompatible with given width, height"); int[] mirroredPixels; switch (mode) { diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java index a922230463..12ff145109 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/FormatSpecificSpecs.java @@ -24,7 +24,6 @@ import javax.imageio.ImageWriter; import javax.imageio.stream.ImageOutputStream; -import cbit.vcell.solver.VCSimulationDataIdentifier; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -37,9 +36,6 @@ import cbit.vcell.export.gloworm.quicktime.VideoMediaSampleJPEG; import cbit.vcell.export.gloworm.quicktime.VideoMediaSampleRaw; import cbit.vcell.solvers.CartesianMesh; -import org.vcell.util.document.GroupAccessAll; -import org.vcell.util.document.GroupAccessNone; -import org.vcell.util.document.GroupAccessSome; /** * Dummy parent class. @@ -198,12 +194,12 @@ public static Dimension getImageDimension(int meshMode,int imageScale,CartesianM } @JsonIgnore - public static Dimension getMirrorDimension(ExportSpecss.MirroringMethod mirroringType,int originalWidth,int originalHeight){ + public static Dimension getMirrorDimension(ExportEnums.MirroringMethod mirroringType, int originalWidth, int originalHeight){ Dimension mirrorDim = new Dimension(originalWidth,originalHeight); - if ((mirroringType == ExportSpecss.MirroringMethod.MIRROR_LEFT) || (mirroringType == ExportSpecss.MirroringMethod.MIRROR_RIGHT)){ + if ((mirroringType == ExportEnums.MirroringMethod.MIRROR_LEFT) || (mirroringType == ExportEnums.MirroringMethod.MIRROR_RIGHT)){ mirrorDim.width = 2 * originalWidth; } - if ((mirroringType == ExportSpecss.MirroringMethod.MIRROR_TOP) || (mirroringType == ExportSpecss.MirroringMethod.MIRROR_BOTTOM)){ + if ((mirroringType == ExportEnums.MirroringMethod.MIRROR_TOP) || (mirroringType == ExportEnums.MirroringMethod.MIRROR_BOTTOM)){ mirrorDim.height = 2 * originalHeight; } return mirrorDim; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java index 58b219af82..0ccf1c7bf0 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/GeometrySpecs.java @@ -34,7 +34,7 @@ public class GeometrySpecs implements Serializable { private transient SpatialSelection[] spatialSelections = null; private final int axis; private final int sliceNumber; - private final ExportSpecss.GeometryMode modeID; + private final ExportEnums.GeometryMode modeID; /** * This method was created in VisualAge. @@ -46,7 +46,7 @@ public class GeometrySpecs implements Serializable { */ @JsonCreator - public GeometrySpecs(SpatialSelection[] selections, int axis, int sliceNumber, ExportSpecss.GeometryMode geometryMode){ + public GeometrySpecs(SpatialSelection[] selections, int axis, int sliceNumber, ExportEnums.GeometryMode geometryMode){ if(selections != null){ try { serializedSelections = new byte[selections.length][]; @@ -138,7 +138,7 @@ public SpatialSelection[] getCurves(){ } @JsonIgnore - public ExportSpecss.GeometryMode getMode(){ + public ExportEnums.GeometryMode getMode(){ return modeID; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java index 77e2faa04b..cc5b17e6f7 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/IMGExporter.java @@ -16,8 +16,7 @@ import cbit.image.DisplayAdapterService; import cbit.image.DisplayPreferences; import cbit.image.ImagePaneModel; -import cbit.rmi.event.ExportEvent; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import cbit.vcell.export.gloworm.atoms.UserDataEntry; import cbit.vcell.export.gloworm.quicktime.*; import cbit.vcell.resource.PropertyLoader; @@ -50,13 +49,13 @@ public class IMGExporter { private static final int FULL_MODE_ALL_SLICES = -1; - private ExportStatusEventCreator exportServiceImpl = null; + private ExportEventController exportServiceImpl = null; /** * Insert the method's description here. * Creation date: (4/27/2004 1:18:37 PM) * @param exportServiceImpl cbit.vcell.export.server.ExportServiceImpl */ -public IMGExporter(ExportStatusEventCreator exportServiceImpl) { +public IMGExporter(ExportEventController exportServiceImpl) { this.exportServiceImpl = exportServiceImpl; } @@ -88,13 +87,13 @@ public static void main(String [] args) throws Exception{ DataSetControllerImpl dataSetControllerImpl = new DataSetControllerImpl(cachetable,primaryDir,null); DataServerImpl dataServerImpl = new DataServerImpl(dataSetControllerImpl, exportServiceImpl); double[] allTimes = dataSetControllerImpl.getDataSetTimes(vcdID); - TimeSpecs timeSpecs = new TimeSpecs(beginTimeIndex, endTimeIndex, allTimes, ExportSpecss.TimeMode.TIME_RANGE); - VariableSpecs variableSpecs = new VariableSpecs(varNames, ExportSpecss.VariableMode.VARIABLE_MULTI); - GeometrySpecs geometrySpecs = new GeometrySpecs(null, 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SLICE); + TimeSpecs timeSpecs = new TimeSpecs(beginTimeIndex, endTimeIndex, allTimes, ExportEnums.TimeMode.TIME_RANGE); + VariableSpecs variableSpecs = new VariableSpecs(varNames, ExportEnums.VariableMode.VARIABLE_MULTI); + GeometrySpecs geometrySpecs = new GeometrySpecs(null, 0, 0, ExportEnums.GeometryMode.GEOMETRY_SLICE); DisplayPreferences displayPreferences = new DisplayPreferences(DisplayAdapterService.BLUERED, new Range(0,1), DisplayAdapterService.createBlueRedSpecialColors(),true,false); MovieSpecs movieSpecs = new MovieSpecs( - 1000.0, false, new DisplayPreferences[] {displayPreferences}, ExportFormat.FORMAT_JPEG, ExportSpecss.MirroringMethod.NO_MIRRORING, 1, 1, 1,/// + 1000.0, false, new DisplayPreferences[] {displayPreferences}, ExportFormat.FORMAT_JPEG, ExportEnums.MirroringMethod.NO_MIRRORING, 1, 1, 1,/// ImagePaneModel.MESH_MODE, FormatSpecificSpecs.CODEC_JPEG, 1.0f, false,FormatSpecificSpecs.PARTICLE_SELECT); ExportSpecs exportSpecs = new ExportSpecs(vcdID, ExportFormat.QUICKTIME, variableSpecs, timeSpecs, geometrySpecs, movieSpecs,"IMGExporterTest",null); exportServiceImpl.makeRemoteFile(null, user, dataServerImpl, exportSpecs); @@ -337,19 +336,19 @@ private File[] getParticleFiles(ExportSpecs exportSpecs,User user,DataServerImpl // return new ParticleInfo(visitSmoldynScriptTempDir); //} -private static ExportOutput[] makeMedia(ExportStatusEventCreator exportServiceImpl, - OutputContext outputContext,long jobID, User user, DataServerImpl dataServerImpl, - ExportSpecs exportSpecs,ClientTaskStatusSupport clientTaskStatusSupport,ParticleInfo particleInfo,FileDataContainerManager fileDataContainerManager) +private static ExportOutput[] makeMedia(ExportEventController exportServiceImpl, + OutputContext outputContext, long jobID, User user, DataServerImpl dataServerImpl, + ExportSpecs exportSpecs, ClientTaskStatusSupport clientTaskStatusSupport, ParticleInfo particleInfo, FileDataContainerManager fileDataContainerManager) throws RemoteException, IOException, GIFFormatException, DataAccessException, Exception { boolean bOverLay = false; int sliceIndicator = 0; if(particleInfo == null){ - sliceIndicator = (exportSpecs.getGeometrySpecs().getMode() == ExportSpecss.GeometryMode.GEOMETRY_FULL ? FULL_MODE_ALL_SLICES:exportSpecs.getGeometrySpecs().getSliceNumber()); + sliceIndicator = (exportSpecs.getGeometrySpecs().getMode() == ExportEnums.GeometryMode.GEOMETRY_FULL ? FULL_MODE_ALL_SLICES:exportSpecs.getGeometrySpecs().getSliceNumber()); } int imageScale = 0; int meshMode = 0; - ExportSpecss.MirroringMethod mirroringType = null; + ExportEnums.MirroringMethod mirroringType = null; int membraneScale = 0; double duration = 1.0; DisplayPreferences[] displayPreferences = null; @@ -607,9 +606,9 @@ public int[] getPixelsRGB(int imageScale,int membraneScaling,int meshMode,int vo }; private static MirrorInfo renderAndMirrorSliceTimePixels( - ExportRenderInfo exportRenderInfo,String varName,double timePoint,DisplayPreferences displayPreference, - int imageScale,int membraneScaling,int meshMode,int volVarMembrOutlineThickness, - int originalWidth,int originalHeight,ExportSpecss.MirroringMethod mirroringType) throws Exception{ + ExportRenderInfo exportRenderInfo, String varName, double timePoint, DisplayPreferences displayPreference, + int imageScale, int membraneScaling, int meshMode, int volVarMembrOutlineThickness, + int originalWidth, int originalHeight, ExportEnums.MirroringMethod mirroringType) throws Exception{ exportRenderInfo.setVarAndTimeAndDisplay(varName,timePoint, displayPreference); int[] pixels = exportRenderInfo.getPixelsRGB(imageScale,membraneScaling,meshMode,volVarMembrOutlineThickness); pixels = ExportUtils.extendMirrorPixels(pixels,originalWidth,originalHeight, mirroringType); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java index 2963e53774..04f7e24b2d 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ImageSpecs.java @@ -23,8 +23,8 @@ public class ImageSpecs extends FormatSpecificSpecs implements Serializable { private DisplayPreferences[] displayPreferences; private ExportFormat format; - private ExportSpecss.CompressionFormats compression; - private ExportSpecss.MirroringMethod mirroringType; + private ExportEnums.CompressionFormats compression; + private ExportEnums.MirroringMethod mirroringType; private double duration; private int loopingMode; private int volVarMembrOutlineThickness; @@ -46,9 +46,9 @@ public class ImageSpecs extends FormatSpecificSpecs implements Serializable { * @param loopingMode int */ public ImageSpecs(DisplayPreferences[] displayPreferences, ExportFormat mediaType, - ExportSpecss.CompressionFormats compression, ExportSpecss.MirroringMethod mirroringType, - double duration, int loopingMode, int volVarMembrOutlineThickness, - int imageScaling,int membraneScaling,int meshMode,float compressionQuality,boolean bOverlay,int particleMode) { + ExportEnums.CompressionFormats compression, ExportEnums.MirroringMethod mirroringType, + double duration, int loopingMode, int volVarMembrOutlineThickness, + int imageScaling, int membraneScaling, int meshMode, float compressionQuality, boolean bOverlay, int particleMode) { super("ImageSpecs"); this.displayPreferences = displayPreferences; this.format = mediaType; @@ -109,7 +109,7 @@ public boolean equals(java.lang.Object object) { * This method was created in VisualAge. * @return int */ -public ExportSpecss.CompressionFormats getCompression() { +public ExportEnums.CompressionFormats getCompression() { return compression; } /** @@ -145,7 +145,7 @@ public int getLoopingMode() { * This method was created in VisualAge. * @return int */ -public ExportSpecss.MirroringMethod getMirroringType() { +public ExportEnums.MirroringMethod getMirroringType() { return mirroringType; } /** diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java index 84f4e633f4..7d39012119 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/MovieSpecs.java @@ -25,7 +25,7 @@ public class MovieSpecs extends FormatSpecificSpecs implements Serializable { private boolean overlayMode; private DisplayPreferences[] displayPreferences; private ExportFormat encodingFormat; - private ExportSpecss.MirroringMethod mirroringType; + private ExportEnums.MirroringMethod mirroringType; private int volVarMembrOutlineThickness; private int imageScaling; private int membraneScaling; @@ -45,8 +45,8 @@ public class MovieSpecs extends FormatSpecificSpecs implements Serializable { * @param mirroring int */ public MovieSpecs(double duration, boolean overlayMode, DisplayPreferences[] displayPreferences, ExportFormat format, - ExportSpecss.MirroringMethod mirroringType, int volVarMembrOutlineThickness, - int imageScaling,int membraneScaling,int meshMode,int compressionType,float compressionQuality,boolean bQTVR,int particleMode) { + ExportEnums.MirroringMethod mirroringType, int volVarMembrOutlineThickness, + int imageScaling, int membraneScaling, int meshMode, int compressionType, float compressionQuality, boolean bQTVR, int particleMode) { super("MovieSpecs"); this.duration = duration; this.overlayMode = overlayMode; @@ -134,7 +134,7 @@ public ExportFormat getEncodingFormat() { * This method was created in VisualAge. * @return int */ -public ExportSpecss.MirroringMethod getMirroringType() { +public ExportEnums.MirroringMethod getMirroringType() { return mirroringType; } /** diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java index fb92184fbb..1fcfd79a47 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/N5Exporter.java @@ -10,7 +10,7 @@ package cbit.vcell.export.server; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import cbit.vcell.export.MeshToImage; import cbit.vcell.math.VariableType; import cbit.vcell.model.ModelUnitSystem; @@ -44,7 +44,7 @@ public class N5Exporter { private final static Logger lg = LogManager.getLogger(N5Exporter.class); - private ExportStatusEventCreator exportServiceImpl = null; + private ExportEventController exportServiceImpl = null; private DataServerImpl dataServer; @@ -65,7 +65,7 @@ public class N5Exporter { )); - public N5Exporter(ExportStatusEventCreator exportServiceImpl, User user, DataServerImpl dataServer, VCSimulationDataIdentifier vcSimulationDataIdentifier) { + public N5Exporter(ExportEventController exportServiceImpl, User user, DataServerImpl dataServer, VCSimulationDataIdentifier vcSimulationDataIdentifier) { this.exportServiceImpl = exportServiceImpl; this.user = user; this.dataServer = dataServer; diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java index 624958b88d..084963df0b 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/N5Specs.java @@ -15,12 +15,9 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.Gson; -import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; import org.eclipse.microprofile.openapi.annotations.media.Schema; -import org.eclipse.microprofile.openapi.annotations.media.SchemaProperty; import org.janelia.saalfeldlab.n5.*; import org.vcell.util.DataAccessException; -import org.vcell.util.document.GroupAccess; import java.io.FileWriter; import java.io.IOException; @@ -36,7 +33,7 @@ @Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class N5Specs extends FormatSpecificSpecs implements Serializable { private final ExportFormat formatType; - private final ExportSpecss.ExportableDataType dataType; + private final ExportEnums.ExportableDataType dataType; public Map subVolumeMapping; @JsonIgnore private final CompressionLevel compression; @@ -55,8 +52,8 @@ public static enum CompressionLevel{ /** * TextSpecs constructor comment. */ - public N5Specs(ExportSpecss.ExportableDataType dataType, ExportFormat format, - CompressionLevel compressionLevel, String dataSetName) { + public N5Specs(ExportEnums.ExportableDataType dataType, ExportFormat format, + CompressionLevel compressionLevel, String dataSetName) { super("N5"); this.formatType = format; this.dataType = dataType; @@ -66,8 +63,8 @@ public N5Specs(ExportSpecss.ExportableDataType dataType, ExportFormat format, } @JsonCreator - public N5Specs(@JsonProperty("dataType") ExportSpecss.ExportableDataType dataType, @JsonProperty("format") ExportFormat format, - @JsonProperty("dataSetName") String dataSetName, @JsonProperty("subVolumeMapping") Map subVolumeMapping) { + public N5Specs(@JsonProperty("dataType") ExportEnums.ExportableDataType dataType, @JsonProperty("format") ExportFormat format, + @JsonProperty("dataSetName") String dataSetName, @JsonProperty("subVolumeMapping") Map subVolumeMapping) { super("N5"); this.formatType = format; this.dataType = dataType; @@ -83,7 +80,7 @@ public Map getSubVolumeMapping() { * This method was created in VisualAge. * @return int */ - public ExportSpecss.ExportableDataType getDataType() { + public ExportEnums.ExportableDataType getDataType() { return dataType; } /** diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/RasterExporter.java b/vcell-core/src/main/java/cbit/vcell/export/server/RasterExporter.java index ac14213bbc..bbb60daa11 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/RasterExporter.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/RasterExporter.java @@ -37,7 +37,7 @@ import javax.imageio.ImageIO; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import org.vcell.util.Coordinate; import org.vcell.util.DataAccessException; import org.vcell.util.Extent; @@ -80,7 +80,7 @@ * @author: Ion Moraru */ public class RasterExporter { - private ExportStatusEventCreator exportServiceImpl = null; + private ExportEventController exportServiceImpl = null; private static final int VTK_HEXAHEDRON = 12; private static final int VTK_QUAD = 9; @@ -91,7 +91,7 @@ public class RasterExporter { * Creation date: (4/27/2004 1:18:37 PM) * @param exportServiceImpl cbit.vcell.export.server.ExportServiceImpl */ -public RasterExporter(ExportStatusEventCreator exportServiceImpl) { +public RasterExporter(ExportEventController exportServiceImpl) { this.exportServiceImpl = exportServiceImpl; } @@ -464,7 +464,7 @@ private NrrdInfo[] exportPDEData(OutputContext outputContext,long jobID, User us } } - private static long fireThrottledProgress(ExportStatusEventCreator exportServiceImpl,long lastUpdateTime,String message,long jobID,VCDataIdentifier vcdID,int progressIndex,int endIndex){ + private static long fireThrottledProgress(ExportEventController exportServiceImpl, long lastUpdateTime, String message, long jobID, VCDataIdentifier vcdID, int progressIndex, int endIndex){ if(lastUpdateTime == 0 || (System.currentTimeMillis() - lastUpdateTime)>5000){ lastUpdateTime = System.currentTimeMillis(); exportServiceImpl.fireExportProgress(jobID, vcdID, message,(double)(progressIndex)/(double)(endIndex+1)); diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java index f8c4c553d5..7535b6a608 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/RasterSpecs.java @@ -19,7 +19,7 @@ */ @Schema(allOf = FormatSpecificSpecs.class, requiredProperties = {"specClass"}) public class RasterSpecs extends FormatSpecificSpecs implements Serializable { - private ExportSpecss.RasterFormats format; + private ExportEnums.RasterFormats format; private boolean separateHeader; /** @@ -28,7 +28,7 @@ public class RasterSpecs extends FormatSpecificSpecs implements Serializable { * @param format int * @param separateHeader boolean */ -public RasterSpecs(ExportSpecss.RasterFormats format, boolean separateHeader) { +public RasterSpecs(ExportEnums.RasterFormats format, boolean separateHeader) { super("RasterSpecs"); this.format = format; this.separateHeader = separateHeader; @@ -59,7 +59,7 @@ public boolean equals(java.lang.Object object) { * Creation date: (4/23/2004 11:34:51 AM) * @return int */ -public ExportSpecss.RasterFormats getFormat() { +public ExportEnums.RasterFormats getFormat() { return format; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java index d3f5b6aab5..c5cfc5d79f 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/TimeSpecs.java @@ -23,13 +23,13 @@ public class TimeSpecs implements Serializable { private int endTimeIndex; private double[] allTimes; @JsonIgnore - private ExportSpecss.TimeMode modeID; + private ExportEnums.TimeMode modeID; /** * TimeSpecs constructor comment. */ @JsonCreator public TimeSpecs(@JsonProperty("beginTimeIndex") int beginTimeIndex, @JsonProperty("endTimeIndex") int endTimeIndex, - @JsonProperty("allTimes") double[] allTimes, @JsonProperty("mode") ExportSpecss.TimeMode modeID) { + @JsonProperty("allTimes") double[] allTimes, @JsonProperty("mode") ExportEnums.TimeMode modeID) { this.beginTimeIndex = beginTimeIndex; this.endTimeIndex = endTimeIndex; this.allTimes = allTimes; @@ -82,7 +82,7 @@ public int getEndTimeIndex() { return endTimeIndex; } -public ExportSpecss.TimeMode getMode(){ +public ExportEnums.TimeMode getMode(){ return modeID; } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java b/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java index 77cd2ec13b..154e35a42d 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/VariableSpecs.java @@ -22,15 +22,15 @@ public class VariableSpecs implements Serializable { private final String[] variableNames; @JsonIgnore - private final ExportSpecss.VariableMode modeID; + private final ExportEnums.VariableMode modeID; -public VariableSpecs(String[] variableNames, ExportSpecss.VariableMode modeID) { +public VariableSpecs(String[] variableNames, ExportEnums.VariableMode modeID) { this.variableNames = variableNames; this.modeID = modeID; } @JsonCreator -public VariableSpecs (@JsonProperty("variableNames") List variableNames, @JsonProperty("mode") ExportSpecss.VariableMode modeID){ +public VariableSpecs (@JsonProperty("variableNames") List variableNames, @JsonProperty("mode") ExportEnums.VariableMode modeID){ this(variableNames.toArray(new String[0]), modeID); } @@ -57,7 +57,7 @@ public boolean equals(Object object) { return false; } -public ExportSpecss.VariableMode getMode() { +public ExportEnums.VariableMode getMode() { return modeID; } diff --git a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java index 7236c2c1b9..fbf7848a89 100644 --- a/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java +++ b/vcell-core/src/test/java/cbit/vcell/export/N5ExporterTest.java @@ -177,12 +177,12 @@ public void makeN5FileWithSpecificSimulationResults(N5Specs.CompressionLevel com OutputContext outputContext = new OutputContext(new AnnotatedFunction[0]); - VariableSpecs variableSpecs = new VariableSpecs(variables.stream().map(di -> di.getName()).toList(), ExportSpecss.VariableMode.VARIABLE_MULTI); - GeometrySpecs geometrySpecs = new GeometrySpecs(new SpatialSelection[0], 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS); - N5Specs n5Specs = new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, modelID); + VariableSpecs variableSpecs = new VariableSpecs(variables.stream().map(di -> di.getName()).toList(), ExportEnums.VariableMode.VARIABLE_MULTI); + GeometrySpecs geometrySpecs = new GeometrySpecs(new SpatialSelection[0], 0, 0, ExportEnums.GeometryMode.GEOMETRY_SELECTIONS); + N5Specs n5Specs = new N5Specs(ExportEnums.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, compressionLevel, modelID); double[] allTimes = dataServer.getDataSetTimes(testUser,n5Exporter.getVcDataID()); - TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportSpecss.TimeMode.TIME_RANGE); + TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportEnums.TimeMode.TIME_RANGE); ExportSpecs exportSpecs = new ExportSpecs(n5Exporter.getVcDataID(), ExportFormat.N5, variableSpecs, timeSpecs, geometrySpecs, n5Specs, "", ""); HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; exportSpecs.setExportMetaData(new HumanReadableExportData("", "", "", new ArrayList<>(), "", "", false, dummyMaskInfo)); @@ -200,7 +200,7 @@ private void setExportTestState(TestModels simModel) throws IOException, DataAcc VCSimulationIdentifier vcSimulationIdentifier = new VCSimulationIdentifier(new KeyValue(simModel.simID), testUser); vcDataID = new VCSimulationDataIdentifier(vcSimulationIdentifier, 0); - OldExportEventCreator oldExportEventCreator = new OldExportEventCreator(); + ClientExportEventController oldExportEventCreator = new ClientExportEventController(); n5Exporter = new N5Exporter(oldExportEventCreator, testUser, dataServer, vcDataID); dataIdentifiers = new ArrayList<>(Arrays.asList(dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), testUser, vcDataID))); diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index ae8d39f057..1a3ab6376b 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -21,15 +21,10 @@ import org.eclipse.microprofile.reactive.messaging.Emitter; import org.eclipse.microprofile.reactive.messaging.Incoming; import org.eclipse.microprofile.reactive.messaging.Message; -import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.restq.handlers.ExportResource; -import org.vcell.restq.services.Exports.ExportService; -import org.vcell.restq.services.Exports.ExportStatusCreator; +import org.vcell.restq.services.Exports.ServerExportEventController; import org.vcell.util.DataAccessException; -import org.vcell.util.document.ExternalDataIdentifier; -import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; -import org.vcell.util.document.VCDataIdentifier; import java.io.File; import java.io.FileNotFoundException; @@ -68,13 +63,9 @@ public class ExportRequestListenerMQ implements ExportMQInterface { private TimeUnit waitUnit = TimeUnit.MINUTES; @Inject - ExportService exportService; - @Inject - ExportStatusCreator exportStatusCreator; + ServerExportEventController exportStatusCreator; @Inject ObjectMapper mapper; - @Inject - AgroalConnectionFactory connectionFactory; @Inject @Channel("export-request") @@ -82,8 +73,8 @@ public class ExportRequestListenerMQ implements ExportMQInterface { @PostConstruct void init() throws FileNotFoundException { - String primarySimDataDir = PropertyLoader.getProperty(PropertyLoader.primarySimDataDirInternalProperty, "/simdata"); - String secondarySimDataDir = PropertyLoader.getProperty(PropertyLoader.secondarySimDataDirInternalProperty, "/simdata"); + String primarySimDataDir = PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirInternalProperty); + String secondarySimDataDir = PropertyLoader.getRequiredProperty(PropertyLoader.secondarySimDataDirInternalProperty); this.dataServer = new DataServerImpl(new DataSetControllerImpl(null, new File(primarySimDataDir), new File(secondarySimDataDir)), new ExportServiceImpl()); } diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index db8a5724c9..efa3834f82 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -126,7 +126,7 @@ public long createN5Export(N5ExportRequest er) throws DataAccessWebException, No public record N5ExportRequest( StandardExportInfo standardExportInformation, Map subVolume, - ExportSpecss.ExportableDataType exportableDataType, + ExportEnums.ExportableDataType exportableDataType, String datasetName ){ } @@ -151,6 +151,6 @@ public record ExportHistory( ){ } public record GeometrySpecDTO( - SpatialSelection[] selections, int axis, int sliceNumber, ExportSpecss.GeometryMode geometryMode + SpatialSelection[] selections, int axis, int sliceNumber, ExportEnums.GeometryMode geometryMode ){ } } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index 69064141e7..258a67d661 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -4,21 +4,16 @@ import cbit.vcell.export.server.ExportFormat; import cbit.vcell.export.server.FormatSpecificSpecs; import cbit.vcell.export.server.JobRequest; -import cbit.vcell.modeldb.DatabaseServerImpl; import cbit.vcell.modeldb.SimulationRep; import cbit.vcell.parser.Expression; import cbit.vcell.parser.ExpressionException; import cbit.vcell.solver.AnnotatedFunction; -import cbit.vcell.solver.VCSimulationDataIdentifier; import cbit.vcell.solver.VCSimulationIdentifier; import com.fasterxml.jackson.databind.ObjectMapper; import io.smallrye.mutiny.Multi; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.vcell.restq.activemq.ExportRequestListenerMQ; -import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.restq.errors.exceptions.RuntimeWebException; import org.vcell.restq.handlers.ExportResource; import org.vcell.restq.services.SimulationRestService; @@ -34,7 +29,7 @@ @ApplicationScoped public class ExportService { @Inject - ExportStatusCreator exportStatusCreator; + ServerExportEventController exportStatusCreator; @Inject SimulationRestService simulationRestService; @@ -43,7 +38,7 @@ public class ExportService { ObjectMapper jsonMapper; @Inject - public ExportService(ExportStatusCreator exportStatusCreator) throws DataAccessException, FileNotFoundException { + public ExportService(ServerExportEventController exportStatusCreator) throws DataAccessException, FileNotFoundException { this.exportStatusCreator = exportStatusCreator; } diff --git a/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java b/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java index 5827133f44..8d008d8664 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java +++ b/vcell-rest/src/test/java/org/vcell/restq/TestEndpointUtils.java @@ -214,6 +214,7 @@ public static void insertAdminsSimulation(DatabaseServerImpl databaseServer, Agr public static void setSystemProperties(String simDir, String exportBaseDir){ PropertyLoader.setProperty(PropertyLoader.primarySimDataDirInternalProperty, simDir); + PropertyLoader.setProperty(PropertyLoader.secondarySimDataDirInternalProperty, simDir); PropertyLoader.setProperty(PropertyLoader.exportBaseDirInternalProperty, exportBaseDir); PropertyLoader.setProperty(PropertyLoader.exportBaseURLProperty, previousExportURL); PropertyLoader.setProperty(PropertyLoader.n5DataDir, exportBaseDir); @@ -222,6 +223,7 @@ public static void setSystemProperties(String simDir, String exportBaseDir){ public static void restoreSystemProperties(){ PropertyLoader.setProperty(PropertyLoader.primarySimDataDirInternalProperty, previousSimDir); + PropertyLoader.setProperty(PropertyLoader.secondarySimDataDirInternalProperty, previousSimDir); PropertyLoader.setProperty(PropertyLoader.exportBaseDirInternalProperty, previousExportBaseDir); PropertyLoader.setProperty(PropertyLoader.n5DataDir, previousN5Path); PropertyLoader.setProperty(PropertyLoader.exportBaseURLProperty, previousExportURL); diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java index c41c2fba51..b84c22c43a 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java @@ -1,6 +1,6 @@ package org.vcell.restq.exports; -import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.ExportEnums; import cbit.vcell.math.VariableType; import cbit.vcell.modeldb.DatabaseServerImpl; import cbit.vcell.resource.PropertyLoader; @@ -83,8 +83,8 @@ public void testExportRequestClient() throws Exception { Set allEvents = exportResourceApi.exportStatus(); ExportEvent eventUnderInspection = allEvents.stream().toList().get(0); Assertions.assertEquals(1, allEvents.size()); - Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, ExportSpecss.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue())); - while (ExportSpecss.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue()) != ExportSpecss.ExportProgressType.EXPORT_COMPLETE){ + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, ExportEnums.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue())); + while (ExportEnums.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue()) != ExportEnums.ExportProgressType.EXPORT_COMPLETE){ allEvents = exportResourceApi.exportStatus(); eventUnderInspection = allEvents.stream().toList().get(0); Thread.sleep(500); diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java index 6a47f69be2..1d7a48e757 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java @@ -26,7 +26,7 @@ import org.vcell.restq.db.AgroalConnectionFactory; import org.vcell.restq.handlers.ExportResource; import org.vcell.restq.services.Exports.ExportService; -import org.vcell.restq.services.Exports.ExportStatusCreator; +import org.vcell.restq.services.Exports.ServerExportEventController; import org.vcell.util.DataAccessException; import org.vcell.util.document.KeyValue; @@ -48,7 +48,7 @@ public class ExportServerTest { @Inject Instance requestListenerMQ; @Inject - ExportStatusCreator statusCreator; + ServerExportEventController statusCreator; @Inject ExportService exportService; @Inject @@ -104,20 +104,20 @@ public void testExportStatus() throws Exception { switch (i){ case 0: Assertions.assertNull(exportEvent.getProgress()); - Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_START, exportEvent.getEventType()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_START, exportEvent.getEventType()); break; case 1: Assertions.assertEquals(.25,exportEvent.getProgress()); - Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); break; case 2: Assertions.assertEquals(.8125,exportEvent.getProgress()); - Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); Assertions.assertNull(exportEvent.getLocation()); break; case 3: Assertions.assertNull(exportEvent.getProgress()); - Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_COMPLETE, exportEvent.getEventType()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_COMPLETE, exportEvent.getEventType()); Assertions.assertNotNull(exportEvent.getLocation()); break; default: @@ -135,7 +135,7 @@ public void testInvalidInputException() throws Exception { ExportSpecs exportSpecs = getValidExportSpec(0, 1); long badJobID = 2; ExportSpecs badExportSpecs = new ExportSpecs(exportSpecs.getVCDataIdentifier(), null, null, null, - new GeometrySpecs(new SpatialSelection[]{}, 1, 1, ExportSpecss.GeometryMode.GEOMETRY_SLICE), null, "TestSim", null); + new GeometrySpecs(new SpatialSelection[]{}, 1, 1, ExportEnums.GeometryMode.GEOMETRY_SLICE), null, "TestSim", null); Multi status = createExportListener(badExportSpecs, badJobID); CompletableFuture future = CompletableFuture.runAsync(() -> { VCSimulationDataIdentifier vcSimulationDataIdentifier = (VCSimulationDataIdentifier) exportSpecs.getVCDataIdentifier(); @@ -152,7 +152,7 @@ public void testInvalidInputException() throws Exception { }); BlockingIterable blockingIterable = status.subscribe().asIterable(); for (ExportEvent exportEvent : blockingIterable) { - Assertions.assertEquals(ExportSpecss.ExportProgressType.EXPORT_FAILURE, exportEvent.getEventType()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_FAILURE, exportEvent.getEventType()); } future.join(); } @@ -160,7 +160,7 @@ public void testInvalidInputException() throws Exception { @Test public void testLongRunningThread() throws Exception { ExportRequestListenerMQ.ExportJob exportJob = exportService.createExportJobFromRequest(TestEndpointUtils.administratorUser, getValidExportRequest(0, 3).standardExportInformation(), - new N5Specs(ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, "TestDataset", dummyMaskInfo), ExportFormat.N5); + new N5Specs(ExportEnums.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, "TestDataset", dummyMaskInfo), ExportFormat.N5); statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); ((ExportRequestListenerMQ) requestListenerMQ.get()).setThreadWaitTimeUnit(TimeUnit.MILLISECONDS); @@ -182,16 +182,16 @@ private ExportResource.N5ExportRequest getValidExportRequest(int startTimeIndex, DataIdentifier[] dataIdentifier = dataServer.getDataIdentifiers(new OutputContext(new AnnotatedFunction[0]), TestEndpointUtils.administratorUser, simulationDataIdentifier); DataIdentifier volumetricDataID = getOneDIWithSpecificType(VariableType.VOLUME, dataIdentifier); - VariableSpecs variableSpecs = new VariableSpecs(new ArrayList<>(){{add(volumetricDataID.getName());}}, ExportSpecss.VariableMode.VARIABLE_ONE); - ExportResource.GeometrySpecDTO geometrySpecs = new ExportResource.GeometrySpecDTO(new SpatialSelection[0], 0, 0, ExportSpecss.GeometryMode.GEOMETRY_SELECTIONS); + VariableSpecs variableSpecs = new VariableSpecs(new ArrayList<>(){{add(volumetricDataID.getName());}}, ExportEnums.VariableMode.VARIABLE_ONE); + ExportResource.GeometrySpecDTO geometrySpecs = new ExportResource.GeometrySpecDTO(new SpatialSelection[0], 0, 0, ExportEnums.GeometryMode.GEOMETRY_SELECTIONS); double[] allTimes = dataServer.getDataSetTimes(TestEndpointUtils.administratorUser, simulationDataIdentifier); - TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportSpecss.TimeMode.TIME_RANGE); + TimeSpecs timeSpecs = new TimeSpecs(startTimeIndex, endTimeIndex, allTimes, ExportEnums.TimeMode.TIME_RANGE); HashMap dummyMaskInfo = new HashMap<>(){{put(0, "Dummy"); put(1, "Test");}}; ExportResource.StandardExportInfo request = new ExportResource.StandardExportInfo(new ArrayList<>(){},"", "TestSim", simulationID, 0, geometrySpecs, timeSpecs, variableSpecs); - return new ExportResource.N5ExportRequest(request, dummyMaskInfo, ExportSpecss.ExportableDataType.PDE_VARIABLE_DATA, "TestDataset"); + return new ExportResource.N5ExportRequest(request, dummyMaskInfo, ExportEnums.ExportableDataType.PDE_VARIABLE_DATA, "TestDataset"); } private ExportSpecs getValidExportSpec(int startTimeIndex, int endTimeIndex) throws Exception { diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java b/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java index 1aa71b1784..daf4932964 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java @@ -5,7 +5,7 @@ import cbit.image.GifParsingException; import cbit.image.VCImageInfo; import cbit.rmi.event.ExportEvent; -import cbit.rmi.event.ExportStatusEventCreator; +import cbit.rmi.event.ExportEventController; import cbit.vcell.export.server.*; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.field.FieldDataAllDBEntries; @@ -16,7 +16,6 @@ import cbit.vcell.simdata.DataIdentifier; import cbit.vcell.solver.VCSimulationDataIdentifier; import org.vcell.restclient.model.*; -import org.vcell.restclient.model.VariableSpecs; import org.vcell.util.Extent; import org.vcell.util.Origin; import org.vcell.util.document.BioModelChildSummary; @@ -312,11 +311,11 @@ public static VCImageInfo imageSummaryToVCImageInfo(org.vcell.restclient.model.V public static TimeSpecs dtoToTimeSpecs(org.vcell.restclient.model.TimeSpecs dto){ return new TimeSpecs(dto.getBeginTimeIndex(), dto.getEndTimeIndex(), dto.getAllTimes().stream().mapToDouble(Double::doubleValue).toArray(), - ExportSpecss.TimeMode.valueOf(dto.getMode().getValue())); + ExportEnums.TimeMode.valueOf(dto.getMode().getValue())); } public static cbit.vcell.export.server.VariableSpecs dtoToVariableSpecs(org.vcell.restclient.model.VariableSpecs dto){ - return new cbit.vcell.export.server.VariableSpecs(dto.getVariableNames(), ExportSpecss.VariableMode.valueOf(dto.getMode().getValue())); + return new cbit.vcell.export.server.VariableSpecs(dto.getVariableNames(), ExportEnums.VariableMode.valueOf(dto.getMode().getValue())); } public static org.vcell.restclient.model.TimeSpecs timeSpecsToDTO(cbit.vcell.export.server.TimeSpecs timeSpecs) { @@ -510,7 +509,7 @@ public static ExportEvent dtoToExportEvent(org.vcell.restclient.model.ExportEven if (restEvent == null) return null; // Convert fields - ExportSpecss.ExportProgressType eventType = ExportSpecss.ExportProgressType.valueOf(restEvent.getEventType().getValue()); + ExportEnums.ExportProgressType eventType = ExportEnums.ExportProgressType.valueOf(restEvent.getEventType().getValue()); Double progress = restEvent.getProgress(); String format = restEvent.getFormat(); String location = restEvent.getLocation(); @@ -523,7 +522,7 @@ public static ExportEvent dtoToExportEvent(org.vcell.restclient.model.ExportEven // Construct ExportEvent return new cbit.rmi.event.ExportEvent( - ExportStatusEventCreator.class, // source (set as needed) + ExportEventController.class, // source (set as needed) jobID, user, dataIdString, diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java index 4b62b3fc32..e98a0993d0 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/bootstrap/LocalVCellConnection.java @@ -82,7 +82,7 @@ public LocalVCellConnection(UserLoginInfo userLoginInfo, SimulationDatabase simu this.exportServiceImpl = exportServiceImpl; this.dataSetControllerImpl = dataSetControllerImpl; - this.exportServiceImpl.getEventCreator().addExportListener(this); + this.exportServiceImpl.getEventController().addExportListener(this); this.dataSetControllerImpl.addDataJobListener(this); performanceMonitoringFacility = new PerformanceMonitoringFacility(this.userLoginInfo.getUser()); diff --git a/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java b/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java index a47024b9ce..c56b850738 100644 --- a/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java +++ b/vcell-server/src/main/java/cbit/vcell/message/server/data/SimDataServer.java @@ -73,7 +73,7 @@ public SimDataServer() throws Exception { dataSetControllerImpl.addDataJobListener(this); // add export listener - exportServiceImpl.getEventCreator().addExportListener(this); + exportServiceImpl.getEventController().addExportListener(this); } public void init(SimDataServiceType serviceType) throws Exception { From 0c945ef3c906bbd488aa5aaedc2b1f6f00a63f5e Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 7 Aug 2025 12:18:22 -0400 Subject: [PATCH 36/41] Return Empty Set for Status Update --- .../api/server/AsynchMessageManager.java | 5 +- .../vcell/restq/handlers/ExportResource.java | 8 +-- .../restq/services/Exports/ExportService.java | 2 +- ....java => ServerExportEventController.java} | 62 ++++++++++++------- 4 files changed, 43 insertions(+), 34 deletions(-) rename vcell-rest/src/main/java/org/vcell/restq/services/Exports/{ExportStatusCreator.java => ServerExportEventController.java} (73%) diff --git a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java index 9f0e87be32..3263133bfd 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java @@ -144,10 +144,7 @@ private void poll( ) { List exportEvents = setOfExports.stream().map(DtoModelTransforms::dtoToExportEvent).toList(); queuedEvents = Stream.concat(exportEvents.stream(), Stream.of(queuedEvents)).toArray(MessageEvent[]::new); } catch (ApiException ex){ - boolean isObjectNotFoundException = ex.getCode() == 404; - if (!isObjectNotFoundException){ - throw ExceptionHandler.getProperException(ex); - } + throw ExceptionHandler.getProperException(ex); } } if (report) { diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index efa3834f82..f38a4f41e1 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -76,13 +76,9 @@ public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, N @RolesAllowed("user") @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "exportStatus", description = "Get the status of your most recent export jobs.") - public Set pollExportStatus() throws DataAccessWebException, NotAuthenticatedWebException, NotFoundWebException { + public Set pollExportStatus() throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); - try{ - return exportService.getMostRecentExportStatus(user); - } catch (ObjectNotFoundException e) { - throw new NotFoundWebException(e.getMessage(), e); - } + return exportService.getMostRecentExportStatus(user); } @Path("/{exportJobID}/status-sse") diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index 258a67d661..275ea0622c 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -50,7 +50,7 @@ public Multi getExportStatuses(User user, long jobID) throws Object return exportStatusCreator.getUsersExportStatus(user, jobID); } - public Set getMostRecentExportStatus(User user) throws ObjectNotFoundException { + public Set getMostRecentExportStatus(User user) { return exportStatusCreator.getMostRecentExportStatus(user); } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java similarity index 73% rename from vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java rename to vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java index 63357bbfa9..8617ac6977 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusCreator.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java @@ -1,10 +1,8 @@ package org.vcell.restq.services.Exports; import cbit.rmi.event.ExportEvent; -import cbit.rmi.event.ExportListener; -import cbit.rmi.event.ExportStatusEventCreator; import cbit.vcell.export.server.ExportSpecs; -import cbit.vcell.export.server.ExportSpecss; +import cbit.vcell.export.server.ExportEnums; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; import cbit.vcell.solver.VCSimulationDataIdentifier; @@ -20,22 +18,42 @@ import java.util.HashSet; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; @ApplicationScoped -public class ExportStatusCreator implements ExportStatusEventCreator { +public class ServerExportEventController implements cbit.rmi.event.ExportEventController { private final ConcurrentHashMap jobRequestToUser = new ConcurrentHashMap<>(); private final ConcurrentHashMap> listeners = new ConcurrentHashMap<>(); - private final ConcurrentHashMap> mostRecentExportEvents = new ConcurrentHashMap<>(); // TODO: Clean out this set + private final ConcurrentHashMap> mostRecentExportEvents = new ConcurrentHashMap<>(); // TODO: Clean out this set + static class ComparableExportEvent{ + private final ExportEvent exportEvent; + + public ComparableExportEvent(ExportEvent exportEvent) { + this.exportEvent = exportEvent; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ComparableExportEvent cpe){ + return cpe.exportEvent.getJobID() == this.exportEvent.getJobID() && + cpe.exportEvent.getUser().equals(this.exportEvent.getUser()); + } + return false; + } + @Override + public int hashCode() { + int result = Long.hashCode(exportEvent.getJobID()); + result = 31 * result + exportEvent.getUser().hashCode(); + return result; + } + } protected ExportSpecs exportExists(ExportSpecs exportSpecs) { // Call DB for export history and check if it exists. Store in cache if it exists for future requests. return exportSpecs; } - public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { + public synchronized ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); @@ -54,7 +72,7 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin String key = entryKey(user, jobID); event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportSpecss.ExportProgressType.EXPORT_COMPLETE, + this, jobID, user, vcdID.getID(), dataKey, ExportEnums.ExportProgressType.EXPORT_COMPLETE, format, location, null, timeSpecs, varSpecs); event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); @@ -72,7 +90,7 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin return event; } - public synchronized void addExportListener(ExportListener listener) { + public void addExportListener(cbit.rmi.event.ExportListener listener) { throw new IllegalCallerException("addExportListener not implemented for the server"); } @@ -84,11 +102,11 @@ public synchronized Multi getUsersExportStatus(User user, long expo return listeners.get(key).toMulti(); } - public synchronized Set getMostRecentExportStatus (User user) throws ObjectNotFoundException { + public synchronized Set getMostRecentExportStatus (User user) { if (!mostRecentExportEvents.containsKey(user)) { - throw new ObjectNotFoundException("Did not find entry for user " + user.getName()); + return new HashSet<>(); } - return mostRecentExportEvents.get(user); + return mostRecentExportEvents.get(user).stream().map(cpe -> cpe.exportEvent).collect(java.util.stream.Collectors.toSet()); } public synchronized void addServerExportListener(User user, long exportJobID){ @@ -97,17 +115,17 @@ public synchronized void addServerExportListener(User user, long exportJobID){ listeners.put(key, emitter); jobRequestToUser.put(exportJobID, user); ExportEvent event = new ExportEvent( - this, exportJobID, user, "", null, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, + this, exportJobID, user, "", null, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, "", "", 0.0, null, null); if (!mostRecentExportEvents.containsKey(user)) { mostRecentExportEvents.put(user, new HashSet<>()); } - mostRecentExportEvents.get(user).add(event); + mostRecentExportEvents.get(user).add(new ComparableExportEvent(event)); } public synchronized void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); fireExportEvent(event); } @@ -127,7 +145,7 @@ public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, St if (!listeners.containsKey(key)) { throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); listeners.get(key).onNext(event); listeners.get(key).complete(); @@ -138,15 +156,13 @@ public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, St public synchronized void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { User user = jobRequestToUser.get(jobID); - - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_PROGRESS, format, null, progress, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_PROGRESS, format, null, progress, null, null); fireExportEvent(event); } public synchronized void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { User user = jobRequestToUser.get(jobID); - - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportSpecss.ExportProgressType.EXPORT_START, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_START, format, null, null, null, null); fireExportEvent(event); } @@ -159,7 +175,7 @@ private String entryKey(User user, long jobID){ } private synchronized void replaceSetEntry(User user, ExportEvent newEvent){ - mostRecentExportEvents.get(user).remove(newEvent); - mostRecentExportEvents.get(user).add(newEvent); + mostRecentExportEvents.get(user).remove(new ComparableExportEvent(newEvent)); + mostRecentExportEvents.get(user).add(new ComparableExportEvent(newEvent)); } } From dcf68d64b5c4202aa1787c320d16c59d57d09556 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 7 Aug 2025 12:18:36 -0400 Subject: [PATCH 37/41] Allow Concurrent Export Processing --- .../java/org/vcell/restq/activemq/ExportRequestListenerMQ.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index 1a3ab6376b..80b59b0b66 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.quarkus.arc.properties.IfBuildProperty; import io.smallrye.mutiny.Uni; +import io.smallrye.reactive.messaging.annotations.Blocking; import jakarta.annotation.PostConstruct; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -86,6 +87,7 @@ public void addExportJobToQueue(ExportJob exportJob) throws JsonProcessingExcept } @Incoming("processed-export-request") + @Blocking(ordered = false) public Uni consumeExportRequest(Message message) { try { logger.debug("Received export request: {}", message.getPayload()); From aa5f834fe00e836535d658b1f065f5ab1d07bd8b Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Thu, 7 Aug 2025 13:10:55 -0400 Subject: [PATCH 38/41] Update Client --- python-restclient/docs/ExportResourceApi.md | 1 - python-restclient/vcell_client/api/export_resource_api.py | 3 --- tools/compile-and-build-clients.sh | 1 + tools/openapi.yaml | 6 ------ tools/python-fix.sh | 4 +++- vcell-restclient/api/openapi.yaml | 6 ------ vcell-restclient/docs/ExportResourceApi.md | 2 -- 7 files changed, 4 insertions(+), 19 deletions(-) diff --git a/python-restclient/docs/ExportResourceApi.md b/python-restclient/docs/ExportResourceApi.md index bc18fe42d2..1ab1d4ca0f 100644 --- a/python-restclient/docs/ExportResourceApi.md +++ b/python-restclient/docs/ExportResourceApi.md @@ -148,7 +148,6 @@ This endpoint does not need any parameter. **200** | OK | - | **401** | Not Authenticated | - | **403** | Not Allowed | - | -**404** | Not found | - | **500** | Data Access Exception | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/python-restclient/vcell_client/api/export_resource_api.py b/python-restclient/vcell_client/api/export_resource_api.py index deafc31ab4..1e98f7c897 100644 --- a/python-restclient/vcell_client/api/export_resource_api.py +++ b/python-restclient/vcell_client/api/export_resource_api.py @@ -390,7 +390,6 @@ def export_status( '200': "List[ExportEvent]", '401': "VCellHTTPError", '403': None, - '404': "VCellHTTPError", '500': "VCellHTTPError" } @@ -458,7 +457,6 @@ def export_status_with_http_info( '200': "List[ExportEvent]", '401': "VCellHTTPError", '403': None, - '404': "VCellHTTPError", '500': "VCellHTTPError" } @@ -526,7 +524,6 @@ def export_status_without_preload_content( '200': "List[ExportEvent]", '401': "VCellHTTPError", '403': None, - '404': "VCellHTTPError", '500': "VCellHTTPError" } diff --git a/tools/compile-and-build-clients.sh b/tools/compile-and-build-clients.sh index 8decac4d0b..bd739ed028 100755 --- a/tools/compile-and-build-clients.sh +++ b/tools/compile-and-build-clients.sh @@ -19,6 +19,7 @@ fi cp ./vcell-rest/target/generated/openapi.yaml ./tools/openapi.yaml ./tools/generate.sh +./tools/python-fix.sh if [[ "$CURRENT_DIR" == "$SCRIPT_DIR" ]]; then popd || exit diff --git a/tools/openapi.yaml b/tools/openapi.yaml index 2daeb461f5..db27744bc0 100644 --- a/tools/openapi.yaml +++ b/tools/openapi.yaml @@ -485,12 +485,6 @@ paths: $ref: '#/components/schemas/VCellHTTPError' "403": description: Not Allowed - "404": - description: Not found - content: - application/json: - schema: - $ref: '#/components/schemas/VCellHTTPError' "500": description: Data Access Exception content: diff --git a/tools/python-fix.sh b/tools/python-fix.sh index 4441aab046..fda577f17c 100755 --- a/tools/python-fix.sh +++ b/tools/python-fix.sh @@ -3,6 +3,8 @@ # This script is used to fix the generated Python REST client code # Order of operations matters here, so we need to ensure that the imports are correctly handled. +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +pushd "${SCRIPT_DIR}" || { echo "Failed to change directory to ${SCRIPT_DIR}"; exit 1; } INIT_FILE="../python-restclient/vcell_client/models/__init__.py" sed -i '' '/^from vcell_client.models.analytic_curve import AnalyticCurve$/d' $INIT_FILE && \ @@ -14,4 +16,4 @@ echo 'from vcell_client.models.composite_curve import CompositeCurve' >> $INIT_F sed -i '' '/^from vcell_client.models.control_point_curve import ControlPointCurve$/d' $INIT_FILE && \ echo 'from vcell_client.models.control_point_curve import ControlPointCurve' >> $INIT_FILE - +popd diff --git a/vcell-restclient/api/openapi.yaml b/vcell-restclient/api/openapi.yaml index 2a09d75332..39e580aa3b 100644 --- a/vcell-restclient/api/openapi.yaml +++ b/vcell-restclient/api/openapi.yaml @@ -521,12 +521,6 @@ paths: description: Not Authenticated "403": description: Not Allowed - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/VCellHTTPError' - description: Not found "500": content: application/json: diff --git a/vcell-restclient/docs/ExportResourceApi.md b/vcell-restclient/docs/ExportResourceApi.md index 2bc9a2d34f..dfe3ea3c01 100644 --- a/vcell-restclient/docs/ExportResourceApi.md +++ b/vcell-restclient/docs/ExportResourceApi.md @@ -223,7 +223,6 @@ This endpoint does not need any parameter. | **200** | OK | - | | **401** | Not Authenticated | - | | **403** | Not Allowed | - | -| **404** | Not found | - | | **500** | Data Access Exception | - | ## exportStatusWithHttpInfo @@ -293,6 +292,5 @@ ApiResponse<[**Set<ExportEvent>**](ExportEvent.md)> | **200** | OK | - | | **401** | Not Authenticated | - | | **403** | Not Allowed | - | -| **404** | Not found | - | | **500** | Data Access Exception | - | From 404b2d18e6c1e82b0758f220abc1c7899708a527 Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Wed, 13 Aug 2025 09:53:00 -0400 Subject: [PATCH 39/41] Update Export to Use Topic Instead --- python-restclient/README.md | 2 +- python-restclient/docs/ExportEvent.md | 2 - python-restclient/docs/ExportResourceApi.md | 16 +- .../vcell_client/api/export_resource_api.py | 38 ++- .../vcell_client/models/export_event.py | 14 +- tools/openapi.yaml | 14 +- .../types/utils/DTOModelTransformerV0.java | 17 +- .../LocalDataSetControllerMessaging.java | 2 +- .../api/server/AsynchMessageManager.java | 6 +- .../vcell/client/ClientRequestManager.java | 5 +- .../export/gui/ExportMonitorPanelTest.java | 6 +- .../main/java/cbit/rmi/event/ExportEvent.java | 35 ++- .../server/ClientExportEventController.java | 10 +- .../server/HumanReadableExportData.java | 12 +- .../activemq/ExportRequestListenerMQ.java | 19 +- .../vcell/restq/handlers/ExportResource.java | 10 +- .../services/Exports/ExportEventQueue.java | 49 ++++ .../restq/services/Exports/ExportService.java | 20 +- .../Exports/ServerExportEventController.java | 249 ++++++++++-------- .../src/main/resources/application.properties | 9 +- .../restq/exports/ExportRequestTest.java | 14 +- .../vcell/restq/exports/ExportServerTest.java | 44 +++- .../vcell/restq/exports/ManualTestExport.java | 5 +- vcell-restclient/README.md | 4 +- vcell-restclient/api/openapi.yaml | 27 +- vcell-restclient/docs/ExportEvent.md | 2 - vcell-restclient/docs/ExportResourceApi.md | 36 ++- .../restclient/api/ExportResourceApi.java | 34 ++- .../vcell/restclient/model/ExportEvent.java | 76 +----- .../restclient/utils/DtoModelTransforms.java | 6 +- .../restclient/api/ExportResourceApiTest.java | 7 - .../openapi/api/export-resource.service.ts | 23 +- .../api/export-resource.serviceInterface.ts | 5 +- .../modules/openapi/model/export-event.ts | 4 - 34 files changed, 430 insertions(+), 392 deletions(-) create mode 100644 vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportEventQueue.java diff --git a/python-restclient/README.md b/python-restclient/README.md index 9f03577c84..b160f3e372 100644 --- a/python-restclient/README.md +++ b/python-restclient/README.md @@ -97,7 +97,7 @@ Class | Method | HTTP request | Description *BioModelResourceApi* | [**get_bio_model_vcml**](docs/BioModelResourceApi.md#get_bio_model_vcml) | **GET** /api/v1/bioModel/{bioModelID}/vcml_download | Get the BioModel in VCML format. *BioModelResourceApi* | [**save_bio_model**](docs/BioModelResourceApi.md#save_bio_model) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. *ExportResourceApi* | [**export_n5**](docs/ExportResourceApi.md#export_n5) | **POST** /api/v1/export/N5 | -*ExportResourceApi* | [**export_status**](docs/ExportResourceApi.md#export_status) | **GET** /api/v1/export/status | +*ExportResourceApi* | [**export_status**](docs/ExportResourceApi.md#export_status) | **PATCH** /api/v1/export/status | *FieldDataResourceApi* | [**advanced_create**](docs/FieldDataResourceApi.md#advanced_create) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**analyze_file**](docs/FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and return field data. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores. *FieldDataResourceApi* | [**copy_models_field_data**](docs/FieldDataResourceApi.md#copy_models_field_data) | **POST** /api/v1/fieldData/copyModelsFieldData | Copy all existing field data from a BioModel/MathModel that you have access to, but don't own. diff --git a/python-restclient/docs/ExportEvent.md b/python-restclient/docs/ExportEvent.md index d299593341..3908b3c89a 100644 --- a/python-restclient/docs/ExportEvent.md +++ b/python-restclient/docs/ExportEvent.md @@ -12,8 +12,6 @@ Name | Type | Description | Notes **job_id** | **int** | | [optional] **data_key** | **str** | | [optional] **data_id_string** | **str** | | [optional] -**time_specs** | [**TimeSpecs**](TimeSpecs.md) | | [optional] -**variable_specs** | [**VariableSpecs**](VariableSpecs.md) | | [optional] **human_readable_data** | [**HumanReadableExportData**](HumanReadableExportData.md) | | [optional] ## Example diff --git a/python-restclient/docs/ExportResourceApi.md b/python-restclient/docs/ExportResourceApi.md index 1ab1d4ca0f..526d75c0fb 100644 --- a/python-restclient/docs/ExportResourceApi.md +++ b/python-restclient/docs/ExportResourceApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://vcell.cam.uchc.edu* Method | HTTP request | Description ------------- | ------------- | ------------- [**export_n5**](ExportResourceApi.md#export_n5) | **POST** /api/v1/export/N5 | -[**export_status**](ExportResourceApi.md#export_status) | **GET** /api/v1/export/status | +[**export_status**](ExportResourceApi.md#export_status) | **PATCH** /api/v1/export/status | # **export_n5** @@ -84,11 +84,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **export_status** -> List[ExportEvent] export_status() +> List[ExportEvent] export_status(body=body) -Get the status of your most recent export jobs. +Get the status of your export jobs past the timestamp (UTC format). ### Example @@ -115,9 +115,10 @@ configuration = vcell_client.Configuration( with vcell_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vcell_client.ExportResourceApi(api_client) + body = '2013-10-20T19:20:30+01:00' # datetime | (optional) try: - api_response = api_instance.export_status() + api_response = api_instance.export_status(body=body) print("The response of ExportResourceApi->export_status:\n") pprint(api_response) except Exception as e: @@ -127,7 +128,10 @@ with vcell_client.ApiClient(configuration) as api_client: ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **datetime**| | [optional] ### Return type @@ -139,7 +143,7 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/python-restclient/vcell_client/api/export_resource_api.py b/python-restclient/vcell_client/api/export_resource_api.py index 1e98f7c897..f02996de3d 100644 --- a/python-restclient/vcell_client/api/export_resource_api.py +++ b/python-restclient/vcell_client/api/export_resource_api.py @@ -24,6 +24,8 @@ except ImportError: from typing_extensions import Annotated +from datetime import datetime + from typing import List, Optional from vcell_client.models.export_event import ExportEvent @@ -340,6 +342,7 @@ def _export_n5_serialize( @validate_call def export_status( self, + body: Optional[datetime] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -355,8 +358,10 @@ def export_status( ) -> List[ExportEvent]: """export_status - Get the status of your most recent export jobs. + Get the status of your export jobs past the timestamp (UTC format). + :param body: + :type body: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -380,6 +385,7 @@ def export_status( """ # noqa: E501 _param = self._export_status_serialize( + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -407,6 +413,7 @@ def export_status( @validate_call def export_status_with_http_info( self, + body: Optional[datetime] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -422,8 +429,10 @@ def export_status_with_http_info( ) -> ApiResponse[List[ExportEvent]]: """export_status - Get the status of your most recent export jobs. + Get the status of your export jobs past the timestamp (UTC format). + :param body: + :type body: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -447,6 +456,7 @@ def export_status_with_http_info( """ # noqa: E501 _param = self._export_status_serialize( + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -474,6 +484,7 @@ def export_status_with_http_info( @validate_call def export_status_without_preload_content( self, + body: Optional[datetime] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -489,8 +500,10 @@ def export_status_without_preload_content( ) -> RESTResponseType: """export_status - Get the status of your most recent export jobs. + Get the status of your export jobs past the timestamp (UTC format). + :param body: + :type body: datetime :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -514,6 +527,7 @@ def export_status_without_preload_content( """ # noqa: E501 _param = self._export_status_serialize( + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -536,6 +550,7 @@ def export_status_without_preload_content( def _export_status_serialize( self, + body, _request_auth, _content_type, _headers, @@ -560,6 +575,8 @@ def _export_status_serialize( # process the header parameters # process the form parameters # process the body parameter + if body is not None: + _body_params = body # set the HTTP header `Accept` @@ -569,6 +586,19 @@ def _export_status_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -576,7 +606,7 @@ def _export_status_serialize( ] return self.api_client.param_serialize( - method='GET', + method='PATCH', resource_path='/api/v1/export/status', path_params=_path_params, query_params=_query_params, diff --git a/python-restclient/vcell_client/models/export_event.py b/python-restclient/vcell_client/models/export_event.py index fe8b02832f..69abaf5525 100644 --- a/python-restclient/vcell_client/models/export_event.py +++ b/python-restclient/vcell_client/models/export_event.py @@ -24,9 +24,7 @@ from pydantic import Field from vcell_client.models.export_progress_type import ExportProgressType from vcell_client.models.human_readable_export_data import HumanReadableExportData -from vcell_client.models.time_specs import TimeSpecs from vcell_client.models.user import User -from vcell_client.models.variable_specs import VariableSpecs try: from typing import Self except ImportError: @@ -44,10 +42,8 @@ class ExportEvent(BaseModel): job_id: Optional[StrictInt] = Field(default=None, alias="jobID") data_key: Optional[StrictStr] = Field(default=None, alias="dataKey") data_id_string: Optional[StrictStr] = Field(default=None, alias="dataIdString") - time_specs: Optional[TimeSpecs] = Field(default=None, alias="timeSpecs") - variable_specs: Optional[VariableSpecs] = Field(default=None, alias="variableSpecs") human_readable_data: Optional[HumanReadableExportData] = Field(default=None, alias="humanReadableData") - __properties: ClassVar[List[str]] = ["eventType", "progress", "format", "location", "user", "jobID", "dataKey", "dataIdString", "timeSpecs", "variableSpecs", "humanReadableData"] + __properties: ClassVar[List[str]] = ["eventType", "progress", "format", "location", "user", "jobID", "dataKey", "dataIdString", "humanReadableData"] model_config = { "populate_by_name": True, @@ -88,12 +84,6 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of user if self.user: _dict['user'] = self.user.to_dict() - # override the default output from pydantic by calling `to_dict()` of time_specs - if self.time_specs: - _dict['timeSpecs'] = self.time_specs.to_dict() - # override the default output from pydantic by calling `to_dict()` of variable_specs - if self.variable_specs: - _dict['variableSpecs'] = self.variable_specs.to_dict() # override the default output from pydantic by calling `to_dict()` of human_readable_data if self.human_readable_data: _dict['humanReadableData'] = self.human_readable_data.to_dict() @@ -122,8 +112,6 @@ def from_dict(cls, obj: Dict) -> Self: "jobID": obj.get("jobID"), "dataKey": obj.get("dataKey"), "dataIdString": obj.get("dataIdString"), - "timeSpecs": TimeSpecs.from_dict(obj.get("timeSpecs")) if obj.get("timeSpecs") is not None else None, - "variableSpecs": VariableSpecs.from_dict(obj.get("variableSpecs")) if obj.get("variableSpecs") is not None else None, "humanReadableData": HumanReadableExportData.from_dict(obj.get("humanReadableData")) if obj.get("humanReadableData") is not None else None }) return _obj diff --git a/tools/openapi.yaml b/tools/openapi.yaml index db27744bc0..c326c7769b 100644 --- a/tools/openapi.yaml +++ b/tools/openapi.yaml @@ -462,18 +462,22 @@ paths: - openId: - user /api/v1/export/status: - get: + patch: tags: - Export Resource - description: Get the status of your most recent export jobs. + description: Get the status of your export jobs past the timestamp (UTC format). operationId: exportStatus + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Instant' responses: "200": description: OK content: application/json: schema: - uniqueItems: true type: array items: $ref: '#/components/schemas/ExportEvent' @@ -2511,10 +2515,6 @@ components: $ref: '#/components/schemas/KeyValue' dataIdString: type: string - timeSpecs: - $ref: '#/components/schemas/TimeSpecs' - variableSpecs: - $ref: '#/components/schemas/VariableSpecs' humanReadableData: $ref: '#/components/schemas/HumanReadableExportData' ExportProgressType: diff --git a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java index 4c4612ef70..0864ea29ad 100644 --- a/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java +++ b/vcell-api-types/src/main/java/org/vcell/api/types/utils/DTOModelTransformerV0.java @@ -55,14 +55,6 @@ public static DataJobEvent dataJobEventFromJsonRep(Object eventSource, DataJobEv public static ExportEvent exportEventFromJsonRep(Object eventSource, ExportEventRepresentation rep) { User user = new User(rep.username, new KeyValue(rep.userkey)); - TimeSpecs timeSpecs = null; - if (rep.exportTimeSpecs!=null) { - timeSpecs = timeSpecsFromJsonRep(rep.exportTimeSpecs); - } - VariableSpecs variableSpecs = null; - if (rep.exportVariableSpecs!=null) { - variableSpecs = variableSpecsFromJsonRep(rep.exportVariableSpecs); - } HumanReadableExportData humanReadableExportData1 = null; if (rep.exportHumanReadableDataSpec!=null){ humanReadableExportData1 = humanReadableExportDataFromJsonRep(rep.exportHumanReadableDataSpec); @@ -70,21 +62,14 @@ public static ExportEvent exportEventFromJsonRep(Object eventSource, ExportEvent ExportEvent event = new ExportEvent( eventSource, rep.jobid, user, rep.dataIdString, new KeyValue(rep.dataKey), ExportEnums.ExportProgressType.getExportProgressType(rep.eventType), - rep.format, rep.location, rep.progress, - timeSpecs, variableSpecs); + rep.format, rep.location, rep.progress); event.setHumanReadableExportData(humanReadableExportData1); return event; } public static ExportEventRepresentation exportEventToJsonRep(ExportEvent event) { ExportTimeSpecs exportTimeSpecs = null; - if (event.getTimeSpecs()!=null) { - exportTimeSpecs = exportTimeSpecsToJsonRep(event.getTimeSpecs()); - } ExportVariableSpecs exportVariableSpecs = null; - if (event.getVariableSpecs()!=null) { - exportVariableSpecs = variableSpecsToJsonRep(event.getVariableSpecs()); - } ExportHumanReadableDataSpec exportHumanReadableDataSpec = null; if (event.getHumanReadableData() != null){ exportHumanReadableDataSpec = humanReadableExportDataToJsonRep(event.getHumanReadableData()); diff --git a/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java b/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java index 72a368275e..37ac66df9b 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/messaging/LocalDataSetControllerMessaging.java @@ -308,7 +308,7 @@ public ExportEvent makeRemoteFile(OutputContext outputContext,ExportSpecs export // N5 export is handled by the N5ExportService try { long jobID = vCellApiClient.getExportApi().exportN5(DtoModelTransforms.n5ExportRequestFromExportSpecs(exportSpecs)); - return new ExportEvent(this, jobID, null, exportSpecs.getVCDataIdentifier(), ExportEnums.ExportProgressType.EXPORT_START, exportSpecs.getFormat().name(), "", 0.0, exportSpecs.getTimeSpecs(), exportSpecs.getVariableSpecs()); + return new ExportEvent(this, jobID, null, exportSpecs.getVCDataIdentifier(), ExportEnums.ExportProgressType.EXPORT_START, exportSpecs.getFormat().name(), "", 0.0); } catch (ApiException e) { ExceptionHandler.onlyDataAccessOrPermissionException(e); throw new RuntimeException("Error should not reach here: " + e.getMessage(), e); diff --git a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java index 3263133bfd..7d5bc12501 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java @@ -9,6 +9,8 @@ */ package org.vcell.api.server; +import java.time.Instant; +import java.time.OffsetDateTime; import java.util.List; import java.util.Set; import java.util.concurrent.ScheduledExecutorService; @@ -70,6 +72,7 @@ public class AsynchMessageManager implements AsyncMessageManagerInterface { private long pollTime = BASE_POLL_SECONDS; private AtomicBoolean bPoll = new AtomicBoolean(false); private ScheduledFuture pollingHandle = null; + private OffsetDateTime lastPoll = OffsetDateTime.now(); /** * for {@link #schedule(long)} method */ @@ -140,9 +143,10 @@ private void poll( ) { pollTime = BASE_POLL_SECONDS; queuedEvents = clientServerManager.getMessageEvents(); try{ - Set setOfExports = clientServerManager.getVCellApiClient().getExportApi().exportStatus(); + List setOfExports = clientServerManager.getVCellApiClient().getExportApi().exportStatus(lastPoll); List exportEvents = setOfExports.stream().map(DtoModelTransforms::dtoToExportEvent).toList(); queuedEvents = Stream.concat(exportEvents.stream(), Stream.of(queuedEvents)).toArray(MessageEvent[]::new); + lastPoll = OffsetDateTime.now(); } catch (ApiException ex){ throw ExceptionHandler.getProperException(ex); } diff --git a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java index 295dc571ce..d4ccbbd4ee 100644 --- a/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java +++ b/vcell-client/src/main/java/cbit/vcell/client/ClientRequestManager.java @@ -2674,7 +2674,6 @@ private static void updateExportMetaData(final ExportEvent exportEvent){ HumanReadableExportData humanReadableExportData = exportEvent.getHumanReadableData(); DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - double[] exportTimes = exportEvent.getTimeSpecs().getAllTimes(); if (jsonFile.exists()){ @@ -2699,8 +2698,8 @@ private static void updateExportMetaData(final ExportEvent exportEvent){ humanReadableExportData.simulationName, humanReadableExportData.applicationName, humanReadableExportData.biomodelName, - Arrays.toString(exportEvent.getVariableSpecs().getVariableNames()), - exportTimes[exportEvent.getTimeSpecs().getBeginTimeIndex()] + "/" + exportTimes[exportEvent.getTimeSpecs().getEndTimeIndex()], + null, + null, humanReadableExportData.differentParameterValues, humanReadableExportData.serverSavedFileName, humanReadableExportData.applicationType, diff --git a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java index 0636b0d5b7..cf6efcdf4d 100644 --- a/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java +++ b/vcell-client/src/main/java/cbit/vcell/export/gui/ExportMonitorPanelTest.java @@ -47,14 +47,12 @@ public void windowClosing(java.awt.event.WindowEvent e) { aExportMonitorPanel.addExportEvent(new ExportEvent( aExportMonitorPanel, 123456789L, null, vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEnums.ExportProgressType.EXPORT_PROGRESS, - "CSV", "", new Double(0.47), - null, null), + "CSV", "", new Double(0.47)), "bogus [application: model]"); aExportMonitorPanel.addExportEvent(new ExportEvent( aExportMonitorPanel, 987654321L, null, vcSimDataId.getID(), vcSimDataId.getSimulationKey(), ExportEnums.ExportProgressType.EXPORT_COMPLETE, - "GIF", "http://nrcam.uchc.edu/export/987654321.zip", new Double(1), - null, null), + "GIF", "http://nrcam.uchc.edu/export/987654321.zip", new Double(1)), "simulation [application: model]"); frame.pack(); frame.setVisible(true); diff --git a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java index 26300caad0..0357e736cd 100644 --- a/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java +++ b/vcell-core/src/main/java/cbit/rmi/event/ExportEvent.java @@ -14,6 +14,7 @@ import cbit.vcell.export.server.HumanReadableExportData; import cbit.vcell.export.server.TimeSpecs; import cbit.vcell.export.server.VariableSpecs; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import org.vcell.util.document.KeyValue; @@ -40,28 +41,35 @@ public class ExportEvent extends MessageEvent { private final KeyValue dataKey; @JsonProperty(value = "dataIdString") private final String dataIdString; - @JsonProperty(value = "timeSpecs") - private final TimeSpecs timeSpecs; - @JsonProperty(value = "variableSpecs") - private final VariableSpecs variableSpecs; @JsonIgnore private HumanReadableExportData humanReadableExportData = null; public ExportEvent(Object source, long jobID, User user, VCDataIdentifier vcDataId, ExportEnums.ExportProgressType argEventType, - String format, String location, Double argProgress, - TimeSpecs timeSpecs, VariableSpecs variableSpecs) { + String format, String location, Double argProgress) { this(source,jobID,user, vcDataId.getID(),vcDataId.getDataKey(),argEventType, - format,location,argProgress,timeSpecs,variableSpecs); + format,location,argProgress); + } + + @JsonCreator + public ExportEvent(@JsonProperty("jobID") long jobID, @JsonProperty("user") User user, + @JsonProperty("dataIdString") String vcDataId, @JsonProperty("dataKey") String dataKey, + @JsonProperty("eventType") ExportEnums.ExportProgressType argEventType, + @JsonProperty("format") String format, @JsonProperty("location") String location, @JsonProperty("progress") Double argProgress, + @JsonProperty("humanReadableData") HumanReadableExportData humanReadableExportData) { + + this(ExportEvent.class, jobID,user, + vcDataId, new KeyValue(dataKey),argEventType, + format,location,argProgress); + this.humanReadableExportData = humanReadableExportData; } public ExportEvent(Object source, long jobID, User user, String dataIdString, KeyValue dataKey, ExportEnums.ExportProgressType argEventType, - String format, String location, Double argProgress, - TimeSpecs timeSpecs, VariableSpecs variableSpecs) { + String format, String location, Double argProgress) { super(source, new MessageSource(source, dataIdString), new MessageData(argProgress)); this.eventType = argEventType; this.format = format; @@ -71,8 +79,6 @@ public ExportEvent(Object source, long jobID, User user, this.user = user; this.dataIdString = dataIdString; this.dataKey = dataKey; - this.timeSpecs = timeSpecs; - this.variableSpecs = variableSpecs; } @@ -148,13 +154,6 @@ public String getDataIdString() { return dataIdString; } -public TimeSpecs getTimeSpecs() { - return timeSpecs; -} -public VariableSpecs getVariableSpecs() { - return variableSpecs; -} - @Override public boolean isSupercededBy(MessageEvent messageEvent) { if (messageEvent instanceof ExportEvent){ diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java b/vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java index b65397b1eb..5464079c68 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/ClientExportEventController.java @@ -44,7 +44,7 @@ public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, Strin } ExportEvent event = new ExportEvent( this, jobID, user, vcdID.getID(), dataKey, ExportEnums.ExportProgressType.EXPORT_COMPLETE, - format, location, null, timeSpecs, varSpecs); + format, location, null); event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); fireExportEvent(event); return event; @@ -57,7 +57,7 @@ public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String form if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, format, null, null); fireExportEvent(event); } @@ -81,7 +81,7 @@ public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_FAILURE, format, message, null); fireExportEvent(event); } @@ -91,7 +91,7 @@ public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_PROGRESS, format, null, new Double(progress), null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_PROGRESS, format, null, new Double(progress)); fireExportEvent(event); } @@ -102,7 +102,7 @@ public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) if (object != null) { user = (User)object; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_START, format, null, null, null, null); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_START, format, null, null); fireExportEvent(event); } diff --git a/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java b/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java index 46b7ede6f5..918b3518b6 100644 --- a/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java +++ b/vcell-core/src/main/java/cbit/vcell/export/server/HumanReadableExportData.java @@ -1,5 +1,8 @@ package cbit.vcell.export.server; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; @@ -18,9 +21,12 @@ public class HumanReadableExportData implements Serializable { public int zSlices; public int tSlices; public int numChannels; - public HumanReadableExportData(String simulationName, String applicationName, String biomodelName, - ArrayList differentParameterValues, - String serverSavedFileName, String applicationType, boolean nonSpatial, Map subVolume){ + + @JsonCreator + public HumanReadableExportData(@JsonProperty("simulationName") String simulationName, @JsonProperty("applicationName") String applicationName, + @JsonProperty("biomodelName") String biomodelName, @JsonProperty("differentParameterValues") ArrayList differentParameterValues, + @JsonProperty("serverSavedFileName") String serverSavedFileName, @JsonProperty("applicationType") String applicationType, + @JsonProperty("nonSpatial") boolean nonSpatial, @JsonProperty("subVolume") Map subVolume){ this.simulationName = simulationName; this.applicationName = applicationName; this.biomodelName = biomodelName; diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index 80b59b0b66..f3fa388f47 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -80,21 +80,23 @@ void init() throws FileNotFoundException { new ExportServiceImpl()); } - public void addExportJobToQueue(ExportJob exportJob) throws JsonProcessingException { + public void addExportJobToQueue(ExportJob exportJob) { logger.debug("Export job added to queue: {} for user: {}", exportJob.id(), exportJob.user().getName()); - exportStatusCreator.addServerExportListener(exportJob.user(), exportJob.id()); - exportJobEmitter.send(mapper.writeValueAsString(exportJob)); + try{ + exportStatusCreator.addServerExportListener(exportJob); + exportJobEmitter.send(mapper.writeValueAsString(exportJob)); + } catch (Exception e){ + logger.error("Can't add job to remote queue: ", e); + exportStatusCreator.fireExportFailed(exportJob.id(), null, null, e.getMessage()); + } } @Incoming("processed-export-request") - @Blocking(ordered = false) public Uni consumeExportRequest(Message message) { try { logger.debug("Received export request: {}", message.getPayload()); - return Uni.createFrom().completionStage(startJob(message)).onFailure().recoverWithUni(() -> { - logger.error("Failed to process export request: {}", message.getPayload()); - return Uni.createFrom().completionStage(message.nack(new RuntimeException("Failed to process export request"))); - }); + startJob(message); + return Uni.createFrom().completionStage(message.ack()); } catch (Exception e) { logger.error(e); return Uni.createFrom().completionStage(message.nack(e)); @@ -116,7 +118,6 @@ public CompletableFuture startJob(Message message, boolean handleF throw new RuntimeException(e); } }, threadPoolExecutor) - .thenRun(message::ack) .orTimeout(15, waitUnit); if (handleFailure){ diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index f38a4f41e1..bb520ee660 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -27,7 +27,9 @@ import org.vcell.util.document.User; import java.sql.SQLException; +import java.time.Instant; import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.Set; @@ -72,13 +74,13 @@ public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, N } @Path("/status") - @GET + @PATCH @RolesAllowed("user") @Produces(MediaType.APPLICATION_JSON) - @Operation(operationId = "exportStatus", description = "Get the status of your most recent export jobs.") - public Set pollExportStatus() throws DataAccessWebException, NotAuthenticatedWebException { + @Operation(operationId = "exportStatus", description = "Get the status of your export jobs past the timestamp (UTC format).") + public List pollExportStatus(Instant timestamp) throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); - return exportService.getMostRecentExportStatus(user); + return exportService.getMostRecentExportStatus(user, timestamp); } @Path("/{exportJobID}/status-sse") diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportEventQueue.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportEventQueue.java new file mode 100644 index 0000000000..0a45c0bc68 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportEventQueue.java @@ -0,0 +1,49 @@ +package org.vcell.restq.services.Exports; + +import cbit.rmi.event.ExportEvent; +import org.vcell.util.document.User; + +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +class ExportEventQueue { + private final ConcurrentHashMap> exportEventQueue = new ConcurrentHashMap<>(); + + public void addExportEvent(ExportEvent exportEvent) { + User user = exportEvent.getUser(); + if (!exportEventQueue.containsKey(user)) { + exportEventQueue.put(user, new ArrayList<>()); + } + exportEventQueue.get(user).add(new MessageExportEvent(exportEvent, Instant.now())); + } + + public List getExportEventsPastSpecificTime(User user, Instant time) { + if (!exportEventQueue.containsKey(user)) { + return new ArrayList<>(); + } + ArrayList events = exportEventQueue.get(user); + int rp = events.size() - 1; + int lp = 0; + int middle = rp / 2; + while (lp < middle && rp > middle) { + MessageExportEvent ce = events.get(middle); + if (ce.timestamp.isBefore(time)) { + lp = middle; + } else { + rp = middle - 1; + } + middle = lp + ((rp - lp) / 2); + } + if (middle == 0){ + return events; + } + return events.subList(middle, events.size()); + } + + record MessageExportEvent( + ExportEvent exportEvent, + Instant timestamp + ){ } +} diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index 275ea0622c..e40f680173 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -1,6 +1,7 @@ package org.vcell.restq.services.Exports; import cbit.rmi.event.ExportEvent; +import cbit.rmi.event.ExportEventController; import cbit.vcell.export.server.ExportFormat; import cbit.vcell.export.server.FormatSpecificSpecs; import cbit.vcell.export.server.JobRequest; @@ -12,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.smallrye.mutiny.Multi; import jakarta.enterprise.context.ApplicationScoped; +import jakarta.enterprise.inject.Instance; import jakarta.inject.Inject; import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.restq.errors.exceptions.RuntimeWebException; @@ -24,34 +26,28 @@ import java.io.FileNotFoundException; import java.sql.SQLException; +import java.time.Instant; +import java.util.List; import java.util.Set; @ApplicationScoped public class ExportService { @Inject - ServerExportEventController exportStatusCreator; + Instance exportStatusCreator; @Inject SimulationRestService simulationRestService; - @Inject - ObjectMapper jsonMapper; - - @Inject - public ExportService(ServerExportEventController exportStatusCreator) throws DataAccessException, FileNotFoundException { - this.exportStatusCreator = exportStatusCreator; - } - public ExportResource.ExportHistory getExportHistory(User user) throws DataAccessException { return new ExportResource.ExportHistory("Hello"); } public Multi getExportStatuses(User user, long jobID) throws ObjectNotFoundException { - return exportStatusCreator.getUsersExportStatus(user, jobID); + return ((ServerExportEventController) exportStatusCreator.get()).getSSEUsersExportStatus(user, jobID); } - public Set getMostRecentExportStatus(User user) { - return exportStatusCreator.getMostRecentExportStatus(user); + public List getMostRecentExportStatus(User user, Instant instant) { + return ((ServerExportEventController) exportStatusCreator.get()).getMostRecentExportStatus(user, instant); } public ExportRequestListenerMQ.ExportJob createExportJobFromRequest(User user, ExportResource.StandardExportInfo request, FormatSpecificSpecs formatSpecificSpecs, ExportFormat format) throws DataAccessException, SQLException { diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java index 8617ac6977..62e2f3a9f6 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java @@ -1,181 +1,202 @@ package org.vcell.restq.services.Exports; import cbit.rmi.event.ExportEvent; -import cbit.vcell.export.server.ExportSpecs; +import cbit.rmi.event.ExportEventController; +import cbit.rmi.event.ExportListener; import cbit.vcell.export.server.ExportEnums; -import cbit.vcell.export.server.TimeSpecs; -import cbit.vcell.export.server.VariableSpecs; +import cbit.vcell.export.server.ExportSpecs; import cbit.vcell.solver.VCSimulationDataIdentifier; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.arc.properties.IfBuildProperty; import io.smallrye.mutiny.Multi; +import io.smallrye.mutiny.Uni; import io.smallrye.mutiny.helpers.MultiEmitterProcessor; import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.eclipse.microprofile.reactive.messaging.Channel; +import org.eclipse.microprofile.reactive.messaging.Emitter; +import org.eclipse.microprofile.reactive.messaging.Incoming; +import org.eclipse.microprofile.reactive.messaging.Message; +import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.util.ObjectNotFoundException; import org.vcell.util.document.ExternalDataIdentifier; import org.vcell.util.document.KeyValue; import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; -import java.util.HashSet; -import java.util.Set; +import java.time.Instant; +import java.util.List; import java.util.concurrent.ConcurrentHashMap; @ApplicationScoped -public class ServerExportEventController implements cbit.rmi.event.ExportEventController { - private final ConcurrentHashMap jobRequestToUser = new ConcurrentHashMap<>(); - private final ConcurrentHashMap> listeners = new ConcurrentHashMap<>(); - private final ConcurrentHashMap> mostRecentExportEvents = new ConcurrentHashMap<>(); // TODO: Clean out this set +@IfBuildProperty(name = "vcell.exporter", stringValue = "false") +class DummyExportEventController implements ExportEventController{ - static class ComparableExportEvent{ - private final ExportEvent exportEvent; + @Override + public ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { + return null; + } - public ComparableExportEvent(ExportEvent exportEvent) { - this.exportEvent = exportEvent; - } + @Override + public void addExportListener(ExportListener listener) { } - @Override - public boolean equals(Object obj) { - if (obj instanceof ComparableExportEvent cpe){ - return cpe.exportEvent.getJobID() == this.exportEvent.getJobID() && - cpe.exportEvent.getUser().equals(this.exportEvent.getUser()); - } - return false; - } - @Override - public int hashCode() { - int result = Long.hashCode(exportEvent.getJobID()); - result = 31 * result + exportEvent.getUser().hashCode(); - return result; - } - } + @Override + public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { } - protected ExportSpecs exportExists(ExportSpecs exportSpecs) { - // Call DB for export history and check if it exists. Store in cache if it exists for future requests. - return exportSpecs; - } + @Override + public void fireExportEvent(ExportEvent event) { } - public synchronized ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { + @Override + public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { } - TimeSpecs timeSpecs = (exportSpecs!=null)?exportSpecs.getTimeSpecs():(null); - VariableSpecs varSpecs = (exportSpecs!=null)?exportSpecs.getVariableSpecs():(null); - final KeyValue dataKey; - if (vcdID instanceof VCSimulationDataIdentifier) { - dataKey = ((VCSimulationDataIdentifier)vcdID).getSimulationKey(); - }else if (vcdID instanceof ExternalDataIdentifier) { - dataKey = ((ExternalDataIdentifier)vcdID).getSimulationKey(); - }else { - throw new RuntimeException("unexpected VCDataIdentifier"); - } + @Override + public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { } - ExportEvent event = null; - synchronized (this){ - User user = jobRequestToUser.get(jobID); - String key = entryKey(user, jobID); + @Override + public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { } +} - event = new ExportEvent( - this, jobID, user, vcdID.getID(), dataKey, ExportEnums.ExportProgressType.EXPORT_COMPLETE, - format, location, null, timeSpecs, varSpecs); - event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); - event.setHumanReadableExportData(exportSpecs.getHumanReadableExportData()); - if (!listeners.containsKey(key)) { - throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); +@ApplicationScoped +@IfBuildProperty(name = "vcell.exporter", stringValue = "true") +public class ServerExportEventController implements cbit.rmi.event.ExportEventController { + private final ConcurrentHashMap jobRequestToUser = new ConcurrentHashMap<>(); + private final ConcurrentHashMap> listeners = new ConcurrentHashMap<>(); + private final ExportEventQueue exportEventQueue = new ExportEventQueue(); + + private final static Logger logger = LogManager.getLogger(ServerExportEventController.class); + + @Inject + @Channel("outgoing-client-status") + Emitter clientStatusEmitter; + + @Inject + ObjectMapper objectMapper; + + @Incoming("incoming-client-status") + public Uni clientStatusTopicListener(Message message) { + try{ + JsonNode node = objectMapper.readTree(message.getPayload()); + if (node.has("eventType") && node.has("format")){ + ExportEvent exportEvent = objectMapper.treeToValue(node, ExportEvent.class); + synchronized (this){ + exportEventQueue.addExportEvent(exportEvent); + } + logger.debug("Received export status from topic: {}", exportEvent); } - listeners.get(key).onNext(event); - listeners.get(key).complete(); - replaceSetEntry(user, event); - removeServerExportListener(user, jobID); - jobRequestToUser.remove(jobID); + return Uni.createFrom().voidItem(); + } catch (JsonProcessingException jsonProcessingException){ + logger.error("Problem parsing export status message", jsonProcessingException); + return Uni.createFrom().voidItem(); + } finally { + message.ack(); } - - return event; - } - - public void addExportListener(cbit.rmi.event.ExportListener listener) { - throw new IllegalCallerException("addExportListener not implemented for the server"); } - public synchronized Multi getUsersExportStatus(User user, long exportJobID) throws ObjectNotFoundException { - String key = entryKey(user, exportJobID); + public synchronized Multi getSSEUsersExportStatus(User user, long exportJobID) throws ObjectNotFoundException { + String key = sseEventListenerKey(user, exportJobID); if (!listeners.containsKey(key)) { throw new ObjectNotFoundException("Did not find entry for user " + user.getName() + " and job id " + exportJobID); } return listeners.get(key).toMulti(); } - public synchronized Set getMostRecentExportStatus (User user) { - if (!mostRecentExportEvents.containsKey(user)) { - return new HashSet<>(); - } - return mostRecentExportEvents.get(user).stream().map(cpe -> cpe.exportEvent).collect(java.util.stream.Collectors.toSet()); + public synchronized List getMostRecentExportStatus (User user, Instant timestamp) { + return exportEventQueue.getExportEventsPastSpecificTime(user, timestamp).stream().map(ExportEventQueue.MessageExportEvent::exportEvent).toList(); + } + + + public void addExportListener(cbit.rmi.event.ExportListener listener) { + throw new IllegalCallerException("addExportListener not implemented for the server"); } - public synchronized void addServerExportListener(User user, long exportJobID){ + public synchronized void addServerExportListener(ExportRequestListenerMQ.ExportJob exportJob){ + jobRequestToUser.put(exportJob.id(), exportJob.user()); MultiEmitterProcessor emitter = MultiEmitterProcessor.create(); - String key = entryKey(user, exportJobID); + String key = sseEventListenerKey(exportJob.user(), exportJob.id()); listeners.put(key, emitter); - jobRequestToUser.put(exportJobID, user); ExportEvent event = new ExportEvent( - this, exportJobID, user, "", null, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, - "", "", 0.0, null, null); - if (!mostRecentExportEvents.containsKey(user)) { - mostRecentExportEvents.put(user, new HashSet<>()); - } - mostRecentExportEvents.get(user).add(new ComparableExportEvent(event)); - } - - public synchronized void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { - User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, format, null, null, null, null); + this, exportJob.id(), exportJob.user(), exportJob.simulationIdentifier().getID(), exportJob.simulationIdentifier().getSimulationKey(), ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, + exportJob.format().name(), "", null); fireExportEvent(event); } + + + + public synchronized void fireExportEvent(ExportEvent event) { - String key = entryKey(event.getUser(), event.getJobID()); + String key = sseEventListenerKey(event.getUser(), event.getJobID()); if (!listeners.containsKey(key)){ throw new RuntimeException("Did not find entry for user " + event.getUser().getName() + " and job id " + event.getJobID()); } MultiEmitterProcessor listener = listeners.get(event.getUser().getName() + event.getJobID()); listener.onNext(event); - replaceSetEntry(event.getUser(), event); + if (event.getEventType() == ExportEnums.ExportProgressType.EXPORT_FAILURE || event.getEventType() == ExportEnums.ExportProgressType.EXPORT_COMPLETE){ + listener.complete(); + listeners.remove(key); + jobRequestToUser.remove(event.getJobID()); + } + try { + clientStatusEmitter.send(objectMapper.writeValueAsString(event)); + logger.debug("Sent event to client status topic: {}", event); + } catch (JsonProcessingException e) { + logger.error(e); + } } - public synchronized void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { - User user = jobRequestToUser.get(jobID); - String key = entryKey(user, jobID); - if (!listeners.containsKey(key)) { - throw new RuntimeException("Did not find entry for user " + user.getName() + " and job id " + jobID); + private synchronized void fireExportEvent(long jobID, VCDataIdentifier vcdID, String format, Double progress, ExportEnums.ExportProgressType exportProgressType, String message){ + User user = jobRequestToUser.getOrDefault(jobID, null); + if (user == null){ + logger.error("For job (JobID: {}, VCDataID: {}, Format: {}) a user was not found.", jobID, vcdID, format); + return; } - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_FAILURE, format, message, null, null, null); - listeners.get(key).onNext(event); - listeners.get(key).complete(); - - replaceSetEntry(user, event); - removeServerExportListener(user, jobID); - jobRequestToUser.remove(jobID); + ExportEvent event = new ExportEvent(this, jobID, user, vcdID, exportProgressType, format, message, progress); + fireExportEvent(event); } - public synchronized void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { + public synchronized ExportEvent fireExportCompleted(long jobID, VCDataIdentifier vcdID, String format, String location, ExportSpecs exportSpecs) { + final KeyValue dataKey; + if (vcdID instanceof VCSimulationDataIdentifier) { + dataKey = ((VCSimulationDataIdentifier)vcdID).getSimulationKey(); + }else if (vcdID instanceof ExternalDataIdentifier) { + dataKey = ((ExternalDataIdentifier)vcdID).getSimulationKey(); + }else { + throw new RuntimeException("unexpected VCDataIdentifier"); + } + User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_PROGRESS, format, null, progress, null, null); + ExportEvent event = new ExportEvent( + this, jobID, user, vcdID.getID(), dataKey, ExportEnums.ExportProgressType.EXPORT_COMPLETE, + format, location, null); + event.setHumanReadableExportData(exportSpecs != null ? exportSpecs.getHumanReadableExportData() : null); fireExportEvent(event); + + return event; } - public synchronized void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { - User user = jobRequestToUser.get(jobID); - ExportEvent event = new ExportEvent(this, jobID, user, vcdID, ExportEnums.ExportProgressType.EXPORT_START, format, null, null, null, null); - fireExportEvent(event); + public void fireExportFailed(long jobID, VCDataIdentifier vcdID, String format, String message) { + fireExportEvent(jobID, vcdID, format, null, ExportEnums.ExportProgressType.EXPORT_FAILURE, message); } - public synchronized void removeServerExportListener(User user, long exportJobID){ - listeners.remove(user.getName() + exportJobID); + public void fireExportProgress(long jobID, VCDataIdentifier vcdID, String format, double progress) { + fireExportEvent(jobID, vcdID, format, progress, ExportEnums.ExportProgressType.EXPORT_PROGRESS, null); } - private String entryKey(User user, long jobID){ - return user.getName() + jobID; + public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) { + fireExportEvent(jobID, vcdID, format, null, ExportEnums.ExportProgressType.EXPORT_START, null); } - private synchronized void replaceSetEntry(User user, ExportEvent newEvent){ - mostRecentExportEvents.get(user).remove(new ComparableExportEvent(newEvent)); - mostRecentExportEvents.get(user).add(new ComparableExportEvent(newEvent)); + public void fireExportAssembling(long jobID, VCDataIdentifier vcdID, String format) { + fireExportEvent(jobID, vcdID, format, null, ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, null); } + + private String sseEventListenerKey(User user, long jobID){ + return user.getName() + jobID; + } + } diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 2053c8458c..6069d63222 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -2,7 +2,7 @@ quarkus.http.port=9000 quarkus.http.cors=true #%prod.quarkus.http.cors.origins=https://vcell.cam.uchc.edu,https://vcell-dev.cam.uchc.edu,https://vcell-stage.cam.uchc.edu,https://minikube.island,https://minikube.remote,http://localhost:4200 quarkus.http.cors.origins=/.*/ -quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS +quarkus.http.cors.methods=GET,POST,PUT,DELETE,OPTIONS,PATCH quarkus.log.level=INFO %dev.quarkus.log.level=DEBUG @@ -166,6 +166,13 @@ quarkus.swagger-ui.always-include=true %test.quarkus.amqp.devservices.port=2300 %test.quarkus.amqp.devservices.enabled=true %test.vcell.exporter=true + +%test.mp.messaging.incoming.incoming-client-status.connect=smallrye-amqp +%test.mp.messaging.incoming.incoming-client-status.address=client-status + +%test.mp.messaging.outgoing.outgoing-client-status.connect=smallrye-amqp +%test.mp.messaging.outgoing.outgoing-client-status.address=client-status + quarkus.amqp.devservices.enabled=false vcell.exporter=false diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java index b84c22c43a..a51e9f9dc2 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java @@ -27,8 +27,10 @@ import java.io.File; import java.io.IOException; import java.sql.SQLException; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; @@ -74,19 +76,23 @@ public void removeOIDCMappings() throws SQLException, DataAccessException { // Tests the clients capability to submit exports, our queue for accepting and distributing messages, retrieval of export status, and the export job itself @Test public void testExportRequestClient() throws Exception { + final OffsetDateTime time = OffsetDateTime.now(); // Before export even starts, so that all events are grabbed from the queue ExportResourceApi exportResourceApi = new ExportResourceApi(aliceAPIClient); N5ExportRequest exportRequest = getValidExportRequestDTO(0, 1); exportResourceApi.exportN5(exportRequest); CompletableFuture future = CompletableFuture.runAsync(() -> { try{ - Set allEvents = exportResourceApi.exportStatus(); + List allEvents = new ArrayList<>(); + while (allEvents.isEmpty()){ + Thread.sleep(100); + allEvents = exportResourceApi.exportStatus(time); + } ExportEvent eventUnderInspection = allEvents.stream().toList().get(0); - Assertions.assertEquals(1, allEvents.size()); Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, ExportEnums.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue())); while (ExportEnums.ExportProgressType.valueOf(eventUnderInspection.getEventType().getValue()) != ExportEnums.ExportProgressType.EXPORT_COMPLETE){ - allEvents = exportResourceApi.exportStatus(); - eventUnderInspection = allEvents.stream().toList().get(0); + allEvents = exportResourceApi.exportStatus(time); + eventUnderInspection = allEvents.stream().toList().get(allEvents.size() - 1); Thread.sleep(500); } Assertions.assertEquals(ExportProgressType.COMPLETE, eventUnderInspection.getEventType()); diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java index 1d7a48e757..bb7f3d9378 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportServerTest.java @@ -48,7 +48,7 @@ public class ExportServerTest { @Inject Instance requestListenerMQ; @Inject - ServerExportEventController statusCreator; + Instance statusCreator; @Inject ExportService exportService; @Inject @@ -84,7 +84,7 @@ public void removeOIDCMappings() throws SQLException, DataAccessException { // TODO: Add test for the queue itself, ensuring that the ack's and nack's are handled appropriately. - @Test //Tests export listener, and the export service directly without any asynchronous behavior + @Test //Tests export listener, and the export service directly without any event driven behavior public void testExportStatus() throws Exception { long jobID = 1; ExportSpecs exportSpecs = getValidExportSpec(0, 1); @@ -93,7 +93,7 @@ public void testExportStatus() throws Exception { CompletableFuture.runAsync(() -> { try { ExportServiceImpl.makeRemoteFile(new OutputContext(new AnnotatedFunction[]{}), TestEndpointUtils.administratorUser, - dataServer, exportSpecs, statusCreator, jobID); + dataServer, exportSpecs, statusCreator.get(), jobID); } catch (Exception e) { // If an exception is thrown during the export process, the blocking iterable will hang because no finish statement has been sent throw new RuntimeException(e); @@ -104,18 +104,22 @@ public void testExportStatus() throws Exception { switch (i){ case 0: Assertions.assertNull(exportEvent.getProgress()); - Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_START, exportEvent.getEventType()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, exportEvent.getEventType()); break; case 1: + Assertions.assertNull(exportEvent.getProgress()); + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_START, exportEvent.getEventType()); + break; + case 2: Assertions.assertEquals(.25,exportEvent.getProgress()); Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); break; - case 2: + case 3: Assertions.assertEquals(.8125,exportEvent.getProgress()); Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_PROGRESS, exportEvent.getEventType()); Assertions.assertNull(exportEvent.getLocation()); break; - case 3: + case 4: Assertions.assertNull(exportEvent.getProgress()); Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_COMPLETE, exportEvent.getEventType()); Assertions.assertNotNull(exportEvent.getLocation()); @@ -134,13 +138,14 @@ public void testExportStatus() throws Exception { public void testInvalidInputException() throws Exception { ExportSpecs exportSpecs = getValidExportSpec(0, 1); long badJobID = 2; - ExportSpecs badExportSpecs = new ExportSpecs(exportSpecs.getVCDataIdentifier(), null, null, null, - new GeometrySpecs(new SpatialSelection[]{}, 1, 1, ExportEnums.GeometryMode.GEOMETRY_SLICE), null, "TestSim", null); + ExportSpecs badExportSpecs = new ExportSpecs(exportSpecs.getVCDataIdentifier(), ExportFormat.N5, null, null, + new GeometrySpecs(new SpatialSelection[]{}, -1, 5000, ExportEnums.GeometryMode.GEOMETRY_SLICE), null, "TestSim", null); Multi status = createExportListener(badExportSpecs, badJobID); + + // Start job, while having it be blocking on the main thread to check status CompletableFuture future = CompletableFuture.runAsync(() -> { VCSimulationDataIdentifier vcSimulationDataIdentifier = (VCSimulationDataIdentifier) exportSpecs.getVCDataIdentifier(); - ExportRequestListenerMQ.ExportJob exportJob = new ExportRequestListenerMQ.ExportJob(badJobID, TestEndpointUtils.administratorUser, - new AnnotatedFunction[]{}, vcSimulationDataIdentifier.getVcSimID(), vcSimulationDataIdentifier.getJobIndex(), null, null, null, null, null,"TestSim", null); + ExportRequestListenerMQ.ExportJob exportJob = new ExportRequestListenerMQ.ExportJob(badJobID, TestEndpointUtils.administratorUser, new AnnotatedFunction[]{}, vcSimulationDataIdentifier.getVcSimID(), vcSimulationDataIdentifier.getJobIndex(), null, null, null, null, null,"TestSim", null); CompletableFuture job = null; try { job = requestListenerMQ.get().startJob(Message.of(mapper.writeValueAsString(exportJob))); @@ -150,9 +155,20 @@ public void testInvalidInputException() throws Exception { job.join(); Assertions.assertTrue(job.isDone()); }); + + BlockingIterable blockingIterable = status.subscribe().asIterable(); + int i = 0; for (ExportEvent exportEvent : blockingIterable) { - Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_FAILURE, exportEvent.getEventType()); + switch (i){ + case 0: + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_ASSEMBLING, exportEvent.getEventType()); + break; + case 1: + Assertions.assertEquals(ExportEnums.ExportProgressType.EXPORT_FAILURE, exportEvent.getEventType()); + break; + } + i++; } future.join(); } @@ -161,7 +177,7 @@ public void testInvalidInputException() throws Exception { public void testLongRunningThread() throws Exception { ExportRequestListenerMQ.ExportJob exportJob = exportService.createExportJobFromRequest(TestEndpointUtils.administratorUser, getValidExportRequest(0, 3).standardExportInformation(), new N5Specs(ExportEnums.ExportableDataType.PDE_VARIABLE_DATA, ExportFormat.N5, "TestDataset", dummyMaskInfo), ExportFormat.N5); - statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); + statusCreator.get().addServerExportListener(exportJob); ((ExportRequestListenerMQ) requestListenerMQ.get()).setThreadWaitTimeUnit(TimeUnit.MILLISECONDS); CompletableFuture job = ((ExportRequestListenerMQ) requestListenerMQ.get()).startJob(Message.of(mapper.writeValueAsString(exportJob)), false); @@ -228,9 +244,9 @@ private Multi createExportListener(ExportSpecs exportSpecs, long jo ExportRequestListenerMQ.ExportJob exportJob = new ExportRequestListenerMQ.ExportJob(jobID, TestEndpointUtils.administratorUser, new AnnotatedFunction[]{}, vcSimulationDataIdentifier.getVcSimID(), vcSimulationDataIdentifier.getJobIndex(), exportSpecs.getFormat(), exportSpecs.getVariableSpecs(), exportSpecs.getTimeSpecs(), geometrySpecDTO, exportSpecs.getFormatSpecificSpecs(), exportSpecs.getSimulationName(), exportSpecs.getContextName()); - statusCreator.addServerExportListener(TestEndpointUtils.administratorUser, exportJob.id()); + statusCreator.get().addServerExportListener(exportJob); - return statusCreator.getUsersExportStatus(TestEndpointUtils.administratorUser, exportJob.id()); + return statusCreator.get().getSSEUsersExportStatus(TestEndpointUtils.administratorUser, exportJob.id()); } } diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java index 7901339446..3bcf14630a 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java @@ -10,13 +10,16 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.List; import java.util.Set; public class ManualTestExport { public static void main(String[] args) throws URISyntaxException, IOException, ParseException, ApiException, InterruptedException { int numOfExports = 12; + OffsetDateTime time = OffsetDateTime.now(); ApiClient apiClient = InteractiveLogin.login(new URI(InteractiveLogin.authDomain), new URI("https://minikube.remote"), true); System.setProperty("jdk.internal.httpclient.disableHostnameVerification", "true"); @@ -53,7 +56,7 @@ public static void main(String[] args) throws URISyntaxException, IOException, P try { Thread.sleep(1000); System.out.println("---------Checking export status...---------"); - Set exportStatus = exportResourceApi.exportStatus(); + List exportStatus = exportResourceApi.exportStatus(time); for (ExportEvent exportEvent : exportStatus) { if (exportEvent.getEventType() == ExportProgressType.COMPLETE) { numOfExportsCompleted++; diff --git a/vcell-restclient/README.md b/vcell-restclient/README.md index d176009a22..5bc2e07f1b 100644 --- a/vcell-restclient/README.md +++ b/vcell-restclient/README.md @@ -121,8 +121,8 @@ Class | Method | HTTP request | Description *BioModelResourceApi* | [**saveBioModelWithHttpInfo**](docs/BioModelResourceApi.md#saveBioModelWithHttpInfo) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. *ExportResourceApi* | [**exportN5**](docs/ExportResourceApi.md#exportN5) | **POST** /api/v1/export/N5 | *ExportResourceApi* | [**exportN5WithHttpInfo**](docs/ExportResourceApi.md#exportN5WithHttpInfo) | **POST** /api/v1/export/N5 | -*ExportResourceApi* | [**exportStatus**](docs/ExportResourceApi.md#exportStatus) | **GET** /api/v1/export/status | -*ExportResourceApi* | [**exportStatusWithHttpInfo**](docs/ExportResourceApi.md#exportStatusWithHttpInfo) | **GET** /api/v1/export/status | +*ExportResourceApi* | [**exportStatus**](docs/ExportResourceApi.md#exportStatus) | **PATCH** /api/v1/export/status | +*ExportResourceApi* | [**exportStatusWithHttpInfo**](docs/ExportResourceApi.md#exportStatusWithHttpInfo) | **PATCH** /api/v1/export/status | *FieldDataResourceApi* | [**advancedCreate**](docs/FieldDataResourceApi.md#advancedCreate) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**advancedCreateWithHttpInfo**](docs/FieldDataResourceApi.md#advancedCreateWithHttpInfo) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**analyzeFile**](docs/FieldDataResourceApi.md#analyzeFile) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and return field data. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores. diff --git a/vcell-restclient/api/openapi.yaml b/vcell-restclient/api/openapi.yaml index 39e580aa3b..f6144add43 100644 --- a/vcell-restclient/api/openapi.yaml +++ b/vcell-restclient/api/openapi.yaml @@ -500,9 +500,14 @@ paths: x-content-type: application/json x-accepts: application/json /api/v1/export/status: - get: - description: Get the status of your most recent export jobs. + patch: + description: Get the status of your export jobs past the timestamp (UTC format). operationId: exportStatus + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Instant' responses: "200": content: @@ -511,7 +516,6 @@ paths: items: $ref: '#/components/schemas/ExportEvent' type: array - uniqueItems: true description: OK "401": content: @@ -532,6 +536,7 @@ paths: - user tags: - Export Resource + x-content-type: application/json x-accepts: application/json /api/v1/fieldData/IDs: get: @@ -2881,11 +2886,6 @@ components: example: dataKey: dataKey jobID: 6 - variableSpecs: - mode: null - variableNames: - - variableNames - - variableNames dataIdString: dataIdString format: format humanReadableData: @@ -2912,13 +2912,6 @@ components: - null userName: userName key: key - timeSpecs: - mode: null - endTimeIndex: 9 - beginTimeIndex: 5 - allTimes: - - 9.369310271410669 - - 9.369310271410669 properties: eventType: $ref: '#/components/schemas/ExportProgressType' @@ -2938,10 +2931,6 @@ components: type: string dataIdString: type: string - timeSpecs: - $ref: '#/components/schemas/TimeSpecs' - variableSpecs: - $ref: '#/components/schemas/VariableSpecs' humanReadableData: $ref: '#/components/schemas/HumanReadableExportData' type: object diff --git a/vcell-restclient/docs/ExportEvent.md b/vcell-restclient/docs/ExportEvent.md index 7db15120d6..dce83de325 100644 --- a/vcell-restclient/docs/ExportEvent.md +++ b/vcell-restclient/docs/ExportEvent.md @@ -15,8 +15,6 @@ |**jobID** | **Long** | | [optional] | |**dataKey** | **String** | | [optional] | |**dataIdString** | **String** | | [optional] | -|**timeSpecs** | [**TimeSpecs**](TimeSpecs.md) | | [optional] | -|**variableSpecs** | [**VariableSpecs**](VariableSpecs.md) | | [optional] | |**humanReadableData** | [**HumanReadableExportData**](HumanReadableExportData.md) | | [optional] | diff --git a/vcell-restclient/docs/ExportResourceApi.md b/vcell-restclient/docs/ExportResourceApi.md index dfe3ea3c01..c98a2f3ace 100644 --- a/vcell-restclient/docs/ExportResourceApi.md +++ b/vcell-restclient/docs/ExportResourceApi.md @@ -6,8 +6,8 @@ All URIs are relative to *https://vcell.cam.uchc.edu* |------------- | ------------- | -------------| | [**exportN5**](ExportResourceApi.md#exportN5) | **POST** /api/v1/export/N5 | | | [**exportN5WithHttpInfo**](ExportResourceApi.md#exportN5WithHttpInfo) | **POST** /api/v1/export/N5 | | -| [**exportStatus**](ExportResourceApi.md#exportStatus) | **GET** /api/v1/export/status | | -| [**exportStatusWithHttpInfo**](ExportResourceApi.md#exportStatusWithHttpInfo) | **GET** /api/v1/export/status | | +| [**exportStatus**](ExportResourceApi.md#exportStatus) | **PATCH** /api/v1/export/status | | +| [**exportStatusWithHttpInfo**](ExportResourceApi.md#exportStatusWithHttpInfo) | **PATCH** /api/v1/export/status | | @@ -161,11 +161,11 @@ ApiResponse<**Long**> ## exportStatus -> Set exportStatus() +> List exportStatus(body) -Get the status of your most recent export jobs. +Get the status of your export jobs past the timestamp (UTC format). ### Example @@ -185,8 +185,9 @@ public class Example { ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); + OffsetDateTime body = OffsetDateTime.now(); // OffsetDateTime | try { - Set result = apiInstance.exportStatus(); + List result = apiInstance.exportStatus(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExportResourceApi#exportStatus"); @@ -201,11 +202,14 @@ public class Example { ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **OffsetDateTime**| | [optional] | ### Return type -[**Set<ExportEvent>**](ExportEvent.md) +[**List<ExportEvent>**](ExportEvent.md) ### Authorization @@ -214,7 +218,7 @@ This endpoint does not need any parameter. ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json ### HTTP response details @@ -227,11 +231,11 @@ This endpoint does not need any parameter. ## exportStatusWithHttpInfo -> ApiResponse> exportStatus exportStatusWithHttpInfo() +> ApiResponse> exportStatus exportStatusWithHttpInfo(body) -Get the status of your most recent export jobs. +Get the status of your export jobs past the timestamp (UTC format). ### Example @@ -252,8 +256,9 @@ public class Example { ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); + OffsetDateTime body = OffsetDateTime.now(); // OffsetDateTime | try { - ApiResponse> response = apiInstance.exportStatusWithHttpInfo(); + ApiResponse> response = apiInstance.exportStatusWithHttpInfo(body); System.out.println("Status code: " + response.getStatusCode()); System.out.println("Response headers: " + response.getHeaders()); System.out.println("Response body: " + response.getData()); @@ -270,11 +275,14 @@ public class Example { ### Parameters -This endpoint does not need any parameter. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | **OffsetDateTime**| | [optional] | ### Return type -ApiResponse<[**Set<ExportEvent>**](ExportEvent.md)> +ApiResponse<[**List<ExportEvent>**](ExportEvent.md)> ### Authorization @@ -283,7 +291,7 @@ ApiResponse<[**Set<ExportEvent>**](ExportEvent.md)> ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json ### HTTP response details diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java b/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java index 10c124b129..40e30e55b6 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java @@ -19,7 +19,7 @@ import org.vcell.restclient.model.ExportEvent; import org.vcell.restclient.model.N5ExportRequest; -import java.util.Set; +import java.time.OffsetDateTime; import org.vcell.restclient.model.VCellHTTPError; import com.fasterxml.jackson.core.type.TypeReference; @@ -159,23 +159,25 @@ private HttpRequest.Builder exportN5RequestBuilder(N5ExportRequest n5ExportReque } /** * - * Get the status of your most recent export jobs. - * @return Set<ExportEvent> + * Get the status of your export jobs past the timestamp (UTC format). + * @param body (optional) + * @return List<ExportEvent> * @throws ApiException if fails to make API call */ - public Set exportStatus() throws ApiException { - ApiResponse> localVarResponse = exportStatusWithHttpInfo(); + public List exportStatus(OffsetDateTime body) throws ApiException { + ApiResponse> localVarResponse = exportStatusWithHttpInfo(body); return localVarResponse.getData(); } /** * - * Get the status of your most recent export jobs. - * @return ApiResponse<Set<ExportEvent>> + * Get the status of your export jobs past the timestamp (UTC format). + * @param body (optional) + * @return ApiResponse<List<ExportEvent>> * @throws ApiException if fails to make API call */ - public ApiResponse> exportStatusWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = exportStatusRequestBuilder(); + public ApiResponse> exportStatusWithHttpInfo(OffsetDateTime body) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = exportStatusRequestBuilder(body); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -187,10 +189,10 @@ public ApiResponse> exportStatusWithHttpInfo() throws ApiExcept if (localVarResponse.statusCode()/ 100 != 2) { throw getApiException("exportStatus", localVarResponse); } - return new ApiResponse>( + return new ApiResponse>( localVarResponse.statusCode(), localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream + localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream ); } finally { } @@ -203,7 +205,7 @@ public ApiResponse> exportStatusWithHttpInfo() throws ApiExcept } } - private HttpRequest.Builder exportStatusRequestBuilder() throws ApiException { + private HttpRequest.Builder exportStatusRequestBuilder(OffsetDateTime body) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); @@ -211,9 +213,15 @@ private HttpRequest.Builder exportStatusRequestBuilder() throws ApiException { localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java index aa5e08e5d2..6257f6c836 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/model/ExportEvent.java @@ -27,9 +27,7 @@ import java.util.Arrays; import org.vcell.restclient.model.ExportProgressType; import org.vcell.restclient.model.HumanReadableExportData; -import org.vcell.restclient.model.TimeSpecs; import org.vcell.restclient.model.User; -import org.vcell.restclient.model.VariableSpecs; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -45,8 +43,6 @@ ExportEvent.JSON_PROPERTY_JOB_I_D, ExportEvent.JSON_PROPERTY_DATA_KEY, ExportEvent.JSON_PROPERTY_DATA_ID_STRING, - ExportEvent.JSON_PROPERTY_TIME_SPECS, - ExportEvent.JSON_PROPERTY_VARIABLE_SPECS, ExportEvent.JSON_PROPERTY_HUMAN_READABLE_DATA }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -75,12 +71,6 @@ public class ExportEvent { public static final String JSON_PROPERTY_DATA_ID_STRING = "dataIdString"; private String dataIdString; - public static final String JSON_PROPERTY_TIME_SPECS = "timeSpecs"; - private TimeSpecs timeSpecs; - - public static final String JSON_PROPERTY_VARIABLE_SPECS = "variableSpecs"; - private VariableSpecs variableSpecs; - public static final String JSON_PROPERTY_HUMAN_READABLE_DATA = "humanReadableData"; private HumanReadableExportData humanReadableData; @@ -287,56 +277,6 @@ public void setDataIdString(String dataIdString) { } - public ExportEvent timeSpecs(TimeSpecs timeSpecs) { - this.timeSpecs = timeSpecs; - return this; - } - - /** - * Get timeSpecs - * @return timeSpecs - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TIME_SPECS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TimeSpecs getTimeSpecs() { - return timeSpecs; - } - - - @JsonProperty(JSON_PROPERTY_TIME_SPECS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTimeSpecs(TimeSpecs timeSpecs) { - this.timeSpecs = timeSpecs; - } - - - public ExportEvent variableSpecs(VariableSpecs variableSpecs) { - this.variableSpecs = variableSpecs; - return this; - } - - /** - * Get variableSpecs - * @return variableSpecs - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_VARIABLE_SPECS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public VariableSpecs getVariableSpecs() { - return variableSpecs; - } - - - @JsonProperty(JSON_PROPERTY_VARIABLE_SPECS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVariableSpecs(VariableSpecs variableSpecs) { - this.variableSpecs = variableSpecs; - } - - public ExportEvent humanReadableData(HumanReadableExportData humanReadableData) { this.humanReadableData = humanReadableData; return this; @@ -382,14 +322,12 @@ public boolean equals(Object o) { Objects.equals(this.jobID, exportEvent.jobID) && Objects.equals(this.dataKey, exportEvent.dataKey) && Objects.equals(this.dataIdString, exportEvent.dataIdString) && - Objects.equals(this.timeSpecs, exportEvent.timeSpecs) && - Objects.equals(this.variableSpecs, exportEvent.variableSpecs) && Objects.equals(this.humanReadableData, exportEvent.humanReadableData); } @Override public int hashCode() { - return Objects.hash(eventType, progress, format, location, user, jobID, dataKey, dataIdString, timeSpecs, variableSpecs, humanReadableData); + return Objects.hash(eventType, progress, format, location, user, jobID, dataKey, dataIdString, humanReadableData); } @Override @@ -404,8 +342,6 @@ public String toString() { sb.append(" jobID: ").append(toIndentedString(jobID)).append("\n"); sb.append(" dataKey: ").append(toIndentedString(dataKey)).append("\n"); sb.append(" dataIdString: ").append(toIndentedString(dataIdString)).append("\n"); - sb.append(" timeSpecs: ").append(toIndentedString(timeSpecs)).append("\n"); - sb.append(" variableSpecs: ").append(toIndentedString(variableSpecs)).append("\n"); sb.append(" humanReadableData: ").append(toIndentedString(humanReadableData)).append("\n"); sb.append("}"); return sb.toString(); @@ -494,16 +430,6 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format("%sdataIdString%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDataIdString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); } - // add `timeSpecs` to the URL query string - if (getTimeSpecs() != null) { - joiner.add(getTimeSpecs().toUrlQueryString(prefix + "timeSpecs" + suffix)); - } - - // add `variableSpecs` to the URL query string - if (getVariableSpecs() != null) { - joiner.add(getVariableSpecs().toUrlQueryString(prefix + "variableSpecs" + suffix)); - } - // add `humanReadableData` to the URL query string if (getHumanReadableData() != null) { joiner.add(getHumanReadableData().toUrlQueryString(prefix + "humanReadableData" + suffix)); diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java b/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java index daf4932964..8066969d80 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/utils/DtoModelTransforms.java @@ -517,8 +517,6 @@ public static ExportEvent dtoToExportEvent(org.vcell.restclient.model.ExportEven long jobID = restEvent.getJobID() != null ? restEvent.getJobID() : 0L; org.vcell.util.document.KeyValue dataKey = restEvent.getDataKey() != null ? new org.vcell.util.document.KeyValue(restEvent.getDataKey()) : null; String dataIdString = restEvent.getDataIdString(); - cbit.vcell.export.server.TimeSpecs timeSpecs = restEvent.getTimeSpecs() == null ? null : dtoToTimeSpecs(restEvent.getTimeSpecs()); - cbit.vcell.export.server.VariableSpecs variableSpecs = restEvent.getVariableSpecs() == null ? null : dtoToVariableSpecs(restEvent.getVariableSpecs()); // Construct ExportEvent return new cbit.rmi.event.ExportEvent( @@ -530,9 +528,7 @@ public static ExportEvent dtoToExportEvent(org.vcell.restclient.model.ExportEven eventType, format, location, - progress, - timeSpecs, - variableSpecs + progress ); } } diff --git a/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java b/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java index 9443c783d8..3f45167e20 100644 --- a/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java +++ b/vcell-restclient/src/test/java/org/vcell/restclient/api/ExportResourceApiTest.java @@ -62,12 +62,5 @@ public void exportN5Test() throws ApiException { * @throws ApiException * if the Api call fails */ - @Test - public void exportStatusTest() throws ApiException { - Set response = - api.exportStatus(); - - // TODO: test validations - } } diff --git a/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts b/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts index 1a54804fb5..b7e77c97b4 100644 --- a/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts +++ b/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts @@ -170,14 +170,15 @@ export class ExportResourceService implements ExportResourceServiceInterface { } /** - * Get the status of your most recent export jobs. + * Get the status of your export jobs past the timestamp (UTC format). + * @param body * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public exportStatus(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public exportStatus(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; - public exportStatus(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; - public exportStatus(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + public exportStatus(body?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public exportStatus(body?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public exportStatus(body?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public exportStatus(body?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { let localVarHeaders = this.defaultHeaders; @@ -205,6 +206,15 @@ export class ExportResourceService implements ExportResourceServiceInterface { } + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -217,9 +227,10 @@ export class ExportResourceService implements ExportResourceServiceInterface { } let localVarPath = `/api/v1/export/status`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, + return this.httpClient.request>('patch', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, + body: body, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, diff --git a/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts b/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts index c2d92e7576..708e858c11 100644 --- a/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts +++ b/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts @@ -35,8 +35,9 @@ export interface ExportResourceServiceInterface { /** * - * Get the status of your most recent export jobs. + * Get the status of your export jobs past the timestamp (UTC format). + * @param body */ - exportStatus(extraHttpRequestParams?: any): Observable>; + exportStatus(body?: string, extraHttpRequestParams?: any): Observable>; } diff --git a/webapp-ng/src/app/core/modules/openapi/model/export-event.ts b/webapp-ng/src/app/core/modules/openapi/model/export-event.ts index f1433b927b..0db5c39442 100644 --- a/webapp-ng/src/app/core/modules/openapi/model/export-event.ts +++ b/webapp-ng/src/app/core/modules/openapi/model/export-event.ts @@ -9,10 +9,8 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { VariableSpecs } from './variable-specs'; import { ExportProgressType } from './export-progress-type'; import { User } from './user'; -import { TimeSpecs } from './time-specs'; import { HumanReadableExportData } from './human-readable-export-data'; @@ -25,8 +23,6 @@ export interface ExportEvent { jobID?: number; dataKey?: string; dataIdString?: string; - timeSpecs?: TimeSpecs; - variableSpecs?: VariableSpecs; humanReadableData?: HumanReadableExportData; } export namespace ExportEvent { From 309c01d11028fee89b1451d1a09022d788ad814b Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Fri, 15 Aug 2025 07:52:26 -0400 Subject: [PATCH 40/41] Refactor Server Export Event Controller --- .../activemq/ExportRequestListenerMQ.java | 4 +- .../restq/services/Exports/ExportService.java | 4 +- .../Exports/ExportStatusListener.java | 55 +++++++++++++++++++ .../Exports/ServerExportEventController.java | 35 +----------- .../src/main/resources/application.properties | 16 +++--- 5 files changed, 69 insertions(+), 45 deletions(-) create mode 100644 vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusListener.java diff --git a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java index f3fa388f47..ea602a6227 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java +++ b/vcell-rest/src/main/java/org/vcell/restq/activemq/ExportRequestListenerMQ.java @@ -69,7 +69,7 @@ public class ExportRequestListenerMQ implements ExportMQInterface { ObjectMapper mapper; @Inject - @Channel("export-request") + @Channel("publisher-export-request") Emitter exportJobEmitter; @PostConstruct @@ -91,7 +91,7 @@ public void addExportJobToQueue(ExportJob exportJob) { } } - @Incoming("processed-export-request") + @Incoming("subscriber-export-request") public Uni consumeExportRequest(Message message) { try { logger.debug("Received export request: {}", message.getPayload()); diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index e40f680173..dc8c346320 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -34,6 +34,8 @@ public class ExportService { @Inject Instance exportStatusCreator; + @Inject + Instance exportStatusListener; @Inject SimulationRestService simulationRestService; @@ -47,7 +49,7 @@ public Multi getExportStatuses(User user, long jobID) throws Object } public List getMostRecentExportStatus(User user, Instant instant) { - return ((ServerExportEventController) exportStatusCreator.get()).getMostRecentExportStatus(user, instant); + return exportStatusListener.get().getMostRecentExportStatus(user, instant); } public ExportRequestListenerMQ.ExportJob createExportJobFromRequest(User user, ExportResource.StandardExportInfo request, FormatSpecificSpecs formatSpecificSpecs, ExportFormat format) throws DataAccessException, SQLException { diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusListener.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusListener.java new file mode 100644 index 0000000000..20466732d1 --- /dev/null +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportStatusListener.java @@ -0,0 +1,55 @@ +package org.vcell.restq.services.Exports; + +import cbit.rmi.event.ExportEvent; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.arc.properties.IfBuildProperty; +import io.smallrye.mutiny.Uni; +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.eclipse.microprofile.reactive.messaging.Incoming; +import org.eclipse.microprofile.reactive.messaging.Message; +import org.vcell.util.document.User; + +import java.time.Instant; +import java.util.List; + + +@ApplicationScoped +@IfBuildProperty(name = "vcell.exporter", stringValue = "true") +public class ExportStatusListener { + private final ExportEventQueue exportEventQueue = new ExportEventQueue(); + private final Logger logger = LogManager.getLogger(ExportStatusListener.class); + + + @Inject + ObjectMapper objectMapper; + + + @Incoming("subscriber-client-status") + public Uni clientStatusTopicListener(Message message) { + try{ + JsonNode node = objectMapper.readTree(message.getPayload()); + if (node.has("eventType") && node.has("format")){ + ExportEvent exportEvent = objectMapper.treeToValue(node, ExportEvent.class); + synchronized (this){ + exportEventQueue.addExportEvent(exportEvent); + } + logger.debug("Received export status from topic: {}", exportEvent); + } + return Uni.createFrom().voidItem(); + } catch (JsonProcessingException jsonProcessingException){ + logger.error("Problem parsing export status message", jsonProcessingException); + return Uni.createFrom().voidItem(); + } finally { + message.ack(); + } + } + + public synchronized List getMostRecentExportStatus (User user, Instant timestamp) { + return exportEventQueue.getExportEventsPastSpecificTime(user, timestamp).stream().map(ExportEventQueue.MessageExportEvent::exportEvent).toList(); + } +} diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java index 62e2f3a9f6..1a1c8b8712 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ServerExportEventController.java @@ -7,11 +7,9 @@ import cbit.vcell.export.server.ExportSpecs; import cbit.vcell.solver.VCSimulationDataIdentifier; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import io.quarkus.arc.properties.IfBuildProperty; import io.smallrye.mutiny.Multi; -import io.smallrye.mutiny.Uni; import io.smallrye.mutiny.helpers.MultiEmitterProcessor; import jakarta.enterprise.context.ApplicationScoped; import jakarta.inject.Inject; @@ -19,8 +17,6 @@ import org.apache.logging.log4j.Logger; import org.eclipse.microprofile.reactive.messaging.Channel; import org.eclipse.microprofile.reactive.messaging.Emitter; -import org.eclipse.microprofile.reactive.messaging.Incoming; -import org.eclipse.microprofile.reactive.messaging.Message; import org.vcell.restq.activemq.ExportRequestListenerMQ; import org.vcell.util.ObjectNotFoundException; import org.vcell.util.document.ExternalDataIdentifier; @@ -28,8 +24,6 @@ import org.vcell.util.document.User; import org.vcell.util.document.VCDataIdentifier; -import java.time.Instant; -import java.util.List; import java.util.concurrent.ConcurrentHashMap; @ApplicationScoped @@ -66,36 +60,16 @@ public void fireExportStarted(long jobID, VCDataIdentifier vcdID, String format) public class ServerExportEventController implements cbit.rmi.event.ExportEventController { private final ConcurrentHashMap jobRequestToUser = new ConcurrentHashMap<>(); private final ConcurrentHashMap> listeners = new ConcurrentHashMap<>(); - private final ExportEventQueue exportEventQueue = new ExportEventQueue(); private final static Logger logger = LogManager.getLogger(ServerExportEventController.class); @Inject - @Channel("outgoing-client-status") + @Channel("publisher-client-status") Emitter clientStatusEmitter; @Inject ObjectMapper objectMapper; - @Incoming("incoming-client-status") - public Uni clientStatusTopicListener(Message message) { - try{ - JsonNode node = objectMapper.readTree(message.getPayload()); - if (node.has("eventType") && node.has("format")){ - ExportEvent exportEvent = objectMapper.treeToValue(node, ExportEvent.class); - synchronized (this){ - exportEventQueue.addExportEvent(exportEvent); - } - logger.debug("Received export status from topic: {}", exportEvent); - } - return Uni.createFrom().voidItem(); - } catch (JsonProcessingException jsonProcessingException){ - logger.error("Problem parsing export status message", jsonProcessingException); - return Uni.createFrom().voidItem(); - } finally { - message.ack(); - } - } public synchronized Multi getSSEUsersExportStatus(User user, long exportJobID) throws ObjectNotFoundException { String key = sseEventListenerKey(user, exportJobID); @@ -105,10 +79,6 @@ public synchronized Multi getSSEUsersExportStatus(User user, long e return listeners.get(key).toMulti(); } - public synchronized List getMostRecentExportStatus (User user, Instant timestamp) { - return exportEventQueue.getExportEventsPastSpecificTime(user, timestamp).stream().map(ExportEventQueue.MessageExportEvent::exportEvent).toList(); - } - public void addExportListener(cbit.rmi.event.ExportListener listener) { throw new IllegalCallerException("addExportListener not implemented for the server"); @@ -126,9 +96,6 @@ public synchronized void addServerExportListener(ExportRequestListenerMQ.ExportJ } - - - public synchronized void fireExportEvent(ExportEvent event) { String key = sseEventListenerKey(event.getUser(), event.getJobID()); if (!listeners.containsKey(key)){ diff --git a/vcell-rest/src/main/resources/application.properties b/vcell-rest/src/main/resources/application.properties index 6069d63222..93a166cd53 100644 --- a/vcell-rest/src/main/resources/application.properties +++ b/vcell-rest/src/main/resources/application.properties @@ -158,20 +158,20 @@ quarkus.swagger-ui.always-include=true ############# # ActiveMQ # ############ -%test.mp.messaging.outgoing.export-request.connector=smallrye-amqp -%test.mp.messaging.outgoing.export-request.address=export-request +%test.mp.messaging.outgoing.publisher-export-request.connector=smallrye-amqp +%test.mp.messaging.outgoing.publisher-export-request.address=export-request -%test.mp.messaging.incoming.processed-export-request.connector=smallrye-amqp -%test.mp.messaging.incoming.processed-export-request.address=export-request +%test.mp.messaging.incoming.subscriber-export-request.connector=smallrye-amqp +%test.mp.messaging.incoming.subscriber-export-request.address=export-request %test.quarkus.amqp.devservices.port=2300 %test.quarkus.amqp.devservices.enabled=true %test.vcell.exporter=true -%test.mp.messaging.incoming.incoming-client-status.connect=smallrye-amqp -%test.mp.messaging.incoming.incoming-client-status.address=client-status +%test.mp.messaging.incoming.subscriber-client-status.connect=smallrye-amqp +%test.mp.messaging.incoming.subscriber-client-status.address=client-status -%test.mp.messaging.outgoing.outgoing-client-status.connect=smallrye-amqp -%test.mp.messaging.outgoing.outgoing-client-status.address=client-status +%test.mp.messaging.outgoing.publisher-client-status.connect=smallrye-amqp +%test.mp.messaging.outgoing.publisher-client-status.address=client-status quarkus.amqp.devservices.enabled=false From 07deeb083fa3aaa5573ec7ad8f178abe267964ee Mon Sep 17 00:00:00 2001 From: Ezequiel Valencia Date: Fri, 15 Aug 2025 10:39:10 -0400 Subject: [PATCH 41/41] Update Client to Use Epoch Second --- python-restclient/README.md | 2 +- python-restclient/docs/ExportResourceApi.md | 14 ++--- .../vcell_client/api/export_resource_api.py | 55 ++++++++----------- tools/openapi.yaml | 16 +++--- .../api/server/AsynchMessageManager.java | 8 +-- .../vcell/restq/handlers/ExportResource.java | 6 +- .../restq/services/Exports/ExportService.java | 4 +- .../restq/exports/ExportRequestTest.java | 3 +- .../vcell/restq/exports/ManualTestExport.java | 3 +- vcell-restclient/README.md | 4 +- vcell-restclient/api/openapi.yaml | 20 ++++--- vcell-restclient/docs/ExportResourceApi.md | 28 +++++----- .../restclient/api/ExportResourceApi.java | 44 +++++++++------ .../openapi/api/export-resource.service.ts | 31 +++++------ .../api/export-resource.serviceInterface.ts | 6 +- 15 files changed, 122 insertions(+), 122 deletions(-) diff --git a/python-restclient/README.md b/python-restclient/README.md index b160f3e372..9f03577c84 100644 --- a/python-restclient/README.md +++ b/python-restclient/README.md @@ -97,7 +97,7 @@ Class | Method | HTTP request | Description *BioModelResourceApi* | [**get_bio_model_vcml**](docs/BioModelResourceApi.md#get_bio_model_vcml) | **GET** /api/v1/bioModel/{bioModelID}/vcml_download | Get the BioModel in VCML format. *BioModelResourceApi* | [**save_bio_model**](docs/BioModelResourceApi.md#save_bio_model) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. *ExportResourceApi* | [**export_n5**](docs/ExportResourceApi.md#export_n5) | **POST** /api/v1/export/N5 | -*ExportResourceApi* | [**export_status**](docs/ExportResourceApi.md#export_status) | **PATCH** /api/v1/export/status | +*ExportResourceApi* | [**export_status**](docs/ExportResourceApi.md#export_status) | **GET** /api/v1/export/status | *FieldDataResourceApi* | [**advanced_create**](docs/FieldDataResourceApi.md#advanced_create) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**analyze_file**](docs/FieldDataResourceApi.md#analyze_file) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and return field data. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores. *FieldDataResourceApi* | [**copy_models_field_data**](docs/FieldDataResourceApi.md#copy_models_field_data) | **POST** /api/v1/fieldData/copyModelsFieldData | Copy all existing field data from a BioModel/MathModel that you have access to, but don't own. diff --git a/python-restclient/docs/ExportResourceApi.md b/python-restclient/docs/ExportResourceApi.md index 526d75c0fb..0f8f17bfa0 100644 --- a/python-restclient/docs/ExportResourceApi.md +++ b/python-restclient/docs/ExportResourceApi.md @@ -5,7 +5,7 @@ All URIs are relative to *https://vcell.cam.uchc.edu* Method | HTTP request | Description ------------- | ------------- | ------------- [**export_n5**](ExportResourceApi.md#export_n5) | **POST** /api/v1/export/N5 | -[**export_status**](ExportResourceApi.md#export_status) | **PATCH** /api/v1/export/status | +[**export_status**](ExportResourceApi.md#export_status) | **GET** /api/v1/export/status | # **export_n5** @@ -84,11 +84,11 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **export_status** -> List[ExportEvent] export_status(body=body) +> List[ExportEvent] export_status(timestamp=timestamp) -Get the status of your export jobs past the timestamp (UTC format). +Get the status of your export jobs past the timestamp (Unix epoch in seconds). ### Example @@ -115,10 +115,10 @@ configuration = vcell_client.Configuration( with vcell_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = vcell_client.ExportResourceApi(api_client) - body = '2013-10-20T19:20:30+01:00' # datetime | (optional) + timestamp = 56 # int | (optional) try: - api_response = api_instance.export_status(body=body) + api_response = api_instance.export_status(timestamp=timestamp) print("The response of ExportResourceApi->export_status:\n") pprint(api_response) except Exception as e: @@ -131,7 +131,7 @@ with vcell_client.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | **datetime**| | [optional] + **timestamp** | **int**| | [optional] ### Return type @@ -143,7 +143,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details diff --git a/python-restclient/vcell_client/api/export_resource_api.py b/python-restclient/vcell_client/api/export_resource_api.py index f02996de3d..51b2e44c4f 100644 --- a/python-restclient/vcell_client/api/export_resource_api.py +++ b/python-restclient/vcell_client/api/export_resource_api.py @@ -24,7 +24,7 @@ except ImportError: from typing_extensions import Annotated -from datetime import datetime +from pydantic import StrictInt from typing import List, Optional @@ -342,7 +342,7 @@ def _export_n5_serialize( @validate_call def export_status( self, - body: Optional[datetime] = None, + timestamp: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -358,10 +358,10 @@ def export_status( ) -> List[ExportEvent]: """export_status - Get the status of your export jobs past the timestamp (UTC format). + Get the status of your export jobs past the timestamp (Unix epoch in seconds). - :param body: - :type body: datetime + :param timestamp: + :type timestamp: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -385,7 +385,7 @@ def export_status( """ # noqa: E501 _param = self._export_status_serialize( - body=body, + timestamp=timestamp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -413,7 +413,7 @@ def export_status( @validate_call def export_status_with_http_info( self, - body: Optional[datetime] = None, + timestamp: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -429,10 +429,10 @@ def export_status_with_http_info( ) -> ApiResponse[List[ExportEvent]]: """export_status - Get the status of your export jobs past the timestamp (UTC format). + Get the status of your export jobs past the timestamp (Unix epoch in seconds). - :param body: - :type body: datetime + :param timestamp: + :type timestamp: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -456,7 +456,7 @@ def export_status_with_http_info( """ # noqa: E501 _param = self._export_status_serialize( - body=body, + timestamp=timestamp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -484,7 +484,7 @@ def export_status_with_http_info( @validate_call def export_status_without_preload_content( self, - body: Optional[datetime] = None, + timestamp: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -500,10 +500,10 @@ def export_status_without_preload_content( ) -> RESTResponseType: """export_status - Get the status of your export jobs past the timestamp (UTC format). + Get the status of your export jobs past the timestamp (Unix epoch in seconds). - :param body: - :type body: datetime + :param timestamp: + :type timestamp: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -527,7 +527,7 @@ def export_status_without_preload_content( """ # noqa: E501 _param = self._export_status_serialize( - body=body, + timestamp=timestamp, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -550,7 +550,7 @@ def export_status_without_preload_content( def _export_status_serialize( self, - body, + timestamp, _request_auth, _content_type, _headers, @@ -572,11 +572,13 @@ def _export_status_serialize( # process the path parameters # process the query parameters + if timestamp is not None: + + _query_params.append(('timestamp', timestamp)) + # process the header parameters # process the form parameters # process the body parameter - if body is not None: - _body_params = body # set the HTTP header `Accept` @@ -586,19 +588,6 @@ def _export_status_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -606,7 +595,7 @@ def _export_status_serialize( ] return self.api_client.param_serialize( - method='PATCH', + method='GET', resource_path='/api/v1/export/status', path_params=_path_params, query_params=_query_params, diff --git a/tools/openapi.yaml b/tools/openapi.yaml index c326c7769b..0c7df40f21 100644 --- a/tools/openapi.yaml +++ b/tools/openapi.yaml @@ -462,16 +462,18 @@ paths: - openId: - user /api/v1/export/status: - patch: + get: tags: - Export Resource - description: Get the status of your export jobs past the timestamp (UTC format). + description: Get the status of your export jobs past the timestamp (Unix epoch + in seconds). operationId: exportStatus - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Instant' + parameters: + - name: timestamp + in: query + schema: + format: int64 + type: integer responses: "200": description: OK diff --git a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java index 7d5bc12501..20f953c1d2 100644 --- a/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java +++ b/vcell-apiclient/src/main/java/org/vcell/api/server/AsynchMessageManager.java @@ -12,7 +12,6 @@ import java.time.Instant; import java.time.OffsetDateTime; import java.util.List; -import java.util.Set; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -48,7 +47,6 @@ import cbit.vcell.resource.VCellExecutorService; import cbit.vcell.server.VCellConnection; import edu.uchc.connjur.wb.ExecutionTrace; -import org.vcell.util.ObjectNotFoundException; /** * {@link AsynchMessageManager} polls from {@link VCellConnection} to get remote messages. Remote Messages include the following: @@ -72,7 +70,7 @@ public class AsynchMessageManager implements AsyncMessageManagerInterface { private long pollTime = BASE_POLL_SECONDS; private AtomicBoolean bPoll = new AtomicBoolean(false); private ScheduledFuture pollingHandle = null; - private OffsetDateTime lastPoll = OffsetDateTime.now(); + private long lastPollEpochSecond = Instant.now().getEpochSecond(); /** * for {@link #schedule(long)} method */ @@ -143,10 +141,10 @@ private void poll( ) { pollTime = BASE_POLL_SECONDS; queuedEvents = clientServerManager.getMessageEvents(); try{ - List setOfExports = clientServerManager.getVCellApiClient().getExportApi().exportStatus(lastPoll); + List setOfExports = clientServerManager.getVCellApiClient().getExportApi().exportStatus(lastPollEpochSecond); List exportEvents = setOfExports.stream().map(DtoModelTransforms::dtoToExportEvent).toList(); queuedEvents = Stream.concat(exportEvents.stream(), Stream.of(queuedEvents)).toArray(MessageEvent[]::new); - lastPoll = OffsetDateTime.now(); + lastPollEpochSecond = Instant.now().getEpochSecond(); } catch (ApiException ex){ throw ExceptionHandler.getProperException(ex); } diff --git a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java index bb520ee660..47488a8f95 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java +++ b/vcell-rest/src/main/java/org/vcell/restq/handlers/ExportResource.java @@ -74,11 +74,11 @@ public ExportHistory deleteExportHistoryEntry() throws DataAccessWebException, N } @Path("/status") - @PATCH + @GET @RolesAllowed("user") @Produces(MediaType.APPLICATION_JSON) - @Operation(operationId = "exportStatus", description = "Get the status of your export jobs past the timestamp (UTC format).") - public List pollExportStatus(Instant timestamp) throws DataAccessWebException, NotAuthenticatedWebException { + @Operation(operationId = "exportStatus", description = "Get the status of your export jobs past the timestamp (Unix epoch in seconds).") + public List pollExportStatus(@QueryParam("timestamp") long timestamp) throws DataAccessWebException, NotAuthenticatedWebException { User user = userRestService.getUserFromIdentity(securityIdentity); return exportService.getMostRecentExportStatus(user, timestamp); } diff --git a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java index dc8c346320..d680d095e1 100644 --- a/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java +++ b/vcell-rest/src/main/java/org/vcell/restq/services/Exports/ExportService.java @@ -48,8 +48,8 @@ public Multi getExportStatuses(User user, long jobID) throws Object return ((ServerExportEventController) exportStatusCreator.get()).getSSEUsersExportStatus(user, jobID); } - public List getMostRecentExportStatus(User user, Instant instant) { - return exportStatusListener.get().getMostRecentExportStatus(user, instant); + public List getMostRecentExportStatus(User user, long timestamp) { + return exportStatusListener.get().getMostRecentExportStatus(user, Instant.ofEpochSecond(timestamp)); } public ExportRequestListenerMQ.ExportJob createExportJobFromRequest(User user, ExportResource.StandardExportInfo request, FormatSpecificSpecs formatSpecificSpecs, ExportFormat format) throws DataAccessException, SQLException { diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java index a51e9f9dc2..013e1cf7a2 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ExportRequestTest.java @@ -27,6 +27,7 @@ import java.io.File; import java.io.IOException; import java.sql.SQLException; +import java.time.Instant; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; @@ -76,7 +77,7 @@ public void removeOIDCMappings() throws SQLException, DataAccessException { // Tests the clients capability to submit exports, our queue for accepting and distributing messages, retrieval of export status, and the export job itself @Test public void testExportRequestClient() throws Exception { - final OffsetDateTime time = OffsetDateTime.now(); // Before export even starts, so that all events are grabbed from the queue + final long time = Instant.now().getEpochSecond(); // Before export even starts, so that all events are grabbed from the queue ExportResourceApi exportResourceApi = new ExportResourceApi(aliceAPIClient); N5ExportRequest exportRequest = getValidExportRequestDTO(0, 1); exportResourceApi.exportN5(exportRequest); diff --git a/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java b/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java index 3bcf14630a..b9b6b1696f 100644 --- a/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java +++ b/vcell-rest/src/test/java/org/vcell/restq/exports/ManualTestExport.java @@ -10,6 +10,7 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.time.Instant; import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; @@ -19,7 +20,7 @@ public class ManualTestExport { public static void main(String[] args) throws URISyntaxException, IOException, ParseException, ApiException, InterruptedException { int numOfExports = 12; - OffsetDateTime time = OffsetDateTime.now(); + long time = Instant.now().getEpochSecond(); ApiClient apiClient = InteractiveLogin.login(new URI(InteractiveLogin.authDomain), new URI("https://minikube.remote"), true); System.setProperty("jdk.internal.httpclient.disableHostnameVerification", "true"); diff --git a/vcell-restclient/README.md b/vcell-restclient/README.md index 5bc2e07f1b..d176009a22 100644 --- a/vcell-restclient/README.md +++ b/vcell-restclient/README.md @@ -121,8 +121,8 @@ Class | Method | HTTP request | Description *BioModelResourceApi* | [**saveBioModelWithHttpInfo**](docs/BioModelResourceApi.md#saveBioModelWithHttpInfo) | **POST** /api/v1/bioModel | Save's the given BioModel. Optional parameters of name and simulations to update due to math changes. Returns saved BioModel as VCML. *ExportResourceApi* | [**exportN5**](docs/ExportResourceApi.md#exportN5) | **POST** /api/v1/export/N5 | *ExportResourceApi* | [**exportN5WithHttpInfo**](docs/ExportResourceApi.md#exportN5WithHttpInfo) | **POST** /api/v1/export/N5 | -*ExportResourceApi* | [**exportStatus**](docs/ExportResourceApi.md#exportStatus) | **PATCH** /api/v1/export/status | -*ExportResourceApi* | [**exportStatusWithHttpInfo**](docs/ExportResourceApi.md#exportStatusWithHttpInfo) | **PATCH** /api/v1/export/status | +*ExportResourceApi* | [**exportStatus**](docs/ExportResourceApi.md#exportStatus) | **GET** /api/v1/export/status | +*ExportResourceApi* | [**exportStatusWithHttpInfo**](docs/ExportResourceApi.md#exportStatusWithHttpInfo) | **GET** /api/v1/export/status | *FieldDataResourceApi* | [**advancedCreate**](docs/FieldDataResourceApi.md#advancedCreate) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**advancedCreateWithHttpInfo**](docs/FieldDataResourceApi.md#advancedCreateWithHttpInfo) | **POST** /api/v1/fieldData/advancedCreate | Create Field Data with granular detail in one request.The following files are accepted: .tif and .zip. *FieldDataResourceApi* | [**analyzeFile**](docs/FieldDataResourceApi.md#analyzeFile) | **POST** /api/v1/fieldData/analyzeFile | Analyze uploaded image file (Tiff, Zip, and Non-GPL BioFormats) and return field data. Color mapped images not supported (the colors in those images will be interpreted as separate channels). Filenames must be lowercase alphanumeric, and can contain underscores. diff --git a/vcell-restclient/api/openapi.yaml b/vcell-restclient/api/openapi.yaml index f6144add43..6216886b8c 100644 --- a/vcell-restclient/api/openapi.yaml +++ b/vcell-restclient/api/openapi.yaml @@ -500,14 +500,19 @@ paths: x-content-type: application/json x-accepts: application/json /api/v1/export/status: - patch: - description: Get the status of your export jobs past the timestamp (UTC format). + get: + description: Get the status of your export jobs past the timestamp (Unix epoch + in seconds). operationId: exportStatus - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Instant' + parameters: + - explode: true + in: query + name: timestamp + required: false + schema: + format: int64 + type: integer + style: form responses: "200": content: @@ -536,7 +541,6 @@ paths: - user tags: - Export Resource - x-content-type: application/json x-accepts: application/json /api/v1/fieldData/IDs: get: diff --git a/vcell-restclient/docs/ExportResourceApi.md b/vcell-restclient/docs/ExportResourceApi.md index c98a2f3ace..f093dd744a 100644 --- a/vcell-restclient/docs/ExportResourceApi.md +++ b/vcell-restclient/docs/ExportResourceApi.md @@ -6,8 +6,8 @@ All URIs are relative to *https://vcell.cam.uchc.edu* |------------- | ------------- | -------------| | [**exportN5**](ExportResourceApi.md#exportN5) | **POST** /api/v1/export/N5 | | | [**exportN5WithHttpInfo**](ExportResourceApi.md#exportN5WithHttpInfo) | **POST** /api/v1/export/N5 | | -| [**exportStatus**](ExportResourceApi.md#exportStatus) | **PATCH** /api/v1/export/status | | -| [**exportStatusWithHttpInfo**](ExportResourceApi.md#exportStatusWithHttpInfo) | **PATCH** /api/v1/export/status | | +| [**exportStatus**](ExportResourceApi.md#exportStatus) | **GET** /api/v1/export/status | | +| [**exportStatusWithHttpInfo**](ExportResourceApi.md#exportStatusWithHttpInfo) | **GET** /api/v1/export/status | | @@ -161,11 +161,11 @@ ApiResponse<**Long**> ## exportStatus -> List exportStatus(body) +> List exportStatus(timestamp) -Get the status of your export jobs past the timestamp (UTC format). +Get the status of your export jobs past the timestamp (Unix epoch in seconds). ### Example @@ -185,9 +185,9 @@ public class Example { ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); - OffsetDateTime body = OffsetDateTime.now(); // OffsetDateTime | + Long timestamp = 56L; // Long | try { - List result = apiInstance.exportStatus(body); + List result = apiInstance.exportStatus(timestamp); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExportResourceApi#exportStatus"); @@ -205,7 +205,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | **OffsetDateTime**| | [optional] | +| **timestamp** | **Long**| | [optional] | ### Return type @@ -218,7 +218,7 @@ public class Example { ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details @@ -231,11 +231,11 @@ public class Example { ## exportStatusWithHttpInfo -> ApiResponse> exportStatus exportStatusWithHttpInfo(body) +> ApiResponse> exportStatus exportStatusWithHttpInfo(timestamp) -Get the status of your export jobs past the timestamp (UTC format). +Get the status of your export jobs past the timestamp (Unix epoch in seconds). ### Example @@ -256,9 +256,9 @@ public class Example { ExportResourceApi apiInstance = new ExportResourceApi(defaultClient); - OffsetDateTime body = OffsetDateTime.now(); // OffsetDateTime | + Long timestamp = 56L; // Long | try { - ApiResponse> response = apiInstance.exportStatusWithHttpInfo(body); + ApiResponse> response = apiInstance.exportStatusWithHttpInfo(timestamp); System.out.println("Status code: " + response.getStatusCode()); System.out.println("Response headers: " + response.getHeaders()); System.out.println("Response body: " + response.getData()); @@ -278,7 +278,7 @@ public class Example { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **body** | **OffsetDateTime**| | [optional] | +| **timestamp** | **Long**| | [optional] | ### Return type @@ -291,7 +291,7 @@ ApiResponse<[**List<ExportEvent>**](ExportEvent.md)> ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json ### HTTP response details diff --git a/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java b/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java index 40e30e55b6..49c8e682c2 100644 --- a/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java +++ b/vcell-restclient/src/main/java/org/vcell/restclient/api/ExportResourceApi.java @@ -19,7 +19,6 @@ import org.vcell.restclient.model.ExportEvent; import org.vcell.restclient.model.N5ExportRequest; -import java.time.OffsetDateTime; import org.vcell.restclient.model.VCellHTTPError; import com.fasterxml.jackson.core.type.TypeReference; @@ -159,25 +158,25 @@ private HttpRequest.Builder exportN5RequestBuilder(N5ExportRequest n5ExportReque } /** * - * Get the status of your export jobs past the timestamp (UTC format). - * @param body (optional) + * Get the status of your export jobs past the timestamp (Unix epoch in seconds). + * @param timestamp (optional) * @return List<ExportEvent> * @throws ApiException if fails to make API call */ - public List exportStatus(OffsetDateTime body) throws ApiException { - ApiResponse> localVarResponse = exportStatusWithHttpInfo(body); + public List exportStatus(Long timestamp) throws ApiException { + ApiResponse> localVarResponse = exportStatusWithHttpInfo(timestamp); return localVarResponse.getData(); } /** * - * Get the status of your export jobs past the timestamp (UTC format). - * @param body (optional) + * Get the status of your export jobs past the timestamp (Unix epoch in seconds). + * @param timestamp (optional) * @return ApiResponse<List<ExportEvent>> * @throws ApiException if fails to make API call */ - public ApiResponse> exportStatusWithHttpInfo(OffsetDateTime body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = exportStatusRequestBuilder(body); + public ApiResponse> exportStatusWithHttpInfo(Long timestamp) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = exportStatusRequestBuilder(timestamp); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -205,23 +204,32 @@ public ApiResponse> exportStatusWithHttpInfo(OffsetDateTime bo } } - private HttpRequest.Builder exportStatusRequestBuilder(OffsetDateTime body) throws ApiException { + private HttpRequest.Builder exportStatusRequestBuilder(Long timestamp) throws ApiException { HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); String localVarPath = "/api/v1/export/status"; - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "timestamp"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("timestamp", timestamp)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } - localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); - localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); if (memberVarReadTimeout != null) { localVarRequestBuilder.timeout(memberVarReadTimeout); } diff --git a/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts b/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts index b7e77c97b4..a911b3fc48 100644 --- a/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts +++ b/webapp-ng/src/app/core/modules/openapi/api/export-resource.service.ts @@ -170,15 +170,21 @@ export class ExportResourceService implements ExportResourceServiceInterface { } /** - * Get the status of your export jobs past the timestamp (UTC format). - * @param body + * Get the status of your export jobs past the timestamp (Unix epoch in seconds). + * @param timestamp * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public exportStatus(body?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; - public exportStatus(body?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; - public exportStatus(body?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; - public exportStatus(body?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + public exportStatus(timestamp?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>; + public exportStatus(timestamp?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public exportStatus(timestamp?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable>>; + public exportStatus(timestamp?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (timestamp !== undefined && timestamp !== null) { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + timestamp, 'timestamp'); + } let localVarHeaders = this.defaultHeaders; @@ -206,15 +212,6 @@ export class ExportResourceService implements ExportResourceServiceInterface { } - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { @@ -227,10 +224,10 @@ export class ExportResourceService implements ExportResourceServiceInterface { } let localVarPath = `/api/v1/export/status`; - return this.httpClient.request>('patch', `${this.configuration.basePath}${localVarPath}`, + return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, - body: body, + params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, diff --git a/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts b/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts index 708e858c11..05c50e07c3 100644 --- a/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts +++ b/webapp-ng/src/app/core/modules/openapi/api/export-resource.serviceInterface.ts @@ -35,9 +35,9 @@ export interface ExportResourceServiceInterface { /** * - * Get the status of your export jobs past the timestamp (UTC format). - * @param body + * Get the status of your export jobs past the timestamp (Unix epoch in seconds). + * @param timestamp */ - exportStatus(body?: string, extraHttpRequestParams?: any): Observable>; + exportStatus(timestamp?: number, extraHttpRequestParams?: any): Observable>; }