add ListPersistentRequests and WatchGlobal command
[jSite2.git] / src / net / pterodactylus / util / fcp / BaseMessage.java
1 /**
2  * © 2008 INA Service GmbH
3  */
4 package net.pterodactylus.util.fcp;
5
6
7 /**
8  * A basic message abstraction that wraps a received FCP message.
9  * 
10  * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
11  * @version $Id$
12  */
13 public class BaseMessage {
14
15         /** The received message, wrapped here. */
16         private final FcpMessage receivedMessage;
17
18         /**
19          * Creates a new base message that wraps the given message.
20          * 
21          * @param receivedMessage
22          *            The FCP message that was received
23          */
24         public BaseMessage(FcpMessage receivedMessage) {
25                 this.receivedMessage = receivedMessage;
26         }
27
28         /**
29          * Returns the name of the message.
30          * 
31          * @return The name of the message
32          */
33         public String getName() {
34                 return receivedMessage.getName();
35         }
36
37         /**
38          * Returns the content of the field.
39          * 
40          * @param field
41          *            The name of the field
42          * @return The content of the field, or <code>null</code> if there is no
43          *         such field
44          */
45         public String getField(String field) {
46                 return receivedMessage.getField(field);
47         }
48
49 }