Commit fbb06c9f authored by michael.simon's avatar michael.simon
Browse files

add simple list for cluster members

parent 8c9a3f06
/*******************************************************************************
* Copyright (c) 2014 Michael Simon.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Michael Simon - initial
******************************************************************************/
package edu.kit.scc.webreg.service;
import edu.kit.scc.webreg.entity.ClusterMemberEntity;
public interface ClusterMemberService extends BaseService<ClusterMemberEntity, Long> {
}
/*******************************************************************************
* Copyright (c) 2014 Michael Simon.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Michael Simon - initial
******************************************************************************/
package edu.kit.scc.webreg.service.impl;
import javax.ejb.Stateless;
import javax.inject.Inject;
import edu.kit.scc.webreg.dao.BaseDao;
import edu.kit.scc.webreg.dao.ClusterMemberDao;
import edu.kit.scc.webreg.entity.ClusterMemberEntity;
import edu.kit.scc.webreg.service.ClusterMemberService;
@Stateless
public class ClusterMemberServiceImpl extends BaseServiceImpl<ClusterMemberEntity, Long> implements ClusterMemberService {
private static final long serialVersionUID = 1L;
@Inject
private ClusterMemberDao dao;
@Override
protected BaseDao<ClusterMemberEntity, Long> getDao() {
return dao;
}
}
......@@ -10,6 +10,8 @@
******************************************************************************/
package edu.kit.scc.webreg.service.timer;
import edu.kit.scc.webreg.dao.ClusterMemberDao;
public interface ClusterSchedulerManager {
void initialize();
......
......@@ -147,6 +147,5 @@ public class ClusterSchedulerManagerImpl implements ClusterSchedulerManager, Ser
clusterMemberEntity.setClusterSchedulerStatus(ClusterSchedulerStatus.PASSIVE);
clusterMemberEntity.setLastSchedulerStatusChange(new Date());
}
}
}
}
......@@ -12,15 +12,20 @@ package edu.kit.scc.webreg.bean.admin.timer;
import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.primefaces.model.LazyDataModel;
import edu.kit.scc.webreg.bootstrap.NodeConfiguration;
import edu.kit.scc.webreg.entity.ClusterMemberEntity;
import edu.kit.scc.webreg.model.GenericLazyDataModelImpl;
import edu.kit.scc.webreg.service.ClusterMemberService;
import edu.kit.scc.webreg.service.timer.StandardScheduler;
@Named("schedulerStatusBean")
@RequestScoped
@ManagedBean
@ViewScoped
public class SchedulerStatusBean implements Serializable {
private static final long serialVersionUID = 1L;
......@@ -31,6 +36,17 @@ public class SchedulerStatusBean implements Serializable {
@Inject
private NodeConfiguration nodeConfiguration;
@Inject
private ClusterMemberService clusterMemberService;
private LazyDataModel<ClusterMemberEntity> list;
public void preRenderView() {
if (list == null) {
list = new GenericLazyDataModelImpl<ClusterMemberEntity, ClusterMemberService, Long>(clusterMemberService);
}
}
public NodeConfiguration getNodeConfiguration() {
return nodeConfiguration;
}
......@@ -38,6 +54,13 @@ public class SchedulerStatusBean implements Serializable {
public StandardScheduler getStandardScheduler() {
return standardScheduler;
}
public LazyDataModel<ClusterMemberEntity> getList() {
return list;
}
public void setList(LazyDataModel<ClusterMemberEntity> list) {
this.list = list;
}
}
......@@ -5,12 +5,20 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:bw="http://www.scc.kit.edu/bwfacelets"
xmlns:p="http://primefaces.org/ui">
xmlns:p="http://primefaces.org/ui"
xmlns:of="http://omnifaces.org/functions">
<head>
<title></title>
</head>
<body>
<f:view>
<f:metadata>
<f:event type="javax.faces.event.PreRenderViewEvent"
listener="#{schedulerStatusBean.preRenderView}" />
</f:metadata>
<ui:composition template="/template/default-admin.xhtml">
<ui:param name="title" value="#{messages.title}"/>
......@@ -18,74 +26,44 @@
<h:form id="form">
<div class="panel">
<p:panel header="#{messages.scheduler_status}">
<p:panelGrid id="baseData" columns="2">
<h:outputText value="#{messages.cluster_scheduler_node}:"/>
<h:outputText value="#{schedulerStatusBean.clusterSchedulerStatusService.activeNode}"/>
<h:outputText value="#{messages.cluster_scheduler_ejb}:"/>
<h:outputText value="#{schedulerStatusBean.clusterSchedulerStatusService.clusterScheduler}"/>
<h:outputText value="#{messages.cluster_scheduler_node}:"/>
<h:outputText value="#{schedulerStatusBean.nodeConfiguration.nodeName}"/>
<h:outputText value="#{messages.timer_configured}:"/>
<h:outputText value="#{schedulerStatusBean.nodeConfiguration.timerConfigured}"/>
<h:outputText value="#{messages.timer_singleton_configured}:"/>
<h:outputText value="#{schedulerStatusBean.clusterSchedulerStatusService.clusterScheduler.timerConfigured}"/>
<h:outputText value="#{messages.rules_configured}:"/>
<h:outputText value="#{schedulerStatusBean.nodeConfiguration.rulesConfigured}"/>
</p:panelGrid>
</p:panel>
</div>
<div class="panel">
<p:panel header="#{messages.singleton_scheduler_status}">
<p:dataTable id="clusterSchedTable" var="t" value="#{schedulerStatusBean.clusterSchedulerStatusService.clusterScheduler.timerService.timers.toArray()}">
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.next_timeout}" />
</f:facet>
<h:outputText value="#{t.nextTimeout}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.timer_info}" />
</f:facet>
<h:outputText value="#{t.info.name} (#{t.info.jobClass.jobClassName})" rendered="#{t.info.class.simpleName == 'JobScheduleEntity'}" />
<h:outputText value="#{t.info}" rendered="#{t.info.class.simpleName != 'JobScheduleEntity'}" />
</p:column>
</p:dataTable>
</p:panel>
</div>
<div class="panel">
<p:panel header="#{messages.standard_scheduler_status}">
<p:dataTable id="schedTable" var="t" value="#{schedulerStatusBean.standardScheduler.timerService.timers.toArray()}">
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.next_timeout}" />
</f:facet>
<h:outputText value="#{t.nextTimeout}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{messages.timer_info}" />
</f:facet>
<h:outputText value="#{t.info.name} (#{t.info.jobClass.jobClassName})" rendered="#{t.info.class.simpleName == 'JobScheduleEntity'}" />
<h:outputText value="#{t.info}" rendered="#{t.info.class.simpleName != 'JobScheduleEntity'}" />
</p:column>
</p:dataTable>
</p:panel>
</div>
<p:dataTable id="dataTable" var="node" value="#{schedulerStatusBean.list}" paginator="true"
lazy="true" rows="15">
<p:column sortBy="#{node.id}" style="width:36px;">
<f:facet name="header">
<h:outputText value="#{messages.id}" />
</f:facet>
<h:outputText value="#{node.id}" />
</p:column>
<p:column sortBy="#{node.nodeName}" filterBy="#{node.nodeName}">
<f:facet name="header">
<h:outputText value="#{messages.name}" />
</f:facet>
<h:outputText value="#{node.nodeName}" />
</p:column>
<p:column sortBy="#{node.clusterMemberStatus}">
<f:facet name="header">
<h:outputText value="#{messages.cluster_member_status}" />
</f:facet>
<h:outputText value="#{node.clusterMemberStatus}" />
</p:column>
<p:column sortBy="#{node.clusterSchedulerStatus}">
<f:facet name="header">
<h:outputText value="#{messages.cluster_scheduler_status}" />
</f:facet>
<h:outputText value="#{node.clusterSchedulerStatus}" />
</p:column>
<p:column sortBy="#{node.lastStatusCheck}">
<f:facet name="header">
<h:outputText value="#{messages.last_check}" />
</f:facet>
<h:outputText value="#{of:formatDate(node.lastStatusCheck, 'dd.MM.yyyy HH:mm')}" />
</p:column>
</p:dataTable>
</h:form>
</ui:define>
</ui:composition>
</ui:composition>
</f:view>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment