|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.iac.ing.codeso.status.client.StatusItemProxyInfo<D,V>
@Immutable public class StatusItemProxyInfo<D extends StatusItemDescriptor,V extends StatusItemValue>
The root of a hierarchy of immutable objects that holds the descriptor
information associated with a StatusItem
subtype.
This class is thread-safe.
Nested Class Summary | |
---|---|
static class |
StatusItemProxyInfo.NotConnectedException
A checked exception which is thrown if an attempt is made to extract value or descriptor information from the parent class if it was constructed when its associated proxy was in the not-connected state. |
Field Summary | |
---|---|
private int |
errorCode
|
private java.lang.String |
extraErrorInformation
|
private boolean |
isSuccessive
|
private StatusItemInfo<D,V> |
statusItemInfo
|
Constructor Summary | |
---|---|
StatusItemProxyInfo(int errorCode,
java.lang.String extraErrorInformation)
Constructs a new instance based on the supplied prxy connection failur einformation. |
|
StatusItemProxyInfo(StatusItemInfo<D,V> statusItemInfo,
boolean isSuccessive)
Constructs a new instance based on the information contained in the supplied StatusItemInfo object. |
Method Summary | |
---|---|
D |
getDescriptor()
Returns the status item proxy's descriptor information, if available, or throws an exception if otherwise. |
int |
getErrorCode()
Returns an integer providing information relating to any connection failure which the status item proxy may have been experiencing when this class instance was constructed. |
java.lang.String |
getExtraErrorInformation()
Returns a string providing additional information relating to any connection failure which the status item proxy may have been experiencing when this class instance was constructed. |
long |
getSequenceNumber()
Returns the sequence number associated with this class instance. |
D |
getUncheckedDescriptor()
Returns the status item proxy's descriptor information, if available, or null if otherwise. |
V |
getUncheckedValue()
Returns the status item proxy's value information, if available, or null if otherwise. |
V |
getValue()
Returns the status item proxy's value information, if available, or throws an exception if otherwise. |
boolean |
isConnected()
Returns a boolean indicating whether the associated status item proxy was connected at the moment when this class instance was constructed. |
boolean |
isSuccessive()
Returns a boolean indicating whether the value on the proxy described by this class instance was successive to (that's to say it's sequence number was one greater than) the proxy's previous value. |
java.lang.String |
toString()
Returns a string representation of this class instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private StatusItemInfo<D extends StatusItemDescriptor,V extends StatusItemValue> statusItemInfo
private boolean isSuccessive
private int errorCode
private java.lang.String extraErrorInformation
Constructor Detail |
---|
public StatusItemProxyInfo(StatusItemInfo<D,V> statusItemInfo, boolean isSuccessive)
StatusItemInfo
object.
statusItemInfo
- reference to an object which encapsulates the
current state of the remote status item.isSuccessive
- flag which indicates whether the sequence number
asscoiated with the current value is one greater than the
sequence number associated with the last value.
java.lang.NullPointerException
- if the supplied parameter was null.public StatusItemProxyInfo(int errorCode, java.lang.String extraErrorInformation)
errorCode
- an integer specifying the error codeextraErrorInformation
- a String providing additional information
regarding the cause of the problem.
java.lang.NullPointerException
- if the extraErrorInformation
parameter was null.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isConnected()
public int getErrorCode()
If there wasn't a connection failure a value of zero will be returned.
To retrieve further information about the cause of failure the returned
value may be looked up in the CODESO Error Catalog using the
ErrorCatalog.getSummary
and ErrorCatalog.getMessage
methods.
public java.lang.String getExtraErrorInformation()
If there wasn't a connection failure an empty string will be returned.
public V getUncheckedValue()
null
if otherwise.
The value information will be available if the proxy was connected
to its remote status item when the class instance was constructed.
This may be tested using the isConnected
method.
Under other circumstances this method will return null
.
null
.isConnected()
,
getValue()
public V getValue() throws StatusItemProxyInfo.NotConnectedException
The value information will be available if the proxy was connected
to its remote status item when the class instance was constructed.
This may be tested using the isConnected
method.
Under other circumstances this method will throw the checked
NotConnectedException
providing details of the cause
of connection failure.
StatusItemProxyInfo.NotConnectedException
- if the proxy was not connected when
this method was invoked.isConnected()
,
getUncheckedValue()
public D getUncheckedDescriptor()
null
if otherwise.
The descriptor information will be available if the proxy was connected
to its remote status item when the class instance was constructed.
This may be tested using the isConnected
method.
Under other circumstances this method will return a null
.
null
.isConnected()
,
getDescriptor()
public D getDescriptor() throws StatusItemProxyInfo.NotConnectedException
The descriptor information will be available if the proxy was connected
to its remote status item when the class instance was constructed.
This may be tested using the isConnected
method.
Under other circumstances this method will throw the checked
NotConnectedException
providing details of the cause
of connection failure.
StatusItemProxyInfo.NotConnectedException
- if the proxy was not connected when
this method was invoked.isConnected()
,
getUncheckedDescriptor()
public long getSequenceNumber()
If the information is not available due to a connection failure then this method will return a value of zero.
public boolean isSuccessive()
This facility may be useful for detecting temporary outages of communication.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |