Class ValidationProfileRunner

java.lang.Object
neqsim.mcp.runners.ValidationProfileRunner

public final class ValidationProfileRunner extends Object
Domain-specific validation profiles for engineering simulations.

Different jurisdictions, operators, and project phases have different design standards and acceptance criteria. This runner manages validation profiles that configure which rules apply and what tolerances are acceptable.

Built-in profiles:

  • ncs — Norwegian Continental Shelf (NORSOK, PSA, DNV)
  • ukcs — UK Continental Shelf (API, HSE, PD 8010)
  • gom — Gulf of Mexico (API, BSEE, 30 CFR 250)
  • brazil — Brazil deepwater (ANP, Petrobras N-series)
  • generic — International standards only (ISO, API)
Version:
1.0
Author:
Even Solbraa
  • Field Details

    • GSON

      private static final com.google.gson.Gson GSON
    • CUSTOM_PROFILES

      private static final ConcurrentHashMap<String, com.google.gson.JsonObject> CUSTOM_PROFILES
      Custom profiles created by users.
    • activeProfile

      private static volatile String activeProfile
      Currently active profile.
  • Constructor Details

    • ValidationProfileRunner

      private ValidationProfileRunner()
      Private constructor — all methods are static.
  • Method Details

    • run

      public static String run(String json)
      Main entry point for validation profile operations.
      Parameters:
      json - JSON with action and parameters
      Returns:
      JSON with results
    • getActiveProfile

      public static String getActiveProfile()
      Returns the currently active validation profile.
      Returns:
      JSON with active profile details
    • getActiveProfileName

      public static String getActiveProfileName()
      Gets the active profile name.
      Returns:
      profile name
    • listProfiles

      private static String listProfiles()
      Lists all available profiles (built-in + custom).
      Returns:
      JSON with profile list
    • getProfile

      private static String getProfile(com.google.gson.JsonObject input)
      Gets the full details of a named profile.
      Parameters:
      input - JSON with profile name
      Returns:
      JSON with profile details
    • setActiveProfile

      private static String setActiveProfile(com.google.gson.JsonObject input)
      Sets the active validation profile.
      Parameters:
      input - JSON with profile name
      Returns:
      JSON confirmation
    • createProfile

      private static String createProfile(com.google.gson.JsonObject input)
      Creates a custom validation profile.
      Parameters:
      input - JSON with profile definition
      Returns:
      JSON confirmation
    • deleteProfile

      private static String deleteProfile(com.google.gson.JsonObject input)
      Deletes a custom profile.
      Parameters:
      input - JSON with profile name
      Returns:
      JSON confirmation
    • validateWithProfile

      private static String validateWithProfile(com.google.gson.JsonObject input)
      Validates simulation input against the active (or specified) profile.
      Parameters:
      input - JSON with simulation parameters and optional profileName
      Returns:
      JSON with validation results
    • getStandardsForEquipment

      private static String getStandardsForEquipment(com.google.gson.JsonObject input)
      Returns standards that apply to a specific equipment type based on the active profile.
      Parameters:
      input - JSON with equipmentType
      Returns:
      JSON with applicable standards
    • getBuiltInProfile

      private static com.google.gson.JsonObject getBuiltInProfile(String name)
      Returns a built-in profile by name.
      Parameters:
      name - the profile name
      Returns:
      the profile JSON, or null if unknown
    • buildNcsProfile

      private static com.google.gson.JsonObject buildNcsProfile()
      Norwegian Continental Shelf profile.
      Returns:
      NCS profile
    • buildUkcsProfile

      private static com.google.gson.JsonObject buildUkcsProfile()
      UK Continental Shelf profile.
      Returns:
      UKCS profile
    • buildGomProfile

      private static com.google.gson.JsonObject buildGomProfile()
      Gulf of Mexico profile.
      Returns:
      GoM profile
    • buildBrazilProfile

      private static com.google.gson.JsonObject buildBrazilProfile()
      Brazil deepwater profile.
      Returns:
      Brazil profile
    • buildGenericProfile

      private static com.google.gson.JsonObject buildGenericProfile()
      Generic international standards profile.
      Returns:
      generic profile
    • buildNcsEquipmentStandards

      private static com.google.gson.JsonObject buildNcsEquipmentStandards()
      NCS equipment standards.
      Returns:
      equipment standards map
    • buildUkcsEquipmentStandards

      private static com.google.gson.JsonObject buildUkcsEquipmentStandards()
      UKCS equipment standards.
      Returns:
      equipment standards map
    • buildGomEquipmentStandards

      private static com.google.gson.JsonObject buildGomEquipmentStandards()
      GoM equipment standards.
      Returns:
      equipment standards map
    • buildGenericEquipmentStandards

      private static com.google.gson.JsonObject buildGenericEquipmentStandards()
      Generic equipment standards.
      Returns:
      equipment standards map
    • getGenericStandards

      private static com.google.gson.JsonArray getGenericStandards(String equipmentType)
      Returns generic standards for an equipment type (fallback).
      Parameters:
      equipmentType - the equipment type
      Returns:
      JSON array of standard names
    • toJsonArray

      private static com.google.gson.JsonArray toJsonArray(String... values)
      Converts a list of strings to a JsonArray.
      Parameters:
      values - the string values
      Returns:
      JSON array
    • errorJson

      private static String errorJson(String code, String message, String remediation)
      Creates a standard error JSON response.
      Parameters:
      code - the error code
      message - the error message
      remediation - how to fix
      Returns:
      the error JSON string