Package com.seeq.link.agent
Class DefaultAgentKeyReader
java.lang.Object
com.seeq.link.agent.DefaultAgentKeyReader
- All Implemented Interfaces:
AgentKeyReader
,com.seeq.utilities.FileChangeListener
Encapsulates the reading of an agent key, including monitoring for modifications or deletions and notifying a
listener.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Shuts down the file watcher for the agent key file.Returns theAgentKeyCredential
or null if it is not available.void
Reads the agent key in (if it exists) and begins watching the file for creation/modification/deletion.void
onFileDelete
(Path filePath) void
onFileModify
(Path filePath) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.seeq.link.agent.interfaces.AgentKeyReader
getAgentKeyModifiedEvent, getAgentKeyPath
-
Field Details
-
agentKeyModifiedEvent
-
-
Constructor Details
-
DefaultAgentKeyReader
-
-
Method Details
-
getAgentKeyCredential
Returns theAgentKeyCredential
or null if it is not available.- Specified by:
getAgentKeyCredential
in interfaceAgentKeyReader
- Returns:
- the
AgentKeyCredential
or null if it is not available
-
initialize
Reads the agent key in (if it exists) and begins watching the file for creation/modification/deletion.- Specified by:
initialize
in interfaceAgentKeyReader
- Throws:
IOException
- thrown if setting up the file watcher encounters a problem
-
destroy
public void destroy()Shuts down the file watcher for the agent key file.- Specified by:
destroy
in interfaceAgentKeyReader
-
onFileModify
- Specified by:
onFileModify
in interfacecom.seeq.utilities.FileChangeListener
-
onFileDelete
- Specified by:
onFileDelete
in interfacecom.seeq.utilities.FileChangeListener
-