Skip to content

Consider tightening AuditEventRepository contract #11331

@vpavic

Description

@vpavic

AuditEventRepository exposes 3 operations for retrieving AuditEvents:

  • AuditEventRepository#find(java.util.Date)
  • AuditEventRepository#find(java.lang.String, java.util.Date)
  • AuditEventRepository#find(java.lang.String, java.util.Date, java.lang.String)

All of these operations allow their parameters to be null which IMO isn't ideal, and is also somewhat confusing as all the retrieval options can actually be expressed using AuditEventRepository#find(java.lang.String, java.util.Date, java.lang.String).

Perhaps AuditEventRepository contract could be tightened so that it wouldn't allow null parameters? This was actually proposed in #5854 as a part of improvements to AuditEventRepository however at the time the change wasn't feasible due to backward compatibility considerations. The upcoming 2.0 could be the chance to revisit this.

It's also worth noting that auditevents Endpoint already behaves inline with what's proposed above as it requires the presence of after parameter.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions