Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fogbow
fogbow-green-sitter
Commits
f711cd90
Commit
f711cd90
authored
Apr 01, 2015
by
aninhacostaribeiro
Browse files
Updated Wake on lan
parent
593b6158
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/fogbowcloud/green/server/communication/ServerCommunicationComponent.java
View file @
f711cd90
...
...
@@ -3,6 +3,7 @@ package org.fogbowcloud.green.server.communication;
import
java.io.IOException
;
import
java.util.Properties
;
import
org.apache.log4j.Logger
;
import
org.fogbowcloud.green.server.core.greenStrategy.GreenStrategy
;
import
org.jamppa.component.XMPPComponent
;
import
org.xmpp.packet.IQ
;
...
...
@@ -10,6 +11,7 @@ import org.xmpp.packet.IQ.Type;
public
class
ServerCommunicationComponent
extends
XMPPComponent
{
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
ServerCommunicationComponent
.
class
);
private
GreenStrategy
gs
;
private
Properties
prop
;
...
...
@@ -22,10 +24,14 @@ public class ServerCommunicationComponent extends XMPPComponent {
addHandlers
();
}
public
void
wakeUpHost
(
String
macAddress
)
throws
IOException
{
public
void
wakeUpHost
(
String
macAddress
)
throws
IOException
,
InterruptedException
{
LOGGER
.
debug
(
"Wake command: powerwake -b "
+
prop
.
getProperty
(
"wol.broadcast.address"
)
+
" "
+
macAddress
);
ProcessBuilder
pb
=
new
ProcessBuilder
(
"powerwake"
,
"-b"
,
prop
.
getProperty
(
"wol.broadcast.address"
),
macAddress
);
pb
.
start
();
Process
process
=
pb
.
start
();
process
.
waitFor
();
}
public
void
sendIdleHostToBed
(
String
hostJID
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment