Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fabio martelli
syncope
Commits
d494d033
Commit
d494d033
authored
Jan 12, 2017
by
Gianluca Filippone
Browse files
Using EE monitoring REST interface
parent
df134b00
Changes
16
Hide whitespace changes
Inline
Side-by-side
choremocks/src/main/java/eu/chorevolution/idm/choremocks/ee/
EnactmentEngine
Api.java
→
choremocks/src/main/java/eu/chorevolution/idm/choremocks/ee/
Monitoring
Api.java
View file @
d494d033
...
...
@@ -15,11 +15,48 @@
*/
package
eu.chorevolution.idm.choremocks.ee
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
public
interface
EnactmentEngineApi
{
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiParam
;
Response
listEEVirtualMachines
(
String
enactmentEngineId
);
Response
listChoreographyVirtualMachines
(
String
enactmentEngineId
,
String
choreographyId
);
}
@Path
(
"/v1/monitoring"
)
@Api
(
"Monitoring"
)
public
interface
MonitoringApi
{
@GET
@Path
(
"/ee"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
Response
getEngineStatus
();
@GET
@Path
(
"/ee/vm"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
Response
getEngineVirtualMachines
();
@GET
@Path
(
"/chor/{choreographyId}"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
Response
getChorStatus
(
@ApiParam
(
name
=
"choreographyId"
,
value
=
"The ID of the choregraphy to monitor"
,
required
=
true
)
@PathParam
(
"choreographyId"
)
String
choreographyId
);
@GET
@Path
(
"/chor/{choreographyId}/vm"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
Response
getChorVirtualMachines
(
@ApiParam
(
name
=
"choreographyId"
,
value
=
"The ID of the choregraphy to monitor"
,
required
=
true
)
@PathParam
(
"choreographyId"
)
String
choreographyId
);
}
\ No newline at end of file
choremocks/src/main/java/eu/chorevolution/idm/choremocks/ee/MonitoringResource.java
0 → 100644
View file @
d494d033
/*
* Copyright 2017 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.choremocks.ee
;
import
eu.chorevolution.idm.common.to.EnactmentEngineStatusTO
;
import
eu.chorevolution.idm.common.to.VirtualMachineInfoTO
;
import
javax.ws.rs.core.Response
;
public
class
MonitoringResource
implements
MonitoringApi
{
@Override
public
Response
getEngineStatus
()
{
EnactmentEngineStatusTO
enactmentEngineStatusTO
=
new
EnactmentEngineStatusTO
();
enactmentEngineStatusTO
.
setKey
(
"dummyKey"
);
enactmentEngineStatusTO
.
setRamUsage
(
4880
);
enactmentEngineStatusTO
.
setRamTotal
(
13336
);
enactmentEngineStatusTO
.
setStorageTotal
(
3024
);
enactmentEngineStatusTO
.
setStorageUsage
(
628
);
enactmentEngineStatusTO
.
setCpuUsageRatio
(
36.0
);
enactmentEngineStatusTO
.
setVirtualMachinesCount
(
4
);
return
Response
.
ok
(
enactmentEngineStatusTO
).
build
();
}
@Override
public
Response
getEngineVirtualMachines
()
{
VirtualMachineInfoTO
info1
=
new
VirtualMachineInfoTO
();
info1
.
setKey
(
"vm001"
);
info1
.
setSysOp
(
"Ubuntu 16.10"
);
info1
.
setCpuCount
(
4
);
info1
.
setCpuUsageRatio
(
30.5
);
info1
.
setRamUsage
(
1500
);
info1
.
setRamTotal
(
4096
);
info1
.
setStorageUsage
(
100
);
info1
.
setStorageTotal
(
1000
);
info1
.
setIsChoreography
(
true
);
info1
.
setIsLoadBalancer
(
false
);
VirtualMachineInfoTO
info2
=
new
VirtualMachineInfoTO
();
info2
.
setKey
(
"vm002"
);
info2
.
setSysOp
(
"Ubuntu 16.10"
);
info2
.
setCpuCount
(
2
);
info2
.
setCpuUsageRatio
(
51
);
info2
.
setRamUsage
(
400
);
info2
.
setRamTotal
(
1048
);
info2
.
setStorageUsage
(
100
);
info2
.
setStorageTotal
(
512
);
info2
.
setIsChoreography
(
false
);
info2
.
setIsLoadBalancer
(
true
);
VirtualMachineInfoTO
info3
=
new
VirtualMachineInfoTO
();
info3
.
setKey
(
"vm003"
);
info3
.
setSysOp
(
"Ubuntu 16.10"
);
info3
.
setCpuCount
(
4
);
info3
.
setCpuUsageRatio
(
26.5
);
info3
.
setRamUsage
(
2230
);
info3
.
setRamTotal
(
4096
);
info3
.
setStorageUsage
(
88
);
info3
.
setStorageTotal
(
512
);
info3
.
setIsChoreography
(
false
);
info3
.
setIsLoadBalancer
(
true
);
VirtualMachineInfoTO
info4
=
new
VirtualMachineInfoTO
();
info4
.
setKey
(
"vm004"
);
info4
.
setSysOp
(
"Ubuntu 16.10"
);
info4
.
setCpuCount
(
4
);
info4
.
setCpuUsageRatio
(
44
);
info4
.
setRamUsage
(
750
);
info4
.
setRamTotal
(
4096
);
info4
.
setStorageUsage
(
340
);
info4
.
setStorageTotal
(
1000
);
info4
.
setIsChoreography
(
true
);
info4
.
setIsLoadBalancer
(
false
);
VirtualMachineInfoTO
[]
result
=
new
VirtualMachineInfoTO
[
4
];
result
[
0
]
=
info1
;
result
[
1
]
=
info2
;
result
[
2
]
=
info3
;
result
[
3
]
=
info4
;
if
(
result
==
null
)
{
return
Response
.
status
(
Response
.
Status
.
NOT_FOUND
)
.
entity
(
"Error while acting on EE"
).
build
();
}
return
Response
.
ok
(
result
).
build
();
}
@Override
public
Response
getChorStatus
(
final
String
choreographyId
)
{
if
(
choreographyId
==
null
||
choreographyId
.
isEmpty
())
{
return
Response
.
serverError
().
entity
(
"chorID cannot be blank"
).
build
();
}
EnactmentEngineStatusTO
enactmentEngineStatusTO
=
new
EnactmentEngineStatusTO
();
enactmentEngineStatusTO
.
setKey
(
"dummyKey"
);
enactmentEngineStatusTO
.
setRamUsage
(
1900
);
enactmentEngineStatusTO
.
setRamTotal
(
5144
);
enactmentEngineStatusTO
.
setStorageTotal
(
1512
);
enactmentEngineStatusTO
.
setStorageUsage
(
200
);
enactmentEngineStatusTO
.
setCpuUsageRatio
(
37.0
);
enactmentEngineStatusTO
.
setVirtualMachinesCount
(
2
);
return
Response
.
ok
(
enactmentEngineStatusTO
).
build
();
}
@Override
public
Response
getChorVirtualMachines
(
final
String
choreographyId
)
{
if
(
choreographyId
==
null
||
choreographyId
.
isEmpty
())
{
return
Response
.
serverError
().
entity
(
"chorID cannot be blank"
).
build
();
}
VirtualMachineInfoTO
info1
=
new
VirtualMachineInfoTO
();
info1
.
setKey
(
"vm001"
);
info1
.
setSysOp
(
"Ubuntu 16.10"
);
info1
.
setCpuCount
(
4
);
info1
.
setCpuUsageRatio
(
30.5
);
info1
.
setRamUsage
(
1500
);
info1
.
setRamTotal
(
4096
);
info1
.
setStorageUsage
(
100
);
info1
.
setStorageTotal
(
1000
);
info1
.
setIsChoreography
(
true
);
info1
.
setIsLoadBalancer
(
false
);
VirtualMachineInfoTO
info2
=
new
VirtualMachineInfoTO
();
info2
.
setKey
(
"vm002"
);
info2
.
setSysOp
(
"Ubuntu 16.10"
);
info2
.
setCpuCount
(
2
);
info2
.
setCpuUsageRatio
(
51
);
info2
.
setRamUsage
(
400
);
info2
.
setRamTotal
(
1048
);
info2
.
setStorageUsage
(
100
);
info2
.
setStorageTotal
(
512
);
info2
.
setIsChoreography
(
false
);
info2
.
setIsLoadBalancer
(
true
);
VirtualMachineInfoTO
[]
result
=
new
VirtualMachineInfoTO
[
2
];
result
[
0
]
=
info1
;
result
[
1
]
=
info2
;
if
(
result
==
null
)
{
return
Response
.
status
(
Response
.
Status
.
NOT_FOUND
)
.
entity
(
"Choreografy not found for choreographyId: "
+
choreographyId
).
build
();
}
return
Response
.
ok
(
result
).
build
();
}
}
ext/choreography/client-console/src/main/java/org/apache/syncope/client/console/panels/ChoreographyEEResourcesPanel.java
View file @
d494d033
...
...
@@ -17,9 +17,8 @@ package org.apache.syncope.client.console.panels;
import
de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal
;
import
eu.chorevolution.idm.common.to.ChoreographyTO
;
import
eu.chorevolution.idm.common.to.
VirtualMachineInfo
TO
;
import
eu.chorevolution.idm.common.to.
EnactmentEngineStatus
TO
;
import
java.io.Serializable
;
import
java.util.List
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.syncope.client.console.SyncopeConsoleSession
;
import
org.apache.syncope.client.console.commons.Constants
;
...
...
@@ -44,8 +43,6 @@ public class ChoreographyEEResourcesPanel extends Panel {
private
final
AnyObjectTO
enactmentEngine
;
private
final
EEStatisticBundle
bundle
;
private
final
BaseModal
<
Serializable
>
utilityModal
=
new
BaseModal
<>(
"resizeEEModal"
);
private
final
ChoreographyTO
choreography
;
...
...
@@ -61,8 +58,11 @@ public class ChoreographyEEResourcesPanel extends Panel {
this
.
restClient
=
new
ChoreographyRestClient
();
this
.
choreography
=
restClient
.
getChoreography
(
choreographyId
);
this
.
enactmentEngine
=
restClient
.
getChoreographyEE
(
choreography
.
getId
());
this
.
bundle
=
new
EEStatisticBundle
(
restClient
.
getChoreographyVmList
(
enactmentEngine
.
getKey
(),
choreography
.
getId
()));
EnactmentEngineStatusTO
ee
=
restClient
.
getChoreographyEEStatus
(
choreographyId
);
double
ramPercentage
=
(
ee
.
getRamUsage
()
/
Float
.
valueOf
(
ee
.
getRamTotal
()))
*
100
;
double
storagePercentage
=
(
ee
.
getStorageUsage
()
/
Float
.
valueOf
(
ee
.
getStorageTotal
()))
*
100
;
add
(
utilityModal
);
add
(
new
Label
(
"eeName"
,
enactmentEngine
.
getName
()));
...
...
@@ -70,16 +70,15 @@ public class ChoreographyEEResourcesPanel extends Panel {
RepeatingView
resourcesOverview
=
new
RepeatingView
(
"resourceWidget"
);
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-yellow"
,
bundle
.
v
irtualMachines
,
"Virtual Machines"
,
"fa fa-cube"
));
"bg-yellow"
,
ee
.
getV
irtualMachines
Count
()
,
"Virtual Machines"
,
"fa fa-cube"
));
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-red"
,
"CPU utilization"
,
bundle
.
percentageCPU
,
"fa fa-cogs"
));
resourcesOverview
.
newChildId
(),
"bg-red"
,
"CPU utilization"
,
ee
.
getCpuUsageRatio
()
,
"fa fa-cogs"
));
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-green"
,
bundle
.
usedRam
,
bundle
.
totalRam
,
"RAM utilization"
,
bundle
.
p
ercentage
Ram
,
"MB"
,
""
));
resourcesOverview
.
newChildId
(),
"bg-green"
,
ee
.
getRamUsage
(),
ee
.
getRamTotal
(),
"RAM utilization"
,
ramP
ercentage
,
"MB"
,
""
));
resourcesOverview
.
add
(
new
ResourceWidget
(
resourcesOverview
.
newChildId
(),
"bg-aqua"
,
bundle
.
usedStorage
,
bundle
.
totalStorage
,
"Storage occupancy"
,
bundle
.
percentageStorage
,
"GB"
,
"fa fa-database"
));
resourcesOverview
.
newChildId
(),
"bg-aqua"
,
ee
.
getStorageUsage
(),
ee
.
getStorageTotal
(),
"Storage occupancy"
,
storagePercentage
,
"GB"
,
"fa fa-database"
));
add
(
resourcesOverview
);
ChoreographyActionsPanel
actionsPanel
=
new
ChoreographyActionsPanel
(
"actionsPanel"
);
...
...
@@ -178,55 +177,5 @@ public class ChoreographyEEResourcesPanel extends Panel {
add
(
new
ChoreographyVMDirectoryPanel
(
"virtualMachinesList"
,
pageRef
,
enactmentEngine
.
getKey
(),
choreography
.
getId
()));
}
private
class
EEStatisticBundle
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3856101339158216754L
;
private
int
virtualMachines
;
private
int
cpus
;
private
double
percentageCPU
;
private
int
usedRam
;
private
int
totalRam
;
private
double
percentageRam
;
private
int
usedStorage
;
private
int
totalStorage
;
private
double
percentageStorage
;
EEStatisticBundle
(
final
List
<
VirtualMachineInfoTO
>
vms
)
{
this
.
virtualMachines
=
0
;
this
.
cpus
=
0
;
this
.
usedRam
=
0
;
this
.
totalRam
=
0
;
this
.
usedStorage
=
0
;
this
.
totalStorage
=
0
;
double
cpuUtilization
=
0
;
for
(
VirtualMachineInfoTO
vm:
vms
)
{
this
.
virtualMachines
++;
this
.
cpus
+=
vm
.
getCpuNumber
();
this
.
usedRam
+=
vm
.
getUsedRam
();
this
.
totalRam
+=
vm
.
getTotalRam
();
this
.
usedStorage
+=
vm
.
getUsedStorage
();
this
.
totalStorage
+=
vm
.
getTotalStorage
();
cpuUtilization
+=
vm
.
getCpuNumber
()
*
vm
.
getCpuUtilization
();
}
this
.
percentageCPU
=
Math
.
round
(
100
*
(
cpuUtilization
/
Float
.
valueOf
(
cpus
)))
/
100
d
;
this
.
percentageRam
=
Math
.
round
(
10000
*
(
usedRam
/
Float
.
valueOf
(
totalRam
)))
/
100
d
;
this
.
percentageStorage
=
Math
.
round
(
10000
*
(
usedStorage
/
Float
.
valueOf
(
totalStorage
))
/
100
d
);
}
}
}
ext/choreography/client-console/src/main/java/org/apache/syncope/client/console/panels/ChoreographyVMDirectoryPanel.java
View file @
d494d033
...
...
@@ -36,6 +36,7 @@ import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulato
import
org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn
;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn
;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn
;
import
org.apache.wicket.markup.html.basic.Label
;
import
org.apache.wicket.markup.repeater.Item
;
import
org.apache.wicket.model.CompoundPropertyModel
;
import
org.apache.wicket.model.IModel
;
...
...
@@ -97,25 +98,39 @@ public class ChoreographyVMDirectoryPanel extends DirectoryPanel<
protected
List
<
IColumn
<
VirtualMachineInfoTO
,
String
>>
getColumns
()
{
final
List
<
IColumn
<
VirtualMachineInfoTO
,
String
>>
columns
=
new
ArrayList
<>();
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"ipAddress"
,
"IP"
),
"IP"
,
"ipAddress"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"hostname"
,
"Hostname"
),
"Hostname"
,
"hostname"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"
o
s"
),
"OS"
,
"
o
s"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"type"
,
"Type"
),
"Type"
,
"type"
));
//
columns.add(new PropertyColumn<>(new ResourceModel("ipAddress", "IP"), "IP", "ipAddress"));
//
columns.add(new PropertyColumn<>(new ResourceModel("hostname", "Hostname"), "Hostname", "hostname"));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"s
ysOp"
,
"OS
"
),
"OS"
,
"s
ysOp
"
));
//
columns.add(new PropertyColumn<>(new ResourceModel("type", "Type"), "Type", "type"));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"choreography"
,
"Deployed Choreography"
),
"Deployed Choreography"
,
"choreography"
));
columns
.
add
(
new
AbstractColumn
<
VirtualMachineInfoTO
,
String
>(
new
ResourceModel
(
""
,
"Type"
))
{
private
static
final
long
serialVersionUID
=
-
5860164518940274921L
;
@Override
public
void
populateItem
(
final
Item
<
ICellPopulator
<
VirtualMachineInfoTO
>>
item
,
final
String
componentId
,
final
IModel
<
VirtualMachineInfoTO
>
model
)
{
if
(
model
.
getObject
().
getIsChoreography
())
{
item
.
add
(
new
Label
(
componentId
,
"Choreography"
));
}
else
{
item
.
add
(
new
Label
(
componentId
,
"Load Balancer"
));
}
}
});
//columns.add(new PropertyColumn<>(new ResourceModel(
// "choreography", "Deployed Choreography"), "Deployed Choreography", "choreography"));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"cpu
Number
"
,
"CPU"
),
"CPU"
,
"cpu
Number
"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"cpu
Count
"
,
"CPU"
),
"CPU"
,
"cpu
Count
"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"cpuU
tiliz
atio
n
"
,
"CPU Utilization (%)"
),
"CPU Utilization (%)"
,
"cpuU
tiliz
atio
n
"
));
"cpuU
sageR
atio"
,
"CPU Utilization (%)"
),
"CPU Utilization (%)"
,
"cpuU
sageR
atio"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"
usedRam
"
,
"Used Memory (MB)"
),
"Used Memory (MB)"
,
"
usedRam
"
));
"
ramUsage
"
,
"Used Memory (MB)"
),
"Used Memory (MB)"
,
"
ramUsage
"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"
t
otal
Ram
"
,
"Total Memory (MB)"
),
"Total Memory (MB)"
,
"
t
otal
Ram
"
));
"
ramT
otal"
,
"Total Memory (MB)"
),
"Total Memory (MB)"
,
"
ramT
otal"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"
usedStor
age"
,
"Used Storage (GB)"
),
"Used Storage (GB)"
,
"
usedStor
age"
));
"
storageUs
age"
,
"Used Storage (GB)"
),
"Used Storage (GB)"
,
"
storageUs
age"
));
columns
.
add
(
new
PropertyColumn
<>(
new
ResourceModel
(
"
totalS
torage"
,
"Total Storage (GB)"
),
"Total Storage (GB)"
,
"
totalS
torage"
));
"
s
torage
Total
"
,
"Total Storage (GB)"
),
"Total Storage (GB)"
,
"
s
torage
Total
"
));
columns
.
add
(
new
AbstractColumn
<
VirtualMachineInfoTO
,
String
>(
new
ResourceModel
(
""
,
""
))
{
...
...
@@ -182,7 +197,7 @@ public class ChoreographyVMDirectoryPanel extends DirectoryPanel<
@Override
public
int
compare
(
final
VirtualMachineInfoTO
o1
,
final
VirtualMachineInfoTO
o2
)
{
return
o1
.
get
Id
().
compareTo
(
o2
.
get
Id
());
return
o1
.
get
Key
().
compareTo
(
o2
.
get
Key
());
}
}
...
...
ext/choreography/client-console/src/main/java/org/apache/syncope/client/console/rest/ChoreographyRestClient.java
View file @
d494d033
...
...
@@ -22,72 +22,73 @@ import eu.chorevolution.idm.common.to.OperationDataTO;
import
eu.chorevolution.idm.common.to.ChoreographyInstanceTO
;
import
eu.chorevolution.idm.common.to.ChoreographyTO
;
import
eu.chorevolution.idm.common.to.CoordinationDelegateTO
;
import
eu.chorevolution.idm.common.to.EnactmentEngineStatusTO
;
import
eu.chorevolution.idm.common.to.ServiceTO
;
import
eu.chorevolution.idm.common.to.VirtualMachineInfoTO
;
import
eu.chorevolution.idm.common.types.ChoreographyAction
;
import
java.util.List
;
import
org.apache.syncope.common.lib.to.AnyObjectTO
;
import
org.apache.syncope.common.rest.api.service.ChoreographyService
;
import
org.apache.syncope.common.rest.api.service.
C
on
sole
InterfaceService
;
import
org.apache.syncope.common.rest.api.service.
M
on
itor
InterfaceService
;
public
class
ChoreographyRestClient
extends
BaseRestClient
{
private
static
final
long
serialVersionUID
=
-
2018208424159468912L
;
public
List
<
ChoreographyInstanceTO
>
instanceList
(
final
String
choreographyId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
instanceList
(
choreographyId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
instanceList
(
choreographyId
);
}
public
List
<
CoordinationDelegateTO
>
cdList
(
final
String
instanceId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
cdList
(
instanceId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
cdList
(
instanceId
);
}
public
List
<
ServiceTO
>
instanceServiceList
(
final
String
instanceId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
instanceServiceList
(
instanceId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
instanceServiceList
(
instanceId
);
}
public
List
<
ServiceTO
>
choreographyServiceList
(
final
String
choreographyId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
choreographyServiceList
(
choreographyId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
choreographyServiceList
(
choreographyId
);
}
public
List
<
OperationDataTO
>
operationList
(
final
String
choreographyInstancePK
,
final
String
cdName
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
operationList
(
choreographyInstancePK
,
cdName
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
operationList
(
choreographyInstancePK
,
cdName
);
}
public
ChoreographyTO
getChoreography
(
final
String
choreographyId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
getChoreography
(
choreographyId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
getChoreography
(
choreographyId
);
}
public
ChoreographyInstanceTO
getChoreographyInstance
(
final
String
choreographyInstancePK
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
getChoreographyInstance
(
choreographyInstancePK
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
getChoreographyInstance
(
choreographyInstancePK
);
}
public
CoordinationDelegateTO
getCD
(
final
String
choreographyInstancePK
,
final
String
cdName
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
getCd
(
choreographyInstancePK
,
cdName
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
getCd
(
choreographyInstancePK
,
cdName
);
}
public
ServiceTO
getService
(
final
String
choreographyInstancePK
,
final
String
serviceName
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
getService
(
choreographyInstancePK
,
serviceName
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
getService
(
choreographyInstancePK
,
serviceName
);
}
public
Double
getAverageInstanceExecutionTime
(
final
String
choreographyId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
getAverageInstanceExecutionTime
(
choreographyId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
getAverageInstanceExecutionTime
(
choreographyId
);
}
public
List
<
AVGCoordinationDelegateTO
>
averageCdList
(
final
String
choreographyId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
averageCdList
(
choreographyId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
averageCdList
(
choreographyId
);
}
public
List
<
AVGServiceTO
>
averageServiceList
(
final
String
choreographyId
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
averageServiceList
(
choreographyId
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
averageServiceList
(
choreographyId
);
}
public
List
<
AVGOperationDataTO
>
averageOperationList
(
final
String
choreographyId
,
final
String
cdName
)
{
return
getService
(
C
on
sole
InterfaceService
.
class
).
averageOperationList
(
choreographyId
,
cdName
);
return
getService
(
M
on
itor
InterfaceService
.
class
).
averageOperationList
(
choreographyId
,
cdName
);
}
public
void
deleteChoreography
(
final
String
choreographyId
)
{
...
...
@@ -95,7 +96,7 @@ public class ChoreographyRestClient extends BaseRestClient {
}
public
void
deleteInstance
(
final
String
choreographyInstancePK
)
{
getService
(
C
on
sole
InterfaceService
.
class
).
deleteInstance
(
choreographyInstancePK
);
getService
(
M
on
itor
InterfaceService
.
class
).
deleteInstance
(
choreographyInstancePK
);
}
public
void
startChoreography
(
final
String
choreographyId
)
{
...
...
@@ -127,14 +128,14 @@ public class ChoreographyRestClient extends BaseRestClient {
return
getService
(
ChoreographyService
.
class
).
getEnactmentEngine
(
choreographyId
);
}
public
EnactmentEngineStatusTO
getChoreographyEEStatus
(
final
String
choreographyId
)
{
return
getService
(
MonitorInterfaceService
.
class
).
getChoreographyEEStatus
(
choreographyId
);
}
public
List
<
VirtualMachineInfoTO
>
getChoreographyVmList
(
final
String
enactmentEngineKey
,
final
String
choreographyId
)
{
return
getService
(
Choreography
Service
.
class
).
getChoreographyVmList
(
enactmentEngineKey
,
choreographyId
);
return
getService
(
MonitorInterface
Service
.
class
).
getChoreographyVmList
(
enactmentEngineKey
,
choreographyId
);
}
public
List
<
VirtualMachineInfoTO
>
getEEVmList
(
final
String
enactmentEngineKey
)
{
return
getService
(
ChoreographyService
.
class
).
getEEVmList
(
enactmentEngineKey
);
}
}
ext/choreography/common-lib/src/main/java/eu/chorevolution/idm/common/to/EnactmentEngineStatusTO.java
0 → 100644
View file @
d494d033
/*
* Copyright 2017 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.to
;
import
org.apache.syncope.common.lib.AbstractBaseBean
;
public
class
EnactmentEngineStatusTO
extends
AbstractBaseBean
{
private
static
final
long
serialVersionUID
=
-
3983719350936183516L
;
private
String
key
;