public final class PlatformInfo
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected jadex.bridge.service.types.awareness.AwarenessInfo |
awainfo
The awareness info (if any).
|
protected double |
bytes_received
The number of received bytes.
|
protected java.util.Date |
connect_time
The time when the connection was established.
|
protected java.lang.Integer |
dbid
The db id.
|
protected java.util.Date |
disconnect_time
The time when the connection was lost.
|
protected java.lang.String |
hostip
The host ip.
|
protected java.lang.String |
hostname
The host name.
|
protected jadex.commons.future.IFuture<java.lang.String> |
hostnamefut
The host name future for eager resolving.
|
protected java.lang.String |
id
The platform id.
|
protected int |
msg_cnt
The number of messages for the recipient.
|
protected jadex.bridge.service.types.message.ICodec[] |
pcodecs
The preferred codecs (if any).
|
protected java.lang.String |
peerid
The peer id.
|
protected java.util.Map<java.lang.String,java.lang.String> |
properties
The properties (if any).
|
protected java.lang.String |
scheme
The protocol (e.g.
|
static java.lang.ThreadLocal<java.text.DateFormat> |
TIME_FORMAT_LONG
The long time format (time and date).
|
static java.lang.ThreadLocal<java.text.DateFormat> |
TIME_FORMAT_SHORT
The short time format (only time).
|
protected double |
total_transmission_time
The accumulated time spent for transmitting data (millis).
|
| Constructor and Description |
|---|
PlatformInfo()
Create a platform info.
|
PlatformInfo(java.lang.Integer dbid,
java.lang.String peerid,
java.lang.String id,
java.lang.String hostip,
java.lang.String hostname,
java.lang.String protocol,
java.util.Date connect_time,
java.util.Date disconnect_time,
int msg_cnt,
double bytes_received,
double total_transmission_time)
Constructor used by db.
|
PlatformInfo(java.lang.String id,
java.lang.String peerid,
java.lang.String hostip,
java.lang.String hostname,
java.lang.String protocol)
Create a platform info.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMessage(int bytes,
long time)
Add a sent message.
|
void |
disconnect()
Platform has disconnected.
|
jadex.bridge.service.types.awareness.AwarenessInfo |
getAwarenessInfo()
Get the awareness info.
|
java.lang.String |
getByteCount()
Get the byte count as beautified string.
|
double |
getBytes()
Get the byte count as raw value
|
java.util.Date |
getConnectDate()
Get the connect date.
|
java.lang.String |
getConnectTime()
Get the connect time.
|
java.lang.String |
getCountryCode()
Get the country code (e.g.
|
java.lang.Integer |
getDBId()
Get the db id
|
java.util.Date |
getDisconnectDate()
Get the disconnect date.
|
java.lang.String |
getDisconnectTime()
Get the disconnect time.
|
java.lang.String |
getHostIP()
Get the host.
|
java.lang.String |
getHostName()
Get the resolved host name.
|
java.lang.String |
getId()
Get the id.
|
java.lang.String |
getLocation()
Get the location (i.e.
|
int |
getMessageCount()
Get the message count.
|
java.lang.String |
getPeerId()
Get the peer id
|
java.lang.String |
getPosition()
Get the location as latitude,longitude.
|
jadex.bridge.service.types.message.ICodec[] |
getPreferredCodecs()
Get the preferred codecs.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Get the properties.
|
java.lang.String |
getScheme()
Get the host.
|
java.lang.String |
getTransferRate()
Get the average transfer rate as beautified string.
|
double |
getTransferTime()
Get the transfer time as raw value (millis).
|
void |
reconnect(java.lang.String hostip,
java.lang.String hostname)
Platform with same id has reconnected.
|
void |
setAwarenessInfo(jadex.bridge.service.types.awareness.AwarenessInfo awainfo)
Set the awareness info.
|
void |
setConnectDate(java.util.Date contime)
Set the connect time.
|
void |
setDBId(java.lang.Integer dbid)
Set db id
|
void |
setDisconnectDate(java.util.Date distime)
Set the disconnect time.
|
void |
setHostIP(java.lang.String hostip)
Set the host ip.
|
void |
setHostName(java.lang.String hostname)
Set the host name.
|
void |
setId(java.lang.String id)
The the platform id.
|
void |
setPeerId(java.lang.String peerid)
Set the peer id
|
void |
setPreferredCodecs(jadex.bridge.service.types.message.ICodec[] pcodecs)
Set the preferred codecs.
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> props)
Set the properties.
|
java.lang.String |
toString()
Create a string representation.
|
public static final java.lang.ThreadLocal<java.text.DateFormat> TIME_FORMAT_SHORT
public static final java.lang.ThreadLocal<java.text.DateFormat> TIME_FORMAT_LONG
protected java.lang.Integer dbid
protected java.lang.String id
protected java.lang.String peerid
protected java.lang.String hostip
protected java.lang.String hostname
protected jadex.commons.future.IFuture<java.lang.String> hostnamefut
protected java.lang.String scheme
protected java.util.Date connect_time
protected java.util.Date disconnect_time
protected double bytes_received
protected double total_transmission_time
protected int msg_cnt
protected jadex.bridge.service.types.awareness.AwarenessInfo awainfo
protected jadex.bridge.service.types.message.ICodec[] pcodecs
protected java.util.Map<java.lang.String,java.lang.String> properties
public PlatformInfo()
public PlatformInfo(java.lang.String id,
java.lang.String peerid,
java.lang.String hostip,
java.lang.String hostname,
java.lang.String protocol)
public PlatformInfo(java.lang.Integer dbid,
java.lang.String peerid,
java.lang.String id,
java.lang.String hostip,
java.lang.String hostname,
java.lang.String protocol,
java.util.Date connect_time,
java.util.Date disconnect_time,
int msg_cnt,
double bytes_received,
double total_transmission_time)
public java.lang.String getId()
public java.lang.String getHostIP()
public java.lang.String getHostName()
public java.lang.String getScheme()
public java.lang.String getConnectTime()
public java.lang.String getDisconnectTime()
public java.util.Date getConnectDate()
public java.util.Date getDisconnectDate()
public int getMessageCount()
public java.lang.String getByteCount()
public double getBytes()
public java.lang.String getTransferRate()
public double getTransferTime()
public jadex.bridge.service.types.awareness.AwarenessInfo getAwarenessInfo()
public java.lang.Integer getDBId()
public java.lang.String getPeerId()
public java.lang.String getLocation()
public java.lang.String getCountryCode()
public java.lang.String getPosition()
public void addMessage(int bytes,
long time)
bytes - The number of bytes sent.time - The time required for sending (nanos).public void reconnect(java.lang.String hostip,
java.lang.String hostname)
public void disconnect()
public void setAwarenessInfo(jadex.bridge.service.types.awareness.AwarenessInfo awainfo)
public void setDBId(java.lang.Integer dbid)
public void setPeerId(java.lang.String peerid)
public void setId(java.lang.String id)
public java.lang.String toString()
toString in class java.lang.Objectpublic void setDisconnectDate(java.util.Date distime)
public void setConnectDate(java.util.Date contime)
public void setHostIP(java.lang.String hostip)
public void setHostName(java.lang.String hostname)
public jadex.bridge.service.types.message.ICodec[] getPreferredCodecs()
public void setPreferredCodecs(jadex.bridge.service.types.message.ICodec[] pcodecs)
public java.util.Map<java.lang.String,java.lang.String> getProperties()
public void setProperties(java.util.Map<java.lang.String,java.lang.String> props)
props - The properties.