-
Notifications
You must be signed in to change notification settings - Fork 32
feat:filtering shells based on timestamp #506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat:filtering shells based on timestamp #506
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DO NOT MERGE..!
… based on timestamp
… based on timestamp
… based on timestamp
… based on timestamp
… based on timestamp
… based on timestamp
...rc/main/java/org/eclipse/tractusx/semantics/registry/service/GranularShellAccessHandler.java
Show resolved
Hide resolved
shellRepository.getCreatedDateByIdExternal( cursorValue ).orElse( MINIMUM_SQL_DATETIME ) : | ||
// If cursor is not available, use createdAfter date or fetch from repository | ||
Optional.ofNullable( createdAfter ).map( OffsetDateTime::toInstant ) | ||
.orElseGet( () -> shellRepository.getCreatedDateByIdExternal( cursorValue ).orElse( MINIMUM_SQL_DATETIME ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getCreatedDate() method will revert to the existing logic if the createdAfter parameter is null. This behavior aligns with the implementation that was in place prior to this change.
The getShellSearchCursor() method includes a fallback mechanism: if no cursor is provided (i.e., nextPageCursor is null or empty), it returns a default timestamp set to five years before the current date and time. This ensures that the search begins from a sufficiently early point when no cursor is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments below and change the file on this review.
BR
This pull request includes changes to add timestamp-based filtering for shells and updates across multiple files to support this new feature. The most important changes include modifications to the
AssetAdministrationShellApiDelegate
,ShellMapper
,ShellAccessHandler
, andShellService
classes.Timestamp-based filtering:
CHANGELOG.md
: Added a note about filtering shells based on timestamp.backend/src/main/java/org/eclipse/tractusx/semantics/registry/controller/AssetAdministrationShellApiDelegate.java
: AddedOffsetDateTime
parameter to methods for filtering shells based on creation time. [1] [2]Code updates for timestamp handling:
backend/src/main/java/org/eclipse/tractusx/semantics/registry/mapper/ShellMapper.java
: Added methods to mapOffsetDateTime
toInstant
and vice versa.backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/ShellService.java
: Updated methods to includecreatedAfter
parameter for filtering shells and submodels. [1] [2]Specification updates:
backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/DefaultShellAccessHandler.java
: ModifiedshellFilterSpecification
to includecreatedAfter
parameter.backend/src/main/java/org/eclipse/tractusx/semantics/registry/service/GranularShellAccessHandler.java
: Added method to retrieve the created date for filtering and updatedshellFilterSpecification
to use this date.## Descriptionfiltering shells based on timestamp
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: