@Test public void testProcessMsgNotifLogs_success() throws Exception { this.processor.tmpDir = this.folder.newFolder().getAbsolutePath(); Map<String,byte[]> map = new HashMap<>( 2 ); map.put( "karaf.log", new byte[ 0 ]); map.put( "roboconf.log", new byte[ 0 ]); File output = new File( this.processor.tmpDir, "roboconf-logs/app/si" ); Assert.assertFalse( output.exists()); MsgNotifLogs msg = new MsgNotifLogs( "app", "si", map ); this.processor.processMessage( msg ); Assert.assertTrue( output.exists()); Assert.assertEquals( 2, output.listFiles().length ); Assert.assertTrue( new File( output, "karaf.log" ).exists()); Assert.assertTrue( new File( output, "roboconf.log" ).exists()); }
@Override public void processMessage( Message message ) { if( message instanceof MsgNotifMachineDown ) processMsgNotifMachineDown((MsgNotifMachineDown) message ); else if( message instanceof MsgNotifInstanceChanged ) processMsgNotifInstanceChanged((MsgNotifInstanceChanged) message ); else if( message instanceof MsgNotifInstanceRemoved ) processMsgNotifInstanceRemoved((MsgNotifInstanceRemoved) message ); else if( message instanceof MsgNotifHeartbeat ) processMsgNotifHeartbeat((MsgNotifHeartbeat) message ); else if(message instanceof MsgNotifAutonomic) processMsgMonitoringEvent((MsgNotifAutonomic) message ); else if( message instanceof MsgEcho ) this.manager.debugMngr().notifyMsgEchoReceived((MsgEcho) message ); else if( message instanceof MsgNotifLogs ) processMsgNotifLogs((MsgNotifLogs) message ); else this.logger.warning( "The DM got an undetermined message to process: " + message.getClass().getName()); }
DmMessageProcessor extends AbstractMessageProcessor<IDmClient> { @Override public void processMessage( Message message ) { if( message instanceof MsgNotifMachineDown ) processMsgNotifMachineDown((MsgNotifMachineDown) message ); else if( message instanceof MsgNotifInstanceChanged ) processMsgNotifInstanceChanged((MsgNotifInstanceChanged) message ); else if( message instanceof MsgNotifInstanceRemoved ) processMsgNotifInstanceRemoved((MsgNotifInstanceRemoved) message ); else if( message instanceof MsgNotifHeartbeat ) processMsgNotifHeartbeat((MsgNotifHeartbeat) message ); else if(message instanceof MsgNotifAutonomic) processMsgMonitoringEvent((MsgNotifAutonomic) message ); else if( message instanceof MsgEcho ) this.manager.debugMngr().notifyMsgEchoReceived((MsgEcho) message ); else if( message instanceof MsgNotifLogs ) processMsgNotifLogs((MsgNotifLogs) message ); else this.logger.warning( "The DM got an undetermined message to process: " + message.getClass().getName()); } }
DmMessageProcessor extends AbstractMessageProcessor<IDmClient> { @Override public void processMessage( Message message ) { if( message instanceof MsgNotifMachineDown ) processMsgNotifMachineDown((MsgNotifMachineDown) message ); else if( message instanceof MsgNotifInstanceChanged ) processMsgNotifInstanceChanged((MsgNotifInstanceChanged) message ); else if( message instanceof MsgNotifInstanceRemoved ) processMsgNotifInstanceRemoved((MsgNotifInstanceRemoved) message ); else if( message instanceof MsgNotifHeartbeat ) processMsgNotifHeartbeat((MsgNotifHeartbeat) message ); else if(message instanceof MsgNotifAutonomic) processMsgMonitoringEvent((MsgNotifAutonomic) message ); else if( message instanceof MsgEcho ) this.manager.debugMngr().notifyMsgEchoReceived((MsgEcho) message ); else if( message instanceof MsgNotifLogs ) processMsgNotifLogs((MsgNotifLogs) message ); else this.logger.warning( "The DM got an undetermined message to process: " + message.getClass().getName()); } DmMessageProcessor( Manager manager ); }
DmMessageProcessor extends AbstractMessageProcessor<IDmClient> { @Override public void processMessage( Message message ) { if( message instanceof MsgNotifMachineDown ) processMsgNotifMachineDown((MsgNotifMachineDown) message ); else if( message instanceof MsgNotifInstanceChanged ) processMsgNotifInstanceChanged((MsgNotifInstanceChanged) message ); else if( message instanceof MsgNotifInstanceRemoved ) processMsgNotifInstanceRemoved((MsgNotifInstanceRemoved) message ); else if( message instanceof MsgNotifHeartbeat ) processMsgNotifHeartbeat((MsgNotifHeartbeat) message ); else if(message instanceof MsgNotifAutonomic) processMsgMonitoringEvent((MsgNotifAutonomic) message ); else if( message instanceof MsgEcho ) this.manager.debugMngr().notifyMsgEchoReceived((MsgEcho) message ); else if( message instanceof MsgNotifLogs ) processMsgNotifLogs((MsgNotifLogs) message ); else this.logger.warning( "The DM got an undetermined message to process: " + message.getClass().getName()); } DmMessageProcessor( Manager manager ); @Override void processMessage( Message message ); }
DmMessageProcessor extends AbstractMessageProcessor<IDmClient> { @Override public void processMessage( Message message ) { if( message instanceof MsgNotifMachineDown ) processMsgNotifMachineDown((MsgNotifMachineDown) message ); else if( message instanceof MsgNotifInstanceChanged ) processMsgNotifInstanceChanged((MsgNotifInstanceChanged) message ); else if( message instanceof MsgNotifInstanceRemoved ) processMsgNotifInstanceRemoved((MsgNotifInstanceRemoved) message ); else if( message instanceof MsgNotifHeartbeat ) processMsgNotifHeartbeat((MsgNotifHeartbeat) message ); else if(message instanceof MsgNotifAutonomic) processMsgMonitoringEvent((MsgNotifAutonomic) message ); else if( message instanceof MsgEcho ) this.manager.debugMngr().notifyMsgEchoReceived((MsgEcho) message ); else if( message instanceof MsgNotifLogs ) processMsgNotifLogs((MsgNotifLogs) message ); else this.logger.warning( "The DM got an undetermined message to process: " + message.getClass().getName()); } DmMessageProcessor( Manager manager ); @Override void processMessage( Message message );  }