Revision 495,
962 bytes
checked in by wojtekp, 13 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package schedframe.resources.computing.profiles.energy.power.ui; |
---|
2 | |
---|
3 | import schedframe.resources.computing.ComputingResource; |
---|
4 | import schedframe.resources.computing.DataCenter; |
---|
5 | import schedframe.resources.computing.profiles.energy.power.PowerProfile; |
---|
6 | import schedframe.resources.computing.profiles.energy.power.PowerStateName; |
---|
7 | import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName; |
---|
8 | |
---|
9 | public class DataCenterPowerInterface extends ComputingResourcePowerInterface{ |
---|
10 | |
---|
11 | public DataCenterPowerInterface(ComputingResource resource, PowerProfile pp){ |
---|
12 | super(resource, pp); |
---|
13 | currentPowerState = StandardPowerStateName.ON; |
---|
14 | } |
---|
15 | |
---|
16 | public boolean setPowerState(PowerStateName state) { |
---|
17 | if(!supportPowerState(state)) |
---|
18 | return false; |
---|
19 | currentPowerState = state; |
---|
20 | DataCenter dataCenter = (DataCenter)resource; |
---|
21 | |
---|
22 | for(ComputingResource child: dataCenter.getChildren()){ |
---|
23 | child.getPowerInterface().setPowerState(state); |
---|
24 | } |
---|
25 | |
---|
26 | return true; |
---|
27 | } |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.