Package de.gsi.acc.remote.clipboard
Class Clipboard
- java.lang.Object
-
- de.gsi.acc.remote.clipboard.Clipboard
-
- All Implemented Interfaces:
de.gsi.dataset.event.EventListener,de.gsi.dataset.event.EventSource
public class Clipboard extends java.lang.Object implements de.gsi.dataset.event.EventSource, de.gsi.dataset.event.EventListenerBasic implementation of a Restfull image clipboard RestServer property are mainly controlled viaRestServerN.B. The '/upload' endpoint access requires write privileges. By default, non logged-in users are mapped to 'anonymous' that by-default have READ_WRITE access roles. This can be reconfigured in the default Password file and/or another customRestUserHandlerimplementation.- Author:
- rstein
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringERROR_WHILE_READING_TEST_IMAGE_FROM
-
Constructor Summary
Constructors Constructor Description Clipboard(java.lang.String exportRoot, java.lang.String exportName, javafx.scene.layout.Region regionToCapture, long maxUpdatePeriod, java.util.concurrent.TimeUnit maxUpdatePeriodTimeUnit, boolean allowUploads)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClipboardData(de.gsi.dataset.remote.DataContainer data)Adds new Clipboard data (non-blocking) to the cache and notifies potential listeners.voidaddTestImageData()java.util.concurrent.atomic.AtomicBooleanautoNotification()static intgetCacheLimit()static intgetCacheTimeOut()static java.util.concurrent.TimeUnitgetCacheTimeOutUnit()de.gsi.dataset.utils.Cache<java.lang.String,de.gsi.dataset.utils.Cache<java.lang.String,de.gsi.dataset.remote.DataContainer>>getClipboardCache()This returns a nested Map of first 'categoryName', then 'exportName' keys to DataContainer objectsde.gsi.dataset.utils.Cache<java.lang.String,de.gsi.dataset.remote.DataContainer>getClipboardCache(java.lang.String category)java.lang.StringgetExportNameImage()java.lang.StringgetExportRoot()java.net.URIgetLocalURI()longgetMaxUpdatePeriod()java.util.concurrent.TimeUnitgetMaxUpdatePeriodTimeUnit()de.gsi.dataset.event.EventRateLimitergetPaletteUpdateRateLimiter()java.net.URIgetPublicURI()javafx.scene.layout.RegiongetRegionToCapture()voidhandle(de.gsi.dataset.event.UpdateEvent event)booleanisUsePalette()voidsetPaletteUpdateRateLimiter(long timeOut, java.util.concurrent.TimeUnit timeUnit)voidsetUsePalette(boolean usePalette)java.util.List<de.gsi.dataset.event.EventListener>updateEventListener()voidupdateListener(java.lang.String eventSource, long eventTimeStamp)protected voidupdatePalette(javafx.scene.image.Image imageCopyOut)javafx.beans.property.ReadOnlyIntegerPropertyuserCountProperty()javafx.beans.property.ReadOnlyIntegerPropertyuserCountSseProperty()
-
-
-
Field Detail
-
ERROR_WHILE_READING_TEST_IMAGE_FROM
public static final java.lang.String ERROR_WHILE_READING_TEST_IMAGE_FROM
- See Also:
- Constant Field Values
-
-
Method Detail
-
addClipboardData
public void addClipboardData(@NotNull de.gsi.dataset.remote.DataContainer data)Adds new Clipboard data (non-blocking) to the cache and notifies potential listeners.- Parameters:
data- data Container
-
addTestImageData
public void addTestImageData()
-
autoNotification
public java.util.concurrent.atomic.AtomicBoolean autoNotification()
- Specified by:
autoNotificationin interfacede.gsi.dataset.event.EventSource
-
getClipboardCache
public de.gsi.dataset.utils.Cache<java.lang.String,de.gsi.dataset.utils.Cache<java.lang.String,de.gsi.dataset.remote.DataContainer>> getClipboardCache()
This returns a nested Map of first 'categoryName', then 'exportName' keys to DataContainer objects- Returns:
- the underlying clipboard data cache N.B. use preferably
addClipboardData(de.gsi.dataset.remote.DataContainer)for adding data since this does not block and also notifies listeners
-
getClipboardCache
public de.gsi.dataset.utils.Cache<java.lang.String,de.gsi.dataset.remote.DataContainer> getClipboardCache(java.lang.String category)
-
getExportNameImage
public java.lang.String getExportNameImage()
-
getExportRoot
public java.lang.String getExportRoot()
-
getLocalURI
public java.net.URI getLocalURI()
-
getMaxUpdatePeriod
public long getMaxUpdatePeriod()
-
getMaxUpdatePeriodTimeUnit
public java.util.concurrent.TimeUnit getMaxUpdatePeriodTimeUnit()
-
getPaletteUpdateRateLimiter
public de.gsi.dataset.event.EventRateLimiter getPaletteUpdateRateLimiter()
-
getPublicURI
public java.net.URI getPublicURI()
-
getRegionToCapture
public javafx.scene.layout.Region getRegionToCapture()
-
handle
public void handle(de.gsi.dataset.event.UpdateEvent event)
- Specified by:
handlein interfacede.gsi.dataset.event.EventListener
-
isUsePalette
public boolean isUsePalette()
-
setPaletteUpdateRateLimiter
public void setPaletteUpdateRateLimiter(long timeOut, java.util.concurrent.TimeUnit timeUnit)
-
setUsePalette
public void setUsePalette(boolean usePalette)
-
updateEventListener
public java.util.List<de.gsi.dataset.event.EventListener> updateEventListener()
- Specified by:
updateEventListenerin interfacede.gsi.dataset.event.EventSource
-
updateListener
public void updateListener(@NotNull java.lang.String eventSource, long eventTimeStamp)
-
userCountProperty
public javafx.beans.property.ReadOnlyIntegerProperty userCountProperty()
-
userCountSseProperty
public javafx.beans.property.ReadOnlyIntegerProperty userCountSseProperty()
-
updatePalette
protected void updatePalette(javafx.scene.image.Image imageCopyOut)
-
getCacheLimit
public static int getCacheLimit()
-
getCacheTimeOut
public static int getCacheTimeOut()
-
getCacheTimeOutUnit
public static java.util.concurrent.TimeUnit getCacheTimeOutUnit()
-
-