MCPcopy Index your code
hub / github.com/OWASP/SecurityShepherd / getModuleResult

Method getModuleResult

src/main/java/dbProcs/Getter.java:1241–1265  ·  view source on GitHub ↗

@param ApplicationRoot The current running context of the application @param moduleId Identifier of module @return The db stored solution key value for the moduleId submitted

(String ApplicationRoot, String moduleId)

Source from the content-addressed store, hash-verified

1239 * @return The db stored solution key value for the moduleId submitted
1240 */
1241 public static String getModuleResult (String ApplicationRoot, String moduleId)
1242 {
1243 log.debug("*** Getter.getModuleResult ***");
1244 String moduleFound = null;
1245 Connection conn = Database.getCoreConnection(ApplicationRoot);
1246 try
1247 {
1248 CallableStatement callstmt = conn.prepareCall("call moduleGetResult(?)");
1249 log.debug("Gathering moduleGetResult ResultSet");
1250 callstmt.setString(1, moduleId);
1251 ResultSet moduleFind = callstmt.executeQuery();
1252 log.debug("Opening Result Set from moduleGetResult");
1253 moduleFind.next();
1254 log.debug("Module " + moduleFind.getString(1) + " Found");
1255 moduleFound = moduleFind.getString(2);
1256 }
1257 catch(Exception e)
1258 {
1259 log.error("Module did not exist: " + e.toString());
1260 moduleFound = null;
1261 }
1262 Database.closeConnection(conn);
1263 log.debug("*** END getModuleResult ***");
1264 return moduleFound;
1265 }
1266
1267 /**
1268 * Returns the result key for a module using the module's hash for the lookup procedure.

Callers 5

testGetModuleResultMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95
doPostMethod · 0.95

Calls 2

getCoreConnectionMethod · 0.95
closeConnectionMethod · 0.95

Tested by 1

testGetModuleResultMethod · 0.76