/*
 * 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.keywordsearch;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;

/**
 * Settings for a keyword search file ingest module instance.
 */
final class KeywordSearchJobSettings implements IngestModuleIngestJobSettings {

    private static final long serialVersionUID = 1L;
    private HashSet<String> namesOfEnabledKeywordLists;
    private HashSet<String> namesOfDisabledKeywordLists; // Added in version 1.1

    KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists) {
        this(namesOfEnabledKeywordLists, new ArrayList<String>());
    }

    KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists, List<String> namesOfDisabledKeywordLists) {
        this.namesOfEnabledKeywordLists = new HashSet<>(namesOfEnabledKeywordLists);
        this.namesOfDisabledKeywordLists = new HashSet<>(namesOfDisabledKeywordLists);
    }

    @Override
    public long getVersionNumber() {
        return serialVersionUID;
    }

    boolean keywordListIsEnabled(String keywordListName) {
        this.upgradeFromOlderVersions();
        return namesOfEnabledKeywordLists.contains(keywordListName);
    }

    List<String> getNamesOfEnabledKeyWordLists() {
        this.upgradeFromOlderVersions();
        return new ArrayList<>(namesOfEnabledKeywordLists);
    }

    List<String> getNamesOfDisabledKeyWordLists() {
        this.upgradeFromOlderVersions();
        return new ArrayList<>(namesOfDisabledKeywordLists);
    }

    /**
     * Initialize fields set to null when an instance of a previous, but still
     * compatible, version of this class is de-serialized.
     */
    private void upgradeFromOlderVersions() {
        if (null == this.namesOfDisabledKeywordLists) {
            this.namesOfDisabledKeywordLists = new HashSet<>();
        }
    }

}

@@ -873,17 +873,28 @@
 %0A/**%0A * 
-S
+Ingest job s
 ettings 
@@ -901,17 +901,19 @@
 for 
-a
+the
  keyword
  sea
@@ -912,16 +912,17 @@
 word
+s
  search 
 file
@@ -921,34 +921,13 @@
 rch 
-file ingest module instanc
+modul
 e.%0A 
@@ -1209,149 +1209,562 @@
     
-KeywordSearchJobSettings(List%3CString%3E namesOfEnabledKeywordLists) %7B%0A        this(namesOfEnabledKeywordLists, new ArrayList%3CString%3E());%0A    %7D%0A
+/**%0A     * Constructs ingest job settings for the keywords search module.%0A     *%0A     * @param namesOfEnabledKeywordLists A list of enabled keywords lists.%0A     */%0A    KeywordSearchJobSettings(List%3CString%3E namesOfEnabledKeywordLists) %7B%0A        this(namesOfEnabledKeywordLists, new ArrayList%3CString%3E());%0A    %7D%0A%0A    /**%0A     * Constructs ingest job settings for the keywords search module.%0A     *%0A     * @param namesOfEnabledKeywordLists A list of enabled keywords lists.%0A     * @param namesOfDisabledKeywordLists A list of disabled keywords lists.%0A     */
 %0A   
@@ -2049,24 +2049,59 @@
 ts);%0A    %7D%0A%0A
+    /**%0A     * @inheritDoc%0A     */%0A
     @Overrid
@@ -2175,24 +2175,322 @@
 UID;%0A    %7D%0A%0A
+    /**%0A     * Checks whether or not a keywords list is enabled. If there is no setting%0A     * for the requested list, it is deemed to be enabled.%0A     *%0A     * @param hashSetName The name of the keywords list to check.%0A     * @return True if the keywords list is enabled, false otherwise.%0A     */%0A
     boolean 
@@ -2645,32 +2645,152 @@
 stName);%0A    %7D%0A%0A
+    /**%0A     * Get the names of all explicitly enabled keywords lists.%0A     *%0A     * @return The list of names.%0A     */%0A
     List%3CString%3E
@@ -2928,24 +2928,145 @@
 ts);%0A    %7D%0A%0A
+    /**%0A     * Get the names of all explicitly disabled keywords lists.%0A     *%0A     * @return The list of names.%0A     */%0A
     List%3CStr

Add javadocs Comments to KeywordSearchJobSettings.java