diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportAction.java b/Report/src/org/sleuthkit/autopsy/report/ReportAction.java index 848ffb6a92..e8142cc9c1 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportAction.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportAction.java @@ -46,25 +46,23 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Log; import org.sleuthkit.datamodel.BlackboardArtifact; -@ActionID(category = "Tools", -id = "org.sleuthkit.autopsy.report.ReportAction") +@ActionID(category = "Tools", id = "org.sleuthkit.autopsy.report.ReportAction") @ActionRegistration(displayName = "#CTL_ReportAction") -@ActionReferences({ - @ActionReference(path = "Menu/Tools", position = 80) -}) -@Messages("CTL_ReportAction=Run Report") +@ActionReferences(value = { + @ActionReference(path = "Menu/Tools", position = 80)}) +@Messages(value = "CTL_ReportAction=Run Report") public final class ReportAction extends CallableSystemAction implements Presenter.Toolbar { private JButton toolbarButton = new JButton(); private static final String ACTION_NAME = "Generate Report"; static final Logger logger = Logger.getLogger(ReportAction.class.getName()); private JPanel panel; - private ArrayList reportList = new ArrayList(); - private ArrayList configList = new ArrayList(); - + public static ArrayList reportList = new ArrayList(); + public static String preview; + public static ReportConfiguration config; public ReportAction() { - setEnabled(false); + setEnabled(false); Case.addPropertyChangeListener(new PropertyChangeListener() { @Override @@ -86,12 +84,12 @@ public final class ReportAction extends CallableSystemAction implements Presente Case newCase = (Case) evt.getNewValue(); if (newCase != null) { - boolean exists = (new File(newCase.getCaseDirectory() + "\\Reports")).exists(); + boolean exists = (new File(newCase.getCaseDirectory() + File.separator + "Reports")).exists(); if (exists) { // report directory exists -- don't need to do anything } else { // report directory does not exist -- create it - boolean reportCreate = (new File(newCase.getCaseDirectory() + "\\Reports")).mkdirs(); + boolean reportCreate = (new File(newCase.getCaseDirectory() + File.separator + "Reports")).mkdirs(); if (!reportCreate) { logger.log(Level.WARNING, "Could not create Reports directory for case. It does not exist."); } @@ -106,38 +104,79 @@ public final class ReportAction extends CallableSystemAction implements Presente @Override public void actionPerformed(ActionEvent e) { - ReportAction.this.actionPerformed(e); + ReportPanel.this.actionPerformed(e); } }); } - + private class reportListener implements ItemListener { - @Override - public void itemStateChanged(ItemEvent e) { - Object source = e.getItem(); - JCheckBox comp = (JCheckBox)source; - String name = comp.getName(); - JRadioButton buttan = null; - Component[] comps = comp.getParent().getComponents(); - for(Component c : comps) - { - if(c.getName().equals(name+"p")) - { - buttan = (JRadioButton)c; - } - } - if(e.getStateChange() == ItemEvent.DESELECTED) - { - buttan.setEnabled(false); - } - if(e.getStateChange() == ItemEvent.SELECTED) - { - buttan.setEnabled(true); - } - } - }; + @Override + public void itemStateChanged(ItemEvent e) { + Object source = e.getItem(); + JCheckBox comp = (JCheckBox) source; + String name = comp.getName(); + JRadioButton buttan = null; + Component[] comps = comp.getParent().getComponents(); + for (Component c : comps) { + if (c.getName().equals(name + "p")) { + buttan = (JRadioButton) c; + } + } + if (e.getStateChange() == ItemEvent.DESELECTED) { + buttan.setEnabled(false); + } + if (e.getStateChange() == ItemEvent.SELECTED) { + buttan.setEnabled(true); + } + } + }; + + private class configListener implements ItemListener { + + @Override + public void itemStateChanged(ItemEvent e) { + Object source = e.getItem(); + JCheckBox comp = (JCheckBox) source; + String name = comp.getName(); + BlackboardArtifact.ARTIFACT_TYPE type = BlackboardArtifact.ARTIFACT_TYPE.valueOf(name); + if (e.getStateChange() == ItemEvent.DESELECTED) { + try { + config.setGenArtifactType(type, Boolean.FALSE); + } catch (ReportModuleException ex) { + } + } + if (e.getStateChange() == ItemEvent.SELECTED) { + try { + config.setGenArtifactType(type, Boolean.TRUE); + } catch (ReportModuleException ex) { + } + } + } + }; + + private class previewListener implements ItemListener { + + @Override + public void itemStateChanged(ItemEvent e) { + Object source = e.getItem(); + JRadioButton comp = (JRadioButton) source; + String name = comp.getName(); + JRadioButton buttan = new JRadioButton(); + Component[] comps = comp.getParent().getComponents(); + for (Component c : comps) { + if (c.getName().equals(name)) { + buttan = (JRadioButton) c; + } + } + if (e.getStateChange() == ItemEvent.SELECTED) { + String temp = buttan.getName(); + temp = temp.substring(0, temp.length()-1); + preview = temp; + } + } + }; @Override public void actionPerformed(ActionEvent e) { @@ -157,6 +196,11 @@ public final class ReportAction extends CallableSystemAction implements Presente } }); final reportListener listener = new reportListener(); + final configListener clistener = new configListener(); + final previewListener plistener = new previewListener(); + preview = ""; + reportList.clear(); + config = new ReportConfiguration(); final JPanel filterpanel = new JPanel(new GridLayout(0, 2, 5, 5)); final JPanel artpanel = new JPanel(new GridLayout(0, 3, 5, 5)); SwingUtilities.invokeLater(new Runnable() { @@ -170,7 +214,7 @@ public final class ReportAction extends CallableSystemAction implements Presente filterpanel.setAlignmentY(Component.TOP_ALIGNMENT); filterpanel.setAlignmentX(Component.LEFT_ALIGNMENT); filterpanel.setSize(300, 100); - ButtonGroup previewGroup = new ButtonGroup(); + ButtonGroup previewGroup = new ButtonGroup(); for (ReportModule m : Lookup.getDefault().lookupAll(ReportModule.class)) { String name = m.getName(); String desc = m.getReportTypeDescription(); @@ -180,12 +224,14 @@ public final class ReportAction extends CallableSystemAction implements Presente ch.setName(m.getClass().getName()); ch.setToolTipText(desc); ch.setSelected(true); - + JRadioButton cb = new JRadioButton("Preview"); previewGroup.add(cb); - cb.setName(m.getClass().getName()+"p"); + cb.setName(m.getClass().getName() + "p"); + cb.addItemListener(plistener); filterpanel.add(cb, 0); ch.addItemListener(listener); + reportList.add(ch); filterpanel.add(ch, 0); } Border artborder = BorderFactory.createTitledBorder("Report Data"); @@ -200,6 +246,7 @@ public final class ReportAction extends CallableSystemAction implements Presente ce.setToolTipText(a.getDisplayName()); ce.setName(a.getLabel()); ce.setSelected(true); + ce.addItemListener(clistener); artpanel.add(ce); } @@ -228,7 +275,7 @@ public final class ReportAction extends CallableSystemAction implements Presente Log.get(ReportFilterAction.class).log(Level.WARNING, "Error displaying " + ACTION_NAME + " window.", ex); } } - + @Override public void performAction() { } diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportConfiguration.java b/Report/src/org/sleuthkit/autopsy/report/ReportConfiguration.java index c04a8d3f9d..405a328645 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportConfiguration.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportConfiguration.java @@ -50,7 +50,7 @@ class ReportConfiguration { try { ArrayList arttypes = skCase.getBlackboardArtifactTypes(); for (BlackboardArtifact.ARTIFACT_TYPE type : arttypes) { - config.put(type, Boolean.FALSE); + config.put(type, Boolean.TRUE); } } catch (Exception ex) { @@ -73,7 +73,7 @@ class ReportConfiguration { try { ArrayList arttypes = skCase.getBlackboardArtifactTypes(); for (BlackboardArtifact.ARTIFACT_TYPE type : arttypes) { - config.put(type, Boolean.FALSE); + config.put(type, Boolean.TRUE); } } catch (Exception ex) { diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportFilter.java b/Report/src/org/sleuthkit/autopsy/report/ReportFilter.java index e3d1b2fe4e..86ef0f121d 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportFilter.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportFilter.java @@ -25,12 +25,7 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; -import javax.swing.BorderFactory; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; +import javax.swing.*; import javax.swing.border.Border; import org.openide.util.Lookup; import org.sleuthkit.autopsy.casemodule.Case; @@ -157,17 +152,27 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS cancelButton.setEnabled(true); progBar.setStringPainted(true); progBar.setValue(0); - filters.clear(); + ReportConfiguration newConfig = ReportAction.config; + String preview = ReportAction.preview; + ArrayList reportList = ReportAction.reportList; + ArrayList classList = new ArrayList(); + for(JCheckBox box : reportList) + { + if(box.isSelected()){ + classList.add(box.getName()); + + } + } config.resetGenArtifactTypes(); - getReports(); + getReports(newConfig, classList, preview); }//GEN-LAST:event_jButton1ActionPerformed - public void getReports() { + public void getReports(final ReportConfiguration reportConfig, final ArrayList classList, final String preview) { new SwingWorker() { @Override protected Void doInBackground() throws Exception { - rpa.reportGenerate(config, panel); + rpa.reportGenerate(reportConfig, classList, preview, panel); return null; } diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportFilterAction.java b/Report/src/org/sleuthkit/autopsy/report/ReportFilterAction.java index a184fe958d..3dbee14e68 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportFilterAction.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportFilterAction.java @@ -20,17 +20,11 @@ package org.sleuthkit.autopsy.report; import java.awt.Container; import java.awt.Dimension; -import java.awt.GridLayout; import java.awt.Toolkit; import java.util.logging.Level; -import javax.swing.BorderFactory; -import javax.swing.JCheckBox; import javax.swing.JDialog; import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.border.Border; import org.openide.util.HelpCtx; -import org.openide.util.Lookup; import org.sleuthkit.autopsy.coreutils.Log; /** diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Report/src/org/sleuthkit/autopsy/report/ReportHTML.java index c355d92fdc..0a456945cc 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -36,7 +36,6 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.ingest.IngestManager; -import org.sleuthkit.autopsy.report.register.ReportRegisterService; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.FsContent; diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportPanelAction.java b/Report/src/org/sleuthkit/autopsy/report/ReportPanelAction.java index 6941b2d17e..7feedfd07d 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportPanelAction.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportPanelAction.java @@ -24,6 +24,8 @@ import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JDialog; @@ -36,127 +38,152 @@ import org.sleuthkit.autopsy.coreutils.Log; * @author Alex */ public class ReportPanelAction { - private static final String ACTION_NAME = "Report Preview"; - private StringBuilder viewReport = new StringBuilder(); - public ReportPanelAction(){ - - } - - public void reportGenerate(final ReportConfiguration reportconfig, final ReportFilter rr){ - try { - //Clear any old reports in the string - viewReport.setLength(0); - + private static final String ACTION_NAME = "Report Preview"; + private StringBuilder viewReport = new StringBuilder(); + + public ReportPanelAction() { + } + + public void reportGenerate(final ReportConfiguration reportconfig, final ArrayList classList, final String preview, final ReportFilter rr) { + try { + //Clear any old reports in the string + viewReport.setLength(0); + + // Generate the reports and create the hashmap - final ReportGen report = new ReportGen(); - //see what reports we need to run and run them - //Set progress bar to move while doing this - SwingUtilities.invokeLater(new Runnable() { + final ReportGen report = new ReportGen(); + //see what reports we need to run and run them + //Set progress bar to move while doing this + SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { - rr.progBarStartText(); - }}); - report.populateReport(reportconfig); - SwingUtilities.invokeLater(new Runnable() { + rr.progBarStartText(); + } + }); + report.populateReport(reportconfig); + SwingUtilities.invokeLater(new Runnable() { + @Override public void run() { - rr.progBarCount(2*report.Results.size()); - }}); - //Turn our results into the appropriate xml/html reports - //TODO: add a way for users to select what they will run when - Thread reportThread = new Thread(new Runnable() - { + rr.progBarCount(2 * report.Results.size()); + } + }); + //Turn our results into the appropriate xml/html reports + //TODO: add a way for users to select what they will run when + Thread reportThread = new Thread(new Runnable() { + @Override - public void run() - { - StopWatch a = new StopWatch(); - a.start(); - ReportHTML htmlReport = new ReportHTML(); - try{ - String htmlpath = htmlReport.generateReport(reportconfig, rr); - } - catch(ReportModuleException e){ - Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred in generating the htmlReport", e); - } - a.stop(); - System.out.println("html in milliseconds: " + a.getElapsedTime()); + public void run() { - StopWatch s = new StopWatch(); - s.start(); - ReportXLS xlsReport = new ReportXLS(); - try{ - xlsReport.generateReport(reportconfig,rr); - } - catch(ReportModuleException e){ - Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred in generating the XLS Report", e); - } - s.stop(); - System.out.println("xls in milliseconds: " + s.getElapsedTime()); - - StopWatch S = new StopWatch(); - S.start(); - ReportXML xmlReport = new ReportXML(); - try{ - xmlReport.generateReport(reportconfig,rr); - } - catch(ReportModuleException e){ - Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred in generating the XML Report", e); - } - S.stop(); - System.out.println("xml in milliseconds: " + S.getElapsedTime()); - } - }); - - - // start our threads - reportThread.start(); - - // display the window - - // create the popUp window for it - if(ReportFilter.cancel == false){ - - final JFrame frame = new JFrame(ACTION_NAME); - final JDialog popUpWindow = new JDialog(frame, ACTION_NAME, true); // to make the popUp Window to be modal - - - // initialize panel with loaded settings - - //Set the temporary label to let the user know its done and is waiting on the report - rr.progBarText(); - final ReportPanel panel = new ReportPanel(); - - - panel.setjButton1ActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - popUpWindow.dispose(); + for (String s : classList) { + + try { + Class reportclass = Class.forName(s); + Object reportObject = reportclass.newInstance(); + Class[] argTypes = new Class[] { ReportConfiguration.class, ReportFilter.class}; + Method generatereport = reportclass.getDeclaredMethod("generateReport",argTypes); + Object invoke = generatereport.invoke(reportObject,reportconfig,rr); + String path = invoke.toString(); + Class[] argTypes2 = new Class[] { String.class}; + Method getpreview = reportclass.getMethod("getPreview",argTypes2); + + + if(s == null ? preview == null : s.equals(preview)) + { + getpreview.invoke(reportObject,path); } - }); - // add the panel to the popup window - popUpWindow.add(panel); - - popUpWindow.setResizable(true); - popUpWindow.pack(); - // set the location of the popUp Window on the center of the screen - Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); - double w = popUpWindow.getSize().getWidth(); - double h = popUpWindow.getSize().getHeight(); - popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2)); - - reportThread.join(); - rr.progBarDone(); - panel.setFinishedReportText(); - popUpWindow.setVisible(true); - - - - - } + + } catch (Exception e) { + + } + } + +// StopWatch a = new StopWatch(); +// a.start(); +// ReportHTML htmlReport = new ReportHTML(); +// try { +// String htmlpath = htmlReport.generateReport(reportconfig, rr); +// } catch (ReportModuleException e) { +// Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred in generating the htmlReport", e); +// } +// a.stop(); +// System.out.println("html in milliseconds: " + a.getElapsedTime()); +// +// StopWatch s = new StopWatch(); +// s.start(); +// ReportXLS xlsReport = new ReportXLS(); +// try { +// xlsReport.generateReport(reportconfig, rr); +// } catch (ReportModuleException e) { +// Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred in generating the XLS Report", e); +// } +// s.stop(); +// System.out.println("xls in milliseconds: " + s.getElapsedTime()); +// +// StopWatch S = new StopWatch(); +// S.start(); +// ReportXML xmlReport = new ReportXML(); +// try { +// xmlReport.generateReport(reportconfig, rr); +// } catch (ReportModuleException e) { +// Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred in generating the XML Report", e); +// } +// S.stop(); +// System.out.println("xml in milliseconds: " + S.getElapsedTime()); + } + }); + + + // start our threads + reportThread.start(); + + // display the window + + // create the popUp window for it + if (ReportFilter.cancel == false) { + + final JFrame frame = new JFrame(ACTION_NAME); + final JDialog popUpWindow = new JDialog(frame, ACTION_NAME, true); // to make the popUp Window to be modal + + + // initialize panel with loaded settings + + //Set the temporary label to let the user know its done and is waiting on the report + rr.progBarText(); + final ReportPanel panel = new ReportPanel(); + + + panel.setjButton1ActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + popUpWindow.dispose(); + } + }); + // add the panel to the popup window + popUpWindow.add(panel); + + popUpWindow.setResizable(true); + popUpWindow.pack(); + // set the location of the popUp Window on the center of the screen + Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); + double w = popUpWindow.getSize().getWidth(); + double h = popUpWindow.getSize().getHeight(); + popUpWindow.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2)); + + reportThread.join(); + rr.progBarDone(); + panel.setFinishedReportText(); + popUpWindow.setVisible(true); + + + + + } } catch (Exception ex) { Log.get(ReportFilterAction.class).log(Level.WARNING, "Error displaying " + ACTION_NAME + " window.", ex); } - } + } } diff --git a/Report/src/org/sleuthkit/autopsy/report/ReportXML.java b/Report/src/org/sleuthkit/autopsy/report/ReportXML.java index 73760c1dea..7858100fde 100644 --- a/Report/src/org/sleuthkit/autopsy/report/ReportXML.java +++ b/Report/src/org/sleuthkit/autopsy/report/ReportXML.java @@ -39,7 +39,6 @@ import org.jdom.Element; import org.jdom.output.XMLOutputter; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.ingest.IngestManager; -import org.sleuthkit.autopsy.report.register.ReportRegisterService; import org.sleuthkit.datamodel.*; public class ReportXML implements ReportModule { diff --git a/Report/src/org/sleuthkit/autopsy/report/layer.xml b/Report/src/org/sleuthkit/autopsy/report/layer.xml index 9722211874..910891e120 100644 --- a/Report/src/org/sleuthkit/autopsy/report/layer.xml +++ b/Report/src/org/sleuthkit/autopsy/report/layer.xml @@ -1,11 +1,6 @@ - - - - - @@ -15,25 +10,21 @@ - + - + - + - + - - + @@ -41,5 +32,5 @@ - - \ No newline at end of file + + diff --git a/Report/src/org/sleuthkit/autopsy/report/register/ReportRegisterService.java b/Report/src/org/sleuthkit/autopsy/report/register/ReportRegisterService.java deleted file mode 100644 index d798aae729..0000000000 --- a/Report/src/org/sleuthkit/autopsy/report/register/ReportRegisterService.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.report.register; - -import java.beans.PropertyChangeListener; -import java.util.logging.Level; -import java.util.logging.Logger; -import org.sleuthkit.autopsy.ingest.IngestImageWorkerController; -import org.sleuthkit.autopsy.ingest.IngestManagerProxy; -import org.sleuthkit.autopsy.ingest.IngestMessage; -import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; -import org.sleuthkit.autopsy.ingest.IngestServiceImage; -import org.sleuthkit.datamodel.Image; - -/** - * Example implementation of an image ingest service - * - */ -public final class ReportRegisterService implements IngestServiceImage { - - private static final Logger logger = Logger.getLogger(ReportRegisterService.class.getName()); - private static ReportRegisterService defaultInstance = null; - private IngestManagerProxy managerProxy; - private static int messageId = 0; - - //public constructor is required - //as multiple instances are created for processing multiple images simultenously - public ReportRegisterService() { - } - - //default instance used for service registration - public static synchronized ReportRegisterService getDefault() { - if (defaultInstance == null) { - defaultInstance = new ReportRegisterService(); - } - return defaultInstance; - } - - @Override - public void process(Image image, IngestImageWorkerController controller) { - logger.log(Level.INFO, "process() " + this.toString()); - - managerProxy.postMessage(IngestMessage.createMessage(++messageId, MessageType.INFO, this, "Processing " + image.getName())); - - //service specific Image processing code here - //example: - - //if we know amount of work units, we can switch to determinate and update progress bar - int filesToProcess = 100; - controller.switchToDeterminate(filesToProcess); - int processedFiles = 0; - - while (filesToProcess-- > 0) { - - //check if should terminate on every loop iteration - if (controller.isCancelled()) { - return; - } - try { - //do the work - Thread.sleep(500); - //post message to user if found something interesting - managerProxy.postMessage(IngestMessage.createMessage(processedFiles, MessageType.INFO, this, "Processed " + image.getName() + ": " + Integer.toString(processedFiles))); - - //update progress - controller.progress(++processedFiles); - } catch (InterruptedException e) { - } - } - - - } - - @Override - public void complete() { - logger.log(Level.INFO, "complete() " + this.toString()); - - final IngestMessage msg = IngestMessage.createMessage(++messageId, MessageType.INFO, this, "completed image processing"); - managerProxy.postMessage(msg); - - //service specific cleanup due to completion here - } - - @Override - public String getName() { - return "Example Image Service"; - } - - @Override - public String getDescription() { - return "Example Image Service description"; - } - - @Override - public void init(IngestManagerProxy managerProxy) { - logger.log(Level.INFO, "init() " + this.toString()); - this.managerProxy = managerProxy; - - //service specific initialization here - - } - - @Override - public void stop() { - logger.log(Level.INFO, "stop()"); - - //service specific cleanup due to interruption here - } - - @Override - public ServiceType getType() { - return ServiceType.Image; - } - - @Override - public boolean hasSimpleConfiguration() { - return false; - } - - @Override - public boolean hasAdvancedConfiguration() { - return false; - } - - @Override - public javax.swing.JPanel getSimpleConfiguration() { - return null; - } - - @Override - public javax.swing.JPanel getAdvancedConfiguration() { - return null; - } - - @Override - public boolean hasBackgroundJobsRunning() { - return false; - } - - - @Override - public void saveAdvancedConfiguration() { - } - - @Override - public void saveSimpleConfiguration() { - } -}