X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fhelpers%2FNotification.java;h=ae0d37b5c35b64a5d8bc52061f6d71e5d6a67d0a;hb=a50007dcded86acc2dcd610810f8afac720a058a;hp=5c7a826910af54378cdeb0e51fb613a731179f10;hpb=613846477296bd3888ba6e5f939afe688b486ad7;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Notification.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Notification.java index 5c7a8269..ae0d37b5 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Notification.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Notification.java @@ -4,6 +4,8 @@ * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. * =========================================================================== + * Modifications Copyright (C) 2018 IBM. + * =========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -77,17 +79,34 @@ public class Notification { public final String user; public final TYPE type; public Date last; - public int checksum; + public int checkSum; public Message msg; private int current; public Organization org; public int count; + + public static Creator v2_0_18 = new Creator() { + @Override + public Notification create(Row row) { + int idx =row.getInt(1); + TYPE typeCreator = TYPE.get(idx); + if (typeCreator==null) { + return null; + } + return new Notification(row.getString(0), typeCreator, row.getTimestamp(2), row.getInt(3)); + } + + @Override + public String select() { + return "SELECT user,type,last,checksum FROM authz.notify LIMIT 100000"; + } + }; private Notification(String user, TYPE nt, Date last, int checksum) { this.user = user; this.type = nt; this.last = last; - this.checksum = checksum; + this.checkSum = checksum; current = 0; count = 0; } @@ -142,23 +161,6 @@ public class Notification { public static Notification create(String user, TYPE type) { return new Notification(user,type,null,0); } - - public static Creator v2_0_18 = new Creator() { - @Override - public Notification create(Row row) { - int idx =row.getInt(1); - TYPE type = TYPE.get(idx); - if (type==null) { - return null; - } - return new Notification(row.getString(0), type, row.getTimestamp(2), row.getInt(3)); - } - - @Override - public String select() { - return "SELECT user,type,last,checksum FROM authz.notify LIMIT 100000"; - } - }; public void set(Message msg) { @@ -180,7 +182,7 @@ public class Notification { public boolean update(AuthzTrans trans, Session session, boolean dryRun) { checksum(); - if (last==null || current==0 || current!=checksum) { + if (last==null || current==0 || current!=checkSum) { last = now; current = checksum(); String update = "UPDATE authz.notify SET " + @@ -204,6 +206,6 @@ public class Notification { public String toString() { return "\"" + user + "\",\"" + type.name() + "\",\"" - + Chrono.dateTime(last)+ "\", " + checksum; + + Chrono.dateTime(last)+ "\", " + checkSum; } } \ No newline at end of file