Class DefaultFacesManager

  • All Implemented Interfaces:
    FacesManager

    public class DefaultFacesManager
    extends AbstractFacesManager
    Retrieves Face information by face ID. If a face is not available in-memory, an "unknown" (question mark) face is returned immediately. Asynchronously, the face is loaded from the file cache. If loading fails, the face is requested from the server (and later stored into the file cache). As soon as the face becomes available, all registered FacesManagerListeners are notified.
    • Constructor Detail

      • DefaultFacesManager

        public DefaultFacesManager​(@NotNull
                                   @NotNull FaceCache faceCache,
                                   @NotNull
                                   @NotNull FaceQueue faceQueue)
                            throws java.io.IOException
        Creates a new instance.
        Parameters:
        faceCache - the face cache instance for storing in-memory faces
        faceQueue - the face queue to use
        Throws:
        java.io.IOException - if the unknown image resource cannot be loaded
    • Method Detail

      • getFaceImages

        @NotNull
        protected @NotNull FaceImages getFaceImages​(int faceNum,
                                                    boolean @Nullable [] isUnknownImage)
        Returns the FaceImages information for a face ID. This function returns immediately even if the face is not loaded. A not loaded face will be updated as soon as loading has finished.
        Specified by:
        getFaceImages in class AbstractFacesManager
        Parameters:
        faceNum - the face ID
        isUnknownImage - returns whether the returned face is the "unknown" face; ignored if null
        Returns:
        the face images information