You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2016/02/24 16:50:08 UTC
[3/4] syncope git commit: [SYNCOPE-744][SYNCOPE-750] Basic work done
for jobs and executions widget
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
index 19bcd44..6adb0b9 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/ResourceDetailsPanel.html
@@ -16,59 +16,51 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <head>
- <title>Resource details panel</title>
- </head>
- <body>
- <wicket:panel>
-
- <div wicket:id="container" class="summarize">
- <div class="form-group">
- <span wicket:id="name">[name]</span>
- </div>
+ <div wicket:id="container" class="summarize">
+ <div class="form-group">
+ <span wicket:id="name">[name]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="connector">[connector]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="connector">[connector]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="enforceMandatoryCondition">[enforceMandatoryCondition]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="enforceMandatoryCondition">[enforceMandatoryCondition]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="propagationPriority">[propagationPriority]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="propagationPriority">[propagationPriority]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="randomPwdIfNotProvided">[randomPwdIfNotProvided]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="randomPwdIfNotProvided">[randomPwdIfNotProvided]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="actionsClasses">[actionsClasses]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="actionsClasses">[actionsClasses]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="createTraceLevel">[createTraceLevel]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="createTraceLevel">[createTraceLevel]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="updateTraceLevel">[updateTraceLevel]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="updateTraceLevel">[updateTraceLevel]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="deleteTraceLevel">[deleteTraceLevel]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="deleteTraceLevel">[deleteTraceLevel]</span>
+ </div>
- <div class="form-group">
- <span wicket:id="syncTraceLevel">[syncTraceLevel]</span>
- </div>
+ <div class="form-group">
+ <span wicket:id="syncTraceLevel">[syncTraceLevel]</span>
</div>
+ </div>
- <span wicket:id="systeminformation">[System Information]</span>
- </wicket:panel>
- </body>
+ <span wicket:id="systeminformation">[System Information]</span>
+ </wicket:panel>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemasPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemasPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemasPanel.html
index 4e4de2f..ce1be06 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemasPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SchemasPanel.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -17,17 +16,8 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <body>
- <wicket:panel>
- <div wicket:id="accordionPanel"></div>
-<!-- <div class="modal-footer">
- <a wicket:message="title:createSchema" wicket:id="createSchema">
- <i class="glyphicon glyphicon-duplicate"></i>
- </a>
- </div>-->
- </wicket:panel>
- </body>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div wicket:id="accordionPanel"></div>
+ </wicket:panel>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionsModalPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionsModalPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionsModalPanel.html
index 224b6c0..b48c089 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionsModalPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/SecurityQuestionsModalPanel.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
index 0fcd2ed..c5abcba 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/panels/TogglePanel.html
@@ -16,94 +16,91 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <head><title>toggle menu</title></head>
- <body>
- <wicket:head>
- <style type="text/css">
- div.topology-menu {
- display: none;
- border-radius: 5px;
- background-color: rgba(0, 0, 0, 0.45);
- color: #fff;
- position: absolute;
- right: 5px;
- top: 130px;
- width: auto;
- min-width: 250px;
- z-index: 999;
- }
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style type="text/css">
+ div.topology-menu {
+ display: none;
+ border-radius: 5px;
+ background-color: rgba(0, 0, 0, 0.45);
+ color: #fff;
+ position: absolute;
+ right: 5px;
+ top: 130px;
+ width: auto;
+ min-width: 250px;
+ z-index: 999;
+ }
- div.topology-menu ul.menu {
- list-style: outside none none;
- margin: 0;
- padding: 0;
- list-style: outside none none;
- }
+ div.topology-menu ul.menu {
+ list-style: outside none none;
+ margin: 0;
+ padding: 0;
+ list-style: outside none none;
+ }
- div.topology-menu ul.menu li {
- display: block;
- line-height: 2em;
- vertical-align: middle;
- padding: 5px 10px;
- }
+ div.topology-menu ul.menu li {
+ display: block;
+ line-height: 2em;
+ vertical-align: middle;
+ padding: 5px 10px;
+ }
- div.topology-menu ul.menu li a {
- position: relative;
- padding: 12px 5px 12px 15px;
- }
+ div.topology-menu ul.menu li a {
+ position: relative;
+ padding: 12px 5px 12px 15px;
+ }
- div.topology-menu div.header a:active,
- div.topology-menu div.header a:link,
- div.topology-menu div.header a:visited,
- div.topology-menu ul a:active,
- div.topology-menu ul a:link,
- div.topology-menu ul a:visited{
- color: #fff;
- }
+ div.topology-menu div.header a:active,
+ div.topology-menu div.header a:link,
+ div.topology-menu div.header a:visited,
+ div.topology-menu ul a:active,
+ div.topology-menu ul a:link,
+ div.topology-menu ul a:visited{
+ color: #fff;
+ }
- div.topology-menu ul li:hover {
- color: #fff;
- background-color: rgba(0, 0, 0, 0.2);
- z-index: 1000;
- font-weight: bold;
- }
+ div.topology-menu ul li:hover {
+ color: #fff;
+ background-color: rgba(0, 0, 0, 0.2);
+ z-index: 1000;
+ font-weight: bold;
+ }
- div.topology-menu div.header {
- background-color: rgba(0, 0, 0, 0);
- position: relative;
- font-size: 1.5em;
- padding-bottom: 5px;
- border-bottom: 1px solid #aaa;
- }
+ div.topology-menu div.header {
+ background-color: rgba(0, 0, 0, 0);
+ position: relative;
+ font-size: 1.5em;
+ padding-bottom: 5px;
+ border-bottom: 1px solid #aaa;
+ }
- div.topology-menu div.header a {
- display: inline-table;
- padding: 6px 2px 0px 0px;
- }
+ div.topology-menu div.header a {
+ display: inline-table;
+ padding: 6px 2px 0px 0px;
+ }
- div.topology-menu div.header .close {
- text-align: right;
- }
- </style>
- </wicket:head>
- <wicket:panel>
- <div wicket:id="togglePanelContainer" class="topology-menu inactive-topology-menu">
- <div class="header">
- <div class="label">
- <label wicket:id="label"/>
- </div>
- <div class="close">
- <a wicket:id="close" href="#"><i class="glyphicon glyphicon-remove"></i></a>
- </div>
+ div.topology-menu div.header .close {
+ text-align: right;
+ }
+ </style>
+ </wicket:head>
+ <wicket:panel>
+ <div wicket:id="togglePanelContainer" class="topology-menu inactive-topology-menu">
+ <div class="header">
+ <div class="label">
+ <label wicket:id="label"/>
+ </div>
+ <div class="close">
+ <a wicket:id="close" href="#"><i class="glyphicon glyphicon-remove"></i></a>
</div>
- <wicket:child/>
</div>
+ <wicket:child/>
+ </div>
- <span wicket:id="outherObjectsRepeater">
- <div wicket:id="outher"/>
- </span>
+ <span wicket:id="outherObjectsRepeater">
+ <div wicket:id="outher"/>
+ </span>
- </wicket:panel>
- </body>
+ </wicket:panel>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/tasks/SchedTaskSearchResultPanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/tasks/SchedTaskSearchResultPanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/tasks/SchedTaskSearchResultPanel.html
index f1b3b31..e4c5611 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/tasks/SchedTaskSearchResultPanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/tasks/SchedTaskSearchResultPanel.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/tasks/StartAtTogglePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/tasks/StartAtTogglePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/tasks/StartAtTogglePanel.html
index 5c1cdd1..356e28f 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/tasks/StartAtTogglePanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/tasks/StartAtTogglePanel.html
@@ -16,45 +16,42 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <head><title>toggle menu</title></head>
- <body>
- <wicket:head>
- <style type="text/css">
- div#startAt {
- background-color: rgba(98, 98, 98, 0.98) !important;
- color: #CCC;
- right: 5px !important;
- top: 100px !important;
- min-width: 300px;
- min-height: 130px !important;
- z-index: 6000 !important;
- }
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:head>
+ <style type="text/css">
+ div#startAt {
+ background-color: rgba(98, 98, 98, 0.98) !important;
+ color: #CCC;
+ right: 5px !important;
+ top: 100px !important;
+ min-width: 300px;
+ min-height: 130px !important;
+ z-index: 6000 !important;
+ }
- div#startAtContainer {
- padding: 15px;
- }
+ div#startAtContainer {
+ padding: 15px;
+ }
- div#startAtContainer input {
- background-color: rgba(200, 200, 200, 0.60) !important;
- }
- </style>
- </wicket:head>
- <wicket:extend>
- <div id="startAtContainer">
- <form wicket:id="startAtForm">
- <div class="form-group">
- <span wicket:id="startAtCheck"/>
- </div>
- <div class="input-group">
- <span wicket:id="startAtDate"/>
+ div#startAtContainer input {
+ background-color: rgba(200, 200, 200, 0.60) !important;
+ }
+ </style>
+ </wicket:head>
+ <wicket:extend>
+ <div id="startAtContainer">
+ <form wicket:id="startAtForm">
+ <div class="form-group">
+ <span wicket:id="startAtCheck"/>
+ </div>
+ <div class="input-group">
+ <span wicket:id="startAtDate"/>
- <div class="input-group-addon">
- <a wicket:id="startAt"><i class="fa fa-gear"></i></a>
- </div>
+ <div class="input-group-addon">
+ <a wicket:id="startAt"><i class="fa fa-gear"></i></a>
</div>
- </form>
- </div>
- </wicket:extend>
- </body>
+ </div>
+ </form>
+ </div>
+ </wicket:extend>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html b/client/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html
index a96d3d3..4dc40ed 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyNodePanel.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyNodePanel.html b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyNodePanel.html
index d1214be..70d0829 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyNodePanel.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/topology/TopologyNodePanel.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.html
index 68bd843..f0e633f 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/ajax/markup/html/navigation/paging/AjaxDataNavigationToolbar.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/bootstrap/tabs/Accordion.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/bootstrap/tabs/Accordion.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/bootstrap/tabs/Accordion.html
index a53bd65..76ba597 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/bootstrap/tabs/Accordion.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/bootstrap/tabs/Accordion.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -22,7 +21,7 @@ under the License.
<div class="panel box box-primary" wicket:id="tabs">
<div class="box-header with-border">
<h4 class="box-title">
- <a wicket:id="title" class="accordion-toggle" data-toggle="collapse" >Title</a>
+ <a wicket:id="title" class="accordion-toggle" data-toggle="collapse">Title</a>
</h4>
</div>
<div wicket:id="body" class="panel-collapse collapse">
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
index f53174f..d77da3d 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wicket/markup/html/form/preview/BinaryCertPreviewer.html
@@ -1,4 +1,3 @@
-<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -18,10 +17,7 @@ specific language governing permissions and limitations
under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
- <head><title></title></head>
- <body>
- <wicket:extend>
- <div wicket:id = "certCommonName">[certCommonName]</div>
- </wicket:extend>
- </body>
+ <wicket:extend>
+ <div wicket:id = "certCommonName">[certCommonName]</div>
+ </wicket:extend>
</html>
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
new file mode 100644
index 0000000..ccc5ab8
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.html
@@ -0,0 +1,37 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div class="nav-tabs-custom" style="cursor: move;">
+ <ul class="nav nav-tabs pull-right ui-sortable-handle">
+ <li class="active"><a data-toggle="tab" href="#running">Available</a></li>
+ <li><a data-toggle="tab" href="#recent">Recent</a></li>
+ <li class="pull-left header"><i class="fa fa-gears"></i> Jobs</li>
+ </ul>
+ <div class="tab-content no-padding">
+ <div style="position: relative;" id="running" class="chart tab-pane active">
+ <span wicket:id="available"/>
+ </div>
+ <div style="position: relative;" id="recent" class="chart tab-pane">
+ <span wicket:id="recent"/>
+ </div>
+ </div>
+ </div>
+ </wicket:panel>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
new file mode 100644
index 0000000..a3d33ac
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+referenceKey=Key
+referenceName=Name
+running=Running
+scheduled=Scheduled
+start=Start
+message=Message
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
new file mode 100644
index 0000000..a3d33ac
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_it.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+referenceKey=Key
+referenceName=Name
+running=Running
+scheduled=Scheduled
+start=Start
+message=Message
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
new file mode 100644
index 0000000..a3d33ac
--- /dev/null
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/widgets/JobWidget_pt_BR.properties
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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.
+referenceKey=Key
+referenceName=Name
+running=Running
+scheduled=Scheduled
+start=Start
+message=Message
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ConnObjectLink.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ConnObjectLink.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ConnObjectLink.html
index 2f889e6..643dc1c 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ConnObjectLink.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ConnObjectLink.html
@@ -16,18 +16,15 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <head><title></title></head>
- <body>
- <wicket:panel>
- <span wicket:id="connObjectLinkContainer">
- <div class="form-group">
- <span wicket:id="connObjectLinkCheckbox">[connObjectLinkCheckbox]</span>
- </div>
- <div class="form-group">
- <span wicket:id="connObjectLink">[connObjectLink]</span>
- </div>
- </span>
- </wicket:panel>
- </body>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="connObjectLinkContainer">
+ <div class="form-group">
+ <span wicket:id="connObjectLinkCheckbox">[connObjectLinkCheckbox]</span>
+ </div>
+ <div class="form-group">
+ <span wicket:id="connObjectLink">[connObjectLink]</span>
+ </div>
+ </span>
+ </wicket:panel>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$Mapping.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$Mapping.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$Mapping.html
index f5eaaeb..11b1a52 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$Mapping.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$Mapping.html
@@ -16,11 +16,8 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <head><title></title></head>
- <body>
- <wicket:panel>
- <span wicket:id="mapping" />
- </wicket:panel>
- </body>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <span wicket:id="mapping" />
+ </wicket:panel>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ObjectType.html
----------------------------------------------------------------------
diff --git a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ObjectType.html b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ObjectType.html
index 1692194..7b505e4 100644
--- a/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ObjectType.html
+++ b/client/console/src/main/resources/org/apache/syncope/client/console/wizards/provision/ProvisionWizardBuilder$ObjectType.html
@@ -16,20 +16,17 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://xmlns.jcp.org/jsf/composite">
- <head><title></title></head>
- <body>
- <wicket:panel >
- <div wicket:id="container">
- <div class="form-group">
- <label>Object Type</label>
- <span wicket:id="type"/>
- </div>
- <div class="form-group">
- <label>Object Class</label>
- <input type="text" placeholder="Object Class ..." class="form-control" wicket:id="class">
- </div>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
+ <wicket:panel>
+ <div wicket:id="container">
+ <div class="form-group">
+ <label>Object Type</label>
+ <span wicket:id="type"/>
</div>
- </wicket:panel>
- </body>
+ <div class="form-group">
+ <label>Object Class</label>
+ <input type="text" placeholder="Object Class ..." class="form-control" wicket:id="class">
+ </div>
+ </div>
+ </wicket:panel>
</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/lib/src/main/java/org/apache/syncope/common/lib/to/JobTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/JobTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/JobTO.java
new file mode 100644
index 0000000..a50429d
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/JobTO.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.syncope.common.lib.to;
+
+import java.util.Date;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "job")
+@XmlType
+public class JobTO extends AbstractBaseBean {
+
+ private static final long serialVersionUID = -7254450981751326711L;
+
+ private Long referenceKey;
+
+ private String referenceName;
+
+ private boolean running;
+
+ private boolean scheduled;
+
+ private String status;
+
+ private Date start;
+
+ public Long getReferenceKey() {
+ return referenceKey;
+ }
+
+ public void setReferenceKey(final Long referenceKey) {
+ this.referenceKey = referenceKey;
+ }
+
+ public String getReferenceName() {
+ return referenceName;
+ }
+
+ public void setReferenceName(final String referenceName) {
+ this.referenceName = referenceName;
+ }
+
+ public boolean isRunning() {
+ return running;
+ }
+
+ public void setRunning(final boolean running) {
+ this.running = running;
+ }
+
+ public boolean isScheduled() {
+ return scheduled;
+ }
+
+ public void setScheduled(final boolean scheduled) {
+ this.scheduled = scheduled;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(final String status) {
+ this.status = status;
+ }
+
+ public Date getStart() {
+ return start == null
+ ? null
+ : new Date(start.getTime());
+ }
+
+ public void setStart(final Date start) {
+ this.start = start == null
+ ? null
+ : new Date(start.getTime());
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskExecTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskExecTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskExecTO.java
index 467c35e..314c51c 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskExecTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskExecTO.java
@@ -20,6 +20,7 @@ package org.apache.syncope.common.lib.to;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.types.TaskType;
@XmlRootElement(name = "taskExec")
@XmlType
@@ -29,6 +30,8 @@ public class TaskExecTO extends AbstractExecTO {
private long task;
+ private TaskType type;
+
public long getTask() {
return task;
}
@@ -36,4 +39,13 @@ public class TaskExecTO extends AbstractExecTO {
public void setTask(final long task) {
this.task = task;
}
+
+ public TaskType getType() {
+ return type;
+ }
+
+ public void setType(final TaskType type) {
+ this.type = type;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/lib/src/main/java/org/apache/syncope/common/lib/types/JobStatusType.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/JobStatusType.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/JobStatusType.java
deleted file mode 100644
index 3a43807..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/JobStatusType.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 org.apache.syncope.common.lib.types;
-
-import javax.xml.bind.annotation.XmlEnum;
-
-@XmlEnum
-public enum JobStatusType {
-
- ALL,
- RUNNING,
- SCHEDULED;
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
index 11cdcd3..0b3a735 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/JAXRSService.java
@@ -42,4 +42,6 @@ public interface JAXRSService {
String PARAM_CONNID_PAGED_RESULTS_COOKIE = "connIdPagedResultsCookie";
+ String PARAM_MAX = "max";
+
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
index daa0400..2529ec6 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java
@@ -28,9 +28,12 @@ import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.types.JobAction;
/**
* REST operations for notifications.
@@ -86,4 +89,21 @@ public interface NotificationService extends JAXRSService {
@DELETE
@Path("{key}")
void delete(@NotNull @PathParam("key") Long key);
+
+ /**
+ * Returns details about notification job.
+ *
+ * @return details about notification job
+ */
+ @GET
+ @Path("job")
+ @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ JobTO getJob();
+
+ /**
+ * Executes an action on the notification job.
+ *
+ * @param action action to execute
+ */
+ void actionJob(@QueryParam("action") JobAction action);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
index c1427b8..7914eb0 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java
@@ -19,12 +19,13 @@
package org.apache.syncope.common.rest.api.service;
import java.util.List;
+import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.ws.rs.BeanParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@@ -34,10 +35,10 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.ReportExecTO;
import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.types.JobAction;
-import org.apache.syncope.common.lib.types.JobStatusType;
import org.apache.syncope.common.lib.types.ReportExecExportFormat;
import org.apache.syncope.common.rest.api.beans.BulkExecDeleteQuery;
import org.apache.syncope.common.rest.api.beans.ExecuteQuery;
@@ -98,6 +99,17 @@ public interface ReportService extends JAXRSService {
void delete(@NotNull @PathParam("key") Long key);
/**
+ * Returns the list of recently completed report executions, ordered by end date descendent.
+ *
+ * @param max the maximum number of executions to return
+ * @return list of recently completed report executions, ordered by end date descendent
+ */
+ @GET
+ @Path("executions/recent")
+ @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<ReportExecTO> listRecentExecutions(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
+
+ /**
* Deletes report execution with matching key.
*
* @param executionKey key of execution report to be deleted
@@ -143,15 +155,15 @@ public interface ReportService extends JAXRSService {
@QueryParam("format") ReportExecExportFormat fmt);
/**
- * List report jobs of the given type.
+ * List report jobs (running and / or scheduled).
*
- * @param type of report job
- * @return list of report jobs of the given type
+ * @param max the maximum number of jobs to return
+ * @return report jobs (running and / or scheduled)
*/
@GET
@Path("jobs")
@Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<ReportExecTO> listJobs(@MatrixParam("type") JobStatusType type);
+ List<JobTO> listJobs(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
/**
* Executes an action on an existing report's job.
@@ -160,6 +172,6 @@ public interface ReportService extends JAXRSService {
* @param action action to execute
*/
@POST
- @Path("{key}")
- void actionJob(@PathParam("key") Long key, @QueryParam("action") JobAction action);
+ @Path("/job/{key}")
+ void actionJob(@NotNull @PathParam("key") Long key, @QueryParam("action") JobAction action);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
index eda7c4b..15eb358 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
@@ -19,13 +19,13 @@
package org.apache.syncope.common.rest.api.service;
import java.util.List;
+import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.ws.rs.BeanParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@@ -37,11 +37,11 @@ import javax.ws.rs.core.Response;
import org.apache.syncope.common.lib.to.AbstractTaskTO;
import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.SchedTaskTO;
import org.apache.syncope.common.lib.to.TaskExecTO;
import org.apache.syncope.common.lib.types.JobAction;
-import org.apache.syncope.common.lib.types.JobStatusType;
import org.apache.syncope.common.rest.api.beans.BulkExecDeleteQuery;
import org.apache.syncope.common.rest.api.beans.ExecuteQuery;
import org.apache.syncope.common.rest.api.beans.TaskExecQuery;
@@ -120,6 +120,17 @@ public interface TaskService extends JAXRSService {
PagedResult<TaskExecTO> listExecutions(@BeanParam TaskExecQuery query);
/**
+ * Returns the list of recently completed task executions, ordered by end date descendent.
+ *
+ * @param max the maximum number of executions to return
+ * @return list of recently completed task executions, ordered by end date descendent
+ */
+ @GET
+ @Path("executions/recent")
+ @Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
+ List<TaskExecTO> listRecentExecutions(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
+
+ /**
* Deletes the task execution matching the provided key.
*
* @param executionKey key of task execution to be deleted
@@ -163,15 +174,15 @@ public interface TaskService extends JAXRSService {
BulkActionResult bulk(@NotNull BulkAction bulkAction);
/**
- * List task jobs of the given type.
+ * List task jobs (running and / or scheduled).
*
- * @param type of task job
- * @return list task jobs of the given type
+ * @param max the maximum number of jobs to return
+ * @return task jobs (running and / or scheduled)
*/
@GET
@Path("jobs")
@Produces({ JAXRSService.APPLICATION_XML, MediaType.APPLICATION_JSON })
- List<TaskExecTO> listJobs(@NotNull @MatrixParam("type") JobStatusType type);
+ List<JobTO> listJobs(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max);
/**
* Executes an action on an existing task's job.
@@ -180,6 +191,6 @@ public interface TaskService extends JAXRSService {
* @param action action to execute
*/
@POST
- @Path("{key}")
- void actionJob(@PathParam("key") Long key, @QueryParam("action") JobAction action);
+ @Path("/job/{key}")
+ void actionJob(@NotNull @PathParam("key") Long key, @QueryParam("action") JobAction action);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractJobLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractJobLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractJobLogic.java
index b534c64..d153d70 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractJobLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractJobLogic.java
@@ -19,15 +19,14 @@
package org.apache.syncope.core.logic;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.List;
-import java.util.Objects;
+import org.apache.commons.collections4.ComparatorUtils;
+import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.AbstractBaseBean;
-import org.apache.syncope.common.lib.to.AbstractExecTO;
-import org.apache.syncope.common.lib.to.ReportExecTO;
-import org.apache.syncope.common.lib.to.TaskExecTO;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.types.JobAction;
-import org.apache.syncope.common.lib.types.JobStatusType;
-import org.quartz.JobExecutionContext;
+import org.apache.syncope.core.provisioning.api.job.JobManager;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
@@ -38,151 +37,107 @@ import org.springframework.scheduling.quartz.SchedulerFactoryBean;
abstract class AbstractJobLogic<T extends AbstractBaseBean> extends AbstractTransactionalLogic<T> {
+ private static final Comparator<Boolean> BOOLEAN_COMPARATOR = ComparatorUtils.booleanComparator(true);
+
+ @SuppressWarnings("unchecked")
+ private static final Comparator<JobTO> CHAINED_COMPARATOR = ComparatorUtils.chainedComparator(
+ new Comparator<JobTO>() {
+
+ @Override
+ public int compare(final JobTO job1, final JobTO job2) {
+ return BOOLEAN_COMPARATOR.compare(job1.isRunning(), job2.isRunning());
+ }
+ },
+ new Comparator<JobTO>() {
+
+ @Override
+ public int compare(final JobTO job1, final JobTO job2) {
+ return BOOLEAN_COMPARATOR.compare(job1.isScheduled(), job2.isScheduled());
+ }
+ },
+ new Comparator<JobTO>() {
+
+ @Override
+ public int compare(final JobTO job1, final JobTO job2) {
+ int result;
+
+ if (job1.getStart() == null && job2.getStart() == null) {
+ result = 0;
+ } else if (job1.getStart() == null) {
+ result = -1;
+ } else if (job2.getStart() == null) {
+ result = 1;
+ } else {
+ result = job1.getStart().compareTo(job2.getStart());
+ }
+
+ return result;
+ }
+ });
+
+ @Autowired
+ protected JobManager jobManager;
+
@Autowired
protected SchedulerFactoryBean scheduler;
- protected abstract Long getKeyFromJobName(final JobKey jobKey);
+ protected abstract Pair<Long, String> getReference(final JobKey jobKey);
- private <E extends AbstractExecTO> void setTaskOrReportKey(final E jobExecTO, final Long taskOrReportKey) {
- if (jobExecTO instanceof TaskExecTO) {
- ((TaskExecTO) jobExecTO).setTask(taskOrReportKey);
- } else if (jobExecTO instanceof ReportExecTO) {
- ((ReportExecTO) jobExecTO).setReport(taskOrReportKey);
- }
- }
+ protected List<JobTO> listJobs(final int max) {
+ List<JobTO> jobTOs = new ArrayList<>();
- public <E extends AbstractExecTO> List<E> listJobs(final JobStatusType type, final Class<E> reference) {
- List<E> jobExecTOs = new ArrayList<>();
-
- switch (type) {
- case ALL:
- try {
- for (String groupName : scheduler.getScheduler().getJobGroupNames()) {
- for (JobKey jobKey
- : scheduler.getScheduler().getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
-
- Long key = getKeyFromJobName(jobKey);
- if (key != null) {
- List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
- if (jobTriggers.isEmpty()) {
- E jobExecTO = reference.newInstance();
- setTaskOrReportKey(jobExecTO, key);
- jobExecTO.setStatus("Not Scheduled");
-
- jobExecTOs.add(jobExecTO);
- } else {
- for (Trigger t : jobTriggers) {
- E jobExecTO = reference.newInstance();
- jobExecTO.setKey(key);
- jobExecTO.
- setStatus(scheduler.getScheduler().getTriggerState(t.getKey()).name());
- jobExecTO.setStart(t.getStartTime());
-
- jobExecTOs.add(jobExecTO);
- }
- }
- }
- }
- }
- } catch (SchedulerException e) {
- LOG.debug("Problems while retrieving all scheduled jobs", e);
- } catch (InstantiationException e) {
- LOG.debug("Problems while instantiating {}", reference, e);
- } catch (IllegalAccessException e) {
- LOG.debug("Problems while accessing {}", reference, e);
- }
- break;
-
- case RUNNING:
- try {
- for (JobExecutionContext jec : scheduler.getScheduler().getCurrentlyExecutingJobs()) {
- Long key = getKeyFromJobName(jec.getJobDetail().getKey());
- if (key != null) {
- E jobExecTO = reference.newInstance();
- setTaskOrReportKey(jobExecTO, key);
- jobExecTO.setStatus(
- scheduler.getScheduler().getTriggerState(jec.getTrigger().getKey()).name());
- jobExecTO.setStart(jec.getFireTime());
-
- jobExecTOs.add(jobExecTO);
- }
- }
- } catch (SchedulerException e) {
- LOG.debug("Problems while retrieving all currently executing jobs", e);
- } catch (InstantiationException e) {
- LOG.debug("Problems while instantiating {}", reference, e);
- } catch (IllegalAccessException e) {
- LOG.debug("Problems while accessing {}", reference, e);
- }
- break;
-
- case SCHEDULED:
- try {
- for (String groupName : scheduler.getScheduler().getJobGroupNames()) {
- for (JobKey jobKey
- : scheduler.getScheduler().getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
-
- Long key = getKeyFromJobName(jobKey);
- if (key != null) {
- List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
- for (Trigger t : jobTriggers) {
- E jobExecTO = reference.newInstance();
- setTaskOrReportKey(jobExecTO, key);
- jobExecTO.setStatus(scheduler.getScheduler().getTriggerState(t.getKey()).name());
- jobExecTO.setStart(t.getStartTime());
-
- jobExecTOs.add(jobExecTO);
- }
- }
- }
+ try {
+ for (JobKey jobKey : scheduler.getScheduler().
+ getJobKeys(GroupMatcher.jobGroupEquals(Scheduler.DEFAULT_GROUP))) {
+
+ JobTO jobTO = new JobTO();
+
+ Pair<Long, String> reference = getReference(jobKey);
+ if (reference != null) {
+ jobTOs.add(jobTO);
+
+ jobTO.setReferenceKey(reference.getLeft());
+ jobTO.setReferenceName(reference.getRight());
+
+ List<? extends Trigger> jobTriggers = scheduler.getScheduler().getTriggersOfJob(jobKey);
+ if (jobTriggers.isEmpty()) {
+ jobTO.setScheduled(false);
+ } else {
+ jobTO.setScheduled(true);
+ jobTO.setStart(jobTriggers.get(0).getStartTime());
+ jobTO.setStatus(scheduler.getScheduler().getTriggerState(jobTriggers.get(0).getKey()).name());
}
- } catch (SchedulerException e) {
- LOG.debug("Problems while retrieving all scheduled jobs", e);
- } catch (InstantiationException e) {
- LOG.debug("Problems while instantiating {}", reference, e);
- } catch (IllegalAccessException e) {
- LOG.debug("Problems while accessing {}", reference, e);
- }
- break;
- default:
+ jobTO.setRunning(jobManager.isRunning(jobKey));
+ }
+ }
+ } catch (SchedulerException e) {
+ LOG.debug("Problems while retrieving scheduled jobs", e);
}
- return jobExecTOs;
+
+ jobTOs.sort(CHAINED_COMPARATOR);
+ return jobTOs.size() > max ? jobTOs.subList(0, max) : jobTOs;
}
- protected void actionJob(final String jobName, final JobAction action) {
- if (jobName != null) {
- JobKey jobKey = new JobKey(jobName, Scheduler.DEFAULT_GROUP);
- try {
- if (scheduler.getScheduler().checkExists(jobKey)) {
- switch (action) {
- case START:
- Long currentKey = getKeyFromJobName(jobKey);
- boolean found = false;
- //Two or more equals jobs cannot be executed concurrently
- for (int i = 0; i < scheduler.getScheduler().getCurrentlyExecutingJobs().size() && !found;
- i++) {
- JobExecutionContext jec = scheduler.getScheduler().getCurrentlyExecutingJobs().get(i);
- Long execJobKey = getKeyFromJobName(jec.getJobDetail().getKey());
- if (Objects.equals(execJobKey, currentKey)) {
- found = true;
- }
- }
- if (!found) {
- scheduler.getScheduler().triggerJob(jobKey);
- }
- break;
-
- case STOP:
- scheduler.getScheduler().interrupt(jobKey);
- break;
-
- default:
- }
+ protected void actionJob(final JobKey jobKey, final JobAction action) {
+ try {
+ if (scheduler.getScheduler().checkExists(jobKey)) {
+ switch (action) {
+ case START:
+ scheduler.getScheduler().triggerJob(jobKey);
+ break;
+
+ case STOP:
+ scheduler.getScheduler().interrupt(jobKey);
+ break;
+
+ default:
}
- } catch (SchedulerException e) {
- LOG.debug("Problems during {} operation on job {}", action.toString(), jobName, e);
+ } else {
+ LOG.warn("Could not find job {}", jobKey);
}
+ } catch (SchedulerException e) {
+ LOG.debug("Problems during {} operation on job {}", action.toString(), jobKey, e);
}
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/core/logic/src/main/java/org/apache/syncope/core/logic/NotificationLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/NotificationLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/NotificationLogic.java
index da2c13e..86a0d9a 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/NotificationLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/NotificationLogic.java
@@ -24,18 +24,23 @@ import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.NotificationTO;
+import org.apache.syncope.common.lib.types.JobAction;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
import org.apache.syncope.core.persistence.api.dao.NotificationDAO;
import org.apache.syncope.core.persistence.api.entity.Notification;
import org.apache.syncope.core.provisioning.api.data.NotificationDataBinder;
+import org.apache.syncope.core.provisioning.api.job.JobManager;
+import org.quartz.JobKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@Component
-public class NotificationLogic extends AbstractTransactionalLogic<NotificationTO> {
+public class NotificationLogic extends AbstractJobLogic<NotificationTO> {
@Autowired
private NotificationDAO notificationDAO;
@@ -100,6 +105,20 @@ public class NotificationLogic extends AbstractTransactionalLogic<NotificationTO
}
@Override
+ protected Pair<Long, String> getReference(final JobKey jobKey) {
+ return JobManager.NOTIFICATION_JOB.equals(jobKey) ? Pair.of(0L, jobKey.getName()) : null;
+ }
+
+ public JobTO getJob() {
+ List<JobTO> jobs = super.listJobs(1);
+ return jobs.isEmpty() ? null : jobs.get(0);
+ }
+
+ public void actionJob(final JobAction action) {
+ super.actionJob(JobManager.NOTIFICATION_JOB, action);
+ }
+
+ @Override
protected NotificationTO resolveReference(final Method method, final Object... args)
throws UnresolvedReferenceException {
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/core/logic/src/main/java/org/apache/syncope/core/logic/ReportLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/ReportLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/ReportLogic.java
index b2d9f81..56f3d13 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/ReportLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/ReportLogic.java
@@ -38,6 +38,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.to.ReportExecTO;
import org.apache.syncope.common.lib.to.ReportTO;
@@ -52,17 +53,15 @@ import org.apache.syncope.core.persistence.api.entity.Report;
import org.apache.syncope.core.persistence.api.entity.ReportExec;
import org.apache.syncope.core.provisioning.api.data.ReportDataBinder;
import org.apache.syncope.core.provisioning.api.job.JobNamer;
-import org.apache.syncope.core.provisioning.api.job.JobInstanceLoader;
import org.apache.syncope.core.logic.report.TextSerializer;
-import org.apache.syncope.common.lib.to.AbstractExecTO;
import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.types.JobAction;
-import org.apache.syncope.common.lib.types.JobStatusType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.core.logic.report.XSLTTransformer;
+import org.apache.syncope.core.persistence.api.dao.ConfDAO;
import org.apache.xmlgraphics.util.MimeConstants;
import org.quartz.JobKey;
-import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@@ -71,13 +70,13 @@ import org.springframework.stereotype.Component;
public class ReportLogic extends AbstractJobLogic<ReportTO> {
@Autowired
- private ReportDAO reportDAO;
+ private ConfDAO confDAO;
@Autowired
- private ReportExecDAO reportExecDAO;
+ private ReportDAO reportDAO;
@Autowired
- private JobInstanceLoader jobInstanceLoader;
+ private ReportExecDAO reportExecDAO;
@Autowired
private ReportDataBinder binder;
@@ -92,7 +91,10 @@ public class ReportLogic extends AbstractJobLogic<ReportTO> {
report = reportDAO.save(report);
try {
- jobInstanceLoader.registerJob(report, null);
+ jobManager.register(
+ report,
+ null,
+ confDAO.find("tasks.interruptMaxRetries", "1").getValues().get(0).getLongValue());
} catch (Exception e) {
LOG.error("While registering quartz job for report " + report.getKey(), e);
@@ -115,7 +117,10 @@ public class ReportLogic extends AbstractJobLogic<ReportTO> {
report = reportDAO.save(report);
try {
- jobInstanceLoader.registerJob(report, null);
+ jobManager.register(
+ report,
+ null,
+ confDAO.find("tasks.interruptMaxRetries", "1").getValues().get(0).getLongValue());
} catch (Exception e) {
LOG.error("While registering quartz job for report " + report.getKey(), e);
@@ -162,9 +167,12 @@ public class ReportLogic extends AbstractJobLogic<ReportTO> {
}
try {
- jobInstanceLoader.registerJob(report, startAt);
+ jobManager.register(
+ report,
+ startAt,
+ confDAO.find("tasks.interruptMaxRetries", "1").getValues().get(0).getLongValue());
- scheduler.getScheduler().triggerJob(new JobKey(JobNamer.getJobName(report), Scheduler.DEFAULT_GROUP));
+ scheduler.getScheduler().triggerJob(JobNamer.getJobKey(report));
} catch (Exception e) {
LOG.error("While executing report {}", report, e);
@@ -276,11 +284,22 @@ public class ReportLogic extends AbstractJobLogic<ReportTO> {
}
ReportTO deletedReport = binder.getReportTO(report);
- jobInstanceLoader.unregisterJob(report);
+ jobManager.unregister(report);
reportDAO.delete(report);
return deletedReport;
}
+ @PreAuthorize("hasRole('" + StandardEntitlement.REPORT_LIST + "')")
+ public List<ReportExecTO> listRecentExecutions(final int max) {
+ return CollectionUtils.collect(reportExecDAO.findRecent(max), new Transformer<ReportExec, ReportExecTO>() {
+
+ @Override
+ public ReportExecTO transform(final ReportExec reportExec) {
+ return binder.getReportExecTO(reportExec);
+ }
+ }, new ArrayList<ReportExecTO>());
+ }
+
@PreAuthorize("hasRole('" + StandardEntitlement.REPORT_DELETE + "')")
public ReportExecTO deleteExecution(final Long executionKey) {
ReportExec reportExec = reportExecDAO.find(executionKey);
@@ -319,14 +338,17 @@ public class ReportLogic extends AbstractJobLogic<ReportTO> {
}
@Override
- protected Long getKeyFromJobName(final JobKey jobKey) {
- return JobNamer.getReportKeyFromJobName(jobKey.getName());
+ protected Pair<Long, String> getReference(final JobKey jobKey) {
+ Long key = JobNamer.getReportKeyFromJobName(jobKey.getName());
+
+ Report report = reportDAO.find(key);
+ return report == null ? null : Pair.of(key, report.getName());
}
@Override
@PreAuthorize("hasRole('" + StandardEntitlement.REPORT_LIST + "')")
- public <E extends AbstractExecTO> List<E> listJobs(final JobStatusType type, final Class<E> reference) {
- return super.listJobs(type, reference);
+ public List<JobTO> listJobs(final int max) {
+ return super.listJobs(max);
}
@PreAuthorize("hasRole('" + StandardEntitlement.REPORT_EXECUTE + "')")
@@ -335,8 +357,8 @@ public class ReportLogic extends AbstractJobLogic<ReportTO> {
if (report == null) {
throw new NotFoundException("Report " + key);
}
- String jobName = JobNamer.getJobName(report);
- actionJob(jobName, action);
+
+ actionJob(JobNamer.getJobKey(report), action);
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/core/logic/src/main/java/org/apache/syncope/core/logic/SystemLoadReporterJob.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SystemLoadReporterJob.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SystemLoadReporterJob.java
index 75e7f71..bb419bc 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SystemLoadReporterJob.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SystemLoadReporterJob.java
@@ -20,8 +20,7 @@ package org.apache.syncope.core.logic;
import java.lang.management.ManagementFactory;
import org.apache.syncope.common.lib.info.SystemInfo;
-import org.quartz.DisallowConcurrentExecution;
-import org.quartz.Job;
+import org.apache.syncope.core.provisioning.java.job.AbstractInterruptableJob;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
@@ -31,8 +30,7 @@ import org.springframework.stereotype.Component;
* Reports about system load.
*/
@Component
-@DisallowConcurrentExecution
-public class SystemLoadReporterJob implements Job {
+public class SystemLoadReporterJob extends AbstractInterruptableJob {
private static final Integer MB = 1024 * 1024;
@@ -41,6 +39,8 @@ public class SystemLoadReporterJob implements Job {
@Override
public void execute(final JobExecutionContext context) throws JobExecutionException {
+ super.execute(context);
+
SystemInfo.LoadInstant instant = new SystemInfo.LoadInstant();
instant.setSystemLoadAverage(ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage());
@@ -54,5 +54,4 @@ public class SystemLoadReporterJob implements Job {
logic.addLoadInstant(instant);
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/15582e4f/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
index 5101a98..24fbf16 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
@@ -26,16 +26,16 @@ import java.util.Map;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractExecTO;
import org.apache.syncope.common.lib.to.AbstractTaskTO;
import org.apache.syncope.common.lib.to.BulkActionResult;
+import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.SchedTaskTO;
import org.apache.syncope.common.lib.to.TaskExecTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.JobAction;
-import org.apache.syncope.common.lib.types.JobStatusType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
@@ -52,14 +52,12 @@ import org.apache.syncope.core.persistence.api.entity.task.TaskUtilsFactory;
import org.apache.syncope.core.provisioning.api.data.TaskDataBinder;
import org.apache.syncope.core.provisioning.api.job.JobNamer;
import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor;
-import org.apache.syncope.core.provisioning.api.job.JobInstanceLoader;
import org.apache.syncope.core.logic.notification.NotificationJobDelegate;
import org.apache.syncope.core.persistence.api.dao.ConfDAO;
import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
import org.apache.syncope.core.provisioning.java.job.TaskJob;
import org.quartz.JobDataMap;
import org.quartz.JobKey;
-import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@@ -89,9 +87,6 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
private NotificationJobDelegate notificationJobDelegate;
@Autowired
- private JobInstanceLoader jobInstanceLoader;
-
- @Autowired
private TaskUtilsFactory taskUtilsFactory;
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_CREATE + "')")
@@ -102,7 +97,7 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
task = taskDAO.save(task);
try {
- jobInstanceLoader.registerJob(
+ jobManager.register(
task,
task.getStartAt(),
confDAO.find("tasks.interruptMaxRetries", "1").getValues().get(0).getLongValue());
@@ -130,7 +125,7 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
task = taskDAO.save(task);
try {
- jobInstanceLoader.registerJob(
+ jobManager.register(
task,
task.getStartAt(),
confDAO.find("tasks.interruptMaxRetries", "1").getValues().get(0).getLongValue());
@@ -210,7 +205,7 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
}
try {
- Map<String, Object> jobDataMap = jobInstanceLoader.registerJob(
+ Map<String, Object> jobDataMap = jobManager.register(
(SchedTask) task,
startAt,
confDAO.find("tasks.interruptMaxRetries", "1").getValues().get(0).getLongValue());
@@ -219,7 +214,7 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
if (startAt == null) {
scheduler.getScheduler().triggerJob(
- new JobKey(JobNamer.getJobName(task), Scheduler.DEFAULT_GROUP),
+ JobNamer.getJobKey(task),
new JobDataMap(jobDataMap));
}
} catch (Exception e) {
@@ -257,7 +252,7 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
|| TaskType.SYNCHRONIZATION == taskUtils.getType()
|| TaskType.PUSH == taskUtils.getType()) {
- jobInstanceLoader.unregisterJob(task);
+ jobManager.unregister(task);
}
taskDAO.delete(task);
@@ -288,6 +283,17 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
}, new ArrayList<TaskExecTO>());
}
+ @PreAuthorize("hasRole('" + StandardEntitlement.TASK_LIST + "')")
+ public List<TaskExecTO> listRecentExecutions(final int max) {
+ return CollectionUtils.collect(taskExecDAO.findRecent(max), new Transformer<TaskExec, TaskExecTO>() {
+
+ @Override
+ public TaskExecTO transform(final TaskExec taskExec) {
+ return binder.getTaskExecTO(taskExec);
+ }
+ }, new ArrayList<TaskExecTO>());
+ }
+
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_DELETE + "')")
public TaskExecTO deleteExecution(final Long execKey) {
TaskExec taskExec = taskExecDAO.find(execKey);
@@ -326,24 +332,27 @@ public class TaskLogic extends AbstractJobLogic<AbstractTaskTO> {
}
@Override
- protected Long getKeyFromJobName(final JobKey jobKey) {
- return JobNamer.getTaskKeyFromJobName(jobKey.getName());
+ protected Pair<Long, String> getReference(final JobKey jobKey) {
+ Long key = JobNamer.getTaskKeyFromJobName(jobKey.getName());
+
+ Task task = taskDAO.find(key);
+ return task == null || !(task instanceof SchedTask) ? null : Pair.of(key, ((SchedTask) task).getName());
}
@Override
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_LIST + "')")
- public <E extends AbstractExecTO> List<E> listJobs(final JobStatusType type, final Class<E> reference) {
- return super.listJobs(type, reference);
+ public List<JobTO> listJobs(final int max) {
+ return super.listJobs(max);
}
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_EXECUTE + "')")
- public void actionJob(final Long taskKey, final JobAction action) {
- Task task = taskDAO.find(taskKey);
+ public void actionJob(final Long key, final JobAction action) {
+ Task task = taskDAO.find(key);
if (task == null) {
- throw new NotFoundException("Task " + taskKey);
+ throw new NotFoundException("Task " + key);
}
- String jobName = JobNamer.getJobName(task);
- actionJob(jobName, action);
+
+ actionJob(JobNamer.getJobKey(task), action);
}
@Override