Enum Class WithheldFromApi.Reason

java.lang.Object
java.lang.Enum<WithheldFromApi.Reason>
ubic.gemma.model.annotations.WithheldFromApi.Reason
All Implemented Interfaces:
Serializable, Comparable<WithheldFromApi.Reason>, Constable
Enclosing class:
WithheldFromApi

public static enum WithheldFromApi.Reason extends Enum<WithheldFromApi.Reason>
Author:
paul
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The value depends on who is asking rather than on the entity — an authorization flag, an ownership check, a per-principal count.
    Not per-caller, but still should not leave the building: internal filesystem paths, raw instrument headers, submitter-local identifiers, internal free-text notes.
    The member cannot mean anything to a client, so publishing it would mislead rather than inform.
    Withheld by curation or editorial policy rather than by a technical hazard.
    Nothing is being withheld: this datum is already on the wire under another name, or is trivially derivable from what is.
    Real data that a client might legitimately want, withheld only because Gemma Web was once the consumer, and not yet traced far enough to expose safely.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • CALLER_IDENTITY

      public static final WithheldFromApi.Reason CALLER_IDENTITY
      The value depends on who is asking rather than on the entity — an authorization flag, an ownership check, a per-principal count.

      Serializing one onto a response cached by URL is the classic cross-user leak. The dataset endpoints do carry @CacheControl(isPrivate = true, authorities = {"GROUP_USER"}) alongside their maxAge, which is what keeps this safe today; that is a second, independent control, and this marker exists so correctness does not rest on it alone.

      Never remove one of these without replacing it with something stronger.

    • DISCLOSURE

      public static final WithheldFromApi.Reason DISCLOSURE
      Not per-caller, but still should not leave the building: internal filesystem paths, raw instrument headers, submitter-local identifiers, internal free-text notes.
    • REDUNDANT

      public static final WithheldFromApi.Reason REDUNDANT
      Nothing is being withheld: this datum is already on the wire under another name, or is trivially derivable from what is. A denormalized copy, a flattened convenience accessor beside the object it flattens, or a member whose content a separate projection already publishes.

      This is the one reason that asserts no hazard, so it is deliberately exempt from the suppression enforcement in WithheldFromApiInventoryTest — a property of the same name serializing elsewhere confirms the claim rather than contradicting it. Do not reach for it when the member is merely useless; that is INTERNAL_ONLY, and the distinction is what decides whether the guard watches the member or ignores it.

      Safe to delete outright. Name the member or projection that carries the data in WithheldFromApi.comment(), so the claim can be rechecked.

    • INTERNAL_ONLY

      public static final WithheldFromApi.Reason INTERNAL_ONLY
      The member cannot mean anything to a client, so publishing it would mislead rather than inform. Three shapes recur:
      • nothing populates it, so it would serialize a permanent 0 / null / "" that reads as data;
      • its shape is lossy — a category-keyed map that silently drops colliding entries, say — so the honest form of the same data is elsewhere;
      • it lives on a value object nothing serves, or exists purely as scaffolding for an editor that is gone.
      Unlike REDUNDANT, the suppression here is doing real work, so it is enforced: exposing one of these publishes a falsehood, not a duplicate.

      "Nothing populates it" is a claim about today's code and can quietly stop being true. Say in WithheldFromApi.comment() which shape applies and how it was established, and prefer deleting the member over annotating it — for a field nobody writes, this annotation is a placeholder for that deletion.

    • POLICY

      public static final WithheldFromApi.Reason POLICY
      Withheld by curation or editorial policy rather than by a technical hazard. The data is not dangerous; we have decided not to publish it. Say whose decision in WithheldFromApi.comment() so it can be revisited by the right person.
    • UNTRIAGED

      public static final WithheldFromApi.Reason UNTRIAGED
      Real data that a client might legitimately want, withheld only because Gemma Web was once the consumer, and not yet traced far enough to expose safely.

      This is debt, not a verdict, and it is the one reason that should never be chosen for a new member — it exists to carry the residue of the @GemmaWebOnly migration. Retiring one means tracing where it is populated and whether null is meaningful, then un-hiding it with a NON_NULL guard and a serialization test — the process CharacteristicValueObject.originalValue went through in 3646111985.

  • Method Details

    • values

      public static WithheldFromApi.Reason[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static WithheldFromApi.Reason valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null