X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-certman%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fcm%2Fmapper%2FMapper1_0.java;h=bf5665afce2c6925e124c243e56c960645994784;hb=be1edcb6830745015f5de72e820f40f36dd571ad;hp=22243ae480995a71a4bf946e0616484b2e761ace;hpb=66f7d22a452e1f819ca9cc763fff8ebe60265742;p=aaf%2Fauthz.git diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java index 22243ae4..bf5665af 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper1_0.java @@ -3,13 +3,14 @@ * org.onap.aaf * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 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 - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -36,7 +37,6 @@ import org.onap.aaf.auth.dao.cass.ArtiDAO.Data; import org.onap.aaf.auth.dao.cass.CertDAO; import org.onap.aaf.auth.env.AuthzTrans; import org.onap.aaf.auth.layer.Result; -import org.onap.aaf.cadi.util.FQI; import org.onap.aaf.cadi.util.Vars; import aaf.v2_0.Error; @@ -50,7 +50,7 @@ import certman.v1_0.CertificateRequest; public class Mapper1_0 implements Mapper { - + @Override public Class getClass(API api) { switch(api) { @@ -124,11 +124,9 @@ public class Mapper1_0 implements Mapper { // Certs in keystore versus Truststore. Separate in Version 2_0 if (cin.trustCAs()!=null) { for (String c : cin.trustCAs()) { - if (c!=null) { - if (!cout.getCerts().contains(c)) { - cout.getCerts().add(c); - } - } + if ((c!=null)&&(!cout.getCerts().contains(c))) { + cout.getCerts().add(c); + } } } if (cin.notes()!=null) { @@ -223,10 +221,10 @@ public class Mapper1_0 implements Mapper { data.mechid = trim(arti.getMechid()); data.machine = trim(arti.getMachine()); if(arti.getType()!=null) { - Set ss = data.type(true); - for(String t : arti.getType()) { - ss.add(trim(t)); - } + Set ss = data.type(true); + for(String t : arti.getType()) { + ss.add(trim(t)); + } } data.ca = trim(arti.getCa()); data.dir = trim(arti.getDir()); @@ -235,14 +233,14 @@ public class Mapper1_0 implements Mapper { data.ns = trim(arti.getNs()); data.renewDays = arti.getRenewDays(); data.notify = trim(arti.getNotification()); - + // Ignored on way in for create/update data.sponsor = (arti.getSponsor()); if(arti.getSans()!=null) { Set ls = data.sans(true); - for(String t : arti.getSans()) { - ls.add(trim(t)); - } + for(String t : arti.getSans()) { + ls.add(trim(t)); + } } data.expires = null; ladd.add(data); @@ -266,13 +264,13 @@ public class Mapper1_0 implements Mapper { a.setCa(trim(arti.ca)); a.setDir(trim(arti.dir)); for(String t : arti.type(false)) { - a.getType().add(trim(t)); + a.getType().add(trim(t)); } a.setOsUser(trim(arti.os_user)); a.setRenewDays(arti.renewDays); a.setNotification(trim(arti.notify)); for(String t : arti.sans(false)) { - a.getSans().add(trim(t)); + a.getSans().add(trim(t)); } artis.getArtifact().add(a); } @@ -281,14 +279,14 @@ public class Mapper1_0 implements Mapper { return Result.err(lArtiDAO); } } - - + + private String trim(String s) { - if(s==null) { - return s; - } else { - return s.trim(); - } - } + if(s==null) { + return s; + } else { + return s.trim(); + } + } } \ No newline at end of file