Skip to content

Commit

Permalink
Relocate API Types to Separate Module
Browse files Browse the repository at this point in the history
  • Loading branch information
AvocadoMoon committed Jan 23, 2025
1 parent 48ffe47 commit 4df69f1
Show file tree
Hide file tree
Showing 40 changed files with 176 additions and 83 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@

<modules>
<module>vcell-admin</module>
<module>vcell-api-types</module>
<module>vcell-api</module>
<module>vcell-apiclient</module>
<module>vcell-client</module>
Expand Down
87 changes: 87 additions & 0 deletions vcell-api-types/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.vcell</groupId>
<artifactId>vcell-pom</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>vcell-api-types</artifactId>

<name>vcell-api-types</name>

<description>Types used for communication.</description>
<version>1.0.0</version>
<url>https://maven.apache.org</url>
<inceptionYear>2025</inceptionYear>
<organization>
<name>VCell</name>
<url>https://vcell.org</url>
</organization>
<licenses>
<license>
<name>MIT</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>

<developers>
<developer>
<id>avocadomoon</id>
<name>Ezequiel Valencia</name>
<roles>
<role>founder</role>
<role>lead</role>
<role>developer</role>
<role>debugger</role>
<role>reviewer</role>
<role>support</role>
<role>maintainer</role>
</roles>
</developer>
</developers>

<mailingLists>
<mailingList>
<name>VCell Open Discussion Forum</name>
<subscribe>https://groups.google.com/group/vcell-discuss</subscribe>
<unsubscribe>https://groups.google.com/group/vcell-discuss</unsubscribe>
<post>[email protected]</post>
<archive>https://groups.google.com/group/vcell-discuss</archive>
</mailingList>
</mailingLists>

<scm>
<connection>scm:git:git://github.com/virtualcell/vcell</connection>
<developerConnection>scm:git:[email protected]:virtualcell/vcell</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/virtualcell/vcell</url>
</scm>
<issueManagement>
<system>Bugzilla</system>
<url>https://github.com/virtualcell/vcell/issues</url>
</issueManagement>

<properties>
<license.licenseName>MIT</license.licenseName>
<license.copyrightOwners>UConn Health</license.copyrightOwners>
</properties>

<repositories>
<repository>
<id>maven-restlet</id>
<name>Restlet repository</name>
<url>https://maven.restlet.talend.com</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.vcell</groupId>
<artifactId>vcell-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;


public class ApplicationRepresentation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;

public class BioModelLink {
public final static String bmid = "bioModelKey";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;


public class BiomodelRepresentation {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;


public class MathModelLink {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;



Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.common;
package org.vcell.api.types.common;


public class SimulationTaskRepresentation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*/

package cbit.rmi.event.client.common;
package org.vcell.api.types.common;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class BroadcastEventRepresentation {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class DataJobEventRepresentation {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class EventWrapper {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class ExportEventRepresentation {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class ExportTimeSpecs {
public final int beginTimeIndex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class ExportVariableSpecs {
public final String[] variableNames;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

public class SimulationJobStatusEventRepresentation {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cbit.rmi.event.client.events;
package org.vcell.api.types.events;

import java.util.Date;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package cbit.rmi.event.client;
package org.vcell.api.types.utils;

import cbit.rmi.event.DataJobEvent;
import cbit.rmi.event.ExportEvent;
import cbit.rmi.event.SimulationJobStatusEvent;
import cbit.rmi.event.client.common.SimpleJobStatusRepresentation;
import cbit.rmi.event.client.events.*;
import cbit.vcell.export.server.HumanReadableExportData;
import cbit.vcell.export.server.TimeSpecs;
import cbit.vcell.export.server.VariableSpecs;
Expand All @@ -15,6 +13,9 @@
import cbit.vcell.solver.Simulation;
import cbit.vcell.solver.VCSimulationIdentifier;
import cbit.vcell.solver.server.SimulationMessage;
import org.vcell.api.types.common.SimpleJobStatusRepresentation;
import org.vcell.api.types.common.UserInfo;
import org.vcell.api.types.events.*;
import org.vcell.util.document.*;

import java.io.BufferedInputStream;
Expand Down Expand Up @@ -252,17 +253,17 @@ public static SimulationJobStatusEventRepresentation simulationJobStatusEventToJ
return eventRep;
}

public static cbit.rmi.event.client.common.UserInfo getApiUserInfo(UserInfo userInfo){
cbit.rmi.event.client.common.UserInfo apiUserInfo = new cbit.rmi.event.client.common.UserInfo(
public static UserInfo getApiUserInfo(org.vcell.util.document.UserInfo userInfo){
UserInfo apiUserInfo = new UserInfo(
(userInfo.id!=null) ? userInfo.id.toString() : null,
userInfo.userid, userInfo.digestedPassword0.getString(), userInfo.email, userInfo.wholeName,
userInfo.title, userInfo.company, userInfo.country, userInfo.notify, userInfo.insertDate);
return apiUserInfo;
}


public static UserInfo fromApiUserInfo(cbit.rmi.event.client.common.UserInfo apiUserInfo) {
UserInfo userInfo = new UserInfo();
public static org.vcell.util.document.UserInfo fromApiUserInfo(UserInfo apiUserInfo) {
org.vcell.util.document.UserInfo userInfo = new org.vcell.util.document.UserInfo();
userInfo.id = new KeyValue(apiUserInfo.id);
userInfo.userid = apiUserInfo.userid;
userInfo.digestedPassword0 = UserLoginInfo.DigestedPassword.createAlreadyDigested(apiUserInfo.digestedPassword0);
Expand Down
5 changes: 5 additions & 0 deletions vcell-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,10 @@
<artifactId>joda-time</artifactId>
<version>${joda-time.version}</version>
</dependency>
<dependency>
<groupId>org.vcell</groupId>
<artifactId>vcell-api-types</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public enum AuthenticationPolicy {
public static final String SIMDATA = "simdata";
public static final String SIMDATAID = "simdataid";

public static final String EVENTS = "events";
public static final String EVENTS = "org/vcell/api/types";
public static final String EVENTS_BEGINTIMESTAMP = "beginTimestamp";

public static final String N5DATA = "n5data";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.vcell.rest.admin;

import org.vcell.api.types.common.SimpleJobStatusRepresentation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.restlet.Context;
Expand All @@ -12,14 +13,13 @@
import org.restlet.data.Status;
import org.restlet.engine.adapter.HttpRequest;
import org.restlet.ext.json.JsonRepresentation;
import cbit.rmi.event.client.common.SimpleJobStatusRepresentation;
import cbit.rmi.event.client.DTOOldAPI;
import org.vcell.rest.VCellApiApplication;

import com.google.gson.Gson;

import cbit.vcell.server.SimpleJobStatusQuerySpec;
import cbit.vcell.server.SimulationJobStatus;
import org.vcell.api.types.utils.DTOOldAPI;

public final class AdminJobsRestlet extends Restlet {
private final static Logger lg = LogManager.getLogger(AdminJobsRestlet.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.vcell.rest.events;

import org.vcell.api.types.events.EventWrapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.restlet.Context;
Expand All @@ -12,7 +13,6 @@
import org.restlet.data.Status;
import org.restlet.engine.adapter.HttpRequest;
import org.restlet.ext.json.JsonRepresentation;
import cbit.rmi.event.client.events.EventWrapper;
import org.vcell.rest.VCellApiApplication;
import org.vcell.rest.VCellApiApplication.AuthenticationPolicy;
import org.vcell.util.document.User;
Expand Down
Loading

0 comments on commit 4df69f1

Please sign in to comment.