Properties props = (new DB()).getProperties();
String type = props.getProperty(Main.KEYSTORE_TYPE_PROPERTY, "jks");
String store = props.getProperty(Main.KEYSTORE_PATH_PROPERTY);
- String pass = props.getProperty(Main.KEYSTORE_PASSWORD_PROPERTY);
+ String pass = props.getProperty(Main.KEYSTORE_PASS_PROPERTY);
KeyStore keyStore = KeyStore.getInstance(type);
try(FileInputStream instream = new FileInputStream(new File(store))) {
keyStore.load(instream, pass.toCharArray());
}
store = props.getProperty(Main.TRUSTSTORE_PATH_PROPERTY);
- pass = props.getProperty(Main.TRUSTSTORE_PASSWORD_PROPERTY);
+ pass = props.getProperty(Main.TRUSTSTORE_PASS_PROPERTY);
KeyStore trustStore = null;
if (store != null && store.length() > 0) {
trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
// We are connecting with the node name, but the certificate will have the CNAME
// So we need to accept a non-matching certificate name
String keystorepass = props.getProperty(
- Main.KEYSTORE_PASSWORD_PROPERTY); //itrack.web.att.com/browse/DATARTR-6 for changing hard coded passphase ref
+ Main.KEYSTORE_PASS_PROPERTY); //itrack.web.att.com/browse/DATARTR-6 for changing hard coded passphase ref
try(AbstractHttpClient hc = new DefaultHttpClient()) {
SSLSocketFactory socketFactory =
(trustStore == null)
}
} catch (Exception e) {
logger.warn("PROV0020: Caught exception in SynchronizerTask: " + e);
- e.printStackTrace();
}
}
String thisPod = myaddr.getHostName();
Set<String> pods = new TreeSet<>(Arrays.asList(BaseServlet.getPods()));
if (pods.contains(thisPod)) {
- InetAddress pserver = InetAddress.getByName(BaseServlet.activeProvName);
+ InetAddress pserver = InetAddress.getByName(BaseServlet.getActiveProvName());
newstate = myaddr.equals(pserver) ? ACTIVE : STANDBY;
if (logger.isDebugEnabled() && System.currentTimeMillis() >= nextMsg) {
logger.debug("Active POD = " + pserver + ", Current state is " + stnames[newstate]);
* Synchronize the Feeds in the JSONArray, with the Feeds in the DB.
*/
private void syncFeeds(JSONArray ja) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (int n = 0; n < ja.length(); n++) {
try {
Feed f = new Feed(ja.getJSONObject(n));
* Synchronize the Subscriptions in the JSONArray, with the Subscriptions in the DB.
*/
private void syncSubs(JSONArray ja) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (int n = 0; n < ja.length(); n++) {
try {
//Data Router Subscriber HTTPS Relaxation feature USERSTORYID:US674047.
* Rally:US708115 - Synchronize the Groups in the JSONArray, with the Groups in the DB.
*/
private void syncGroups(JSONArray ja) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (int n = 0; n < ja.length(); n++) {
try {
Group g = new Group(ja.getJSONObject(n));
* Synchronize the Parameters in the JSONObject, with the Parameters in the DB.
*/
private void syncParams(JSONObject jo) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (String k : jo.keySet()) {
String v = "";
try {
}
private void syncIngressRoutes(JSONArray ja) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (int n = 0; n < ja.length(); n++) {
try {
IngressRoute in = new IngressRoute(ja.getJSONObject(n));
}
private void syncEgressRoutes(JSONObject jo) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (String key : jo.keySet()) {
try {
int sub = Integer.parseInt(key);
}
private void syncNetworkRoutes(JSONArray ja) {
- Collection<Syncable> coll = new ArrayList<Syncable>();
+ Collection<Syncable> coll = new ArrayList<>();
for (int n = 0; n < ja.length(); n++) {
try {
NetworkRoute nr = new NetworkRoute(ja.getJSONObject(n));
try {
Map<String, Syncable> newmap = getMap(newc);
Map<String, Syncable> oldmap = getMap(oldc);
- Set<String> union = new TreeSet<String>(newmap.keySet());
+ Set<String> union = new TreeSet<>(newmap.keySet());
union.addAll(oldmap.keySet());
DB db = new DB();
@SuppressWarnings("resource")
db.release(conn);
} catch (SQLException e) {
logger.warn("PROV5009: problem during sync, exception: " + e);
- e.printStackTrace();
}
return changes;
}
private Map<String, Syncable> getMap(Collection<? extends Syncable> c) {
- Map<String, Syncable> map = new HashMap<String, Syncable>();
+ Map<String, Syncable> map = new HashMap<>();
for (Syncable v : c) {
map.put(v.getKey(), v);
}