All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.domain.subtitles.SubtitlesWorkflow Maven / Gradle / Ivy

Go to download

Several domains like 'media', pages' and 'subtitles' in the POMS system share some common properties which are collected here

There is a newer version: 8.3.1
Show newest version
package nl.vpro.domain.subtitles;

import lombok.Getter;

import java.util.Set;

import jakarta.xml.bind.annotation.XmlEnum;
import jakarta.xml.bind.annotation.XmlType;

import nl.vpro.domain.Xmlns;

/**
 * @author Michiel Meeuwissen
 * @since 5.11
 */
@XmlEnum
@XmlType(name = "subtitlesWorkflowEnum", namespace = Xmlns.SHARED_NAMESPACE)
public enum SubtitlesWorkflow {

    /**
     * Completely excluded from publishing/unpublishing logic. Not a real status, can can only be
     * attained by manually setting it in the database.
     */
    IGNORE(null),

    /**
     * Revoked because the media itself is not published, or is not playable
     */
    REVOKED(null),



    /**
     * Marked deleted, and already revoked from API
     */
    DELETED(null),

     /**
     * Marked for deletion, but not yet processed
     */
    FOR_DELETION(DELETED),

    /**
     * The subtitles are published to the API
     */
    PUBLISHED(null),

    /**
     * New subtitles, not yet processed for publication.
     */
    FOR_PUBLICATION(PUBLISHED),

     /**
     * Changed subtitles, not yet processed for publication
     */
    FOR_REPUBLICATION(PUBLISHED),



    /**
     * Could not be published because of some error
     */
    PUBLISH_ERROR(null),


    /**
     * The subtitles are not available in POMS. But the player probably does have them?
     * This is missed opportunity, but that's how it is.
     * @since 7.11
     */
    MISSING(null)
    ;


    public static final  Set NEEDS_WORK = Set.of(
        FOR_DELETION,
        FOR_PUBLICATION,
        FOR_REPUBLICATION
    );

    public static final  Set NOT_PUBLISHED = Set.of(
        FOR_DELETION,
        DELETED,
        REVOKED,
        FOR_PUBLICATION,
        FOR_REPUBLICATION
    );

    public static final Set IN_API = Set.of(
        PUBLISHED,
        MISSING
    );

    public static final  Set DELETEDS = Set.of(
        FOR_DELETION,
        DELETED
    );

    public static final Set INVISIBLE = Set.of(
        FOR_DELETION,
        DELETED,
        IGNORE
    );


    @Getter
    private final SubtitlesWorkflow dest;

    SubtitlesWorkflow(SubtitlesWorkflow dest) {
        this.dest = dest;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy