Top Description Fields Constructors Methods
org.eclipse.jetty.util.ssl

public Class KeyStoreScanner

extends ContainerLifeCycle
implements DiscreteListener
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.Scanner.DiscreteListener, org.eclipse.jetty.util.Scanner.Listener
Imports
java.io.IOException, java.nio.file.Files, .Path, java.util.concurrent.CompletableFuture, .TimeUnit, java.util.function.Consumer, org.eclipse.jetty.util.Callback, .Scanner, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedOperation, org.eclipse.jetty.util.component.ContainerLifeCycle, org.eclipse.jetty.util.resource.Resource, org.slf4j.Logger, .LoggerFactory

The KeyStoreScanner is used to monitor the KeyStore file used by the SslContextFactory. It will reload the SslContextFactory if it detects that the KeyStore file has been modified.

If the TrustStore file needs to be changed, then this should be done before touching the KeyStore file, the SslContextFactory#reload(Consumer) will only occur after the KeyStore file has been modified.

Field Summary

Modifier and TypeField and Description
private final Scanner
private final Path
private static final Logger
private final SslContextFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
fileAdded(String
the Path#toRealPath(LinkOption...) as a string of the added file
filename
)

Overrides default org.eclipse.jetty.util.Scanner.DiscreteListener.fileAdded.

Called when a file is added.
public void
fileChanged(String
the Path#toRealPath(LinkOption...) as a string of the changed file
filename
)

Overrides default org.eclipse.jetty.util.Scanner.DiscreteListener.fileChanged.

Called when a file is changed.
public void
fileRemoved(String
the Path#toRealPath(LinkOption...) as a string of the removed file
filename
)

Overrides default org.eclipse.jetty.util.Scanner.DiscreteListener.fileRemoved.

Called when a file is removed.
private Path
public int
public void
public boolean
scan(long waitMillis)

public void
setScanInterval(int scanInterval)

Inherited from org.eclipse.jetty.util.component.ContainerLifeCycle:
addBeanaddBeanaddEventListeneraddManagedcontainsdestroydoStartdoStopdumpdumpdumpdumpObjectsdumpStdErrgetBeangetBeansgetBeansgetContainedBeansgetContainedBeansisAutoisManagedisUnmanagedmanageremoveBeanremoveBeansremoveEventListenersetBeansstartstopunmanageupdateBeanupdateBeanupdateBeansupdateBeans

Field Detail

_scannerback to summary
private final Scanner _scanner
keystoreFileback to summary
private final Path keystoreFile
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.ContainerLifeCycle.LOG.

sslContextFactoryback to summary
private final SslContextFactory sslContextFactory

Constructor Detail

KeyStoreScannerback to summary
public KeyStoreScanner(SslContextFactory sslContextFactory)

Method Detail

fileAddedback to summary
public void fileAdded(String filename)

Overrides default org.eclipse.jetty.util.Scanner.DiscreteListener.fileAdded.

Doc from org.eclipse.jetty.util.Scanner.DiscreteListener.fileAdded.

Called when a file is added. May not be called if pathAdded(Path) is overridden.

Parameters
filename:String

the Path#toRealPath(LinkOption...) as a string of the added file

Annotations
@Override
fileChangedback to summary
public void fileChanged(String filename)

Overrides default org.eclipse.jetty.util.Scanner.DiscreteListener.fileChanged.

Doc from org.eclipse.jetty.util.Scanner.DiscreteListener.fileChanged.

Called when a file is changed. May not be called if pathChanged(Path) is overridden.

Parameters
filename:String

the Path#toRealPath(LinkOption...) as a string of the changed file

Annotations
@Override
fileRemovedback to summary
public void fileRemoved(String filename)

Overrides default org.eclipse.jetty.util.Scanner.DiscreteListener.fileRemoved.

Doc from org.eclipse.jetty.util.Scanner.DiscreteListener.fileRemoved.

Called when a file is removed. May not be called if pathRemoved(Path) is overridden.

Parameters
filename:String

the Path#toRealPath(LinkOption...) as a string of the removed file

Annotations
@Override
getRealKeyStorePathback to summary
private Path getRealKeyStorePath()
getScanIntervalback to summary
public int getScanInterval()
Annotations
@ManagedAttribute:scanning interval to detect changes which need reloaded
reloadback to summary
public void reload()
Annotations
@ManagedOperation:Reload the SSL Keystore
impact:ACTION
scanback to summary
public boolean scan(long waitMillis)
Annotations
@ManagedOperation:Scan for changes in the SSL Keystore
impact:ACTION
setScanIntervalback to summary
public void setScanInterval(int scanInterval)