/*
 * Autopsy Forensic Browser
 *
 * Copyright 2014 Basis Technology Corp.
 * Contact: carrier <at> sleuthkit <dot> 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.ingest;

/**
 * Combines an ingest module factory with ingest module settings and an enabled
 * flag to create a template for creating fully configured ingest modules.
 */
final class IngestModuleTemplate {

    private final IngestModuleFactory moduleFactory;
    private IngestModuleIngestJobSettings settings = null;
    private boolean enabled = true;

    IngestModuleTemplate(IngestModuleFactory moduleFactory, IngestModuleIngestJobSettings settings) {
        this.moduleFactory = moduleFactory;
        this.settings = settings;
    }

    IngestModuleFactory getModuleFactory() {
        return moduleFactory;
    }

    String getModuleName() {
        return moduleFactory.getModuleDisplayName();
    }

    String getModuleDescription() {
        return moduleFactory.getModuleDescription();
    }

    IngestModuleIngestJobSettings getModuleSettings() {
        return settings;
    }

    void setModuleSettings(IngestModuleIngestJobSettings settings) {
        this.settings = settings;
    }

    boolean hasModuleSettingsPanel() {
        return moduleFactory.hasIngestJobSettingsPanel();
    }

    IngestModuleIngestJobSettingsPanel getModuleSettingsPanel() {
        return moduleFactory.getIngestJobSettingsPanel(settings);
    }

    boolean hasGlobalSettingsPanel() {
        return moduleFactory.hasGlobalSettingsPanel();
    }

    IngestModuleGlobalSettingsPanel getGlobalSettingsPanel() {
        return moduleFactory.getGlobalSettingsPanel();
    }

    boolean isDataSourceIngestModuleTemplate() {
        return moduleFactory.isDataSourceIngestModuleFactory();
    }

    DataSourceIngestModule createDataSourceIngestModule() {
        return moduleFactory.createDataSourceIngestModule(settings);
    }

    boolean isFileIngestModuleTemplate() {
        return moduleFactory.isFileIngestModuleFactory();
    }

    FileIngestModule createFileIngestModule() {
        return moduleFactory.createFileIngestModule(settings);
    }

    void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    boolean isEnabled() {
        return enabled;
    }
}

@@ -44,16 +44,21 @@
 ght 2014
+-2018
  Basis T
@@ -882,16 +882,23 @@
 es.%0A */%0A
+public 
 final cl
@@ -1074,24 +1074,31 @@
  true;%0A%0A    
+public 
 IngestModule
@@ -1264,32 +1264,39 @@
 ngs;%0A    %7D%0A%0A    
+public 
 IngestModuleFact
@@ -1353,32 +1353,39 @@
 ory;%0A    %7D%0A%0A    
+public 
 String getModule
@@ -1457,16 +1457,23 @@
  %7D%0A%0A    
+public 
 String g
@@ -1552,32 +1552,39 @@
 n();%0A    %7D%0A%0A    
+public 
 IngestModuleInge
@@ -1647,32 +1647,39 @@
 ngs;%0A    %7D%0A%0A    
+public 
 void setModuleSe
@@ -1764,32 +1764,39 @@
 ngs;%0A    %7D%0A%0A    
+public 
 boolean hasModul
@@ -1875,32 +1875,39 @@
 l();%0A    %7D%0A%0A    
+public 
 IngestModuleInge
@@ -2021,32 +2021,39 @@
 gs);%0A    %7D%0A%0A    
+public 
 boolean hasGloba
@@ -2137,16 +2137,23 @@
  %7D%0A%0A    
+public 
 IngestMo
@@ -2261,32 +2261,39 @@
 l();%0A    %7D%0A%0A    
+public 
 boolean isDataSo
@@ -2396,16 +2396,23 @@
  %7D%0A%0A    
+public 
 DataSour
@@ -2531,32 +2531,39 @@
 gs);%0A    %7D%0A%0A    
+public 
 boolean isFileIn
@@ -2654,16 +2654,23 @@
  %7D%0A%0A    
+public 
 FileInge
@@ -2779,16 +2779,23 @@
  %7D%0A%0A    
+public 
 void set
@@ -2864,16 +2864,23 @@
  %7D%0A%0A    
+public 
 boolean 
@@ -2923,10 +2923,15 @@
 ;%0A    %7D%0A
+    %0A
 %7D%0A

Make IngestModuleTemplate for testing, etc.