Class BaseProblemResourceListener

java.lang.Object
com.onenetwork.platform.integ.rest.problem.BaseProblemResourceListener

public abstract class BaseProblemResourceListener
extends java.lang.Object
Base class which defines hook points within ProblemResource to allow modules to filter and modify responses to be sent to the client. Note: Subclasses need to:
  • add the ResourceListener annotation at the class level and provide a value which is set to this class' fully-qualified name.
  • be located under the com.onenetwork..rest package. They can be in any subpackage, as long as it's in your module's rest package.
  • Constructor Details

  • Method Details

    • afterPartnerRecordsRead

      public void afterPartnerRecordsRead​(java.util.List<SqlRow> sqlRows, PlatformUserContext pltCtx)
      Called after the partner organizations has been read to build the response for lines/getPartnerOrgs API. Modules can provide implementation of this method by extending ProblemResourceListener class to manipulate this list before sending response.
      Parameters:
      sqlRows - list of sql rows containing information about partner organizations such as id, name, enterprise name, description and vcId.
      pltCtx -
    • afterPartnerOrgResponseConstruction

      public void afterPartnerOrgResponseConstruction​(org.json.JSONArray outputLines, PlatformUserContext pltCtx)
      Called after the partner organizations list has been constructed as response for lines/getPartnerOrgs API. Modules can provide implementation of this method by extending ProblemResourceListener class to manipulate this list before sending response.
      Parameters:
      outputLines - list of JSONObject containing sysId, name, description vcId and entName of partner organizations
      pltCtx -
    • afterAssigneeListConstructed

      @Deprecated public void afterAssigneeListConstructed​(org.json.JSONArray users, PlatformUserContext pltCtx)
      Deprecated.
      Called after the users list has been constructed as response for /assign/list API. Modules can provide implementation of this method by extending ProblemResourceListener class to manipulate this list before sending response.
      Parameters:
      users - list containing id and full name of users
      pltCtx -
    • afterAssigneeListConstructed

      public void afterAssigneeListConstructed​(java.util.List<java.lang.Long> problemIds, org.json.JSONArray users, PlatformUserContext pltCtx)
      Called after the users list has been constructed as response for /assign/list API. Modules can provide implementation of this method by extending ProblemResourceListener class to manipulate this list before sending response.
      Parameters:
      problemIds - sysIds of problems
      users - list containing id and full name of users
      pltCtx -
    • afterProblemListConstructed

      public void afterProblemListConstructed​(org.json.JSONArray problemsArr, org.json.JSONObject resultObj, PlatformUserContext pltCtx)
      Called after the problems list has been constructed as response for /problem/list API. Modules can add details to each problem in the array.
      Parameters:
      problemsArr - The array of WBProblems
      resultObj - Object which will contain a problemTypes object with a mapping of surrogate id to WBProblemType
      pltCtx -
    • afterNeoPrescriptionsExecuted

      public void afterNeoPrescriptionsExecuted​(java.util.Map<NeoPrescription,​AsyncAction> asyncActionsByPrescription, org.json.JSONObject resultObj, PlatformUserContext pltCtx)
      Called after the AsyncActions have been created for NeoPrescriptions and sent off to the Grid for execution. Each AsyncAction has a Grid Task id which can be passed into GridService.await(Long, long, long) to get notified when complete.
      Parameters:
      asyncActionsByPrescription - A Map of NeoPrescription to AsyncAction. This is guaranteeed to be non-null and contain at least 1 Neo Prescription.
      resultObj - The JSON object which will be returned to the user.
      pltCtx - The PlatformUserContext executing these prescriptions.
    • getRootCauseCodes

      public java.util.List<java.lang.String> getRootCauseCodes​(WBProblem problem)
      Called before the root cause codes has been constructed as response for /problem/resolve/lists API. Modules can return list of custom root cause codes for the problem.
      Parameters:
      problem - WBProblem
      Returns:
      list of custom root cause codes
    • getResolutionCodes

      public java.util.List<java.lang.String> getResolutionCodes​(WBProblem problem)
      Called before the root resolution codes has been constructed as response for /problem/resolve/lists API. Modules can return list of custom root resolution codes for the problem.
      Parameters:
      problem - WBProblem
      Returns:
      list of custom resolution cause codes