|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable jap.forward.JAPRoutingRegistrationStatusObserver
public class JAPRoutingRegistrationStatusObserver
This class is the backend of the forwarding server registration visualization. It can be used for displaying the current registration status of the local forwarding server at the InfoServices. Also if there are registration issues, an errorcode with more detailed information is provided. This class sends a JAPRoutingMessage.REGISTRATION_STATUS_CHANGED to all observers, if the registration state or the errorcode has been changed. So the displayed information can be updated.
Field Summary | |
---|---|
static int |
ERROR_INFOSERVICE_CONNECT_ERROR
This is the errorcode, if we know at least one InfoService with a forwarder list but cannot reach any of those InfoServices (we will try it every 10 minutes again). |
static int |
ERROR_NO_ERROR
This is the errorcode returned in every state except STATE_INITIAL_REGISTRATION. |
static int |
ERROR_NO_KNOWN_PRIMARY_INFOSERVICES
This is the errorcode, if we don't know any InfoService with a forwarder list. |
static int |
ERROR_UNKNOWN_ERROR
This is the errorcode, if we know at least one InfoService with a forwarder list but only unknown errors occured (should not happen). |
static int |
ERROR_VERIFICATION_ERROR
This is the errorcode, if we could reach at least one InfoService with a forwarder list, but all successful reached InfoServices returned a verification error of our local forwarding server (maybe because of a running firewall). |
private int |
m_currentErrorCode
Stores the current error code (only meaningful, if we are in STATE_NO_REGISTRATION). |
private int |
m_currentState
Stores the current forwarding server registration state at the infoservices. |
private java.util.Vector |
m_propagandaInstances
This is the list of all known propaganda instances. |
static int |
STATE_DISABLED
This is the state, if the propaganda for the local forwaring server is not running (usually this is only the case, when the forwarding server is not running). |
static int |
STATE_INITIAL_REGISTRATION
This is the state, when all propaganda instances are started (usually shortly after the start of the local forwarding server). |
static int |
STATE_NO_REGISTRATION
This is the state, if the propaganda is running but we have no valid registration at any infoservice. |
static int |
STATE_SUCCESSFUL_REGISTRATION
This is the state, if the propaganda is running and we have at least one valid registration at an InfoService. |
Constructor Summary | |
---|---|
JAPRoutingRegistrationStatusObserver()
Creates a new instance of JAPRoutingRegistrationStatusObserver. |
Method Summary | |
---|---|
int |
getCurrentErrorCode()
Returns the current errorcode, if the current state is STATE_NO_REGISTRATION. |
int |
getCurrentState()
Returns the current state of the local forwarding server registration at the infoservices. |
void |
update(java.util.Observable a_notifier,
java.lang.Object a_message)
This is the implementation of the observer of the propaganda instances and JAPRoutingSettings. |
private void |
updateCurrentState(boolean a_overwriteInitialRegistrationState)
Updates the current state value and the errorcode value based on the internal stored list of all propaganda instances. |
private void |
updatePropagandaInstancesList(java.util.Vector a_newPropagandaInstancesList)
Updates the list of all displayed propaganda instances. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STATE_DISABLED
public static final int STATE_INITIAL_REGISTRATION
public static final int STATE_NO_REGISTRATION
public static final int STATE_SUCCESSFUL_REGISTRATION
public static final int ERROR_NO_ERROR
public static final int ERROR_NO_KNOWN_PRIMARY_INFOSERVICES
public static final int ERROR_INFOSERVICE_CONNECT_ERROR
public static final int ERROR_VERIFICATION_ERROR
public static final int ERROR_UNKNOWN_ERROR
private java.util.Vector m_propagandaInstances
private int m_currentState
private int m_currentErrorCode
Constructor Detail |
---|
public JAPRoutingRegistrationStatusObserver()
Method Detail |
---|
public int getCurrentState()
public int getCurrentErrorCode()
public void update(java.util.Observable a_notifier, java.lang.Object a_message)
update
in interface java.util.Observer
a_notifier
- The propaganda instance, which has changed the state or the
JAPRoutingSettings instance.a_message
- The notification message (should be null for propaganda instances and a
JAPRoutingMessage for the JAPRoutingSettings instance).private void updateCurrentState(boolean a_overwriteInitialRegistrationState)
a_overwriteInitialRegistrationState
- If we are in STATE_INITIAL_REGISTRATION normally
this method should not update the state and the
errorcode if the registration is not finished yet.
But after the initial registration is done (all
propaganda instances have been started), the state
constant and error code need to be updated, so
also the STATE_INITIAL_REGISTRATION must be
overwritten. If this parameter is true, also
the initial registration state is overwritten, if
this parameter is false, the initial registration
state would not be changed (and also not the
errorcode). If we are in any other state than
STATE_INITIAL_REGISTRATION, we are not affected by
this parameter.private void updatePropagandaInstancesList(java.util.Vector a_newPropagandaInstancesList)
a_newPropagandaInstancesList
- A Vector with propaganda instances. The new ones are
added to the internal list.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |