-
Notifications
You must be signed in to change notification settings - Fork 13
MORPH-7515: Plugin Query DataService interfaces #138
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
MrClement
wants to merge
4
commits into
v1.4.x
Choose a base branch
from
MORPH-7515-plugin-query-dataservice
base: v1.4.x
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 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6c886ac
MORPH-7515: Plugin Query DataService
MrClement a7b7440
Merge branch 'v1.4.x' into MORPH-7515-plugin-query-dataservice
MrClement fd5e9ab
MORPH-7515: Move health() from PluginProvider to Plugin
MrClement d3a44a2
MORPH-7515: remove unused PluginInfoIdentityProjection import
MrClement 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
50 changes: 50 additions & 0 deletions
50
morpheus-plugin-api/src/main/java/com/morpheusdata/core/admin/MorpheusPluginService.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,50 @@ | ||
| /* | ||
| * Copyright 2024 Morpheus Data, LLC. | ||
| * | ||
| * Licensed under the PLUGIN CORE SOURCE LICENSE (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://raw.githubusercontent.com/gomorpheus/morpheus-plugin-core/v1.0.x/LICENSE | ||
| * | ||
| * 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.morpheusdata.core.admin; | ||
|
|
||
| import com.morpheusdata.core.MorpheusDataQueryService; | ||
| import com.morpheusdata.model.PluginInfo; | ||
| import com.morpheusdata.model.projection.PluginInfoIdentityProjection; | ||
| import com.morpheusdata.response.ServiceResponse; | ||
| import io.reactivex.rxjava3.core.Single; | ||
|
|
||
| /** | ||
| * Provides query access to plugins registered within the Morpheus appliance. | ||
| * This is a read-only service intended for use in system precheck scenarios — for example, | ||
| * verifying that required plugins are present and healthy before initiating an operation. | ||
| * | ||
| * <p>Use {@link #health(String)} to invoke the {@link com.morpheusdata.core.Plugin#health()} | ||
| * method on a live plugin at runtime.</p> | ||
| * | ||
| * @author David Estes | ||
| * @since 1.4.0 | ||
| * @see com.morpheusdata.core.synchronous.admin.MorpheusSynchronousPluginService | ||
| */ | ||
| public interface MorpheusPluginService extends MorpheusDataQueryService<PluginInfo> { | ||
|
|
||
| /** | ||
| * Calls the {@link com.morpheusdata.core.Plugin#health()} method on the live plugin | ||
| * identified by the given plugin code. If no plugin with the given code is currently loaded, | ||
| * an error {@link ServiceResponse} is returned. | ||
| * | ||
| * <p><strong>Note:</strong> This is a reactive method and will not perform any operation until subscribed or blockingGet() is called on it.</p> | ||
| * | ||
| * @param code the unique provider code to look up | ||
| * @return a Single containing the {@link ServiceResponse} from the provider's health check | ||
| */ | ||
| Single<ServiceResponse> health(String code); | ||
| } | ||
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
42 changes: 42 additions & 0 deletions
42
...c/main/java/com/morpheusdata/core/synchronous/admin/MorpheusSynchronousPluginService.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,42 @@ | ||
| /* | ||
| * Copyright 2024 Morpheus Data, LLC. | ||
| * | ||
| * Licensed under the PLUGIN CORE SOURCE LICENSE (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://raw.githubusercontent.com/gomorpheus/morpheus-plugin-core/v1.0.x/LICENSE | ||
| * | ||
| * 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.morpheusdata.core.synchronous.admin; | ||
|
|
||
| import com.morpheusdata.core.synchronous.MorpheusSynchronousDataQueryService; | ||
| import com.morpheusdata.model.PluginInfo; | ||
| import com.morpheusdata.response.ServiceResponse; | ||
|
|
||
| /** | ||
| * Provides synchronous (blocking) query access to plugins registered within the Morpheus appliance. | ||
| * This is the synchronous counterpart to {@link com.morpheusdata.core.admin.MorpheusPluginService}. | ||
| * | ||
| * @author David Estes | ||
| * @since 1.4.0 | ||
| * @see com.morpheusdata.core.admin.MorpheusPluginService | ||
| */ | ||
| public interface MorpheusSynchronousPluginService extends MorpheusSynchronousDataQueryService<PluginInfo> { | ||
|
|
||
| /** | ||
| * Calls the {@link com.morpheusdata.core.Plugin#health()} method on the live plugin | ||
| * identified by the given provider code. If no provider with the given code is currently loaded, | ||
| * an error {@link ServiceResponse} is returned. | ||
| * | ||
| * @param code the unique provider code to look up | ||
| * @return a {@link ServiceResponse} from the provider's health check | ||
| */ | ||
| ServiceResponse health(String code); | ||
| } |
90 changes: 90 additions & 0 deletions
90
morpheus-plugin-api/src/main/java/com/morpheusdata/model/PluginInfo.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,90 @@ | ||
| /* | ||
| * Copyright 2024 Morpheus Data, LLC. | ||
| * | ||
| * Licensed under the PLUGIN CORE SOURCE LICENSE (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://raw.githubusercontent.com/gomorpheus/morpheus-plugin-core/v1.0.x/LICENSE | ||
| * | ||
| * 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.morpheusdata.model; | ||
|
|
||
| import com.morpheusdata.model.projection.PluginInfoIdentityProjection; | ||
|
|
||
| /** | ||
| * Represents a registered plugin instance within the Morpheus appliance. | ||
| * This model provides metadata about an installed plugin and is used by the | ||
| * {@link com.morpheusdata.core.admin.MorpheusPluginService} for querying plugin availability. | ||
| * @author David Estes | ||
| * @since 1.4.0 | ||
| */ | ||
| public class PluginInfo extends PluginInfoIdentityProjection { | ||
|
|
||
| protected String version; | ||
| protected String description; | ||
| protected String author; | ||
| protected Boolean enabled; | ||
| protected String status; | ||
| protected String statusMessage; | ||
|
|
||
| public String getVersion() { | ||
| return version; | ||
| } | ||
|
|
||
| public void setVersion(String version) { | ||
| this.version = version; | ||
| markDirty("version", version, this.version); | ||
| } | ||
|
|
||
| public String getDescription() { | ||
| return description; | ||
| } | ||
|
|
||
| public void setDescription(String description) { | ||
| this.description = description; | ||
| markDirty("description", description, this.description); | ||
| } | ||
|
|
||
| public String getAuthor() { | ||
| return author; | ||
| } | ||
|
|
||
| public void setAuthor(String author) { | ||
| this.author = author; | ||
| markDirty("author", author, this.author); | ||
| } | ||
|
|
||
| public Boolean getEnabled() { | ||
| return enabled; | ||
| } | ||
|
|
||
| public void setEnabled(Boolean enabled) { | ||
| this.enabled = enabled; | ||
| markDirty("enabled", enabled, this.enabled); | ||
| } | ||
|
|
||
| public String getStatus() { | ||
| return status; | ||
| } | ||
|
|
||
| public void setStatus(String status) { | ||
| this.status = status; | ||
| markDirty("status", status, this.status); | ||
| } | ||
|
|
||
| public String getStatusMessage() { | ||
| return statusMessage; | ||
| } | ||
|
|
||
| public void setStatusMessage(String statusMessage) { | ||
| this.statusMessage = statusMessage; | ||
| markDirty("statusMessage", statusMessage, this.statusMessage); | ||
| } | ||
| } |
46 changes: 46 additions & 0 deletions
46
...gin-api/src/main/java/com/morpheusdata/model/projection/PluginInfoIdentityProjection.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,46 @@ | ||
| /* | ||
| * Copyright 2024 Morpheus Data, LLC. | ||
| * | ||
| * Licensed under the PLUGIN CORE SOURCE LICENSE (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://raw.githubusercontent.com/gomorpheus/morpheus-plugin-core/v1.0.x/LICENSE | ||
| * | ||
| * 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.morpheusdata.model.projection; | ||
|
|
||
| /** | ||
| * Provides a lightweight subset of properties from the {@link com.morpheusdata.model.PluginInfo} | ||
| * for use in list/sync operations with reduced memory footprint. | ||
| * @author David Estes | ||
| * @since 1.4.0 | ||
| */ | ||
| public class PluginInfoIdentityProjection extends MorpheusIdentityModel { | ||
| protected String code; | ||
| protected String name; | ||
|
|
||
| public String getCode() { | ||
| return code; | ||
| } | ||
|
|
||
| public void setCode(String code) { | ||
| this.code = code; | ||
| markDirty("code", code, this.code); | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| markDirty("name", name, this.name); | ||
| } | ||
| } |
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.
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.
NIT: Is there a reason this is imported here? It's not referenced in this file.