-
Notifications
You must be signed in to change notification settings - Fork 30
/
Room.java
36 lines (28 loc) · 895 Bytes
/
Room.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package hudson.plugins.campfire;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Date;
public class Room {
private Campfire campfire;
private String name;
private String id;
public Room(Campfire cf, String name, String id) {
super();
this.campfire = cf;
this.name = name;
this.id = id;
}
public String getName() {
return this.name;
}
public String getId() {
return this.id;
}
public void speak(String message) throws IOException {
campfire.post("room/" + id + "/speak.xml", "<message><type>TextMessage</type><body>" + message + "</body></message>");
}
public void play(String sound) throws IOException {
campfire.post("room/" + id + "/speak.xml", "<message><type>SoundMessage</type><body>" + sound + "</body></message>");
}
}