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 Summary
Constructors Constructor Description BaseProblemResourceListener()
-
Method Summary
Modifier and Type Method Description 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.void
afterAssigneeListConstructed(org.json.JSONArray users, PlatformUserContext pltCtx)
Deprecated.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.void
afterPartnerOrgResponseConstruction(org.json.JSONArray outputLines, PlatformUserContext pltCtx)
Called after the partner organizations list has been constructed as response for lines/getPartnerOrgs API.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.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.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.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.
-
Constructor Details
-
BaseProblemResourceListener
public BaseProblemResourceListener()
-
-
Method Details
-
afterPartnerRecordsRead
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 organizationspltCtx
-
-
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 userspltCtx
-
-
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 problemsusers
- list containing id and full name of userspltCtx
-
-
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 WBProblemsresultObj
- Object which will contain a problemTypes object with a mapping of surrogate id to WBProblemTypepltCtx
-
-
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 intoGridService.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
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
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
-