Class ValidationProfileRunner
java.lang.Object
neqsim.mcp.runners.ValidationProfileRunner
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static StringCurrently active profile.private static final ConcurrentHashMap<String, com.google.gson.JsonObject> Custom profiles created by users.private static final com.google.gson.Gson -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor — all methods are static. -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.google.gson.JsonObjectBrazil deepwater profile.private static com.google.gson.JsonObjectGeneric equipment standards.private static com.google.gson.JsonObjectGeneric international standards profile.private static com.google.gson.JsonObjectGoM equipment standards.private static com.google.gson.JsonObjectGulf of Mexico profile.private static com.google.gson.JsonObjectNCS equipment standards.private static com.google.gson.JsonObjectNorwegian Continental Shelf profile.private static com.google.gson.JsonObjectUKCS equipment standards.private static com.google.gson.JsonObjectUK Continental Shelf profile.private static StringcreateProfile(com.google.gson.JsonObject input) Creates a custom validation profile.private static StringdeleteProfile(com.google.gson.JsonObject input) Deletes a custom profile.private static StringCreates a standard error JSON response.static StringReturns the currently active validation profile.static StringGets the active profile name.private static com.google.gson.JsonObjectgetBuiltInProfile(String name) Returns a built-in profile by name.private static com.google.gson.JsonArraygetGenericStandards(String equipmentType) Returns generic standards for an equipment type (fallback).private static StringgetProfile(com.google.gson.JsonObject input) Gets the full details of a named profile.private static StringgetStandardsForEquipment(com.google.gson.JsonObject input) Returns standards that apply to a specific equipment type based on the active profile.private static StringLists all available profiles (built-in + custom).static StringMain entry point for validation profile operations.private static StringsetActiveProfile(com.google.gson.JsonObject input) Sets the active validation profile.private static com.google.gson.JsonArraytoJsonArray(String... values) Converts a list of strings to a JsonArray.private static StringvalidateWithProfile(com.google.gson.JsonObject input) Validates simulation input against the active (or specified) profile.
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON -
CUSTOM_PROFILES
Custom profiles created by users. -
activeProfile
Currently active profile.
-
-
Constructor Details
-
ValidationProfileRunner
private ValidationProfileRunner()Private constructor — all methods are static.
-
-
Method Details
-
run
-
getActiveProfile
Returns the currently active validation profile.- Returns:
- JSON with active profile details
-
getActiveProfileName
-
listProfiles
Lists all available profiles (built-in + custom).- Returns:
- JSON with profile list
-
getProfile
Gets the full details of a named profile.- Parameters:
input- JSON with profile name- Returns:
- JSON with profile details
-
setActiveProfile
Sets the active validation profile.- Parameters:
input- JSON with profile name- Returns:
- JSON confirmation
-
createProfile
Creates a custom validation profile.- Parameters:
input- JSON with profile definition- Returns:
- JSON confirmation
-
deleteProfile
Deletes a custom profile.- Parameters:
input- JSON with profile name- Returns:
- JSON confirmation
-
validateWithProfile
Validates simulation input against the active (or specified) profile.- Parameters:
input- JSON with simulation parameters and optional profileName- Returns:
- JSON with validation results
-
getStandardsForEquipment
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
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
Returns generic standards for an equipment type (fallback).- Parameters:
equipmentType- the equipment type- Returns:
- JSON array of standard names
-
toJsonArray
Converts a list of strings to a JsonArray.- Parameters:
values- the string values- Returns:
- JSON array
-
errorJson
-