+ private void tryActivateDG(List<String> errors, List<String> fileLines) {
+ if (fileLines != null) {
+ for (String line : fileLines) {
+ if (line != null && !line.trim().startsWith("#")) {
+ String[] lineArray = line.trim().split(":");
+ doActivateDG(errors, line, lineArray);
+ }
+ }
+ }
+ }
+
+ private void doActivateDG(List<String> errors, String line, String[] lineArray) {
+ try {
+ if (lineArray.length >= 4) {
+ String module = lineArray[0];
+ String rpc = lineArray[1];
+ String version = lineArray[2];
+ String mode = lineArray[3];
+ if (StringUtils.isNotBlank(module)
+ && StringUtils.isNotBlank(rpc)
+ && StringUtils.isNotBlank(version)
+ && StringUtils.isNotBlank(mode)) {
+ logger.info("Activating DG :" + line);
+ SvcLogicGraph graph =
+ this.store.fetch(module, rpc, version, mode);
+ tryActivateStore(line, graph);
+ }
+ }
+ } catch (Exception e) {
+ logger.error("Failed to Activate " + line, e);
+ errors.add("Failed to Activate " + line + ", " + e.getMessage());
+ }
+ }
+
+ private void tryActivateStore(String line, SvcLogicGraph graph) throws SvcLogicException, DGXMLException {
+ if (graph != null) {
+ logger.info(
+ "Found Graph :" + line + " Activating ...");
+ this.store.activate(graph);
+ } else {
+ throw new DGXMLException("Failed to fetch from Database");
+ }
+ }