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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.morpheusdata.core.providers.UIExtensionProvider;
import com.morpheusdata.model.OptionType;
import com.morpheusdata.model.Permission;
import com.morpheusdata.response.ServiceResponse;
import com.morpheusdata.views.Renderer;
import com.morpheusdata.web.PluginController;

Expand Down Expand Up @@ -471,4 +472,15 @@ public void checkForProviderConflict(PluginProvider provider) {
}
}

/**
* Returns the health status of this plugin. Plugins may override this to report operational status,
* connectivity state, or other diagnostic information useful for system prechecks.
* The default implementation returns a success response indicating the plugin is available.
* @return a {@link ServiceResponse} indicating the health of this plugin
* @since 1.4.0
*/
public ServiceResponse health() {
return ServiceResponse.success();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ public interface MorpheusAdminService {
* @return an instance of the implementation of the {@link MorpheusApplianceService}
*/
MorpheusApplianceService getAppliance();

/**
* Returns the Plugin Service for querying registered plugins and checking their health asynchronously (reactive).
* @return an instance of the implementation of the {@link MorpheusPluginService}
*/
MorpheusPluginService getPlugin();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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.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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public interface PluginProvider {





/**
* Applying this Facet to an integration will allow it to subscribe to events and perform operations based on the event
* @since 1.2.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ public interface MorpheusSynchronousAdminService {
MorpheusSynchronousUserService getUser();

MorpheusSynchronousApplianceService getAppliance();

MorpheusSynchronousPluginService getPlugin();
}
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);
}
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);
}
}
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);
}
}
Loading