Skip to content

OP-006: Retrieve a stored preference set

GetPreferences is invoked over the PreferenceService route on SAIF.Services.WCF.Services.PreferenceService; this page documents the process end to end, from route dispatch to the message the caller receives.

Field Value
Operation ID OP-006
Trigger Caller invokes GetPreferences over the PreferenceService route.
Entry operation GetPreferences
Owning component SAIF.Services.WCF.Services.PreferenceService.GetPreferences
Inputs Request message parts listed below
Outputs The stored preference set for the application/page/user combination.
Failure behavior Generic SOAP fault, per Faults and error pipeline

Request and response

Direction Element Type Declared in Notes
Request applicationName string BCL (System) Application name portion of the preference key; lower-cased before matching. (Yes)
Request pageName string BCL (System) Page name portion of the preference key; a blank value is normalized to the empty string. (No (default None))
Request user string BCL (System) User portion of the preference key; lower-cased before matching. (Yes)
Response IDictionary<string, string> IDictionary<string, string> BCL (System) The stored preference set for the application/page/user combination.

Steps

  1. Constructor resolves the Oracle CLM connection and opens a unit of work plus a Repository<Preference> (BR-WCF-002).
  2. QueryPrefs lower-cases user and applicationName, and normalizes a null or empty pageName to string.Empty (BR-WCF-005).
  3. Query preferenceRepository.Query().FirstOrDefault(x => x.ApplicationName.ToLower() == applicationName && (pageName.IsNullOrEmpty() ? x.PageName == null : x.PageName.ToLower() == pageName) && x.UserId.ToLower() == user) matching application, page and user, outside any transaction.
  4. If no record matches, return an empty Dictionary<string, string>; otherwise deserialize PreferenceText from JSON into Dictionary<string, string> (BR-WCF-006).
  5. On failure: a deserialization or Oracle exception is logged by the installed error handler and surfaced as a generic SOAP fault with exception detail included.

Process flow

The following diagram visualizes this process's control flow.

flowchart TD
    A["Resolve CLM connection and<br>open Repository&lt;Preference&gt;"]
    B["Normalize applicationName,<br>pageName, and user casing"]
    C["Query preference by<br>application, page, and user"]
    C1{"Record matches?"}
    D1["No match: return an empty<br>Dictionary<string, string>"]
    D2["Match: deserialize PreferenceText from<br>JSON into Dictionary<string, string>"]
    A --> B
    B --> C
    C --> C1
    C1 -->|"No"| D1
    C1 -->|"Yes"| D2

Transaction and side effects

Aspect Finding
Unit of work OracleUnitOfWorkFactory (CLM)
Commit point Not applicable — this is a read outside Begin/Commit
Records written Preference (read only)
Downstream calls None
Shared state touched None
Repeat-call behavior Idempotent read

Logging

Surface Written content
ErrorLogErrorHandler → LogService Failure-path exception logging only, carrying method signature, calling user and exception detail; see Faults and error pipeline

Faults and error handling

Failure Fault type the caller receives Produced by Source
Oracle/NHibernate exception Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/PreferenceService.cs
JSON deserialization failure of PreferenceText Generic SOAP fault The ErrorLogErrorHandler installed by [LogErrorBehavior] src/WCF/SAIF.Services.WCF.Host/Services/PreferenceService.cs

Authorization

Requirement Enforced by Source Applies to
None in code IIS authentication on the deployment (see Activation and hosting) src/WCF/SAIF.Services.WCF.Host/Services/PreferenceService.cs This operation

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • src/WCF/SAIF.Services.WCF.Host/Services/PreferenceService.cs