summaryrefslogtreecommitdiff
path: root/sources/shared/remotecall/ServerResponse.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2009-02-18 17:33:22 +0000
committerPaul Buetow <paul@buetow.org>2009-02-18 17:33:22 +0000
commit4722100cba287b164957c658c2e035783e20c963 (patch)
tree35733fd3e50aeeb493e38ceaea83521a4710f0ac /sources/shared/remotecall/ServerResponse.java
parent61f7175cc3e51c0afaf63e380d03824a77464ba8 (diff)
moved sources
Diffstat (limited to 'sources/shared/remotecall/ServerResponse.java')
-rw-r--r--sources/shared/remotecall/ServerResponse.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/sources/shared/remotecall/ServerResponse.java b/sources/shared/remotecall/ServerResponse.java
new file mode 100644
index 0000000..49cd0c9
--- /dev/null
+++ b/sources/shared/remotecall/ServerResponse.java
@@ -0,0 +1,53 @@
+package shared.remotecall;
+
+import java.io.*;
+import java.util.Vector;
+
+/**
+ * This class represents a server response. A server response will sent from the calendar
+ * server to the calendar client if the client has sent a client request.
+ * @author buetow
+ *
+ */
+public final class ServerResponse extends RemoteCall implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private Vector vecEvents = null;
+
+ /**
+ * Simple constructor, creates a server response which can be sent to the calendar client.
+ * @param vecEvents Specifies all calendar events to be sent to the calendar client.
+ */
+ public ServerResponse(Vector vecEvents) {
+ this.vecEvents = vecEvents;
+ }
+
+ /**
+ * Needed for ojbect serialization (sending part).
+ * @param objectOutputStream Specifies the output stream.
+ * @throws IOException
+ */
+ private void writeObject(ObjectOutputStream objectOutputStream)
+ throws IOException {
+ super.writeObjectIfDefined(objectOutputStream, vecEvents);
+ }
+
+ /**
+ * Needed for object serialization (recieving part).
+ * @param objectInputStream Specifies the input stream.
+ * @throws IOException
+ * @throws ClassNotFoundException
+ */
+ private void readObject(ObjectInputStream objectInputStream)
+ throws IOException, ClassNotFoundException {
+ if (objectInputStream.readBoolean())
+ vecEvents = (Vector) objectInputStream.readObject();
+ }
+
+ /**
+ * This method returns a vector of all requested calendar events.
+ * @return Returns a Vector of all requested CalendarEvent objects.
+ */
+ public Vector getEvents() {
+ return vecEvents;
+ }
+}