Package de.das.encrypter.model
Interface KeyFilesSearchReceiver
- All Known Implementing Classes:
KeySearchingExample
public interface KeyFilesSearchReceiver
Interface for classes which want to use the key files searcher. The
concurrently running autonomous thread (searcher) communicates its results to
its users through this interface.
How to use the key files searcher:
The KeyFilesSeacher is activated by invoking "KeyFilesSearcher.createInstance(receiver)" where "receiver" must be the instance of a class which implements this "KeyFilesSearchReceiver" interface.
This receiver class acts as a manager of keys. To do this, it must create an instance of the "KeyFiles" class. This will be a list of all currently available keys. If the "KeyFilesSearcher" has performed a search, it will also pass an instance of the "KeyFiles" class to the receiver class via the method "synchronizeKeyFilesList" with the keys it has found, so that the receiver can synchronize its key list.
How to use the key files searcher:
The KeyFilesSeacher is activated by invoking "KeyFilesSearcher.createInstance(receiver)" where "receiver" must be the instance of a class which implements this "KeyFilesSearchReceiver" interface.
This receiver class acts as a manager of keys. To do this, it must create an instance of the "KeyFiles" class. This will be a list of all currently available keys. If the "KeyFilesSearcher" has performed a search, it will also pass an instance of the "KeyFiles" class to the receiver class via the method "synchronizeKeyFilesList" with the keys it has found, so that the receiver can synchronize its key list.
-
Method Summary
Modifier and TypeMethodDescriptionRequest the hash map with key files from the key file search receiver.booleanTells the key file searcher that searching for keys is allowed.voidsetBundleFolders(ArrayList<File> bundleFolders) Passes a list of file paths of the currently existing key bundle folders to the key file search receiver.voidsetKeyFileLocations(ArrayList<KeyFileLocation> keyFileLocations) Passes a list of key file locations objects to the key file search receiver.voidsetKeyFileSearching(boolean b) Informs the key file search receiver that the key files searcher is currently searching for keys.voidsynchronizeKeyFilesList(KeyFiles files) Passes a hash map with found key files to the key file search receiver for it can synchronize its own hash map with key files.
-
Method Details
-
synchronizeKeyFilesList
Passes a hash map with found key files to the key file search receiver for it can synchronize its own hash map with key files.- Parameters:
files- a hash map with found key files.
-
getKeyFiles
KeyFiles getKeyFiles()Request the hash map with key files from the key file search receiver.- Returns:
- the hash map with key files.
-
setKeyFileLocations
Passes a list of key file locations objects to the key file search receiver.- Parameters:
keyFileLocations- an array list with key file locations objects.
-
setKeyFileSearching
void setKeyFileSearching(boolean b) Informs the key file search receiver that the key files searcher is currently searching for keys.- Parameters:
b- true, if the key files searcher is currently searching for keys.
-
setBundleFolders
Passes a list of file paths of the currently existing key bundle folders to the key file search receiver.- Parameters:
bundleFolders- an array list with paths to existing bundle folders.
-
isSearchingAllowed
boolean isSearchingAllowed()Tells the key file searcher that searching for keys is allowed.- Returns:
- true, if searching for keys is allowed.
-