Enum Class ServiceType

java.lang.Object
java.lang.Enum<ServiceType>
ecmwf.ecpds.master.ServiceType
All Implemented Interfaces:
Serializable, Comparable<ServiceType>, Constable

public enum ServiceType extends Enum<ServiceType>
Represents the supported service types that can register with the MasterServer.

This enumeration is used to avoid raw string comparisons when identifying services such as DataMover and DataProxy. It provides helper methods to safely determine the service category and to convert external string representations into strongly typed values.

Any unknown or unsupported service string is mapped to OTHER.

  • Enum Constant Details

    • DATA_MOVER

      public static final ServiceType DATA_MOVER
      Represents a DataMover service.
    • DATA_PROXY

      public static final ServiceType DATA_PROXY
      Represents a DataProxy service.
    • OTHER

      public static final ServiceType OTHER
      Represents any unknown or unsupported service type.
  • Method Details

    • values

      public static ServiceType[] 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 ServiceType 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
    • from

      public static ServiceType from(String service)
      Converts a service name string into a ServiceType.

      If the provided string does not match any known service type, OTHER is returned.

      Parameters:
      service - the service name (may be null)
      Returns:
      the corresponding ServiceType, or OTHER if the service is unknown or null
    • isMover

      public boolean isMover()
      Indicates whether this service type represents a DataMover.
      Returns:
      true if this is DATA_MOVER, otherwise false
    • isProxy

      public boolean isProxy()
      Indicates whether this service type represents a DataProxy.
      Returns:
      true if this is DATA_PROXY, otherwise false