Skip to content

Commit

Permalink
Breaking change: moves most of the dynamic schema classes back to sta…
Browse files Browse the repository at this point in the history
…tic Java code.
  • Loading branch information
cmorgner committed Oct 18, 2024
1 parent 6b4a990 commit ed91214
Show file tree
Hide file tree
Showing 488 changed files with 12,790 additions and 10,267 deletions.
1,355 changes: 678 additions & 677 deletions structr-base/pom.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion structr-base/run_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ else
fi

# start Structr
java -server -Djava.awt.headless=true -Djava.system.class.loader=org.structr.StructrClassLoader -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Duser.timezone=$PROCESS_TZ -Duser.country=US -Duser.language=en -Djava.net.useSystemProxies=true -Dorg.apache.sshd.registerBouncyCastle=false -Dorg.neo4j.io.pagecache.implSingleFilePageSwapper.channelStripePower=0 -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=$SUSPEND -Dfile.encoding=utf-8 $MEMORY_OPTS -XX:+UseG1GC -XX:+UseNUMA -XX:+UseCodeCacheFlushing -cp target/lib/*:$LATEST org.structr.Server
java -server -Djava.awt.headless=true -Djava.system.class.loader=org.structr.StructrClassLoader -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false -Duser.timezone=$PROCESS_TZ -Duser.country=US -Duser.language=en -Djava.net.useSystemProxies=true -Dorg.apache.sshd.registerBouncyCastle=false -Dorg.neo4j.io.pagecache.implSingleFilePageSwapper.channelStripePower=0 -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=$SUSPEND -Dfile.encoding=utf-8 $MEMORY_OPTS -XX:+UseG1GC -XX:+UseNUMA -XX:+UseCodeCacheFlushing -cp target/lib/*:$LATEST org.structr.Server
3 changes: 3 additions & 0 deletions structr-base/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* along with Structr. If not, see <http://www.gnu.org/licenses/>.
*/
module structr.base {

requires java.desktop;
requires java.logging;
requires java.management;
Expand Down Expand Up @@ -104,6 +105,8 @@
requires zero.allocation.hashing;
requires zip4j;
requires commons.collections4;
requires ch.qos.logback.core;
requires jakarta.activation;

exports org.structr;
exports org.structr.agent;
Expand Down
3 changes: 3 additions & 0 deletions structr-base/src/main/java/org/structr/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.slf4j.LoggerFactory;
import org.structr.common.helper.VersionHelper;
import org.structr.core.Services;
import org.structr.core.app.StructrApp;

/**
* Main startup class for Structr.
Expand All @@ -36,6 +37,8 @@ public static void main(String[] args) {

logger.info("Starting Structr {}", VersionHelper.getFullVersionInfo());

StructrApp.initializeSchemaIds();

// start service layer using default configuration
// augmented by local structr.conf
Services.getInstance();
Expand Down
12 changes: 6 additions & 6 deletions structr-base/src/main/java/org/structr/agent/AbstractTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.structr.agent;

import org.structr.core.entity.Principal;
import org.structr.core.entity.PrincipalInterface;

import java.util.*;
import java.util.concurrent.Delayed;
Expand All @@ -32,19 +32,19 @@ public class AbstractTask<T> implements Task<T> {

private final Map<String, Object> statusProperties = new LinkedHashMap<>();
private final List<T> objects = new LinkedList<>();
private Principal user = null;
private PrincipalInterface user = null;
private int priority = 0;
private Date scheduledTime = null;
private Date creationTime = null;
private String type = null;
private long delay = 0L;
private int retryCount = 0;

public AbstractTask(final String type, final Principal user) {
public AbstractTask(final String type, final PrincipalInterface user) {
this(type, user, null);
}

public AbstractTask(final String type, final Principal user, final T node) {
public AbstractTask(final String type, final PrincipalInterface user, final T node) {

this.type = type;
this.user = user;
Expand All @@ -55,7 +55,7 @@ public AbstractTask(final String type, final Principal user, final T node) {
}

@Override
public Principal getUser() {
public PrincipalInterface getUser() {
return user;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public void addNode(final T node) {
this.objects.add(node);
}

public void setUser(final Principal user) {
public void setUser(final PrincipalInterface user) {
this.user = user;
}

Expand Down
4 changes: 2 additions & 2 deletions structr-base/src/main/java/org/structr/agent/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.structr.agent;

import org.structr.core.entity.Principal;
import org.structr.core.entity.PrincipalInterface;

import java.util.Date;
import java.util.List;
Expand All @@ -34,7 +34,7 @@ public interface Task<T> extends Delayed, StatusInfo {
*
* @return user
*/
Principal getUser();
PrincipalInterface getUser();

/**
* Returns the objects this task should operate on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.structr.common;

import org.structr.common.error.FrameworkException;
import org.structr.core.entity.Principal;
import org.structr.core.entity.PrincipalInterface;
import org.structr.core.entity.Security;

import java.util.Date;
Expand All @@ -38,7 +38,7 @@ public interface AccessControllable {
*
* @return owner
*/
public Principal getOwnerNode();
public PrincipalInterface getOwnerNode();

/**
* Return true if principal has the given permission on this object.
Expand All @@ -57,7 +57,7 @@ public interface AccessControllable {
* @param principal
* @throws FrameworkException
*/
public void grant(final Permission permission, final Principal principal) throws FrameworkException;
public void grant(final Permission permission, final PrincipalInterface principal) throws FrameworkException;

/**
* Grant given permissions to given principal.
Expand All @@ -66,7 +66,7 @@ public interface AccessControllable {
* @param principal
* @throws FrameworkException
*/
public void grant(final Set<Permission> permissions, final Principal principal) throws FrameworkException;
public void grant(final Set<Permission> permissions, final PrincipalInterface principal) throws FrameworkException;

/**
* Grant given permissions to given principal.
Expand All @@ -76,7 +76,7 @@ public interface AccessControllable {
* @param ctx
* @throws FrameworkException
*/
public void grant(final Set<Permission> permissions, final Principal principal, final SecurityContext ctx) throws FrameworkException;
public void grant(final Set<Permission> permissions, final PrincipalInterface principal, final SecurityContext ctx) throws FrameworkException;

/**
* Revoke given permission from given principal.
Expand All @@ -85,7 +85,7 @@ public interface AccessControllable {
* @param principal
* @throws FrameworkException
*/
public void revoke(final Permission permission, final Principal principal) throws FrameworkException;
public void revoke(final Permission permission, final PrincipalInterface principal) throws FrameworkException;

/**
* Revoke given permissions from given principal.
Expand All @@ -94,7 +94,7 @@ public interface AccessControllable {
* @param principal
* @throws FrameworkException
*/
public void revoke(final Set<Permission> permissions, final Principal principal) throws FrameworkException;
public void revoke(final Set<Permission> permissions, final PrincipalInterface principal) throws FrameworkException;

/**
* Revoke given permissions from given principal.
Expand All @@ -104,7 +104,7 @@ public interface AccessControllable {
* @param ctx
* @throws FrameworkException
*/
public void revoke(final Set<Permission> permissions, final Principal principal, final SecurityContext ctx) throws FrameworkException;
public void revoke(final Set<Permission> permissions, final PrincipalInterface principal, final SecurityContext ctx) throws FrameworkException;

/**
* Applies the given permissions to the given principal.
Expand All @@ -114,7 +114,7 @@ public interface AccessControllable {
* @param principal
* @throws FrameworkException
*/
public void setAllowed(final Set<Permission> permissions, final Principal principal) throws FrameworkException;
public void setAllowed(final Set<Permission> permissions, final PrincipalInterface principal) throws FrameworkException;

/**
* Applies the given permissions to the given principal.
Expand All @@ -125,7 +125,7 @@ public interface AccessControllable {
* @param ctx
* @throws FrameworkException
*/
public void setAllowed(final Set<Permission> permissions, final Principal principal, final SecurityContext ctx) throws FrameworkException;
public void setAllowed(final Set<Permission> permissions, final PrincipalInterface principal, final SecurityContext ctx) throws FrameworkException;

/**
* Return the (cached) incoming relationship between this node and the
Expand All @@ -134,7 +134,7 @@ public interface AccessControllable {
* @param principal
* @return incoming security relationship
*/
public Security getSecurityRelationship(final Principal principal);
public Security getSecurityRelationship(final PrincipalInterface principal);

// visibility
public boolean isVisibleToPublicUsers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public int compareTo(Object o) {
}

@Override
public Principal getOwnerNode() {
public PrincipalInterface getOwnerNode() {
throw new UnsupportedOperationException("Not supported by this container.");
}

Expand All @@ -366,47 +366,47 @@ public boolean isGranted(Permission permission, SecurityContext securityContext)
}

@Override
public void grant(Permission permission, Principal principal) throws FrameworkException {
public void grant(Permission permission, PrincipalInterface principal) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void grant(Set<Permission> permissions, Principal principal) throws FrameworkException {
public void grant(Set<Permission> permissions, PrincipalInterface principal) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void grant(Set<Permission> permissions, Principal principal, SecurityContext ctx) throws FrameworkException {
public void grant(Set<Permission> permissions, PrincipalInterface principal, SecurityContext ctx) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void revoke(Permission permission, Principal principal) throws FrameworkException {
public void revoke(Permission permission, PrincipalInterface principal) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void revoke(Set<Permission> permissions, Principal principal) throws FrameworkException {
public void revoke(Set<Permission> permissions, PrincipalInterface principal) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void revoke(Set<Permission> permissions, Principal principal, SecurityContext ctx) throws FrameworkException {
public void revoke(Set<Permission> permissions, PrincipalInterface principal, SecurityContext ctx) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void setAllowed(final Set<Permission> permissions, final Principal principal) throws FrameworkException {
public void setAllowed(final Set<Permission> permissions, final PrincipalInterface principal) throws FrameworkException {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public void setAllowed(final Set<Permission> permissions, final Principal principal, final SecurityContext ctx) {
public void setAllowed(final Set<Permission> permissions, final PrincipalInterface principal, final SecurityContext ctx) {
throw new UnsupportedOperationException("Not supported by this container.");
}

@Override
public Security getSecurityRelationship(Principal principal) {
public Security getSecurityRelationship(PrincipalInterface principal) {
throw new UnsupportedOperationException("Not supported by this container.");
}

Expand Down
Loading

0 comments on commit ed91214

Please sign in to comment.