Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,13 @@ on:
jobs:
build:
uses: openmrs/openmrs-contrib-gha-workflows/.github/workflows/build-backend-module.yml@main
with:
java_versions: '["8", "11", "17", "21", "25"]'
main_java_version: '8'
run_owasp_check: false
secrets:
MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }}
MAVEN_REPO_API_KEY: ${{ secrets.MAVEN_REPO_API_KEY }}
BOT_GH_TOKEN: ${{ secrets.OMRS_BOT_GH_TOKEN }}

owasp-dependency-check:
if: ${{ github.event_name != 'pull_request' }}
uses: openmrs/openmrs-contrib-gha-workflows/.github/workflows/owasp-dependency-check.yml@main
with:
java_version: '8'
secrets:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
BOT_GH_TOKEN: ${{ secrets.OMRS_BOT_GH_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:
release_version: ${{ inputs.release_version }}
development_version: ${{ inputs.development_version }}
branch: ${{ inputs.branch }}
java_version: '8'
secrets:
MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }}
MAVEN_REPO_API_KEY: ${{ secrets.MAVEN_REPO_API_KEY }}
BOT_PAT: ${{ secrets.BOT_PAT }}
BOT_PAT: ${{ secrets.OMRS_BOT_GH_TOKEN }}
105 changes: 11 additions & 94 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.openmrs</groupId>
<artifactId>event</artifactId>
<version>4.1.0-SNAPSHOT</version>
<version>5.0.0-SNAPSHOT</version>
</parent>

<artifactId>event-api</artifactId>
Expand All @@ -13,99 +13,16 @@
<description>API project for EventQueue</description>

<dependencies>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<version>5.7.0</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
</exclusion>
<exclusion>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
<exclusion>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
</exclusion>
<exclusion>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.0.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
</exclusion>
<exclusion>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
</exclusion>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
</exclusion>
</exclusions>
</dependency>

<!--
Provides javax.jms.MessageListener / MapMessage interfaces required by the deprecated
EventListener API (see LegacyEventBridge). Small spec-only jar with no transitive deps;
can be removed once the deprecated Event.subscribe / EventListener API is removed.
-->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>

<build>
Expand Down
22 changes: 19 additions & 3 deletions api/src/main/java/org/openmrs/event/EntityEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,37 @@
package org.openmrs.event;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import org.openmrs.OpenmrsObject;

import java.io.Serializable;
import java.util.Objects;

/**
* Represents a particular action performed on a particular OpenmrsObject entity
* Represents a particular action performed on a particular OpenmrsObject entity.
* Equality is based on entity UUID + action, not object reference, to ensure correct
* deduplication even when Hibernate returns different proxy objects for the same entity.
*/
@Data
@Getter
@AllArgsConstructor
public class EntityEvent implements Serializable {

private OpenmrsObject entity;
private Event.Action action;

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof EntityEvent)) return false;
EntityEvent that = (EntityEvent) o;
return action == that.action && Objects.equals(entity.getUuid(), that.entity.getUuid());
}

@Override
public int hashCode() {
return Objects.hash(entity.getUuid(), action);
}

@Override
public String toString() {
return action + " " + entity.getClass().getSimpleName() + "[" + entity.getUuid() + "]";
Expand Down
Loading