@Override
 public StoreContext spool(
     String localAETitle, String remoteAETitle, InputStream in, InstanceAvailableCallback callback)
     throws Exception {
   StoreContext context;
   ApplicationEntity localAE = aeCache.findApplicationEntity(localAETitle);
   StoreSession session = storeService.createStoreSession(storeService);
   session.setSource(
       new GenericParticipant(localAE.getConnections().get(0).getHostname(), "WadoRS Fetch"));
   session.setRemoteAET(remoteAETitle);
   ArchiveAEExtension arcAEExt =
       aeCache.get(localAETitle).getAEExtension(ArchiveAEExtension.class);
   session.setArchiveAEExtension(arcAEExt);
   storeService.init(session);
   context = storeService.createStoreContext(session);
   try {
     DicomInputStream din = new DicomInputStream(in);
     Attributes fmi = din.getFileMetaInformation();
     storeService.writeSpoolFile(context, fmi, din);
   } catch (Exception e) {
     throw new Exception("Failed to spool WadoRS response from AE " + remoteAETitle);
   }
   return context;
 }