-
Notifications
You must be signed in to change notification settings - Fork 13
[EAK-651] Introduce Relay resource provider service #653
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
Open
smiakchilo
wants to merge
92
commits into
epic/2.8.0
Choose a base branch
from
feature/EAK-651
base: epic/2.8.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 82 commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
933f836
[Tech] Change project version to 2.8.0-SNAPSHOT
smiakchilo 49d42fd
[EAK-651] Implement basic Relay Resource Provider logic
smiakchilo 98e8102
[EAK-647] Introduce ResolverUtil to unify resource resolver handling
smiakchilo d7514f3
[EAK-647] Add ResolverUtil tests
smiakchilo bb062ee
[Tech] Remove obsolete plugin reference
smiakchilo cc0a2ba
[Tech] Simplify launching tests
smiakchilo 2a86c63
[EAK-651] Move ResolverUtil
smiakchilo 8f547fb
[EAK-651] Add a JSON-to-entity conversion method
smiakchilo f56bbda
[EAK-651] Optimize relay code; add Javadoc
smiakchilo 74cfcfd
[EAK-651] Create unit tests
smiakchilo fbc0756
[EAK-651] Fix incorrect paths
smiakchilo b5b4e91
[EAK-651] Update path sampling logic; handle NullPointerException in …
smiakchilo 9ed7308
[EAK-651] Implement thread-safe SubsidiaryHolder for ResourceResolver…
smiakchilo aed6e25
[EAK-651] Rename service class
smiakchilo f8f3190
[EAK-651] Fix minor linting issues
smiakchilo b8c173f
[EAK-651] Simplify ResourceHelper method calls
smiakchilo 0970843
[EAK-651] Modify the Relay config structure
smiakchilo c8b7725
[Tech] Introduce ServiceUtil for operations with OSGi components call…
smiakchilo 644494f
[Tech] Replace marker annotations for uniformity
smiakchilo f5e4670
[Tech] Improve exception handling
smiakchilo 57cef56
[EAK-651] Add method for creating a resolver for a provided user name
smiakchilo a984081
[EAK-651] Reaorder methods; cosmetic renaming
smiakchilo c1e1c4e
[EAK-651] Add utility method
smiakchilo 3daf1f7
[EAK-651] Extract subsidiary data models; add a guardrail against sha…
smiakchilo 469fc47
[EAK-651] Refactor PathSampler; add support for specifying a user
smiakchilo 8cd5426
[EAK-651] Cosmetic config model change
smiakchilo f5df5ed
[EAK-651] Introduce RelayInfo model
smiakchilo 67d4533
[EAK-651] Improve thread-safety on updating RelayInfo data
smiakchilo 165a1b1
[EAK-651] Lower service retrieval failure log level
smiakchilo 43981ed
[EAK-651] Handle an empty user ID; improve OSGi bundle context checks
smiakchilo a1d90a7
[EAK-651] Use normalized path for prefix check
smiakchilo 58e59fa
[EAK-651] Improve handling exceptions during deactivation
smiakchilo 247f28a
[EAK-651] Cosmetic wording change
smiakchilo 3d3e325
[EAK-651] Improve sampling routine
smiakchilo 2013d14
[EAK-651] Minor Javadoc fixes
smiakchilo f995b81
[EAK-651] Improve log reporting
smiakchilo 3f3b8ac
[EAK-651] Add a guard against a ResourceResolver leak
smiakchilo 7c62ff6
[EAK-651] Add missing Sling attribute
smiakchilo eb4082c
[EAK-651] Cosmetic syntax changes
smiakchilo 7f26451
[EAK-651] Remove plain-text credential processing
smiakchilo 3b847e4
[EAK-651] Add an NPE guard
smiakchilo fb3563d
[EAK-651] Reduce PathSampler's "isEmpty" logic; add local copy of vol…
smiakchilo 4c04831
[EAK-651] Minor doc change
smiakchilo 869d8cf
[EAK-651] Enhance service retrieval with callback support
smiakchilo 155f6b9
[EAK-651] Rename helper classes
smiakchilo df18889
[EAK-651] Update RelayProviderTest
smiakchilo bb552cf
[EAK-651] Update RelayProviderHostTest
smiakchilo ca4580a
[EAK-651] Update PathSamplerTest
smiakchilo 376d051
[EAK-651] Create tests for relay-related model classes
smiakchilo f7398fd
[EAK-651] Update ResolverUtilTest
smiakchilo 66bdb23
[EAK-651] Update ServiceUtilTest
smiakchilo 8f007e1
[EAK-651] Fix path sampling cache logic
smiakchilo 36d0135
[EAK-651] Change the fallback child resource listing call
smiakchilo 9bef4ab
[EAK-651] Fix the re-activation routine with paths property change
smiakchilo fa5dd77
[EAK-651] Make subsidiary resource resolvers more persistent
smiakchilo 70201f0
[EAK-651] Fixed ResourceResolver not reset to the default when empty …
smiakchilo a40db7f
[EAK-651] Discard caching sampled paths
smiakchilo f7e704c
[EAK-651] Fix falling back to a pre-existent resolver in case of logi…
smiakchilo 51fd1c4
[EAK-651] Limit RelayMapping identity to the "from" value
smiakchilo ceafd32
[EAK-651] Avoid ResourceResolver leaks; limit the number of ResourceR…
smiakchilo 7908257
[EAK-651] Log duplicate path and user mappings
smiakchilo ade30c4
[EAK-651] Add a check for non-null bundle context
smiakchilo 1979b8a
[EAK-651] Optimize path replacement logic in RelayPathHelper
smiakchilo 7d5e1a1
[EAK-651] Synchronize update method in RelayProvider; reset sampler o…
smiakchilo 8ca2173
[EAK-651] Simplify resolution path assignment in RelayResource constr…
smiakchilo 44f393c
[EAK-651] Prevent duplicate service reference release
smiakchilo 2aa114d
[EAK-651] Register ExternalResourceChangeListener in RelayProviderHost
smiakchilo e18652f
[EAK-651] Prevent overlap with remaining relays when processing a mul…
smiakchilo 390726f
[EAK-651] Prevent overlap with remaining relays when processing a mul…
smiakchilo 2b8c51c
[EAK-651] Fix sampling consistency when a replay provider's config up…
smiakchilo ab12acf
Merge remote-tracking branch 'origin/feature/EAK-651' into feature/EA…
smiakchilo 682f0a0
[EAK-651] Develop test coverage for RelayProviderHost
smiakchilo d1860d9
[EAK-651] Fix the risk of re-entry cycle in case of incorrect mapping
smiakchilo 057725d
[EAK-651] Add missing overridden methods in RelayResource
smiakchilo 9001e28
[EAK-651] Remove legacy configuration for maven-surefire-plugin
smiakchilo 78d1a52
[EAK-651] Improve null handling for top-level paths
smiakchilo 500d199
[EAK-651] Use an empty context instead of null
smiakchilo 7ec3c70
[EAK-651] Improve re-entry cycle breaker
smiakchilo a88375e
[EAK-651] Rename method for clarity; add a test case
smiakchilo f62567f
[EAK-651] Change callback type from AutoCloseable to Closeable in Res…
smiakchilo 45d0805
[EAK-651] Add a re-entry guard for listChildren calls
smiakchilo e16f1c4
[Tech] Add null check for bundle context in ConfigDefinition
smiakchilo e99706b
[EAK-651] Simplify announce logic
smiakchilo b93e6d3
[EAK-651] Disable falling back to default resolver when user mapping …
smiakchilo 8c84a55
[EAK-651] Disable parent resource hint for re-entry breaker
smiakchilo be6154a
[EAK-651] Code formatting; renaming
smiakchilo 7fa9bf4
[EAK-651] Retire redundant setUp/tearDown cycle
smiakchilo f2be0b8
[EAK-651] Invalidate nested mappings
smiakchilo b4f6ce6
[EAK-651] Improve handling of irregular paths
smiakchilo fd5e450
[EAK-651] Improve handling of irregular paths
smiakchilo dd4d5c2
Merge remote-tracking branch 'origin/feature/EAK-651' into feature/EA…
smiakchilo ad052eb
[EAK-651] Improve handling of irregular paths
smiakchilo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
core/src/main/java/com/exadel/aem/toolkit/core/relay/models/ChangeSample.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /* | ||
| * Licensed under the Apache License, Version 2.0 (the "License"). | ||
| * You may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package com.exadel.aem.toolkit.core.relay.models; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| /** | ||
| * Represents a change announcement entry defining a JCR path or XPath to report as changed when the relay is enabled or | ||
| * disabled. | ||
| * <p><u>Note</u>: This class is not a part of the public API and is subject to change. Do not use it in your own | ||
| * code</p> | ||
| */ | ||
| public class ChangeSample { | ||
| private final String path; | ||
| private final int limit; | ||
| private final String user; | ||
|
|
||
| /** | ||
| * Creates a new {@code ChangeSample} with the provided path, limit and user values | ||
| * @param path JCR path or XPath expression to report as changed | ||
| * @param limit Optional limit of resources to report as changed under the provided path | ||
| * @param user Optional user identifier to use for reporting changes | ||
| */ | ||
| @JsonCreator | ||
| ChangeSample( | ||
| @JsonProperty("path") String path, | ||
| @JsonProperty("limit") int limit, | ||
| @JsonProperty("user") String user) { | ||
| this.path = path; | ||
| this.limit = limit; | ||
| this.user = user; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the JCR path or XPath expression defined in this announcement | ||
| * @return String value | ||
| */ | ||
| public String getPath() { | ||
| return path; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the optional limit of resources to report as changed under the provided path | ||
| * @return Integer limit value | ||
| */ | ||
| public int getLimit() { | ||
| return limit; | ||
| } | ||
|
|
||
| /** | ||
| * Gets the optional user identifier to use for reporting changes | ||
| * @return A nullable user identifier string | ||
| */ | ||
| public String getUser() { | ||
| return user; | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| * <p>The equality check is based solely on the {@code path} property since we do not want to report the | ||
| * same path as changed multiple times</p> | ||
| */ | ||
| @Override | ||
| public final boolean equals(Object other) { | ||
| if (!(other instanceof ChangeSample)) { | ||
| return false; | ||
| } | ||
| ChangeSample announcement = (ChangeSample) other; | ||
| return Objects.equals(path, announcement.path); | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| * <p>The hash code is based solely on the {@code path} property since we do not want to report the same path as | ||
| * changed multiple times</p> | ||
| */ | ||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hashCode(path); | ||
|
smiakchilo marked this conversation as resolved.
|
||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.