@@ -59,7 +59,7 @@ private void setupFolderMap() throws IOException, ASAPException {
5959 this .folderMap = new HashMap <>();
6060 File rootFolder = new File (rootFolderName .toString ());
6161
62- System .out .println (this .getLogStart () + "iterate subfolder in " + this .rootFolderName );
62+ System .out .println (this .getLogStart () + "setting up ASAPEngine based on subfolders in " + this .rootFolderName );
6363 File [] files = rootFolder .listFiles ();
6464 for (File file : files ) {
6565 if (file .isDirectory ()) {
@@ -342,29 +342,33 @@ public ASAPConnection getASAPConnection(CharSequence recipient) {
342342 public void pushInterests (OutputStream os ) throws IOException , ASAPException {
343343 ASAP_1_0 protocol = new ASAP_Modem_Impl ();
344344
345+ System .out .println (this .getLogStart () + "start sending interest for each engine" );
345346 // issue an interest for each owner / format combination
346347 for (CharSequence format : this .folderMap .keySet ()) {
348+ System .out .println (this .getLogStart () + "send interest for app/format: " + format );
347349 protocol .interest (this .owner , null , format ,null , -1 , -1 , os , false );
348350 }
349351 }
350352
351- public void handleASAPManagementPDU (ASAP_PDU_1_0 asapPDU , ASAP_1_0 protocol ,
352- InputStream is ) throws ASAPException , IOException {
353+ public boolean handleASAPManagementPDU (ASAP_PDU_1_0 asapPDU , ASAP_1_0 protocol ,
354+ InputStream is ) throws ASAPException , IOException {
353355
354356 StringBuilder b = new StringBuilder ();
355357 b .append (this .getLogStart ());
356358 b .append ("start processing asap management pdu" );
357359 System .out .println (b .toString ());
358360
361+ System .out .println (this .getLogStart () + asapPDU );
362+
359363 ASAP_AssimilationPDU_1_0 asap_assimilationPDU_1_0 = null ;
360364 if (asapPDU instanceof ASAP_AssimilationPDU_1_0 ) {
361365 asap_assimilationPDU_1_0 = (ASAP_AssimilationPDU_1_0 ) asapPDU ;
362366 } else {
363367 b = new StringBuilder ();
364368 b .append (this .getLogStart ());
365- b .append ("asap management pdu must be within an assimilate message - got another one / nothing todo " );
369+ b .append ("asap management pdu not an assimilate message - let ordinary engine to the job " );
366370 System .out .println (b .toString ());
367- return ;
371+ return false ;
368372 }
369373
370374 CharSequence owner = asapPDU .getPeer ();
@@ -412,17 +416,18 @@ public void handleASAPManagementPDU(ASAP_PDU_1_0 asapPDU, ASAP_1_0 protocol,
412416 }
413417 }
414418 // ok it the same
415- return ;
419+ return false ;
416420 } else {
417421 throw new ASAPException ("channel already exists but with different settings" );
418422 }
419423 }
420424
421425 // else - channel does not exist - create by setting recipients
422426 asapStorage .createChannel (channelUri , recipients );
427+ return false ;
423428 }
424429
425430 private String getLogStart () {
426- return this .getClass ().getSimpleName () + ": " ;
431+ return this .getClass ().getSimpleName () + "(" + this . getOwner () + ") : " ;
427432 }
428433}
0 commit comments