Search in sources :

Example 1 with UpdateArtifactObject

use of org.wso2.ei.dashboard.core.rest.delegates.UpdateArtifactObject in project product-mi-tooling by wso2.

the class MiArtifactsManager method updateArtifactDetails.

public boolean updateArtifactDetails() throws ManagementApiException {
    if (updateArtifactObject != null) {
        String groupId = updateArtifactObject.getGroupId();
        String nodeId = updateArtifactObject.getNodeId();
        String mgtApiUrl = updateArtifactObject.getMgtApiUrl();
        String accessToken = databaseManager.getAccessToken(groupId, nodeId);
        String artifactType = updateArtifactObject.getType();
        String artifactName = updateArtifactObject.getName();
        JsonObject details = getArtifactDetails(groupId, nodeId, mgtApiUrl, artifactType, artifactName, accessToken);
        return databaseManager.updateDetails(artifactType, artifactName, groupId, nodeId, details.toString());
    } else {
        throw new DashboardServerException("Artifact details are invalid");
    }
}
Also used : JsonObject(com.google.gson.JsonObject) DashboardServerException(org.wso2.ei.dashboard.core.exception.DashboardServerException)

Example 2 with UpdateArtifactObject

use of org.wso2.ei.dashboard.core.rest.delegates.UpdateArtifactObject in project product-mi-tooling by wso2.

the class DelegatesUtil method updateDatabase.

private static boolean updateDatabase(String artifactType, String mgtApiUrl, String groupId, ArtifactUpdateRequest request) throws ManagementApiException {
    UpdateArtifactObject updateArtifactObject = new UpdateArtifactObject(mgtApiUrl, artifactType, request.getArtifactName(), groupId, request.getNodeId());
    MiArtifactsManager miArtifactsManager = new MiArtifactsManager(updateArtifactObject);
    return miArtifactsManager.updateArtifactDetails();
}
Also used : MiArtifactsManager(org.wso2.ei.dashboard.micro.integrator.MiArtifactsManager) UpdateArtifactObject(org.wso2.ei.dashboard.core.rest.delegates.UpdateArtifactObject)

Aggregations

JsonObject (com.google.gson.JsonObject)1 DashboardServerException (org.wso2.ei.dashboard.core.exception.DashboardServerException)1 UpdateArtifactObject (org.wso2.ei.dashboard.core.rest.delegates.UpdateArtifactObject)1 MiArtifactsManager (org.wso2.ei.dashboard.micro.integrator.MiArtifactsManager)1