diff options
author | Simon Rettberg | 2015-05-21 16:39:25 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-05-21 16:39:25 +0200 |
commit | 45ada5475192f6afc9645c401de46765be87ee3f (patch) | |
tree | e5fa80f72f85995a95c2a80282a03e48b32a6c27 /src/main/java/org/openslx/dnbd3/status/rpc | |
download | dnbd3-status-45ada5475192f6afc9645c401de46765be87ee3f.tar.gz dnbd3-status-45ada5475192f6afc9645c401de46765be87ee3f.tar.xz dnbd3-status-45ada5475192f6afc9645c401de46765be87ee3f.zip |
Lean and mean first prototype - to be improved!
Diffstat (limited to 'src/main/java/org/openslx/dnbd3/status/rpc')
-rw-r--r-- | src/main/java/org/openslx/dnbd3/status/rpc/Client.java | 31 | ||||
-rw-r--r-- | src/main/java/org/openslx/dnbd3/status/rpc/Image.java | 37 | ||||
-rw-r--r-- | src/main/java/org/openslx/dnbd3/status/rpc/Status.java | 73 |
3 files changed, 141 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/dnbd3/status/rpc/Client.java b/src/main/java/org/openslx/dnbd3/status/rpc/Client.java new file mode 100644 index 0000000..fcb8e3e --- /dev/null +++ b/src/main/java/org/openslx/dnbd3/status/rpc/Client.java @@ -0,0 +1,31 @@ +package org.openslx.dnbd3.status.rpc; + +public class Client +{ + + private String address = null; + private int imageId = -1; + private long bytesSent = -1; + + public String getAddress() + { + return address; + } + + public int getImageId() + { + return imageId; + } + + public long getBytesSent() + { + return bytesSent; + } + + @Override + public String toString() + { + return "[Addr: " + address + ", image: " + imageId + "]"; + } + +} diff --git a/src/main/java/org/openslx/dnbd3/status/rpc/Image.java b/src/main/java/org/openslx/dnbd3/status/rpc/Image.java new file mode 100644 index 0000000..910db82 --- /dev/null +++ b/src/main/java/org/openslx/dnbd3/status/rpc/Image.java @@ -0,0 +1,37 @@ +package org.openslx.dnbd3.status.rpc; + +public class Image +{ + + private String name = null; + private int rid = -1; + private int complete = -1; + private int users = -1; + + public String getName() + { + return name; + } + + public int getRid() + { + return rid; + } + + public int getComplete() + { + return complete; + } + + public int getUsers() + { + return users; + } + + @Override + public String toString() + { + return "[" + name + " (users: " + users + ")]"; + } + +} diff --git a/src/main/java/org/openslx/dnbd3/status/rpc/Status.java b/src/main/java/org/openslx/dnbd3/status/rpc/Status.java new file mode 100644 index 0000000..07fc782 --- /dev/null +++ b/src/main/java/org/openslx/dnbd3/status/rpc/Status.java @@ -0,0 +1,73 @@ +package org.openslx.dnbd3.status.rpc; + +import java.util.List; + +public class Status +{ + + private long bytesReceived = -1; + private long bytesSent = -1; + private int uptime = -1; + private List<Image> images = null; + private List<Client> clients = null; + private String address = null; + private long timeStamp = -1; + + public long getBytesReceived() + { + return bytesReceived; + } + + public long getBytesSent() + { + return bytesSent; + } + + public int getUptime() + { + return uptime; + } + + public List<Image> getImages() + { + return images; + } + + public List<Client> getClients() + { + return clients; + } + + public String getAddress() + { + return address; + } + + public void setAddress( String address ) + { + this.address = address; + } + + @Override + public String toString() + { + String ret = "(in: " + bytesReceived + ", out: " + bytesSent; + if ( clients != null ) + ret += ", clients: (" + clients.toString() + ")"; + if ( images != null ) + ret += ", images: (" + images.toString() + ")"; + ret += ")"; + return ret; + } + + public void setTimestamp( long currentTimeMillis ) + { + this.timeStamp = currentTimeMillis; + } + + public long getTimestamp() + { + return this.timeStamp; + } + +} |