83 |
|
public static final int QUIT = 5; |
84 |
|
|
85 |
|
/** |
86 |
+ |
* Thread action GETCONFIGURATION |
87 |
+ |
* Starts the command to obtain the configuration |
88 |
+ |
* from the server. |
89 |
+ |
* It then passes the IO to the Configuration object |
90 |
+ |
* so it can obtain any specific configuration |
91 |
+ |
*/ |
92 |
+ |
public static final int GETCONFIGURATION = 6; |
93 |
+ |
|
94 |
+ |
/** |
95 |
|
* This is the time in seconds that this class |
96 |
|
* should wait on the DataReader class to fully |
97 |
|
* shutdown after calling shutdown() before |
218 |
|
|
219 |
|
throw new IOException("client name rejected - " + _configuration.getProperty("clientname")); |
220 |
|
} |
221 |
+ |
// get the config...we are connected now! |
222 |
+ |
_actionQueue.add(new Integer(GETCONFIGURATION)); |
223 |
|
} catch (IOException e) { |
224 |
|
// print the error and tidy up what's left |
225 |
|
Conient.addMessage("ERROR{control link}: " + e); |
422 |
|
|
423 |
|
Conient.setControlStatus("Disconnected"); |
424 |
|
} catch (IOException e) { |
425 |
< |
Conient.addMessage("Control Link Error: " + e); |
425 |
> |
Conient.addMessage("ERROR{control link}: " + e); |
426 |
|
try { |
427 |
|
_inBound.close(); |
428 |
|
_outBound.close(); |
467 |
|
Conient.addMessage("WARNING: open connections detected - queueing stop events"); |
468 |
|
} |
469 |
|
break; |
470 |
< |
|
470 |
> |
case GETCONFIGURATION: |
471 |
> |
if(_controlLink != null) { |
472 |
> |
try { |
473 |
> |
String response = null; |
474 |
> |
_outBound.println("STARTCONFIG"); |
475 |
> |
_outBound.flush(); |
476 |
> |
response = _inBound.readLine(); |
477 |
> |
if (!response.equals("OK")) { |
478 |
> |
throw new IOException("server refused (" + response + ")"); |
479 |
> |
} |
480 |
> |
_configuration.readServerConfiguration(_inBound, _outBound); |
481 |
> |
_outBound.println("ENDCONFIG"); |
482 |
> |
_outBound.flush(); |
483 |
> |
response = _inBound.readLine(); |
484 |
> |
if (!response.equals("OK")) { |
485 |
> |
throw new IOException("server reported error when finishing configuration"); |
486 |
> |
} |
487 |
> |
} catch (IOException e) { |
488 |
> |
Conient.addMessage("ERROR{control link}: when getting configuration - " + e); |
489 |
> |
} |
490 |
> |
} |
491 |
> |
break; |
492 |
|
} |
493 |
|
} |
494 |
|
} |