Class 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.EventListener
    Basic implementation of a Restfull image clipboard RestServer property are mainly controlled via RestServer N.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 custom RestUserHandler implementation.
    Author:
    rstein
    • 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
    • Constructor Detail

      • Clipboard

        public Clipboard​(java.lang.String exportRoot,
                         java.lang.String exportName,
                         javafx.scene.layout.Region regionToCapture,
                         long maxUpdatePeriod,
                         java.util.concurrent.TimeUnit maxUpdatePeriodTimeUnit,
                         boolean allowUploads)
    • 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:
        autoNotification in interface de.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:
        handle in interface de.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:
        updateEventListener in interface de.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()