Commit 4886de18 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

[CRV-213] Added basis to tracking instances status and refactoring

parent 120d6ba8
......@@ -26,7 +26,7 @@ import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.AVGOperationPanel;
import org.apache.syncope.client.console.panels.AVGOperationDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
......@@ -214,7 +214,7 @@ public class AVGCDDetailPage extends BaseExtPage {
content.add(charts);
content.add(new AVGOperationPanel(
content.add(new AVGOperationDirectoryPanel(
"operations", getPageReference(), choreographyId, cdName, ArtifactType.CD));
body.add(content);
}
......
......@@ -27,8 +27,8 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.AVGCDPanel;
import org.apache.syncope.client.console.panels.AVGServicePanel;
import org.apache.syncope.client.console.panels.AVGCDDirectoryPanel;
import org.apache.syncope.client.console.panels.AVGServiceDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
......@@ -201,7 +201,7 @@ public class AVGInstanceStatsPage extends BaseExtPage {
@Override
public Panel getPanel(final String panelId) {
return new AVGCDPanel(panelId, getPageReference(), choreographyId);
return new AVGCDDirectoryPanel(panelId, getPageReference(), choreographyId);
}
});
......@@ -211,7 +211,7 @@ public class AVGInstanceStatsPage extends BaseExtPage {
@Override
public Panel getPanel(final String panelId) {
return new AVGServicePanel(panelId, getPageReference(), choreographyId);
return new AVGServiceDirectoryPanel(panelId, getPageReference(), choreographyId);
}
});
......
......@@ -24,7 +24,7 @@ import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.AVGOperationPanel;
import org.apache.syncope.client.console.panels.AVGOperationDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
......@@ -108,7 +108,7 @@ public class AVGServiceDetailPage extends BaseExtPage {
content.add(charts);
content.add(new AVGOperationPanel(
content.add(new AVGOperationDirectoryPanel(
"operations", getPageReference(), choreographyId, serviceName, ArtifactType.SERVICE));
body.add(content);
}
......
......@@ -28,7 +28,7 @@ import java.util.LinkedList;
import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.panels.OperationPanel;
import org.apache.syncope.client.console.panels.OperationDirectoryPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
......@@ -221,7 +221,7 @@ public class CDDetailPage extends BaseExtPage {
content.add(charts);
content.add(new OperationPanel(
content.add(new OperationDirectoryPanel(
"operations", getPageReference(), choreographyInstancePK, cdName, ArtifactType.CD));
body.add(content);
}
......
......@@ -27,10 +27,10 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.CDPanel;
import org.apache.syncope.client.console.panels.CDDirectoryPanel;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.panels.ChoreographyActionsPanel;
import org.apache.syncope.client.console.panels.ServicePanel;
import org.apache.syncope.client.console.panels.ServiceDirectoryPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
......@@ -272,7 +272,7 @@ public class InstanceStatsPage extends BaseExtPage {
@Override
public Panel getPanel(final String panelId) {
return new CDPanel(panelId, getPageReference(), instanceId);
return new CDDirectoryPanel(panelId, getPageReference(), instanceId);
}
});
......@@ -282,7 +282,7 @@ public class InstanceStatsPage extends BaseExtPage {
@Override
public Panel getPanel(final String panelId) {
return new ServicePanel(panelId, getPageReference(), instanceId);
return new ServiceDirectoryPanel(panelId, getPageReference(), instanceId);
}
});
......
......@@ -25,7 +25,7 @@ import java.util.LinkedList;
import java.util.List;
import org.apache.syncope.client.console.BookmarkablePageLinkBuilder;
import org.apache.syncope.client.console.panels.ChartsLegendPanel;
import org.apache.syncope.client.console.panels.OperationPanel;
import org.apache.syncope.client.console.panels.OperationDirectoryPanel;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.widget.StatsWidget;
import org.apache.syncope.client.console.widgets.LabeledBarDataSet;
......@@ -112,7 +112,7 @@ public class ServiceDetailPage extends BaseExtPage {
content.add(charts);
content.add(new OperationPanel(
content.add(new OperationDirectoryPanel(
"operations", getPageReference(), choreographyInstancePK, serviceName, ArtifactType.SERVICE));
body.add(content);
}
......
......@@ -27,7 +27,7 @@ import java.util.List;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.AVGCDDetailPage;
import org.apache.syncope.client.console.pages.InstanceStatsPage;
import org.apache.syncope.client.console.panels.AVGCDPanel.CDProvider;
import org.apache.syncope.client.console.panels.AVGCDDirectoryPanel.CDProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -44,14 +44,14 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
public class AVGCDPanel extends DirectoryPanel<
public class AVGCDDirectoryPanel extends DirectoryPanel<
AVGCoordinationDelegateTO, AVGCoordinationDelegateTO, CDProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
private String choreographyId;
public AVGCDPanel(final String id, final PageReference pageRef, final String choreographyId) {
public AVGCDDirectoryPanel(final String id, final PageReference pageRef, final String choreographyId) {
super(id,
new DirectoryPanel.Builder<
......@@ -63,7 +63,7 @@ public class AVGCDPanel extends DirectoryPanel<
@Override
protected WizardMgtPanel<AVGCoordinationDelegateTO> newInstance(
final String id, final boolean wizardInModal) {
return new AVGCDPanel(id, this);
return new AVGCDDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -75,7 +75,7 @@ public class AVGCDPanel extends DirectoryPanel<
initResultTable();
}
private AVGCDPanel(final String id,
private AVGCDDirectoryPanel(final String id,
final DirectoryPanel.Builder<
AVGCoordinationDelegateTO, AVGCoordinationDelegateTO, ChoreographyRestClient> builder) {
......
......@@ -42,7 +42,7 @@ import java.util.Iterator;
import java.util.List;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.CDDetailPage;
import org.apache.syncope.client.console.panels.AVGOperationPanel.AVGOperationProvider;
import org.apache.syncope.client.console.panels.AVGOperationDirectoryPanel.AVGOperationProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -53,7 +53,7 @@ import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
public class AVGOperationPanel extends DirectoryPanel<
public class AVGOperationDirectoryPanel extends DirectoryPanel<
AVGOperationDataTO, AVGOperationDataTO, AVGOperationProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
......@@ -64,7 +64,7 @@ public class AVGOperationPanel extends DirectoryPanel<
private ArtifactType artifactType;
public AVGOperationPanel(final String id, final PageReference pageRef,
public AVGOperationDirectoryPanel(final String id, final PageReference pageRef,
final String choreographyId, final String artifactName, final ArtifactType artifactType) {
super(id, new DirectoryPanel.Builder<AVGOperationDataTO, AVGOperationDataTO, ChoreographyRestClient>(
......@@ -74,7 +74,7 @@ public class AVGOperationPanel extends DirectoryPanel<
@Override
protected WizardMgtPanel<AVGOperationDataTO> newInstance(final String id, final boolean wizardInModal) {
return new AVGOperationPanel(id, this);
return new AVGOperationDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -88,7 +88,7 @@ public class AVGOperationPanel extends DirectoryPanel<
initResultTable();
}
private AVGOperationPanel(
private AVGOperationDirectoryPanel(
final String id,
final DirectoryPanel.Builder<AVGOperationDataTO, AVGOperationDataTO, ChoreographyRestClient> builder) {
......
......@@ -27,7 +27,7 @@ import java.util.List;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.InstanceStatsPage;
import org.apache.syncope.client.console.pages.AVGServiceDetailPage;
import org.apache.syncope.client.console.panels.AVGServicePanel.AVGServiceProvider;
import org.apache.syncope.client.console.panels.AVGServiceDirectoryPanel.AVGServiceProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -44,14 +44,14 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
public class AVGServicePanel extends DirectoryPanel<
public class AVGServiceDirectoryPanel extends DirectoryPanel<
AVGServiceTO, AVGServiceTO, AVGServiceProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
private String choreographyId;
public AVGServicePanel(final String id, final PageReference pageRef, final String choreographyId) {
public AVGServiceDirectoryPanel(final String id, final PageReference pageRef, final String choreographyId) {
super(id, new DirectoryPanel.Builder<AVGServiceTO, AVGServiceTO, ChoreographyRestClient>(
new ChoreographyRestClient(), pageRef) {
......@@ -60,7 +60,7 @@ public class AVGServicePanel extends DirectoryPanel<
@Override
protected WizardMgtPanel<AVGServiceTO> newInstance(final String id, final boolean wizardInModal) {
return new AVGServicePanel(id, this);
return new AVGServiceDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -72,7 +72,7 @@ public class AVGServicePanel extends DirectoryPanel<
initResultTable();
}
private AVGServicePanel(
private AVGServiceDirectoryPanel(
final String id,
final DirectoryPanel.Builder<AVGServiceTO, AVGServiceTO, ChoreographyRestClient> builder) {
......
......@@ -27,7 +27,7 @@ import java.util.List;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.CDDetailPage;
import org.apache.syncope.client.console.pages.InstanceStatsPage;
import org.apache.syncope.client.console.panels.CDPanel.CDProvider;
import org.apache.syncope.client.console.panels.CDDirectoryPanel.CDProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -44,14 +44,14 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
public class CDPanel extends DirectoryPanel<
public class CDDirectoryPanel extends DirectoryPanel<
CoordinationDelegateTO, CoordinationDelegateTO, CDProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
private String instanceId;
public CDPanel(final String id, final PageReference pageRef, final String instanceId) {
public CDDirectoryPanel(final String id, final PageReference pageRef, final String instanceId) {
super(id, new Builder<CoordinationDelegateTO, CoordinationDelegateTO, ChoreographyRestClient>(
new ChoreographyRestClient(), pageRef) {
......@@ -60,7 +60,7 @@ public class CDPanel extends DirectoryPanel<
@Override
protected WizardMgtPanel<CoordinationDelegateTO> newInstance(final String id, final boolean wizardInModal) {
return new CDPanel(id, this);
return new CDDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -72,7 +72,7 @@ public class CDPanel extends DirectoryPanel<
initResultTable();
}
private CDPanel(
private CDDirectoryPanel(
final String id,
final Builder<CoordinationDelegateTO, CoordinationDelegateTO, ChoreographyRestClient> builder) {
......
......@@ -27,7 +27,7 @@ import java.util.Comparator;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.ChoreographyDetailPage;
import org.apache.syncope.client.console.pages.InstanceStatsPage;
import org.apache.syncope.client.console.panels.InstancePanel.InstanceProvider;
import org.apache.syncope.client.console.panels.InstanceDirectoryPanel.InstanceProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -44,14 +44,14 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
public class InstancePanel extends DirectoryPanel<
public class InstanceDirectoryPanel extends DirectoryPanel<
ChoreographyInstanceTO, ChoreographyInstanceTO, InstanceProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
private String choreographyId;
public InstancePanel(final String id, final PageReference pageRef, final String choreographyId) {
public InstanceDirectoryPanel(final String id, final PageReference pageRef, final String choreographyId) {
super(id, new Builder<ChoreographyInstanceTO, ChoreographyInstanceTO, ChoreographyRestClient>(
new ChoreographyRestClient(), pageRef) {
......@@ -59,7 +59,7 @@ public class InstancePanel extends DirectoryPanel<
@Override
protected WizardMgtPanel<ChoreographyInstanceTO> newInstance(final String id, final boolean wizardInModal) {
return new InstancePanel(id, this);
return new InstanceDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -71,7 +71,7 @@ public class InstancePanel extends DirectoryPanel<
initResultTable();
}
private InstancePanel(
private InstanceDirectoryPanel(
final String id,
final Builder<ChoreographyInstanceTO, ChoreographyInstanceTO, ChoreographyRestClient> builder) {
......@@ -100,8 +100,9 @@ public class InstancePanel extends DirectoryPanel<
"Id", "choreographyInstanceId"));
columns.add(new PropertyColumn<>(new ResourceModel("instanceDescription", "Description"),
"instanceDescription"));
columns.add(new PropertyColumn<>(new ResourceModel("executionTime", "Overall Execution Time (ms)"),
"executionTime"));
columns.add(new PropertyColumn<>(new ResourceModel("status", "Status"), "Status", "status"));
columns.add(new PropertyColumn<>(new ResourceModel("executionTime", "Execution Time (ms)"),
"Execution Time (ms)", "executionTime"));
columns.add(new AbstractColumn<ChoreographyInstanceTO, String>(new ResourceModel("actions", "")) {
private static final long serialVersionUID = -3503023501954863131L;
......
......@@ -32,7 +32,7 @@ public class InstancesOverviewPanel extends Panel {
final String choreographyId) {
super(id);
super.add(new InstancePanel("instances", pageReference, choreographyId));
super.add(new InstanceDirectoryPanel("instances", pageReference, choreographyId));
Double averageInstanceExecutionTime = restClient.getAverageInstanceExecutionTime(choreographyId);
super.add(new Label("avg_instances", getString("average") + ": "
......
......@@ -42,7 +42,7 @@ import java.util.Iterator;
import java.util.List;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.CDDetailPage;
import org.apache.syncope.client.console.panels.OperationPanel.OperationProvider;
import org.apache.syncope.client.console.panels.OperationDirectoryPanel.OperationProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -53,7 +53,7 @@ import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
public class OperationPanel extends DirectoryPanel<
public class OperationDirectoryPanel extends DirectoryPanel<
OperationDataTO, OperationDataTO, OperationProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
......@@ -64,7 +64,7 @@ public class OperationPanel extends DirectoryPanel<
private ArtifactType artifactType;
public OperationPanel(final String id, final PageReference pageRef,
public OperationDirectoryPanel(final String id, final PageReference pageRef,
final String instanceId, final String artifactName, final ArtifactType artifactType) {
super(id, new DirectoryPanel.Builder<OperationDataTO, OperationDataTO, ChoreographyRestClient>(
......@@ -74,7 +74,7 @@ public class OperationPanel extends DirectoryPanel<
@Override
protected WizardMgtPanel<OperationDataTO> newInstance(final String id, final boolean wizardInModal) {
return new OperationPanel(id, this);
return new OperationDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -88,7 +88,7 @@ public class OperationPanel extends DirectoryPanel<
initResultTable();
}
private OperationPanel(
private OperationDirectoryPanel(
final String id,
final DirectoryPanel.Builder<OperationDataTO, OperationDataTO, ChoreographyRestClient> builder) {
......
......@@ -27,7 +27,7 @@ import java.util.List;
import org.apache.syncope.client.console.commons.DirectoryDataProvider;
import org.apache.syncope.client.console.pages.InstanceStatsPage;
import org.apache.syncope.client.console.pages.ServiceDetailPage;
import org.apache.syncope.client.console.panels.ServicePanel.ServiceProvider;
import org.apache.syncope.client.console.panels.ServiceDirectoryPanel.ServiceProvider;
import org.apache.syncope.client.console.rest.ChoreographyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wizards.WizardMgtPanel;
......@@ -44,13 +44,14 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
public class ServicePanel extends DirectoryPanel<ServiceTO, ServiceTO, ServiceProvider, ChoreographyRestClient> {
public class ServiceDirectoryPanel extends DirectoryPanel<
ServiceTO, ServiceTO, ServiceProvider, ChoreographyRestClient> {
private static final long serialVersionUID = 3727444742501082182L;
private String instanceId;
public ServicePanel(final String id, final PageReference pageRef, final String instanceId) {
public ServiceDirectoryPanel(final String id, final PageReference pageRef, final String instanceId) {
super(id, new DirectoryPanel.Builder<ServiceTO, ServiceTO, ChoreographyRestClient>(
new ChoreographyRestClient(), pageRef) {
......@@ -59,7 +60,7 @@ public class ServicePanel extends DirectoryPanel<ServiceTO, ServiceTO, ServicePr
@Override
protected WizardMgtPanel<ServiceTO> newInstance(final String id, final boolean wizardInModal) {
return new ServicePanel(id, this);
return new ServiceDirectoryPanel(id, this);
}
}.disableCheckBoxes());
......@@ -71,7 +72,7 @@ public class ServicePanel extends DirectoryPanel<ServiceTO, ServiceTO, ServicePr
initResultTable();
}
private ServicePanel(
private ServiceDirectoryPanel(
final String id,
final DirectoryPanel.Builder<ServiceTO, ServiceTO, ChoreographyRestClient> builder) {
......
......@@ -15,6 +15,7 @@
*/
package eu.chorevolution.idm.common.to;
import eu.chorevolution.idm.common.types.InstanceStatusType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import org.apache.syncope.common.lib.AbstractBaseBean;
......@@ -35,6 +36,8 @@ public class ChoreographyInstanceTO extends AbstractBaseBean {
private String choreographyName;
private InstanceStatusType status;
private Long executionTime;
public String getId() {
......@@ -77,6 +80,14 @@ public class ChoreographyInstanceTO extends AbstractBaseBean {
this.choreographyName = choreographyName;
}
public InstanceStatusType getStatus() {
return status;
}
public void setStatus(final InstanceStatusType status) {
this.status = status;
}
public Long getExecutionTime() {
return executionTime;
}
......
/*
* Copyright 2016 The CHOReVOLUTION project.
*
* 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 eu.chorevolution.idm.common.types;
public enum InstanceStatusType {
RUNNING,
COMPLETED,
FAILED
}
......@@ -28,6 +28,7 @@ import eu.chorevolution.idm.common.to.OperationDataTO;
import eu.chorevolution.idm.common.to.ServiceTO;
import eu.chorevolution.idm.common.types.ArtifactType;
import eu.chorevolution.idm.common.types.EventType;
import eu.chorevolution.idm.common.types.InstanceStatusType;
import java.util.LinkedList;
import org.apache.syncope.core.persistence.api.dao.ChoreographyDAO;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -121,6 +122,7 @@ public class MonitorLogic extends AbstractTransactionalLogic<AbstractBaseBean> {
choreographyInstanceTO.setId(current.getKey()); // choreography instance primary key
choreographyInstanceTO.setChoreographyInstanceId(current.getChoreographyInstanceId());
choreographyInstanceTO.setInstanceDescription(current.getDescription());
choreographyInstanceTO.setStatus(getChoreographyInstanceStatus(current.getKey()));
choreographyInstanceTO.setExecutionTime(getChoreographyInstanceExecutionTime(current.getKey()));
choreographyInstanceTO.setChoreographyId(choreographyId);
......@@ -362,7 +364,10 @@ public class MonitorLogic extends AbstractTransactionalLogic<AbstractBaseBean> {
operation.setServiceExecutionTime(serviceReplyResponse - serviceReceivingRequest);
operation.setServiceWaitTimeForResponse(serviceReceivingResponse - serviceSendingRequest);
operation.setNetworkOverheadForBusinessMessagesExchangeTime(
cdReceivingResponse - cdForwardingRequest - operation.getServiceExecutionTime()
cdReceivingResponse - cdForwardingRequest
- operation.getServiceExecutionTime()
+ (cdReceivingRequest - serviceSendingRequest)
+ (serviceReceivingResponse - cdForwardingResponse)
);
operation.setCoordinationAlgorithmReasoningTime((cdForwardingRequest - cdReceivingRequest)
+ (cdForwardingResponse - cdReceivingResponse)
......@@ -417,11 +422,18 @@ public class MonitorLogic extends AbstractTransactionalLogic<AbstractBaseBean> {
}
choreographyInstanceTO.setChoreographyName(choreography.getName());
}
choreographyInstanceTO.setStatus(getChoreographyInstanceStatus(choreographyInstancePK));
choreographyInstanceTO.setExecutionTime(getChoreographyInstanceExecutionTime(choreographyInstancePK));
return choreographyInstanceTO;
}
// Temporary implementation: it has to be updated when will be possible to determine instance status
private InstanceStatusType getChoreographyInstanceStatus(final String choreographyInstancePK) {
return InstanceStatusType.COMPLETED;
}
private Long getChoreographyInstanceExecutionTime(final String choreographyInstancePK) {
List<Event> events = eventDAO.findByChoreographyInstancePK(choreographyInstancePK);