Issue-ID: AAF-386
Change-Id: I8ba8d8561d03e680ddc90a81b8db0339814c65fa
Signed-off-by: Instrumental <jonathan.gathman@att.com>
145 files changed:
if(person!=null) {
ln = byApprover.get(person);
if(ln==null) {
if(person!=null) {
ln = byApprover.get(person);
if(ln==null) {
- ln = new ArrayList<Approval>();
+ ln = new ArrayList<>();
byApprover.put(app.getApprover(), ln);
}
ln.add(app);
byApprover.put(app.getApprover(), ln);
}
ln.add(app);
if(person!=null) {
ln = byUser.get(person);
if(ln==null) {
if(person!=null) {
ln = byUser.get(person);
if(ln==null) {
- ln = new ArrayList<Approval>();
+ ln = new ArrayList<>();
byUser.put(app.getUser(), ln);
}
ln.add(app);
byUser.put(app.getUser(), ln);
}
ln.add(app);
if(ticket!=null) {
ln = byTicket.get(ticket);
if(ln==null) {
if(ticket!=null) {
ln = byTicket.get(ticket);
if(ln==null) {
- ln = new ArrayList<Approval>();
+ ln = new ArrayList<>();
byTicket.put(app.getTicket(), ln);
}
ln.add(app);
byTicket.put(app.getTicket(), ln);
}
ln.add(app);
public Approver(String approver, Organization org) {
this.name = approver;
this.org = org;
public Approver(String approver, Organization org) {
this.name = approver;
this.org = org;
- userRequests = new HashMap<String, Integer>();
+ userRequests = new HashMap<>();
}
public void addRequest(String user) {
}
public void addRequest(String user) {
private List<T> removed;
public CacheChange() {
private List<T> removed;
public CacheChange() {
- removed = new ArrayList<T>();
+ removed = new ArrayList<>();
import com.datastax.driver.core.Statement;
public class Cred {
import com.datastax.driver.core.Statement;
public class Cred {
- public static final TreeMap<String,Cred> data = new TreeMap<String,Cred>();
- public static final TreeMap<String,List<Cred>> byNS = new TreeMap<String,List<Cred>>();
+ public static final TreeMap<String,Cred> data = new TreeMap<>();
+ public static final TreeMap<String,List<Cred>> byNS = new TreeMap<>();
public final String id;
public final List<Instance> instances;
public final String id;
public final List<Instance> instances;
public Cred(String id) {
this.id = id;
public Cred(String id) {
this.id = id;
- instances = new ArrayList<Instance>();
+ instances = new ArrayList<>();
ns=Question.domain2ns(id);
}
ns=Question.domain2ns(id);
}
public Set<Integer> types() {
public Set<Integer> types() {
- Set<Integer> types = new HashSet<Integer>();
+ Set<Integer> types = new HashSet<>();
for(Instance i : instances) {
types.add(i.type);
}
for(Instance i : instances) {
types.add(i.type);
}
List<Cred> lscd = byNS.get(cred.ns);
if(lscd==null) {
List<Cred> lscd = byNS.get(cred.ns);
if(lscd==null) {
- byNS.put(cred.ns, (lscd=new ArrayList<Cred>()));
+ byNS.put(cred.ns, (lscd=new ArrayList<>()));
}
boolean found = false;
for(Cred c : lscd) {
}
boolean found = false;
for(Cred c : lscd) {
import com.datastax.driver.core.Statement;
public class MiscID {
import com.datastax.driver.core.Statement;
public class MiscID {
- public static final TreeMap<String,MiscID> data = new TreeMap<String,MiscID>();
+ public static final TreeMap<String,MiscID> data = new TreeMap<>();
/*
Sample Record
aad890|mj9030|20040902|20120207
/*
Sample Record
aad890|mj9030|20040902|20120207
import java.util.TreeMap;
public class MonthData {
import java.util.TreeMap;
public class MonthData {
- public final Map<Integer,Set<Row>> data =
- new TreeMap<Integer,Set<Row>>();
+ public final Map<Integer,Set<Row>> data = new TreeMap<>();
private File f;
public MonthData(String env) throws IOException {
private File f;
public MonthData(String env) throws IOException {
public void add(int yr_mon, String target, long total, long adds, long drops) {
Set<Row> row = data.get(yr_mon);
if(row==null) {
public void add(int yr_mon, String target, long total, long adds, long drops) {
Set<Row> row = data.get(yr_mon);
if(row==null) {
- data.put(yr_mon, (row=new HashSet<Row>()));
+ data.put(yr_mon, (row=new HashSet<>()));
}
row.add(new Row(target,total,adds,drops));
}
}
row.add(new Row(target,total,adds,drops));
}
import com.datastax.driver.core.Statement;
public class NS implements Comparable<NS> {
import com.datastax.driver.core.Statement;
public class NS implements Comparable<NS> {
- public final static Map<String,NS> data = new TreeMap<String,NS>();
+ public final static Map<String,NS> data = new TreeMap<>();
public final String name, description, parent;
public final int scope,type;
public final String name, description, parent;
public final int scope,type;
- public static final TreeMap<String,List<Notification>> data = new TreeMap<String,List<Notification>>();
+ public static final TreeMap<String,List<Notification>> data = new TreeMap<>();
public static final Date now = new Date();
public final String user;
public static final Date now = new Date();
public final String user;
Notification not = creator.create(row);
List<Notification> ln = data.get(not.user);
if(ln==null) {
Notification not = creator.create(row);
List<Notification> ln = data.get(not.user);
if(ln==null) {
- ln = new ArrayList<Notification>();
+ ln = new ArrayList<>();
data.put(not.user, ln);
}
ln.add(not);
data.put(not.user, ln);
}
ln.add(not);
import com.datastax.driver.core.Statement;
public class Perm implements Comparable<Perm> {
import com.datastax.driver.core.Statement;
public class Perm implements Comparable<Perm> {
- public static final TreeMap<Perm,Set<String>> data = new TreeMap<Perm,Set<String>>();
- public static final TreeMap<String,Perm> keys = new TreeMap<String,Perm>();
- private static List<Perm> deletePerms = new ArrayList<Perm>();
+ public static final TreeMap<Perm,Set<String>> data = new TreeMap<>();
+ public static final TreeMap<String,Perm> keys = new TreeMap<>();
+ private static List<Perm> deletePerms = new ArrayList<>();
public final String ns, type, instance, action,description;
private String fullType = null, fullPerm = null, encode = null;
public final String ns, type, instance, action,description;
private String fullType = null, fullPerm = null, encode = null;
import com.datastax.driver.core.Statement;
public class Role implements Comparable<Role> {
import com.datastax.driver.core.Statement;
public class Role implements Comparable<Role> {
- public static final TreeMap<Role,Set<String>> data = new TreeMap<Role,Set<String>>();
- public static final TreeMap<String,Role> keys = new TreeMap<String,Role>();
- public static final TreeMap<String,Role> byName = new TreeMap<String,Role>();
- private static List<Role> deleteRoles = new ArrayList<Role>();
+ public static final TreeMap<Role,Set<String>> data = new TreeMap<>();
+ public static final TreeMap<String,Role> keys = new TreeMap<>();
+ public static final TreeMap<String,Role> byName = new TreeMap<>();
+ private static List<Role> deleteRoles = new ArrayList<>();
public final String ns, name, description;
private String full, encode;
public final String ns, name, description;
private String full, encode;
public Role(String full) {
ns = name = description = "";
this.full = full;
public Role(String full) {
ns = name = description = "";
this.full = full;
- perms = new HashSet<String>();
+ perms = new HashSet<>();
}
public Role(String ns, String name, String description,Set<String> perms) {
}
public Role(String ns, String name, String description,Set<String> perms) {
import com.datastax.driver.core.Statement;
public class UserRole implements Cloneable, CacheChange.Data {
import com.datastax.driver.core.Statement;
public class UserRole implements Cloneable, CacheChange.Data {
- public static final List<UserRole> data = new ArrayList<UserRole>();
- public static final TreeMap<String,List<UserRole>> byUser = new TreeMap<String,List<UserRole>>();
- public static final TreeMap<String,List<UserRole>> byRole = new TreeMap<String,List<UserRole>>();
- private final static CacheChange<UserRole> cache = new CacheChange<UserRole>();
+ public static final List<UserRole> data = new ArrayList<>();
+ public static final TreeMap<String,List<UserRole>> byUser = new TreeMap<>();
+ public static final TreeMap<String,List<UserRole>> byRole = new TreeMap<>();
+ private final static CacheChange<UserRole> cache = new CacheChange<>();
private static PrintStream urDelete=System.out,urRecover=System.err;
private static int totalLoaded;
private static int deleted;
private static PrintStream urDelete=System.out,urRecover=System.err;
private static int totalLoaded;
private static int deleted;
List<UserRole> lur = byUser.get(ur.urdd.user);
if(lur==null) {
List<UserRole> lur = byUser.get(ur.urdd.user);
if(lur==null) {
- lur = new ArrayList<UserRole>();
+ lur = new ArrayList<>();
byUser.put(ur.urdd.user, lur);
}
lur.add(ur);
lur = byRole.get(ur.urdd.role);
if(lur==null) {
byUser.put(ur.urdd.user, lur);
}
lur.add(ur);
lur = byRole.get(ur.urdd.role);
if(lur==null) {
- lur = new ArrayList<UserRole>();
+ lur = new ArrayList<>();
byRole.put(ur.urdd.role, lur);
}
lur.add(ur);
byRole.put(ur.urdd.role, lur);
}
lur.add(ur);
Date earliestUR = gc.getTime();
Date earliestCred = gc.getTime();
// Run for Roles
Date earliestUR = gc.getTime();
Date earliestCred = gc.getTime();
// Run for Roles
- List<String> expiring = new ArrayList<String>();
+ List<String> expiring = new ArrayList<>();
trans.info().log("Checking for Expired UserRoles");
for(UserRole ur : UserRole.data) {
trans.info().log("Checking for Expired UserRoles");
for(UserRole ur : UserRole.data) {
String line,prev="";
try {
UserRole ur;
String line,prev="";
try {
UserRole ur;
- Map<String,Count> tally = new HashMap<String,Count>();
+ Map<String,Count> tally = new HashMap<>();
int count=0;
try {
while((line=urDeleteF.readLine())!=null) {
int count=0;
try {
while((line=urDeleteF.readLine())!=null) {
Message msg = new Message();
int emailCount = 0;
Message msg = new Message();
int emailCount = 0;
- List<Approval> pending = new ArrayList<Approval>();
+ List<Approval> pending = new ArrayList<>();
boolean isOwner,isSupervisor;
for(Entry<String, List<Approval>> es : Approval.byApprover.entrySet()) {
isOwner = isSupervisor = false;
boolean isOwner,isSupervisor;
for(Entry<String, List<Approval>> es : Approval.byApprover.entrySet()) {
isOwner = isSupervisor = false;
Date tooLate = new Date(now);
// Temp structures
Date tooLate = new Date(now);
// Temp structures
- Map<String,Cred> lastCred = new HashMap<String,Cred>();
- Map<String,List<LastCred>> ownerCreds = new TreeMap<String,List<LastCred>>();
+ Map<String,Cred> lastCred = new HashMap<>();
+ Map<String,List<LastCred>> ownerCreds = new TreeMap<>();
- List<LastCred> noOwner = new ArrayList<LastCred>();
+ List<LastCred> noOwner = new ArrayList<>();
ownerCreds.put(UNKNOWN_ID,noOwner);
// Get a list of ONLY the ones needing email by Owner
ownerCreds.put(UNKNOWN_ID,noOwner);
// Get a list of ONLY the ones needing email by Owner
String owner = ur.user();
List<LastCred> llc = ownerCreds.get(owner);
if(llc==null) {
String owner = ur.user();
List<LastCred> llc = ownerCreds.get(owner);
if(llc==null) {
- ownerCreds.put(owner, (llc=new ArrayList<LastCred>()));
+ ownerCreds.put(owner, (llc=new ArrayList<>()));
}
llc.add(new LastCred(c,last));
}
}
llc.add(new LastCred(c,last));
}
protected Class<DATA> dataClass;
private final String name;
// private static Slot sessionSlot; // not used since 2015
protected Class<DATA> dataClass;
private final String name;
// private static Slot sessionSlot; // not used since 2015
- private static final ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo> psinfos = new ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo>();
- private static final List<Object> EMPTY = new ArrayList<Object>(0);
+ private static final ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo> psinfos = new ArrayList<>();
+ private static final List<Object> EMPTY = new ArrayList<>(0);
private static final Deque<ResetRequest> resetDeque = new ConcurrentLinkedDeque<ResetRequest>();
private static boolean resetTrigger = false;
private static long nextAvailableReset = 0;
private static final Deque<ResetRequest> resetDeque = new ConcurrentLinkedDeque<ResetRequest>();
private static boolean resetTrigger = false;
private static long nextAvailableReset = 0;
/// TEST CODE for Exception
// boolean force = true;
// if(force) {
/// TEST CODE for Exception
// boolean force = true;
// if(force) {
-// Map<InetSocketAddress, Throwable> misa = new HashMap<InetSocketAddress,Throwable>();
+// Map<InetSocketAddress, Throwable> misa = new HashMap<>();
// //misa.put(new InetSocketAddress(444),new Exception("no host was tried"));
// misa.put(new InetSocketAddress(444),new Exception("Connection has been closed"));
// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(misa);
// //misa.put(new InetSocketAddress(444),new Exception("no host was tried"));
// misa.put(new InetSocketAddress(444),new Exception("Connection has been closed"));
// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(misa);
return Result.ok((List<DATA>)EMPTY); // Result sets now .emptyList(true);
} else {
DATA d;
return Result.ok((List<DATA>)EMPTY); // Result sets now .emptyList(true);
} else {
DATA d;
- List<DATA> data = indata==null?new ArrayList<DATA>(rows.size()):indata;
+ List<DATA> data = indata==null?new ArrayList<>(rows.size()):indata;
for(Row row : rows) {
try {
for(Row row : rows) {
try {
public void add(DATA data) {
String key = keyFromObjs(dao.keyFrom(data));
public void add(DATA data) {
String key = keyFromObjs(dao.keyFrom(data));
- List<DATA> list = new ArrayList<DATA>();
+ List<DATA> list = new ArrayList<>();
list.add(data);
super.add(key,list);
}
list.add(data);
super.add(key,list);
}
public static final String CASSANDRA_CLUSTERS_USER_NAME = "cassandra.clusters.user";
public static final String CASSANDRA_CLUSTERS_PASSWORD = "cassandra.clusters.password";
public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions";
public static final String CASSANDRA_CLUSTERS_USER_NAME = "cassandra.clusters.user";
public static final String CASSANDRA_CLUSTERS_PASSWORD = "cassandra.clusters.password";
public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions";
- private static final List<Resettable> resetExceptions = new ArrayList<Resettable>();
+ private static final List<Resettable> resetExceptions = new ArrayList<>();
public static final String ERR_ACCESS_MSG = "Accessing Backend";
private static Builder cb = null;
public static final String ERR_ACCESS_MSG = "Accessing Backend";
private static Builder cb = null;
- messages=new ArrayList<String>();
+ messages=new ArrayList<>();
for(int i=1;i<split.length;++i) {
String str = split[i];
int start = str.startsWith("\"")?1:0;
for(int i=1;i<split.length;++i) {
String str = split[i];
int start = str.startsWith("\"")?1:0;
- Set<String> set = new HashSet<String>(l);
+ Set<String> set = new HashSet<>(l);
for(int i=0;i<l;++i) {
set.add(readString(is,buff));
}
for(int i=0;i<l;++i) {
set.add(readString(is,buff));
}
- List<String> list = new ArrayList<String>(l);
+ List<String> list = new ArrayList<>(l);
for(int i=0;i<l;++i) {
list.add(Loader.readString(is,buff));
}
for(int i=0;i<l;++i) {
list.add(Loader.readString(is,buff));
}
- Map<String,String> map = new HashMap<String,String>(l);
+ Map<String,String> map = new HashMap<>(l);
for(int i=0;i<l;++i) {
String key = readString(is,buff);
map.put(key,readString(is,buff));
for(int i=0;i<l;++i) {
String key = readString(is,buff);
map.put(key,readString(is,buff));
if(user.equals(trans.user())) {
Result<List<Data>> rrbu = readByUser(trans, user);
if(rrbu.isOK()) {
if(user.equals(trans.user())) {
Result<List<Data>> rrbu = readByUser(trans, user);
if(rrbu.isOK()) {
- List<Data> ld = new ArrayList<Data>(1);
+ List<Data> ld = new ArrayList<>(1);
for(Data d : rrbu.value) {
if(d.role.equals(role)) {
ld.add(d);
for(Data d : rrbu.value) {
if(d.role.equals(role)) {
ld.add(d);
// // Getters
public Set<String> type(boolean mutable) {
if (type == null) {
// // Getters
public Set<String> type(boolean mutable) {
if (type == null) {
- type = new HashSet<String>();
+ type = new HashSet<>();
} else if (mutable && !(type instanceof HashSet)) {
} else if (mutable && !(type instanceof HashSet)) {
- type = new HashSet<String>(type);
+ type = new HashSet<>(type);
}
return type;
}
public Set<String> sans(boolean mutable) {
if (sans == null) {
}
return type;
}
public Set<String> sans(boolean mutable) {
if (sans == null) {
- sans = new HashSet<String>();
+ sans = new HashSet<>();
} else if (mutable && !(sans instanceof HashSet)) {
} else if (mutable && !(sans instanceof HashSet)) {
- sans = new HashSet<String>(sans);
+ sans = new HashSet<>(sans);
data.mechid = readString(is,buff);
data.machine = readString(is,buff);
int size = is.readInt();
data.mechid = readString(is,buff);
data.machine = readString(is,buff);
int size = is.readInt();
- data.type = new HashSet<String>(size);
+ data.type = new HashSet<>(size);
for(int i=0;i<size;++i) {
data.type.add(readString(is,buff));
}
for(int i=0;i<size;++i) {
data.type.add(readString(is,buff));
}
data.expires = l<0?null:new Date(l);
data.renewDays = is.readInt();
size = is.readInt();
data.expires = l<0?null:new Date(l);
data.renewDays = is.readInt();
size = is.readInt();
- data.sans = new HashSet<String>(size);
+ data.sans = new HashSet<>(size);
for(int i=0;i<size;++i) {
data.sans.add(readString(is,buff));
}
for(int i=0;i<size;++i) {
data.sans.add(readString(is,buff));
}
public class CacheInfoDAO extends CassDAOImpl<AuthzTrans,CacheInfoDAO.Data> implements CIDAO<AuthzTrans> {
private static final String TABLE = "cache";
public class CacheInfoDAO extends CassDAOImpl<AuthzTrans,CacheInfoDAO.Data> implements CIDAO<AuthzTrans> {
private static final String TABLE = "cache";
- public static final Map<String,Date[]> info = new ConcurrentHashMap<String,Date[]>();
+ public static final Map<String,Date[]> info = new ConcurrentHashMap<>();
private static CacheUpdate cacheUpdate;
private static CacheUpdate cacheUpdate;
}
public void add(int[] ints) {
if(set==null) {
}
public void add(int[] ints) {
if(set==null) {
- set = new HashSet<Integer>();
for(int i=0;i<raw.length;++i) {
set.add(raw[i]);
for(int i=0;i<raw.length;++i) {
set.add(raw[i]);
start = System.nanoTime();
trans = env.newTransNoAvg();
cc = new CacheClear(trans);
start = System.nanoTime();
trans = env.newTransNoAvg();
cc = new CacheClear(trans);
- gather = new HashMap<String,IntHolder>();
+ gather = new HashMap<>();
}
IntHolder prev = gather.get(data.table);
if(prev==null) {
}
IntHolder prev = gather.get(data.table);
if(prev==null) {
public String target;
public String subject;
public String memo;
public String target;
public String subject;
public String memo;
-// Map<String, String> detail = null;
-// public Map<String, String> detail() {
-// if(detail == null) {
-// detail = new HashMap<String, String>();
-// }
-// return detail;
-// }
public ByteBuffer reconstruct;
}
public ByteBuffer reconstruct;
}
data.target = row.getString(4);
data.subject = row.getString(5);
data.memo = row.getString(6);
data.target = row.getString(4);
data.subject = row.getString(5);
data.memo = row.getString(6);
-// data.detail = row.getMap(6, String.class, String.class);
data.reconstruct = row.getBytes(7);
return data;
}
data.reconstruct = row.getBytes(7);
return data;
}
// Getters
public Set<String> subprotocol(boolean mutable) {
if (subprotocol == null) {
// Getters
public Set<String> subprotocol(boolean mutable) {
if (subprotocol == null) {
- subprotocol = new HashSet<String>();
+ subprotocol = new HashSet<>();
} else if (mutable && !(subprotocol instanceof HashSet)) {
} else if (mutable && !(subprotocol instanceof HashSet)) {
- subprotocol = new HashSet<String>(subprotocol);
+ subprotocol = new HashSet<>(subprotocol);
data.protocol = readString(is,buff);
int size = is.readInt();
data.protocol = readString(is,buff);
int size = is.readInt();
- data.subprotocol = new HashSet<String>(size);
+ data.subprotocol = new HashSet<>(size);
for(int i=0;i<size;++i) {
data.subprotocol.add(readString(is,buff));
}
for(int i=0;i<size;++i) {
data.subprotocol.add(readString(is,buff));
}
type = ndd.type;
parent = ndd.parent;
if(ndd.attrib!=null && !ndd.attrib.isEmpty()) {
type = ndd.type;
parent = ndd.parent;
if(ndd.attrib!=null && !ndd.attrib.isEmpty()) {
- attrib = new ArrayList<Pair<String,String>>();
+ attrib = new ArrayList<>();
for( Entry<String, String> entry : ndd.attrib.entrySet()) {
attrib.add(new Pair<String,String>(entry.getKey(),entry.getValue()));
}
for( Entry<String, String> entry : ndd.attrib.entrySet()) {
attrib.add(new Pair<String,String>(entry.getKey(),entry.getValue()));
}
type = ndd.type;
parent = ndd.parent;
if(ndd.attrib!=null && !ndd.attrib.isEmpty()) {
type = ndd.type;
parent = ndd.parent;
if(ndd.attrib!=null && !ndd.attrib.isEmpty()) {
- attrib = new ArrayList<Pair<String,String>>();
+ attrib = new ArrayList<>();
for( Entry<String, String> entry : ndd.attrib.entrySet()) {
attrib.add(new Pair<String,String>(entry.getKey(),entry.getValue()));
}
for( Entry<String, String> entry : ndd.attrib.entrySet()) {
attrib.add(new Pair<String,String>(entry.getKey(),entry.getValue()));
}
// // Getters
public Map<String,String> attrib(boolean mutable) {
if (attrib == null) {
// // Getters
public Map<String,String> attrib(boolean mutable) {
if (attrib == null) {
- attrib = new HashMap<String,String>();
+ attrib = new HashMap<>();
} else if (mutable && !(attrib instanceof HashMap)) {
} else if (mutable && !(attrib instanceof HashMap)) {
- attrib = new HashMap<String,String>(attrib);
+ attrib = new HashMap<>(attrib);
//// TEST CODE for Exception
// boolean force = true;
// if(force) {
//// TEST CODE for Exception
// boolean force = true;
// if(force) {
-// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(new HashMap<InetSocketAddress,Throwable>());
+// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(new HashMap<>());
//// throw new com.datastax.driver.core.exceptions.AuthenticationException(new InetSocketAddress(9999),"Sample Message");
// }
////END TEST CODE
//// throw new com.datastax.driver.core.exceptions.AuthenticationException(new InetSocketAddress(9999),"Sample Message");
// }
////END TEST CODE
}
public Result<Map<String,String>> readAttribByNS(AuthzTrans trans, String ns) {
}
public Result<Map<String,String>> readAttribByNS(AuthzTrans trans, String ns) {
- Map<String,String> map = new HashMap<String,String>();
+ Map<String,String> map = new HashMap<>();
TimeTaken tt = trans.start("readAttribByNS " + ns, Env.REMOTE);
try {
ResultSet rs = getSession(trans).execute("SELECT key,value FROM "
TimeTaken tt = trans.start("readAttribByNS " + ns, Env.REMOTE);
try {
ResultSet rs = getSession(trans).execute("SELECT key,value FROM "
}
public Result<Set<String>> readNsByAttrib(AuthzTrans trans, String key) {
}
public Result<Set<String>> readNsByAttrib(AuthzTrans trans, String key) {
- Set<String> set = new HashSet<String>();
+ Set<String> set = new HashSet<>();
TimeTaken tt = trans.start("readNsBykey " + key, Env.REMOTE);
try {
ResultSet rs = getSession(trans).execute("SELECT ns FROM "
TimeTaken tt = trans.start("readNsBykey " + key, Env.REMOTE);
try {
ResultSet rs = getSession(trans).execute("SELECT ns FROM "
public Set<String> scopes(boolean mutable) {
if (scopes == null) {
public Set<String> scopes(boolean mutable) {
if (scopes == null) {
- scopes = new HashSet<String>();
+ scopes = new HashSet<>();
} else if (mutable && !(scopes instanceof HashSet)) {
} else if (mutable && !(scopes instanceof HashSet)) {
- scopes = new HashSet<String>(scopes);
+ scopes = new HashSet<>(scopes);
// Getters
public Set<String> roles(boolean mutable) {
if (roles == null) {
// Getters
public Set<String> roles(boolean mutable) {
if (roles == null) {
- roles = new HashSet<String>();
+ roles = new HashSet<>();
} else if (mutable && !(roles instanceof HashSet)) {
} else if (mutable && !(roles instanceof HashSet)) {
- roles = new HashSet<String>(roles);
+ roles = new HashSet<>(roles);
// Getters
public Set<String> perms(boolean mutable) {
if (perms == null) {
// Getters
public Set<String> perms(boolean mutable) {
if (perms == null) {
- perms = new HashSet<String>();
+ perms = new HashSet<>();
} else if (mutable && !(perms instanceof HashSet)) {
} else if (mutable && !(perms instanceof HashSet)) {
- perms = new HashSet<String>(perms);
+ perms = new HashSet<>(perms);
public static final String FOP_PERM = "perm";
public static final String FOP_ROLE = "role";
public static final String FOP_USER_ROLE = "user_role";
public static final String FOP_PERM = "perm";
public static final String FOP_ROLE = "role";
public static final String FOP_USER_ROLE = "user_role";
- private static final List<Identity> NO_ADDL_APPROVE = new ArrayList<Identity>();
+ private static final List<Identity> NO_ADDL_APPROVE = new ArrayList<>();
private static final String ROOT_NS = Define.ROOT_NS();
// First Action should ALWAYS be "write", see "CreateRole"
public final Question q;
private static final String ROOT_NS = Define.ROOT_NS();
// First Action should ALWAYS be "write", see "CreateRole"
public final Question q;
if (result.notOK()) {
if (sb == null) {
sb = new StringBuilder();
if (result.notOK()) {
if (sb == null) {
sb = new StringBuilder();
- ao = new ArrayList<String>();
+ ao = new ArrayList<>();
}
sb.append(result.details);
sb.append('\n');
}
sb.append(result.details);
sb.append('\n');
if (rrdc.isOKhasData()) {
for (RoleDAO.Data rdd : rrdc.value) {
// Remove old Role from Perms, save them off
if (rrdc.isOKhasData()) {
for (RoleDAO.Data rdd : rrdc.value) {
// Remove old Role from Perms, save them off
- List<PermDAO.Data> lpdd = new ArrayList<PermDAO.Data>();
+ List<PermDAO.Data> lpdd = new ArrayList<>();
for(String p : rdd.perms(false)) {
Result<PermDAO.Data> rpdd = PermDAO.Data.decode(trans,q,p);
if(rpdd.isOKhasData()) {
for(String p : rdd.perms(false)) {
Result<PermDAO.Data> rpdd = PermDAO.Data.decode(trans,q,p);
if(rpdd.isOKhasData()) {
if (rpdc.isOKhasData()) {
for (PermDAO.Data pdd : rpdc.value) {
// Remove old Perm from Roles, save them off
if (rpdc.isOKhasData()) {
for (PermDAO.Data pdd : rpdc.value) {
// Remove old Perm from Roles, save them off
- List<RoleDAO.Data> lrdd = new ArrayList<RoleDAO.Data>();
+ List<RoleDAO.Data> lrdd = new ArrayList<>();
for(String rl : pdd.roles(false)) {
Result<RoleDAO.Data> rrdd = RoleDAO.Data.decode(trans,q,rl);
for(String rl : pdd.roles(false)) {
Result<RoleDAO.Data> rrdd = RoleDAO.Data.decode(trans,q,rl);
pd.action = Question.ASTERIX;
pd.description = "AAF Namespace Write Access";
pd.action = Question.ASTERIX;
pd.description = "AAF Namespace Write Access";
- rd.perms = new HashSet<String>();
+ rd.perms = new HashSet<>();
rd.perms.add(pd.encode());
eb.log(q.roleDAO.create(trans, rd));
rd.perms.add(pd.encode());
eb.log(q.roleDAO.create(trans, rd));
- pd.roles = new HashSet<String>();
+ pd.roles = new HashSet<>();
pd.roles.add(rd.encode());
eb.log(q.permDAO.create(trans, pd));
}
pd.roles.add(rd.encode());
eb.log(q.permDAO.create(trans, pd));
}
pd.action = Question.READ;
pd.description = "AAF Namespace Read Access";
pd.action = Question.READ;
pd.description = "AAF Namespace Read Access";
- rd.perms = new HashSet<String>();
+ rd.perms = new HashSet<>();
rd.perms.add(pd.encode());
eb.log(q.roleDAO.create(trans, rd));
rd.perms.add(pd.encode());
eb.log(q.roleDAO.create(trans, rd));
- pd.roles = new HashSet<String>();
+ pd.roles = new HashSet<>();
pd.roles.add(rd.encode());
eb.log(q.permDAO.create(trans, pd));
}
pd.roles.add(rd.encode());
eb.log(q.permDAO.create(trans, pd));
}
continue;
}
// Remove old Perm from Roles, save them off
continue;
}
// Remove old Perm from Roles, save them off
- List<RoleDAO.Data> lrdd = new ArrayList<RoleDAO.Data>();
+ List<RoleDAO.Data> lrdd = new ArrayList<>();
for(String rl : pdd.roles(false)) {
Result<RoleDAO.Data> rrdd = RoleDAO.Data.decode(trans,q,rl);
for(String rl : pdd.roles(false)) {
Result<RoleDAO.Data> rrdd = RoleDAO.Data.decode(trans,q,rl);
continue;
}
// Remove old Role from Perms, save them off
continue;
}
// Remove old Role from Perms, save them off
- List<PermDAO.Data> lpdd = new ArrayList<PermDAO.Data>();
+ List<PermDAO.Data> lpdd = new ArrayList<>();
for(String p : rdd.perms(false)) {
Result<PermDAO.Data> rpdd = PermDAO.Data.decode(trans,q,p);
if(rpdd.isOKhasData()) {
for(String p : rdd.perms(false)) {
Result<PermDAO.Data> rpdd = PermDAO.Data.decode(trans,q,p);
if(rpdd.isOKhasData()) {
}
Date now = new Date();
List<UserRoleDAO.Data> list = rurdd.value;
}
Date now = new Date();
List<UserRoleDAO.Data> list = rurdd.value;
- List<String> rv = new ArrayList<String>(list.size()); // presize
+ List<String> rv = new ArrayList<>(list.size()); // presize
for (UserRoleDAO.Data urdd : rurdd.value) {
if (includeExpired || urdd.expires.after(now)) {
rv.add(urdd.user);
for (UserRoleDAO.Data urdd : rurdd.value) {
if (includeExpired || urdd.expires.after(now)) {
rv.add(urdd.user);
Organization org = trans.org();
// For Reapproval, only check Owners.. Do Supervisors, etc, separately
List<Identity> approvers = op.equals(FUTURE_OP.A)?NO_ADDL_APPROVE:org.getApprovers(trans, user);
Organization org = trans.org();
// For Reapproval, only check Owners.. Do Supervisors, etc, separately
List<Identity> approvers = op.equals(FUTURE_OP.A)?NO_ADDL_APPROVE:org.getApprovers(trans, user);
- List<Identity> owners = new ArrayList<Identity>();
+ List<Identity> owners = new ArrayList<>();
if (nsd != null) {
Result<List<UserRoleDAO.Data>> rrbr = q.userRoleDAO
.readByRole(trans, nsd.name + Question.DOT_OWNER);
if (nsd != null) {
Result<List<UserRoleDAO.Data>> rrbr = q.userRoleDAO
.readByRole(trans, nsd.name + Question.DOT_OWNER);
PermLookup lp=null;
Map<String, PermLookup> permMap = trans.get(Question.PERMS, null);
if (permMap == null) {
PermLookup lp=null;
Map<String, PermLookup> permMap = trans.get(Question.PERMS, null);
if (permMap == null) {
- trans.put(Question.PERMS, permMap = new HashMap<String, PermLookup>());
+ trans.put(Question.PERMS, permMap = new HashMap<>());
} else {
lp = permMap.get(user);
}
} else {
lp = permMap.get(user);
}
if(userRoles==null) {
userRoles = q.userRoleDAO.readByUser(trans,user);
if(userRoles.isOKhasData()) {
if(userRoles==null) {
userRoles = q.userRoleDAO.readByUser(trans,user);
if(userRoles.isOKhasData()) {
- List<UserRoleDAO.Data> lurdd = new ArrayList<UserRoleDAO.Data>();
+ List<UserRoleDAO.Data> lurdd = new ArrayList<>();
Date now = new Date();
for(UserRoleDAO.Data urdd : userRoles.value) {
if(urdd.expires.after(now)) { // Remove Expired
Date now = new Date();
for(UserRoleDAO.Data urdd : userRoles.value) {
if(urdd.expires.after(now)) { // Remove Expired
if(roles==null) {
Result<List<UserRoleDAO.Data>> rur = getUserRoles();
if(rur.isOK()) {
if(roles==null) {
Result<List<UserRoleDAO.Data>> rur = getUserRoles();
if(rur.isOK()) {
- List<RoleDAO.Data> lrdd = new ArrayList<RoleDAO.Data>();
+ List<RoleDAO.Data> lrdd = new ArrayList<>();
for (UserRoleDAO.Data urdata : rur.value) {
// Gather all permissions from all Roles
if(urdata.ns==null || urdata.rname==null) {
for (UserRoleDAO.Data urdata : rur.value) {
// Gather all permissions from all Roles
if(urdata.ns==null || urdata.rname==null) {
if(permNames==null) {
Result<List<RoleDAO.Data>> rlrd = getRoles();
if (rlrd.isOK()) {
if(permNames==null) {
Result<List<RoleDAO.Data>> rlrd = getRoles();
if (rlrd.isOK()) {
- Set<String> pns = new TreeSet<String>();
+ Set<String> pns = new TreeSet<>();
for (RoleDAO.Data rdata : rlrd.value) {
pns.addAll(rdata.perms(false));
}
for (RoleDAO.Data rdata : rlrd.value) {
pns.addAll(rdata.perms(false));
}
// Jonathan 8/12/2013
Result<Set<String>> rss = getPermNames();
if(rss.isOK()) {
// Jonathan 8/12/2013
Result<Set<String>> rss = getPermNames();
if(rss.isOK()) {
- List<PermDAO.Data> lpdd = new ArrayList<PermDAO.Data>();
+ List<PermDAO.Data> lpdd = new ArrayList<>();
for (String perm : rss.value) {
if(lookup) {
Result<String[]> ap = PermDAO.Data.decodeToArray(trans, q, perm);
for (String perm : rss.value) {
if(lookup) {
Result<String[]> ap = PermDAO.Data.decodeToArray(trans, q, perm);
nss = null;
} else {
// Setup a TreeSet to check on Namespaces to
nss = null;
} else {
// Setup a TreeSet to check on Namespaces to
- nss = new TreeSet<String>();
PermLookup fUser = PermLookup.get(trans, this, forUser);
Result<Set<String>> forUpn = fUser.getPermNames();
if(forUpn.notOK()) {
PermLookup fUser = PermLookup.get(trans, this, forUser);
Result<Set<String>> forUpn = fUser.getPermNames();
if(forUpn.notOK()) {
- List<PermDAO.Data> rlpUser = new ArrayList<PermDAO.Data>();
+ List<PermDAO.Data> rlpUser = new ArrayList<>();
Result<PermDAO.Data> rpdd;
PermDAO.Data pdd;
for(String pn : plPermNames.value) {
Result<PermDAO.Data> rpdd;
PermDAO.Data pdd;
for(String pn : plPermNames.value) {
return Result.err(rlrd);
}
// Using Set to avoid duplicates
return Result.err(rlrd);
}
// Using Set to avoid duplicates
- Set<String> permNames = new HashSet<String>();
+ Set<String> permNames = new HashSet<>();
if (rlrd.isOKhasData()) {
for (RoleDAO.Data drr : rlrd.value) {
permNames.addAll(drr.perms(false));
if (rlrd.isOKhasData()) {
for (RoleDAO.Data drr : rlrd.value) {
permNames.addAll(drr.perms(false));
// Note: It should be ok for a Valid user to have no permissions -
// Jonathan 8/12/2013
// Note: It should be ok for a Valid user to have no permissions -
// Jonathan 8/12/2013
- List<PermDAO.Data> perms = new ArrayList<PermDAO.Data>();
+ List<PermDAO.Data> perms = new ArrayList<>();
for (String perm : permNames) {
Result<PermDAO.Data> pr = PermDAO.Data.decode(trans, this, perm);
if (pr.notOK()) {
for (String perm : permNames) {
Result<PermDAO.Data> pr = PermDAO.Data.decode(trans, this, perm);
if (pr.notOK()) {
// Bug noticed 6/22. Sorting on the result can cause Concurrency Issues.
List<CredDAO.Data> cddl;
if(result.value.size() > 1) {
// Bug noticed 6/22. Sorting on the result can cause Concurrency Issues.
List<CredDAO.Data> cddl;
if(result.value.size() > 1) {
- cddl = new ArrayList<CredDAO.Data>(result.value.size());
+ cddl = new ArrayList<>(result.value.size());
for(CredDAO.Data old : result.value) {
if(old.type==CredDAO.BASIC_AUTH || old.type==CredDAO.BASIC_AUTH_SHA256) {
cddl.add(old);
for(CredDAO.Data old : result.value) {
if(old.type==CredDAO.BASIC_AUTH || old.type==CredDAO.BASIC_AUTH_SHA256) {
cddl.add(old);
public static synchronized boolean specialLogOn(AuthzTrans trans, String id) {
if (specialLog == null) {
public static synchronized boolean specialLogOn(AuthzTrans trans, String id) {
if (specialLog == null) {
- specialLog = new HashSet<String>();
+ specialLog = new HashSet<>();
}
boolean rc = specialLog.add(id);
if(rc) {
}
boolean rc = specialLog.add(id);
if(rc) {
AuthzTrans trans = env.newTransNoAvg();
Result<List<Data>> rl = ldao.readByName(trans, name);
if(rl.isOK()) {
AuthzTrans trans = env.newTransNoAvg();
Result<List<Data>> rl = ldao.readByName(trans, name);
if(rl.isOK()) {
- LinkedList<EP> epl = new LinkedList<EP>();
+ LinkedList<EP> epl = new LinkedList<>();
for(Data d : rl.value) {
// if(myhostname!=null && d.port==myport && d.hostname.equals(myhostname)) {
// continue;
for(Data d : rl.value) {
// if(myhostname!=null && d.port==myport && d.hostname.equals(myhostname)) {
// continue;
@Test
public void testInvalidate(){
Cached<Trans, DataStub> cached = new Cached<Trans, DataStub>(ciDaoMock, name, 5, 30000L);
@Test
public void testInvalidate(){
Cached<Trans, DataStub> cached = new Cached<Trans, DataStub>(ciDaoMock, name, 5, 30000L);
- cached.add("test", new ArrayList<DataStub>());
+ cached.add("test", new ArrayList<>());
cached.invalidate("test");
cached.invalidate("test1");
}
cached.invalidate("test");
cached.invalidate("test1");
}
public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions";
public static final String LATITUDE = "LATITUDE";
public static final String LONGITUDE = "LONGITUDE";
public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions";
public static final String LATITUDE = "LATITUDE";
public static final String LONGITUDE = "LONGITUDE";
- //private static final List<Resettable> resetExceptions = new ArrayList<Resettable>();
+ //private static final List<Resettable> resetExceptions = new ArrayList<>();
public static final String ERR_ACCESS_MSG = "Accessing Backend";
private static Builder cb = null;
@Mock
public static final String ERR_ACCESS_MSG = "Accessing Backend";
private static Builder cb = null;
@Mock
public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
private static final String USER_PERMS = "userPerms";
public class AAF_CM extends AbsService<AuthzEnv, AuthzTrans> {
private static final String USER_PERMS = "userPerms";
- private static final Map<String,CA> certAuths = new TreeMap<String,CA>();
+ private static final Map<String,CA> certAuths = new TreeMap<>();
public Facade1_0 facade1_0; // this is the default Facade
public Facade1_0 facade1_0_XML; // this is the XML Facade
public Map<String, Dated> cacheUser;
public Facade1_0 facade1_0; // this is the default Facade
public Facade1_0 facade1_0_XML; // this is the XML Facade
public Map<String, Dated> cacheUser;
private static final String CM_TRUST_CAS = "cm_trust_cas";
protected static final String CM_BACKUP_CAS = "cm_backup_cas";
private static final String CM_TRUST_CAS = "cm_trust_cas";
protected static final String CM_BACKUP_CAS = "cm_backup_cas";
- public static final Set<String> EMPTY = Collections.unmodifiableSet(new HashSet<String>());
+ public static final Set<String> EMPTY = Collections.unmodifiableSet(new HashSet<>());
private final String name;
private final String name;
* @throws CertException
*/
public static List<RDN> parse(final char delim, final String dnString ) throws CertException {
* @throws CertException
*/
public static List<RDN> parse(final char delim, final String dnString ) throws CertException {
- List<RDN> lrnd = new ArrayList<RDN>();
+ List<RDN> lrnd = new ArrayList<>();
StringBuilder sb = new StringBuilder();
boolean inQuotes = false;
for(int i=0;i<dnString.length();++i) {
StringBuilder sb = new StringBuilder();
boolean inQuotes = false;
for(int i=0;i<dnString.length();++i) {
jks.load(null, cap);
// Get the Cert(s)... Might include Trust store
jks.load(null, cap);
// Get the Cert(s)... Might include Trust store
- List<String> lcerts = new ArrayList<String>();
+ List<String> lcerts = new ArrayList<>();
lcerts.add(cr.asCertString());
for(String s : trustChain) {
lcerts.add(s);
lcerts.add(cr.asCertString());
for(String s : trustChain) {
lcerts.add(s);
*/
@Override
public List<ArtiDAO.Data> toArtifact(AuthzTrans trans, Artifacts artifacts) {
*/
@Override
public List<ArtiDAO.Data> toArtifact(AuthzTrans trans, Artifacts artifacts) {
- List<ArtiDAO.Data> ladd = new ArrayList<ArtiDAO.Data>();
+ List<ArtiDAO.Data> ladd = new ArrayList<>();
for(Artifact arti : artifacts.getArtifact()) {
ArtiDAO.Data data = new ArtiDAO.Data();
data.mechid = arti.getMechid();
for(Artifact arti : artifacts.getArtifact()) {
ArtiDAO.Data data = new ArtiDAO.Data();
data.mechid = arti.getMechid();
}
List<String> notes = null;
}
List<String> notes = null;
- List<String> fqdns = new ArrayList<String>(req.value.fqdns);
+ List<String> fqdns = new ArrayList<>(req.value.fqdns);
for(String cn : req.value.fqdns) {
try {
InetAddress[] ias = InetAddress.getAllByName(cn);
for(String cn : req.value.fqdns) {
try {
InetAddress[] ias = InetAddress.getAllByName(cn);
- Set<String> potentialSanNames = new HashSet<String>();
+ Set<String> potentialSanNames = new HashSet<>();
for(InetAddress ia1 : ias) {
InetAddress ia2 = InetAddress.getByAddress(ia1.getAddress());
if(primary==null && ias.length==1 && trans.ip().equals(ia1.getHostAddress())) {
for(InetAddress ia1 : ias) {
InetAddress ia2 = InetAddress.getByAddress(ia1.getAddress());
if(primary==null && ias.length==1 && trans.ip().equals(ia1.getHostAddress())) {
// }
// },
// new AAFPermission(ca.getPermType(), ca.getName(), SANS))) {
// }
// },
// new AAFPermission(ca.getPermType(), ca.getName(), SANS))) {
-// if(notes==null) {notes = new ArrayList<String>();}
+// if(notes==null) {notes = new ArrayList<>();}
// notes.add("Warning: Subject Alternative Names only allowed by Permission: Get CSO Exception.");
// return Result.err(Status.ERR_Denied, "%s must have a CSO Exception to work with SAN",trans.user());
// }
// notes.add("Warning: Subject Alternative Names only allowed by Permission: Get CSO Exception.");
// return Result.err(Status.ERR_Denied, "%s must have a CSO Exception to work with SAN",trans.user());
// }
- X509andChain xac = new X509andChain(cert, new ArrayList<String>());
+ X509andChain xac = new X509andChain(cert, new ArrayList<>());
when(localCA.sign(Mockito.any(Trans.class), Mockito.any(CSRMeta.class))).thenReturn(xac);
certDAO = mock(CachedCertDAO.class, CALLS_REAL_METHODS);
}
when(localCA.sign(Mockito.any(Trans.class), Mockito.any(CSRMeta.class))).thenReturn(xac);
certDAO = mock(CachedCertDAO.class, CALLS_REAL_METHODS);
}
private List<Cmd> cmds;
// Lex State
private List<Cmd> cmds;
// Lex State
- private ArrayList<Integer> expect = new ArrayList<Integer>();
+ private ArrayList<Integer> expect = new ArrayList<>();
private boolean verbose = true;
private int delay;
private SecurityInfoC<HttpURLConnection> si;
private boolean verbose = true;
private int delay;
private SecurityInfoC<HttpURLConnection> si;
- cmds = new ArrayList<Cmd>();
+ cmds = new ArrayList<>();
Role role = new Role(this);
cmds.add(new Help(this, cmds));
Role role = new Role(this);
cmds.add(new Help(this, cmds));
private String[] argEval(String line) {
StringBuilder sb = new StringBuilder();
private String[] argEval(String line) {
StringBuilder sb = new StringBuilder();
- ArrayList<String> arr = new ArrayList<String>();
+ ArrayList<String> arr = new ArrayList<>();
boolean start = true;
char quote = 0;
char last = 0;
boolean start = true;
char quote = 0;
char last = 0;
public BaseCmd(AAFcli aafcli, String name, Param ... params) {
super(aafcli, null, name, params);
public BaseCmd(AAFcli aafcli, String name, Param ... params) {
super(aafcli, null, name, params);
- cmds = new ArrayList<Cmd>();
+ cmds = new ArrayList<>();
}
public BaseCmd(CMD parent, String name, Param ... params) {
super(parent.aafcli, parent, name, params);
}
public BaseCmd(CMD parent, String name, Param ... params) {
super(parent.aafcli, parent, name, params);
- cmds = new ArrayList<Cmd>();
+ cmds = new ArrayList<>();
private int required;
protected final Cmd parent;
protected final List<Cmd> children;
private int required;
protected final Cmd parent;
protected final List<Cmd> children;
- private final static ConcurrentHashMap<Class<?>,RosettaDF<?>> dfs = new ConcurrentHashMap<Class<?>,RosettaDF<?>>();
+ private final static ConcurrentHashMap<Class<?>,RosettaDF<?>> dfs = new ConcurrentHashMap<>();
public final AAFcli aafcli;
protected Access access;
private AuthzEnv env;
public final AAFcli aafcli;
protected Access access;
private AuthzEnv env;
if(parent!=null) {
parent.children.add(this);
}
if(parent!=null) {
parent.children.add(this);
}
- children = new ArrayList<Cmd>();
+ children = new ArrayList<>();
this.params = params;
this.name = name;
required=0;
this.params = params;
this.name = name;
required=0;
Future<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class));
if(fn.get(AAFcli.timeout())) {
if(fn.value!=null) {
Future<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class));
if(fn.get(AAFcli.timeout())) {
if(fn.value!=null) {
- Set<String> uset = detail?null:new HashSet<String>();
+ Set<String> uset = detail?null:new HashSet<>();
for(Ns n : fn.value.getNs()) {
Future<Roles> fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class));
if(fr.get(AAFcli.timeout())) {
for(Ns n : fn.value.getNs()) {
Future<Roles> fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class));
if(fr.get(AAFcli.timeout())) {
Future<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class));
if(fn.get(AAFcli.timeout())) {
if(fn.value!=null) {
Future<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class));
if(fn.get(AAFcli.timeout())) {
if(fn.value!=null) {
- Set<String> uset = detail?null:new HashSet<String>();
+ Set<String> uset = detail?null:new HashSet<>();
for(Ns n : fn.value.getNs()) {
Future<Roles> fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class));
if(fr.get(AAFcli.timeout())) {
for(Ns n : fn.value.getNs()) {
Future<Roles> fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class));
if(fr.get(AAFcli.timeout())) {
Future<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class));
if(fn.get(AAFcli.timeout())) {
if(fn.value!=null) {
Future<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class));
if(fn.get(AAFcli.timeout())) {
if(fn.value!=null) {
- Set<String> uset = detail?null:new HashSet<String>();
+ Set<String> uset = detail?null:new HashSet<>();
for(Ns n : fn.value.getNs()) {
Future<Perms> fp = client.read("/authz/perms/ns/"+n.getName()+(aafcli.isDetailed()?"?ns":"")
for(Ns n : fn.value.getNs()) {
Future<Perms> fp = client.read("/authz/perms/ns/"+n.getName()+(aafcli.isDetailed()?"?ns":"")
private class NssStub extends Nss {
public void addNs(Nss.Ns ns) {
if (this.ns == null) {
private class NssStub extends Nss {
public void addNs(Nss.Ns ns) {
if (this.ns == null) {
- this.ns = new ArrayList<Nss.Ns>();
+ this.ns = new ArrayList<>();
private class NsStub extends Ns{
public void addAttrib(Nss.Ns.Attrib attrib) {
if ( this.attrib == null) {
private class NsStub extends Ns{
public void addAttrib(Nss.Ns.Attrib attrib) {
if ( this.attrib == null) {
- this.attrib = new ArrayList<Nss.Ns.Attrib>();
+ this.attrib = new ArrayList<>();
}
this.attrib.add(attrib);
}
public void addResponsible(String str) {
if (this.responsible == null) {
}
this.attrib.add(attrib);
}
public void addResponsible(String str) {
if (this.responsible == null) {
- this.responsible = new ArrayList<String>();
+ this.responsible = new ArrayList<>();
}
this.responsible.add(str);
}
public void addAdmin(String str) {
if (this.admin == null) {
}
this.responsible.add(str);
}
public void addAdmin(String str) {
if (this.admin == null) {
- this.admin = new ArrayList<String>();
+ this.admin = new ArrayList<>();
private class RolesStub extends Roles {
public void addRole(aaf.v2_0.Role role) {
if (this.role == null) {
private class RolesStub extends Roles {
public void addRole(aaf.v2_0.Role role) {
if (this.role == null) {
- this.role = new ArrayList<aaf.v2_0.Role>();
+ this.role = new ArrayList<>();
public void addPerms(Pkey perms) {
if (this.perms == null) {
public void addPerms(Pkey perms) {
if (this.perms == null) {
- this.perms = new ArrayList<Pkey>();
+ this.perms = new ArrayList<>();
}
this.perms.add(perms);
}
}
this.perms.add(perms);
}
- List<Integer> entries = new ArrayList<Integer>();
+ List<Integer> entries = new ArrayList<>();
for(int i=min;i<=max;++i) {
ttok.pos(i*REC_SIZE);
tib.rewind();
for(int i=min;i<=max;++i) {
ttok.pos(i*REC_SIZE);
tib.rewind();
public void create(final Trans trans,final DataFile data, int maxLine, char delim, int fieldOffset, int skipLines) throws IOException {
FileChannel fos;
public void create(final Trans trans,final DataFile data, int maxLine, char delim, int fieldOffset, int skipLines) throws IOException {
FileChannel fos;
- List<Idx> list = new LinkedList<Idx>(); // Some hashcodes will double... DO NOT make a set
+ List<Idx> list = new LinkedList<>(); // Some hashcodes will double... DO NOT make a set
TimeTaken tt2 = trans.start("Open Files", Env.SUB);
RandomAccessFile raf=null;
try {
TimeTaken tt2 = trans.start("Open Files", Env.SUB);
RandomAccessFile raf=null;
try {
public static final Organization NULL = new Organization()
{
private final GregorianCalendar gc = new GregorianCalendar(1900, 1, 1);
public static final Organization NULL = new Organization()
{
private final GregorianCalendar gc = new GregorianCalendar(1900, 1, 1);
- private final List<Identity> nullList = new ArrayList<Identity>();
- private final Set<String> nullStringSet = new HashSet<String>();
+ private final List<Identity> nullList = new ArrayList<>();
+ private final Set<String> nullStringSet = new HashSet<>();
private String[] nullStringArray = new String[0];
private final Identity nullIdentity = new Identity() {
private String[] nullStringArray = new String[0];
private final Identity nullIdentity = new Identity() {
- List<String> nullUser = new ArrayList<String>();
+ List<String> nullUser = new ArrayList<>();
@Override
public String type() {
return N_A;
@Override
public String type() {
return N_A;
public class OrganizationFactory {
private static final String ORGANIZATION_DOT = "Organization.";
private static Organization defaultOrg = null;
public class OrganizationFactory {
private static final String ORGANIZATION_DOT = "Organization.";
private static Organization defaultOrg = null;
- private static Map<String,Organization> orgs = new ConcurrentHashMap<String,Organization>();
+ private static Map<String,Organization> orgs = new ConcurrentHashMap<>();
public static Organization init(BasicEnv env) throws OrganizationException {
int idx = ORGANIZATION_DOT.length();
Organization org,firstOrg = null;
public static Organization init(BasicEnv env) throws OrganizationException {
int idx = ORGANIZATION_DOT.length();
Organization org,firstOrg = null;
public Acceptor(List<Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>>> types) {
this.types = types;
public Acceptor(List<Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>>> types) {
this.types = types;
- acceptable = new ArrayList<Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>>>();
+ acceptable = new ArrayList<>();
}
private boolean eval(HttpCode<TRANS,?> code, String str, List<String> props) {
}
private boolean eval(HttpCode<TRANS,?> code, String str, List<String> props) {
int cis,cie=-1,cend;
int sis,sie,send;
String name;
int cis,cie=-1,cend;
int sis,sie,send;
String name;
- ArrayList<String> props = new ArrayList<String>();
+ ArrayList<String> props = new ArrayList<>();
do {
// Clear these in case more than one Semi
props.clear(); // on loop, do not want mixed properties
do {
// Clear these in case more than one Semi
props.clear(); // on loop, do not want mixed properties
public CachingFileAccess(EnvJAXB env, String ... args) throws IOException {
super(null,"Caching File Access");
setEnv(env,args);
public CachingFileAccess(EnvJAXB env, String ... args) throws IOException {
super(null,"Caching File Access");
setEnv(env,args);
- content = new ConcurrentSkipListMap<String,Content>(); // multi-thread changes possible
+ content = new ConcurrentSkipListMap<>(); // multi-thread changes possible
- attachOnly = new HashSet<String>(); // short, unchanged
+ attachOnly = new HashSet<>(); // short, unchanged
- typeMap = new TreeMap<String,String>(); // Structure unchanged after Construction
+ typeMap = new TreeMap<>(); // Structure unchanged after Construction
typeMap.put("ico","image/icon");
typeMap.put("html","text/html");
typeMap.put("css","text/css");
typeMap.put("ico","image/icon");
typeMap.put("html","text/html");
typeMap.put("css","text/css");
public void run() {
int size = content.size();
if(size>maxSize) {
public void run() {
int size = content.size();
if(size>maxSize) {
- ArrayList<Comp> scont = new ArrayList<Comp>(size);
+ ArrayList<Comp> scont = new ArrayList<>(size);
Object[] entries = content.entrySet().toArray();
for(int i=0;i<size;++i) {
scont.add(i, new Comp((Map.Entry<String,Content>)entries[i]));
Object[] entries = content.entrySet().toArray();
for(int i=0;i<size;++i) {
scont.add(i, new Comp((Map.Entry<String,Content>)entries[i]));
*/
public Match(String path) {
// IF DEBUG: System.out.print("\n[" + path + "]");
*/
public Match(String path) {
// IF DEBUG: System.out.print("\n[" + path + "]");
- params = new HashMap<String,Integer>();
+ params = new HashMap<>();
if(path!=null) {
String[] pa = path.split("/");
values = new byte[pa.length][];
if(path!=null) {
String[] pa = path.split("/");
values = new byte[pa.length][];
public HttpMethods meth;
public String path;
public String desc;
public HttpMethods meth;
public String path;
public String desc;
- public final List<String> contextTypes = new ArrayList<String>();
+ public final List<String> contextTypes = new ArrayList<>();
}
public List<RouteReport> routeReport() {
}
public List<RouteReport> routeReport() {
- ArrayList<RouteReport> ltr = new ArrayList<RouteReport>();
+ ArrayList<RouteReport> ltr = new ArrayList<>();
for(int i=0;i<end;++i) {
ltr.add(routes[i].api());
}
for(int i=0;i<end;++i) {
ltr.add(routes[i].api());
}
private List<Pair<String, Pair<HttpCode<TRANS,?>,List<Pair<String, Object>>>>> types;
public TypedCode() {
private List<Pair<String, Pair<HttpCode<TRANS,?>,List<Pair<String, Object>>>>> types;
public TypedCode() {
- types = new ArrayList<Pair<String,Pair<HttpCode<TRANS,?>,List<Pair<String,Object>>>>>();
+ types = new ArrayList<>();
@Override
protected Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>> types(HttpCode<TRANS,?> code, String str) {
Pair<String, Pair<HttpCode<TRANS,?>,List<Pair<String, Object>>>> type = null;
@Override
protected Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>> types(HttpCode<TRANS,?> code, String str) {
Pair<String, Pair<HttpCode<TRANS,?>,List<Pair<String, Object>>>> type = null;
- ArrayList<Pair<String, Object>> props = new ArrayList<Pair<String,Object>>();
+ ArrayList<Pair<String, Object>> props = new ArrayList<>();
// Want Q percentage is to be first in the array everytime. If not listed, 1.0 is default
props.add(new Pair<String,Object>(Q,1f));
Pair<HttpCode<TRANS,?>, List<Pair<String,Object>>> cl = new Pair<HttpCode<TRANS,?>, List<Pair<String,Object>>>(code, props);
// Want Q percentage is to be first in the array everytime. If not listed, 1.0 is default
props.add(new Pair<String,Object>(Q,1f));
Pair<HttpCode<TRANS,?>, List<Pair<String,Object>>> cl = new Pair<HttpCode<TRANS,?>, List<Pair<String,Object>>>(code, props);
public void api(RouteReport tr) {
// Need to build up a map, because Prop entries can be in several places.
public void api(RouteReport tr) {
// Need to build up a map, because Prop entries can be in several places.
- HashMap<HttpCode<?,?>,StringBuilder> psb = new HashMap<HttpCode<?,?>,StringBuilder>();
+ HashMap<HttpCode<?,?>,StringBuilder> psb = new HashMap<>();
StringBuilder temp;
tr.desc = null;
StringBuilder temp;
tr.desc = null;
private StringBuilder msgs;
static {
private StringBuilder msgs;
static {
- nsKeywords = new ArrayList<String>();
+ nsKeywords = new ArrayList<>();
nsKeywords.add(".access");
nsKeywords.add(".owner");
nsKeywords.add(".admin");
nsKeywords.add(".access");
nsKeywords.add(".owner");
nsKeywords.add(".admin");
Collection<String> col1 = new ArrayList();
List<String> list1 = new ArrayList();
Collection<String> col1 = new ArrayList();
List<String> list1 = new ArrayList();
- Set<String> set1 = new HashSet<String>();
+ Set<String> set1 = new HashSet<>();
Integer[] R1 = new Integer[0];
set1.add("derp");
list1.add("test");
Integer[] R1 = new Integer[0];
set1.add("derp");
list1.add("test");
// File file = new File("../authz-batch/data/v1.dat");
// DataFile df = new DataFile(file,"r");
// int count = 0;
// File file = new File("../authz-batch/data/v1.dat");
// DataFile df = new DataFile(file,"r");
// int count = 0;
-// List<String> list = new ArrayList<String>();
+// List<String> list = new ArrayList<>();
// try {
// df.open();
// Token tok = df.new Token(1024000);
// try {
// df.open();
// Token tok = df.new Token(1024000);
@Test
public void testCleanupParams() {
@Test
public void testCleanupParams() {
- NavigableMap<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<String,org.onap.aaf.auth.rserv.Content>();
+ NavigableMap<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<>();
cachingFileAccess.cleanupParams(50, 500); //TODO: find right input
}
cachingFileAccess.cleanupParams(50, 500); //TODO: find right input
}
@Test
public void testInvalidate() {
@Test
public void testInvalidate() {
- //NavigableMap<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<String,org.onap.aaf.auth.rserv.Content>();
+ //NavigableMap<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<>();
//Content con = mock(Content.class);
//content.put("hello", con);
cachingFileAccess.invalidate("hello");
//Content con = mock(Content.class);
//content.put("hello", con);
cachingFileAccess.invalidate("hello");
public DefaultOrg(Env env, String realm) throws OrganizationException {
this.realm = realm;
public DefaultOrg(Env env, String realm) throws OrganizationException {
this.realm = realm;
- supportedRealms=new HashSet<String>();
+ supportedRealms=new HashSet<>();
supportedRealms.add(realm);
domain=FQI.reverseDomain(realm);
atDomain = '@'+domain;
supportedRealms.add(realm);
domain=FQI.reverseDomain(realm);
atDomain = '@'+domain;
}
// Implement your own Delegation System
}
// Implement your own Delegation System
- static final List<String> NULL_DELEGATES = new ArrayList<String>();
+ static final List<String> NULL_DELEGATES = new ArrayList<>();
public Identities identities;
private boolean dryRun;
public Identities identities;
private boolean dryRun;
private final static Set<String> typeSet;
static {
private final static Set<String> typeSet;
static {
- typeSet = new HashSet<String>();
+ typeSet = new HashSet<>();
for(Types t : Types.values()) {
typeSet.add(t.name());
}
for(Types t : Types.values()) {
typeSet.add(t.name());
}
public Response notify(AuthzTrans trans, Notify type, String url, String[] identities, String[] ccs, String summary, Boolean urgent) {
String system = trans.getProperty("CASS_ENV", "");
public Response notify(AuthzTrans trans, Notify type, String url, String[] identities, String[] ccs, String summary, Boolean urgent) {
String system = trans.getProperty("CASS_ENV", "");
- ArrayList<String> toList = new ArrayList<String>();
+ ArrayList<String> toList = new ArrayList<>();
Identity identity;
if (identities != null) {
for (String user : identities) {
Identity identity;
if (identities != null) {
for (String user : identities) {
return Response.ERR_NotificationFailure;
}
return Response.ERR_NotificationFailure;
}
- ArrayList<String> ccList = new ArrayList<String>();
+ ArrayList<String> ccList = new ArrayList<>();
// If we're sending an urgent email, CC the user's supervisor
//
// If we're sending an urgent email, CC the user's supervisor
//
- List<String> to = new ArrayList<String>();
+ List<String> to = new ArrayList<>();
for(String em : toList) {
if(em.indexOf('@')<0) {
to.add(new DefaultOrgIdentity(trans, em, this).email());
for(String em : toList) {
if(em.indexOf('@')<0) {
to.add(new DefaultOrgIdentity(trans, em, this).email());
- List<String> cc = new ArrayList<String>();
+ List<String> cc = new ArrayList<>();
if(ccList!=null) {
if(!ccList.isEmpty()) {
if(ccList!=null) {
if(!ccList.isEmpty()) {
message.addHeader("X-Priority", "1");
}
message.addHeader("X-Priority", "1");
}
- ArrayList<String> newBody = new ArrayList<String>();
+ ArrayList<String> newBody = new ArrayList<>();
Address temp[] = getAddresses(to);
String headerString = "TO:\t" + InternetAddress.toString(temp) + "\n";
Address temp[] = getAddresses(to);
String headerString = "TO:\t" + InternetAddress.toString(temp) + "\n";
@Override
public List<Identity> getApprovers(AuthzTrans trans, String user) throws OrganizationException {
Identity orgIdentity = getIdentity(trans, user);
@Override
public List<Identity> getApprovers(AuthzTrans trans, String user) throws OrganizationException {
Identity orgIdentity = getIdentity(trans, user);
- List<Identity> orgIdentitys = new ArrayList<Identity>();
+ List<Identity> orgIdentitys = new ArrayList<>();
if(orgIdentity!=null) {
Identity supervisor = orgIdentity.responsibleTo();
if(supervisor!=null) {
if(orgIdentity!=null) {
Identity supervisor = orgIdentity.responsibleTo();
if(supervisor!=null) {
public final boolean no_cache;
// Note: Only access is synchronized in "getPerm"
public final boolean no_cache;
// Note: Only access is synchronized in "getPerm"
- private final static Map<String,Map<String,Permission>> perms = new HashMap<String,Map<String,Permission>>();
+ private final static Map<String,Map<String,Permission>> perms = new HashMap<>();
public String name() {
return bcName;
public String name() {
return bcName;
Map<String,Permission> msp = perms.get(instance);
Permission p;
if(msp==null) {
Map<String,Permission> msp = perms.get(instance);
Permission p;
if(msp==null) {
- msp = new HashMap<String,Permission>();
perms.put(instance, msp);
p=null;
} else {
perms.put(instance, msp);
p=null;
} else {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
- final ArrayList<AbsCell[]> ns = new ArrayList<AbsCell[]>();
- final ArrayList<AbsCell[]> perms = new ArrayList<AbsCell[]>();
- final ArrayList<AbsCell[]> roles = new ArrayList<AbsCell[]>();
- final ArrayList<AbsCell[]> user = new ArrayList<AbsCell[]>();
- final ArrayList<AbsCell[]> aafOnly = new ArrayList<AbsCell[]>();
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> ns = new ArrayList<>();
+ final ArrayList<AbsCell[]> perms = new ArrayList<>();
+ final ArrayList<AbsCell[]> roles = new ArrayList<>();
+ final ArrayList<AbsCell[]> user = new ArrayList<>();
+ final ArrayList<AbsCell[]> aafOnly = new ArrayList<>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
final TimeTaken tt = trans.start("AAF APIs",Env.REMOTE);
final TimeTaken tt = trans.start("AAF APIs",Env.REMOTE);
return Cells.EMPTY;
}
final String id = str.indexOf('@')>=0?str:str + '@' + FQI.reverseDomain(sc.get(trans,Params.ns, ""));
return Cells.EMPTY;
}
final String id = str.indexOf('@')>=0?str:str + '@' + FQI.reverseDomain(sc.get(trans,Params.ns, ""));
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
final TimeTaken tt = trans.start("AAF X509 Details",Env.REMOTE);
try {
gui.cmClientAsUser(trans.getUserPrincipal(),new Retryable<Void>() {
final TimeTaken tt = trans.start("AAF X509 Details",Env.REMOTE);
try {
gui.cmClientAsUser(trans.getUserPrincipal(),new Retryable<Void>() {
if(ns==null) {
return Cells.EMPTY;
}
if(ns==null) {
return Cells.EMPTY;
}
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
final TimeTaken tt = trans.start("AAF Cred Details",Env.REMOTE);
List<Artifact> la;
try {
final TimeTaken tt = trans.start("AAF Cred Details",Env.REMOTE);
List<Artifact> la;
try {
- final Set<String> lns = new HashSet<String>();
+ final Set<String> lns = new HashSet<>();
if(la!=null) {
for(Artifact a : la){
lns.add(a.getMechid());
if(la!=null) {
for(Artifact a : la){
lns.add(a.getMechid());
Future<Users> fu = client.read("/authn/creds/ns/"+ns,gui.getDF(Users.class));
if(fu.get(AAFcli.timeout())) {
// Organize User entries
Future<Users> fu = client.read("/authn/creds/ns/"+ns,gui.getDF(Users.class));
if(fu.get(AAFcli.timeout())) {
// Organize User entries
- Map<String,List<Map<Integer,List<User>>>> users = new HashMap<String,List<Map<Integer,List<User>>>>();
+ Map<String,List<Map<Integer,List<User>>>> users = new HashMap<>();
List<Map<Integer,List<User>>> lmu=null;
Map<Integer, List<User>> mu = null;
List<Map<Integer,List<User>>> lmu=null;
Map<Integer, List<User>> mu = null;
}
lmu = users.get(u.getId());
if(lmu==null) {
}
lmu = users.get(u.getId());
if(lmu==null) {
- users.put(u.getId(),lmu=new ArrayList<Map<Integer,List<User>>>());
+ users.put(u.getId(),lmu=new ArrayList<>());
}
mu=null;
for(Map<Integer,List<User>> xmu : lmu) {
}
mu=null;
for(Map<Integer,List<User>> xmu : lmu) {
- lmu.add(mu=new HashMap<Integer,List<User>>());
+ lmu.add(mu=new HashMap<>());
}
lu = mu.get(u.getType());
if(lu==null) {
}
lu = mu.get(u.getType());
if(lu==null) {
- mu.put(u.getType(),lu = new ArrayList<User>());
+ mu.put(u.getType(),lu = new ArrayList<>());
if(nsName==null) {
return Cells.EMPTY;
}
if(nsName==null) {
return Cells.EMPTY;
}
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
rv.add(new AbsCell[]{new TextCell("Name:"),new TextCell(nsName)});
final TimeTaken tt = trans.start("AAF Namespace Details",Env.REMOTE);
rv.add(new AbsCell[]{new TextCell("Name:"),new TextCell(nsName)});
final TimeTaken tt = trans.start("AAF Namespace Details",Env.REMOTE);
"/authz/roles/ns/"+nsName,
gui.getDF(Roles.class)
);
"/authz/roles/ns/"+nsName,
gui.getDF(Roles.class)
);
- List<String> roles = new ArrayList<String>();
+ List<String> roles = new ArrayList<>();
if(fr.get(AAFcli.timeout())) {
for (Role r : fr.value.getRole()) {
roles.add(r.getName());
if(fr.get(AAFcli.timeout())) {
for (Role r : fr.value.getRole()) {
roles.add(r.getName());
"/authz/perms/ns/"+nsName,
gui.getDF(Perms.class)
);
"/authz/perms/ns/"+nsName,
gui.getDF(Perms.class)
);
- List<String> perms = new ArrayList<String>();
+ List<String> perms = new ArrayList<>();
if(fp.get(AAFcli.timeout())) {
for (Perm p : fp.value.getPerm()) {
if(fp.get(AAFcli.timeout())) {
for (Perm p : fp.value.getPerm()) {
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
String msg = null;
final TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE);
try {
String msg = null;
final TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE);
try {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
- ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ ArrayList<AbsCell[]> rv = new ArrayList<>();
List<Ns> nss = trans.get(sNssByUser, null);
if(nss==null) {
TimeTaken tt = trans.start("AAF Nss by User for " + privilege,Env.REMOTE);
List<Ns> nss = trans.get(sNssByUser, null);
if(nss==null) {
TimeTaken tt = trans.start("AAF Nss by User for " + privilege,Env.REMOTE);
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
@Override
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
@Override
trans.warn().printf("Error in PermDetail Request: %s", v.errs());
return Cells.EMPTY;
}
trans.warn().printf("Error in PermDetail Request: %s", v.errs());
return Cells.EMPTY;
}
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
rv.add(new AbsCell[]{new TextCell("Type:"),new TextCell(pType)});
rv.add(new AbsCell[]{new TextCell("Instance:"),new TextCell(pInstance)});
rv.add(new AbsCell[]{new TextCell("Action:"),new TextCell(pAction)});
rv.add(new AbsCell[]{new TextCell("Type:"),new TextCell(pType)});
rv.add(new AbsCell[]{new TextCell("Instance:"),new TextCell(pInstance)});
rv.add(new AbsCell[]{new TextCell("Action:"),new TextCell(pAction)});
}
private static List<String> getMyRoles(final AAF_GUI gui, final AuthzTrans trans) {
}
private static List<String> getMyRoles(final AAF_GUI gui, final AuthzTrans trans) {
- final List<String> myRoles = new ArrayList<String>();
+ final List<String> myRoles = new ArrayList<>();
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
@Override
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
@Override
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
String msg = null;
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
String msg = null;
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
@Override
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
- final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ final ArrayList<AbsCell[]> rv = new ArrayList<>();
TimeTaken tt = trans.start("AAF Perms by User",Env.REMOTE);
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
TimeTaken tt = trans.start("AAF Perms by User",Env.REMOTE);
try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() {
@Override
public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException {
TimeTaken tt = trans.start("AAF Approval Details",Env.REMOTE);
@Override
public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException {
TimeTaken tt = trans.start("AAF Approval Details",Env.REMOTE);
- ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ ArrayList<AbsCell[]> rv = new ArrayList<>();
try {
Future<Approvals> fa = client.read(
"/authz/approval/ticket/"+ticket,
try {
Future<Approvals> fa = client.read(
"/authz/approval/ticket/"+ticket,
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
final String pRole = trans.get(sRoleName, null);
final Role role = trans.get(sRole,null);
public Cells get(final AuthzTrans trans, final AAF_GUI gui) {
final String pRole = trans.get(sRoleName, null);
final Role role = trans.get(sRole,null);
- ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ ArrayList<AbsCell[]> rv = new ArrayList<>();
if(role!=null) {
boolean mayWrite = trans.get(sMayWrite, false);
if(role!=null) {
boolean mayWrite = trans.get(sMayWrite, false);
/*fail =*/ gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Boolean>() {
@Override
public Boolean code(Rcli<?> client) throws CadiException, ConnectException, APIException {
/*fail =*/ gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Boolean>() {
@Override
public Boolean code(Rcli<?> client) throws CadiException, ConnectException, APIException {
- List<TypedFuture> ltf = new ArrayList<TypedFuture>();
+ List<TypedFuture> ltf = new ArrayList<>();
String text;
Map<String, String[]> pm = (Map<String, String[]>)req.getParameterMap();
for(final Entry<String, String[]> es : pm.entrySet()) {
String text;
Map<String, String[]> pm = (Map<String, String[]>)req.getParameterMap();
for(final Entry<String, String[]> es : pm.entrySet()) {
rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Cells>() {
@Override
public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException {
rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Cells>() {
@Override
public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException {
- ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>();
+ ArrayList<AbsCell[]> rv = new ArrayList<>();
TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE);
String msg = null;
try {
TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE);
String msg = null;
try {
private static long cacheClear = 0L, emptyCheck=0L;
private static long cacheClear = 0L, emptyCheck=0L;
- private final static Map<String,String> epsCache = new HashMap<String, String>(); // protected manually, in getEndpoints
+ private final static Map<String,String> epsCache = new HashMap<>(); // protected manually, in getEndpoints
public LocateFacadeImpl(AuthzEnv env, LocateService<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,CONFIGURATION,ERROR> service, Data.TYPE dataType) throws APIException {
this.service = service;
public LocateFacadeImpl(AuthzEnv env, LocateService<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,CONFIGURATION,ERROR> service, Data.TYPE dataType) throws APIException {
this.service = service;
\r
assertEquals(endPointResult, output);\r
\r
\r
assertEquals(endPointResult, output);\r
\r
- List<MgmtEndpoint> mgmtEndPoints = new ArrayList<MgmtEndpoint>();\r
+ List<MgmtEndpoint> mgmtEndPoints = new ArrayList<>();\r
mgmtEndPoints.add(mgmtEndPoint);\r
\r
when(mgmtEndPoint.getName()).thenReturn("http.Endpoint1");\r
mgmtEndPoints.add(mgmtEndPoint);\r
\r
when(mgmtEndPoint.getName()).thenReturn("http.Endpoint1");\r
public void testSubProtoCol() {\r
LocateValidator validator = new LocateValidator();\r
\r
public void testSubProtoCol() {\r
LocateValidator validator = new LocateValidator();\r
\r
- List<String> subProtocol = new ArrayList<String>();\r
+ List<String> subProtocol = new ArrayList<>();\r
subProtocol.add(null);\r
\r
when(endpoint.getName()).thenReturn("EndPoint.Endpoint1");\r
subProtocol.add(null);\r
\r
when(endpoint.getName()).thenReturn("EndPoint.Endpoint1");\r
when(endpoint.getHostname()).thenReturn("HOST1");\r
when(endpoint.getPort()).thenReturn(9090);\r
when(endpoint.getProtocol()).thenReturn("HTTP");\r
when(endpoint.getHostname()).thenReturn("HOST1");\r
when(endpoint.getPort()).thenReturn(9090);\r
when(endpoint.getProtocol()).thenReturn("HTTP");\r
- List<String> subprotocol = new ArrayList<String>();\r
+ List<String> subprotocol = new ArrayList<>();\r
when(endpoint.getSubprotocol()).thenReturn(subprotocol);\r
\r
when(endpoint.getSubprotocol()).thenReturn(subprotocol);\r
\r
- List<Endpoint> endpointList = new ArrayList<Endpoint>();\r
+ List<Endpoint> endpointList = new ArrayList<>();\r
endpointList.add(endpoint);\r
\r
when(mgmtEndpoint.getName()).thenReturn("EndPoint.Endpoint1");\r
when(mgmtEndpoint.getHostname()).thenReturn("HOST1");\r
when(mgmtEndpoint.getPort()).thenReturn(9090);\r
when(mgmtEndpoint.getProtocol()).thenReturn("HTTP");\r
endpointList.add(endpoint);\r
\r
when(mgmtEndpoint.getName()).thenReturn("EndPoint.Endpoint1");\r
when(mgmtEndpoint.getHostname()).thenReturn("HOST1");\r
when(mgmtEndpoint.getPort()).thenReturn(9090);\r
when(mgmtEndpoint.getProtocol()).thenReturn("HTTP");\r
- List<SpecialPorts> specialPorts = new ArrayList<SpecialPorts>();\r
+ List<SpecialPorts> specialPorts = new ArrayList<>();\r
specialPorts.add(null);\r
when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts);\r
specialPorts.add(null);\r
when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts);\r
- List<MgmtEndpoint> mgmtEndpoints = new ArrayList<MgmtEndpoint>();\r
+ List<MgmtEndpoint> mgmtEndpoints = new ArrayList<>();\r
mgmtEndpoints.add(mgmtEndpoint);\r
\r
when(endpoints.getEndpoint()).thenReturn(endpointList);\r
mgmtEndpoints.add(mgmtEndpoint);\r
\r
when(endpoints.getEndpoint()).thenReturn(endpointList);\r
when(mgmtEndpoint.getPort()).thenReturn(9090);\r
when(mgmtEndpoint.getProtocol()).thenReturn("HTTP");\r
\r
when(mgmtEndpoint.getPort()).thenReturn(9090);\r
when(mgmtEndpoint.getProtocol()).thenReturn("HTTP");\r
\r
- List<SpecialPorts> specialPorts = new ArrayList<SpecialPorts>();\r
+ List<SpecialPorts> specialPorts = new ArrayList<>();\r
specialPorts.add(specialPort);\r
\r
when(specialPort.getName()).thenReturn("Port1");\r
when(specialPort.getProtocol()).thenReturn("HTTP");\r
when(specialPort.getPort()).thenReturn(9090);\r
\r
specialPorts.add(specialPort);\r
\r
when(specialPort.getName()).thenReturn("Port1");\r
when(specialPort.getProtocol()).thenReturn("HTTP");\r
when(specialPort.getPort()).thenReturn(9090);\r
\r
- List<String> versions = new ArrayList<String>();\r
+ List<String> versions = new ArrayList<>();\r
versions.add("1");\r
\r
when(specialPort.getProtocolVersions()).thenReturn(versions);\r
\r
when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts);\r
versions.add("1");\r
\r
when(specialPort.getProtocolVersions()).thenReturn(versions);\r
\r
when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts);\r
- List<MgmtEndpoint> mgmtEndpoints = new ArrayList<MgmtEndpoint>();\r
+ List<MgmtEndpoint> mgmtEndpoints = new ArrayList<>();\r
mgmtEndpoints.add(mgmtEndpoint);\r
\r
when(me.getMgmtEndpoint()).thenReturn(mgmtEndpoints);\r
mgmtEndpoints.add(mgmtEndpoint);\r
\r
when(me.getMgmtEndpoint()).thenReturn(mgmtEndpoints);\r
if(urd.notOKorIsEmpty()) {
return Result.err(urd);
}
if(urd.notOKorIsEmpty()) {
return Result.err(urd);
}
- Map<String, Namespace> lm = new HashMap<String,Namespace>();
- Map<String, Namespace> other = full || endsWith==null?null:new TreeMap<String,Namespace>();
+ Map<String, Namespace> lm = new HashMap<>();
+ Map<String, Namespace> other = full || endsWith==null?null:new TreeMap<>();
for(UserRoleDAO.Data urdd : urd.value) {
if(full) {
if(endsWith==null || urdd.role.endsWith(endsWith)) {
for(UserRoleDAO.Data urdd : urd.value) {
if(full) {
if(endsWith==null || urdd.role.endsWith(endsWith)) {
}
if(namespace==null) {
namespace = new Namespace(nsd.value);
}
if(namespace==null) {
namespace = new Namespace(nsd.value);
- namespace.admin=new ArrayList<String>();
- namespace.owner=new ArrayList<String>();
+ namespace.admin=new ArrayList<>();
+ namespace.owner=new ArrayList<>();
}
if(endsWith==null || urdd.role.endsWith(endsWith)) {
lm.put(namespace.name,namespace);
}
if(endsWith==null || urdd.role.endsWith(endsWith)) {
lm.put(namespace.name,namespace);
return Result.err(rnd);
}
return Result.err(rnd);
}
- Set<Namespace> lm = new HashSet<Namespace>();
+ Set<Namespace> lm = new HashSet<>();
Result<List<NsDAO.Data>> rlnd = ques.nsDAO.dao().getChildren(trans, parent);
if(rlnd.isOK()) {
if(rlnd.isEmpty()) {
Result<List<NsDAO.Data>> rlnd = ques.nsDAO.dao().getChildren(trans, parent);
if(rlnd.isOK()) {
if(rlnd.isEmpty()) {
}
// Create a set of Update Roles, which are in Internal Format
}
// Create a set of Update Roles, which are in Internal Format
- Set<String> updtRoles = new HashSet<String>();
+ Set<String> updtRoles = new HashSet<>();
Result<NsSplit> nss;
for(String role : updt.value.roles(false)) {
nss = ques.deriveNsSplit(trans, role);
Result<NsSplit> nss;
for(String role : updt.value.roles(false)) {
nss = ques.deriveNsSplit(trans, role);
// filter = false;
// Get list of roles per user, then add to Roles as we go
// filter = false;
// Get list of roles per user, then add to Roles as we go
- HashSet<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>();
+ HashSet<UserRoleDAO.Data> userSet = new HashSet<>();
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
List<UserRoleDAO.Data> content;
if(mustFilter) {
List<UserRoleDAO.Data> content;
if(mustFilter) {
- content = new ArrayList<UserRoleDAO.Data>(rlurd.value.size()); // avoid multi-memory redos
+ content = new ArrayList<>(rlurd.value.size()); // avoid multi-memory redos
for(UserRoleDAO.Data data : rlurd.value) {
ndd.name=data.ns;
for(UserRoleDAO.Data data : rlurd.value) {
ndd.name=data.ns;
return Result.err(Status.ERR_BadData,v.errs());
}
return Result.err(Status.ERR_BadData,v.errs());
}
- Set<String> currRoles = new HashSet<String>();
+ Set<String> currRoles = new HashSet<>();
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByUser(trans, rurdd.value.user);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByUser(trans, rurdd.value.user);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
return Result.err(nsr);
}
return Result.err(nsr);
}
- Set<String> currUsers = new HashSet<String>();
+ Set<String> currUsers = new HashSet<>();
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, rurdd.value.role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, rurdd.value.role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
return Result.err(rnd);
}
return Result.err(rnd);
}
- HashSet<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>();
+ HashSet<UserRoleDAO.Data> userSet = new HashSet<>();
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readUserInRole(trans, user, role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readUserInRole(trans, user, role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
- HashSet<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>();
+ HashSet<UserRoleDAO.Data> userSet = new HashSet<>();
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, role);
if(rlurd.isOK()) {
for(UserRoleDAO.Data data : rlurd.value) {
// Get list of roles per Permission,
// Then loop through Roles to get Users
// Note: Use Sets to avoid processing or responding with Duplicates
// Get list of roles per Permission,
// Then loop through Roles to get Users
// Note: Use Sets to avoid processing or responding with Duplicates
- Set<String> roleUsed = new HashSet<String>();
- Set<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>();
+ Set<String> roleUsed = new HashSet<>();
+ Set<UserRoleDAO.Data> userSet = new HashSet<>();
if(!nss.isEmpty()) {
Result<List<PermDAO.Data>> rlp = ques.permDAO.readByType(trans, nss.value.ns, nss.value.name);
if(!nss.isEmpty()) {
Result<List<PermDAO.Data>> rlp = ques.permDAO.readByType(trans, nss.value.ns, nss.value.name);
}
if(curr.isOKhasData()) {
}
if(curr.isOKhasData()) {
- Map<String, Result<List<DelegateDAO.Data>>> delegateCache = new HashMap<String, Result<List<DelegateDAO.Data>>>();
- Map<UUID, FutureDAO.Data> futureCache = new HashMap<UUID, FutureDAO.Data>();
+ Map<String, Result<List<DelegateDAO.Data>>> delegateCache = new HashMap<>();
+ Map<UUID, FutureDAO.Data> futureCache = new HashMap<>();
FutureDAO.Data hasDeleted = new FutureDAO.Data();
for(ApprovalDAO.Data cd : curr.value) {
FutureDAO.Data hasDeleted = new FutureDAO.Data();
for(ApprovalDAO.Data cd : curr.value) {
return Result.err(Status.ERR_BadData,v.errs());
}
return Result.err(Status.ERR_BadData,v.errs());
}
- List<ApprovalDAO.Data> listRapds = new ArrayList<ApprovalDAO.Data>();
+ List<ApprovalDAO.Data> listRapds = new ArrayList<>();
Result<List<ApprovalDAO.Data>> myRapd = ques.approvalDAO.readByApprover(trans, approver);
if(myRapd.notOK()) {
Result<List<ApprovalDAO.Data>> myRapd = ques.approvalDAO.readByApprover(trans, approver);
if(myRapd.notOK()) {
// Sonar says threading issues.
SimpleDateFormat FMT = new SimpleDateFormat("yyyyMM");
String yyyymm = req.getParameter("yyyymm");
// Sonar says threading issues.
SimpleDateFormat FMT = new SimpleDateFormat("yyyyMM");
String yyyymm = req.getParameter("yyyymm");
- ArrayList<Integer> ai= new ArrayList<Integer>();
+ ArrayList<Integer> ai= new ArrayList<>();
if(yyyymm==null) {
GregorianCalendar gc = new GregorianCalendar();
// three months is the default
if(yyyymm==null) {
GregorianCalendar gc = new GregorianCalendar();
// three months is the default
@Override
public Result<List<PermDAO.Data>> perms(AuthzTrans trans, Perms perms) {
@Override
public Result<List<PermDAO.Data>> perms(AuthzTrans trans, Perms perms) {
- List<PermDAO.Data> lpd = new ArrayList<PermDAO.Data>();
+ List<PermDAO.Data> lpd = new ArrayList<>();
for (Perm p : perms.getPerm()) {
Result<NsSplit> nss = q.deriveNsSplit(trans, p.getType());
PermDAO.Data pd = new PermDAO.Data();
for (Perm p : perms.getPerm()) {
Result<NsSplit> nss = q.deriveNsSplit(trans, p.getType());
PermDAO.Data pd = new PermDAO.Data();
@Override
public Result<List<ApprovalDAO.Data>> approvals(Approvals apprs) {
@Override
public Result<List<ApprovalDAO.Data>> approvals(Approvals apprs) {
- List<ApprovalDAO.Data> lappr = new ArrayList<ApprovalDAO.Data>();
+ List<ApprovalDAO.Data> lappr = new ArrayList<>();
for(Approval a : apprs.getApprovals()) {
ApprovalDAO.Data ad = new ApprovalDAO.Data();
String str = a.getId();
for(Approval a : apprs.getApprovals()) {
ApprovalDAO.Data ad = new ApprovalDAO.Data();
String str = a.getId();
to.ns = "namespace";
to.name = "name";
to.description = "description";
to.ns = "namespace";
to.name = "name";
to.description = "description";
- Set<String> permissions = new HashSet<String>();
+ Set<String> permissions = new HashSet<>();
permissions.add("perm1");
to.perms = permissions;
permissions.add("perm1");
to.perms = permissions;
private List<String> roles;
static {
private List<String> roles;
static {
- NO_ROLES = new ArrayList<String>();
+ NO_ROLES = new ArrayList<>();
}
protected AAFPermission() {roles=NO_ROLES;}
}
protected AAFPermission() {roles=NO_ROLES;}
print(true,"Load Security Setters from Configuration Information");
String user = access.getProperty(Config.AAF_APPID);
print(true,"Load Security Setters from Configuration Information");
String user = access.getProperty(Config.AAF_APPID);
- ArrayList<SecuritySetter<HttpURLConnection>> lss = new ArrayList<SecuritySetter<HttpURLConnection>>();
+ ArrayList<SecuritySetter<HttpURLConnection>> lss = new ArrayList<>();
@Override
public void run() {
try {
@Override
public void run() {
try {
- TreeMap<ByteArrayHolder, String> newCertsMap = new TreeMap<ByteArrayHolder,String>();
- Map<String,Set<String>> newTrustMap = new TreeMap<String,Set<String>>();
- Set<String> userLookup = new HashSet<String>();
+ TreeMap<ByteArrayHolder, String> newCertsMap = new TreeMap<>();
+ Map<String,Set<String>> newTrustMap = new TreeMap<>();
+ Set<String> userLookup = new HashSet<>();
for(String s : certIDs) {
userLookup.add(s);
}
for(String s : certIDs) {
userLookup.add(s);
}
aafcon.access.log(Level.WARN, "AAF Lookup-No IDs in Role com.att.aaf.trustForID <> "+authMech);
} else {
aafcon.access.log(Level.INFO,"Loading Trust Authentication Info for",authMech);
aafcon.access.log(Level.WARN, "AAF Lookup-No IDs in Role com.att.aaf.trustForID <> "+authMech);
} else {
aafcon.access.log(Level.INFO,"Loading Trust Authentication Info for",authMech);
- Set<String> hsUser = new HashSet<String>();
+ Set<String> hsUser = new HashSet<>();
for(User u : users) {
userLookup.add(u.getId());
hsUser.add(u.getId());
for(User u : users) {
userLookup.add(u.getId());
hsUser.add(u.getId());
// Package access
final public int timeout, cleanInterval, connTimeout;
final public int highCount, userExpires, usageRefreshTriggerCount;
// Package access
final public int timeout, cleanInterval, connTimeout;
final public int highCount, userExpires, usageRefreshTriggerCount;
- private Map<String,Rcli<CLIENT>> clients = new ConcurrentHashMap<String,Rcli<CLIENT>>();
+ private Map<String,Rcli<CLIENT>> clients = new ConcurrentHashMap<>();
final public RosettaDF<Perms> permsDF;
final public RosettaDF<Certs> certsDF;
final public RosettaDF<Users> usersDF;
final public RosettaDF<Perms> permsDF;
final public RosettaDF<Certs> certsDF;
final public RosettaDF<Users> usersDF;
client.send();
Future<Endpoints> fr = client.futureRead(epsDF, TYPE.JSON);
if(fr.get(client.timeout())) {
client.send();
Future<Endpoints> fr = client.futureRead(epsDF, TYPE.JSON);
if(fr.get(client.timeout())) {
- List<EP> epl = new LinkedList<EP>();
+ List<EP> epl = new LinkedList<>();
for(Endpoint endpoint : fr.value.getEndpoint()) {
epl.add(new EP(endpoint,latitude,longitude));
}
for(Endpoint endpoint : fr.value.getEndpoint()) {
epl.add(new EP(endpoint,latitude,longitude));
}
- epList = new LinkedList<EP>();
+ epList = new LinkedList<>();
refreshWait = refreshMin;
this.access = access;
refreshWait = refreshMin;
this.access = access;
if(!hasItems()) {
throw new LocatorException("No Entries found" + (pathInfo==null?"":(" for " + pathInfo)));
}
if(!hasItems()) {
throw new LocatorException("No Entries found" + (pathInfo==null?"":(" for " + pathInfo)));
}
- List<EP> lep = new ArrayList<EP>();
+ List<EP> lep = new ArrayList<>();
EP first = null;
// Note: Deque is sorted on the way by closest distance
Iterator<EP> iter = getIterator();
EP first = null;
// Note: Deque is sorted on the way by closest distance
Iterator<EP> iter = getIterator();
} else {
sb.append("\n\tUser does not contain ");
sb.append(pond.getKey());
} else {
sb.append("\n\tUser does not contain ");
sb.append(pond.getKey());
- List<Permission> perms = new ArrayList<Permission>();
+ List<Permission> perms = new ArrayList<>();
user.copyPermsTo(perms);
for(Permission p : perms) {
sb.append("\n\t\t");
user.copyPermsTo(perms);
for(Permission p : perms) {
sb.append("\n\t\t");
permDF = env.newDataFactory(Perms.class);
errMsg = new ErrMessage(env);
permDF = env.newDataFactory(Perms.class);
errMsg = new ErrMessage(env);
- placeArtifact = new HashMap<String,PlaceArtifact>();
+ placeArtifact = new HashMap<>();
placeArtifact.put(JKS, new PlaceArtifactInKeystore(JKS));
placeArtifact.put(PKCS12, new PlaceArtifactInKeystore(PKCS12));
placeArtifact.put(FILE, new PlaceArtifactInFiles());
placeArtifact.put(JKS, new PlaceArtifactInKeystore(JKS));
placeArtifact.put(PKCS12, new PlaceArtifactInKeystore(PKCS12));
placeArtifact.put(FILE, new PlaceArtifactInFiles());
protected static final String C_R = "\n";
protected File dir;
protected static final String C_R = "\n";
protected File dir;
- private List<String> encodeds = new ArrayList<String>();
+ private List<String> encodeds = new ArrayList<>();
private Symm symm;
// This checks for multiple passes of Dir on the same objects. Run clear after done.
private Symm symm;
// This checks for multiple passes of Dir on the same objects. Run clear after done.
- protected static Map<String,Object> processed = new HashMap<String,Object>();
+ protected static Map<String,Object> processed = new HashMap<>();
// find where the trusts end in 1.0 API
X509Certificate x509;
// find where the trusts end in 1.0 API
X509Certificate x509;
- List<X509Certificate> chainList = new ArrayList<X509Certificate>();
- Set<X509Certificate> caSet = new HashSet<X509Certificate>();
+ List<X509Certificate> chainList = new ArrayList<>();
+ Set<X509Certificate> caSet = new HashSet<>();
for(Certificate c : certColl) {
x509 = (X509Certificate)c;
// Is a Root (self-signed, anyway)
for(Certificate c : certColl) {
x509 = (X509Certificate)c;
// Is a Root (self-signed, anyway)
PrivateKey pk = Factory.toPrivateKey(trans, certInfo.getPrivatekey());
addEncProperty(Config.CADI_KEY_PASSWORD, keyPass);
addProperty(Config.CADI_ALIAS, arti.getMechid());
PrivateKey pk = Factory.toPrivateKey(trans, certInfo.getPrivatekey());
addEncProperty(Config.CADI_KEY_PASSWORD, keyPass);
addProperty(Config.CADI_ALIAS, arti.getMechid());
-// Set<Attribute> attribs = new HashSet<Attribute>();
+// Set<Attribute> attribs = new HashSet<>();
// if(kst.equals("pkcs12")) {
// // Friendly Name
// attribs.add(new PKCS12Attribute("1.2.840.113549.1.9.20", arti.getNs()));
// if(kst.equals("pkcs12")) {
// // Friendly Name
// attribs.add(new PKCS12Attribute("1.2.840.113549.1.9.20", arti.getNs()));
Result<TimedToken> rtt = factory.get(key,hash,new Loader<TimedToken>() {
@Override
public Result<TimedToken> load(final String key) throws APIException, CadiException, LocatorException {
Result<TimedToken> rtt = factory.get(key,hash,new Loader<TimedToken>() {
@Override
public Result<TimedToken> load(final String key) throws APIException, CadiException, LocatorException {
- final List<String> params = new ArrayList<String>();
+ final List<String> params = new ArrayList<>();
params.add(scope);
addSecurity(params,authn_method);
params.add(scope);
addSecurity(params,authn_method);
if(ss==null) {
throw new APIException("client_creds(...) must be set before obtaining Access Tokens");
}
if(ss==null) {
throw new APIException("client_creds(...) must be set before obtaining Access Tokens");
}
- final List<String> params = new ArrayList<String>();
+ final List<String> params = new ArrayList<>();
params.add("refresh_token="+token.getRefreshToken());
addSecurity(params,AUTHN_METHOD.refresh_token);
final String scope="scope="+token.getScope().replace(' ', '+');
params.add("refresh_token="+token.getRefreshToken());
addSecurity(params,AUTHN_METHOD.refresh_token);
final String scope="scope="+token.getScope().replace(' ', '+');
return tkCon.best(new Retryable<Result<Introspect>>() {
@Override
public Result<Introspect> code(Rcli<?> client) throws CadiException, ConnectException, APIException {
return tkCon.best(new Retryable<Result<Introspect>>() {
@Override
public Result<Introspect> code(Rcli<?> client) throws CadiException, ConnectException, APIException {
- final List<String> params = new ArrayList<String>();
+ final List<String> params = new ArrayList<>();
params.add("token="+token);
addSecurity(params,AUTHN_METHOD.client_credentials);
final String paramsa[] = new String[params.size()];
params.add("token="+token);
addSecurity(params,AUTHN_METHOD.client_credentials);
final String paramsa[] = new String[params.size()];
public class TokenClientFactory extends Persist<Token,TimedToken> {
private static TokenClientFactory instance;
public class TokenClientFactory extends Persist<Token,TimedToken> {
private static TokenClientFactory instance;
- private Map<String,AAFConHttp> aafcons = new ConcurrentHashMap<String, AAFConHttp>();
+ private Map<String,AAFConHttp> aafcons = new ConcurrentHashMap<>();
private SecurityInfoC<HttpURLConnection> hsi;
// Package on purpose
final Symm symm;
private SecurityInfoC<HttpURLConnection> hsi;
// Package on purpose
final Symm symm;
import aafoauth.v2_0.Introspect;
public class TokenMgr extends Persist<Introspect, TokenPerm> {
import aafoauth.v2_0.Introspect;
public class TokenMgr extends Persist<Introspect, TokenPerm> {
- protected static Map<String,TokenPerm> tpmap = new ConcurrentHashMap<String, TokenPerm>();
- protected static Map<String,TokenMgr> tmmap = new HashMap<String, TokenMgr>(); // synchronized in getInstance
- protected static Map<String,String> currentToken = new HashMap<String,String>(); // synchronized in getTP
+ protected static Map<String,TokenPerm> tpmap = new ConcurrentHashMap<>();
+ protected static Map<String,TokenMgr> tmmap = new HashMap<>(); // synchronized in getInstance
+ protected static Map<String,String> currentToken = new HashMap<>(); // synchronized in getTP
public static RosettaDF<Perms> permsDF;
public static RosettaDF<Introspect> introspectDF;
public static RosettaDF<Perms> permsDF;
public static RosettaDF<Introspect> introspectDF;
import aafoauth.v2_0.Introspect;
public class TokenPerm extends Persisting<Introspect>{
import aafoauth.v2_0.Introspect;
public class TokenPerm extends Persisting<Introspect>{
- private static final List<AAFPermission> NULL_PERMS = new ArrayList<AAFPermission>();
+ private static final List<AAFPermission> NULL_PERMS = new ArrayList<>();
private Introspect introspect;
private List<AAFPermission> perms;
private String scopes;
private Introspect introspect;
private List<AAFPermission> perms;
private String scopes;
while((pd = ij.parse(r,pd.reuse())).valid()) {
switch(pd.event) {
case Parse.START_DOC:
while((pd = ij.parse(r,pd.reuse())).valid()) {
switch(pd.event) {
case Parse.START_DOC:
- perms = new ArrayList<AAFPermission>();
+ perms = new ArrayList<>();
break;
case Parse.START_ARRAY:
inPerms = "perm".equals(pd.name);
break;
case Parse.START_ARRAY:
inPerms = "perm".equals(pd.name);
super(access, sub_dir);
this.env = env;
df = env.newDataFactory(cls);
super(access, sub_dir);
this.env = env;
df = env.newDataFactory(cls);
- tmap = new ConcurrentHashMap<String, CT>();
+ tmap = new ConcurrentHashMap<>();
synchronized(Persist.class) {
if(clean==null) {
clean = new Timer(true);
synchronized(Persist.class) {
if(clean==null) {
clean = new Timer(true);
private List<String> parseArgs(String[] args)
{
private List<String> parseArgs(String[] args)
{
- List<String> larg = new ArrayList<String>(args.length);
+ List<String> larg = new ArrayList<>(args.length);
// Cover for bash's need to escape *.. (\\*)
// also, remove SSO if required
// Cover for bash's need to escape *.. (\\*)
// also, remove SSO if required
@Before
public void setup() {
@Before
public void setup() {
- roles = new ArrayList<String>();
+ roles = new ArrayList<>();
public static void tearDownAfterClass() throws Exception {
Field field = SecurityInfoC.class.getDeclaredField("sicMap");
field.setAccessible(true);
public static void tearDownAfterClass() throws Exception {
Field field = SecurityInfoC.class.getDeclaredField("sicMap");
field.setAccessible(true);
- field.set(null, new HashMap<Class<?>,SecurityInfoC<?>>());
+ field.set(null, new HashMap<>());
output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]);
assertThat(output, is(certString));
output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]);
assertThat(output, is(certString));
- List<String> certStrings = new ArrayList<String>();
+ List<String> certStrings = new ArrayList<>();
certStrings.add(certString);
certStrings.add(certString);
certs = Factory.toX509Certificate(certStrings);
certStrings.add(certString);
certStrings.add(certString);
certs = Factory.toX509Certificate(certStrings);
private String cleanupString(String str) {
String[] lines = str.split("\n", 0);
private String cleanupString(String str) {
String[] lines = str.split("\n", 0);
- List<String> rawLines = new ArrayList<String>();
+ List<String> rawLines = new ArrayList<>();
for (int i = 0; i < lines.length - 2; i++) {
rawLines.add(lines[i + 1]);
}
for (int i = 0; i < lines.length - 2; i++) {
rawLines.add(lines[i + 1]);
}
public static void tearDownAfterClass() throws Exception {
Field field = SecurityInfoC.class.getDeclaredField("sicMap");
field.setAccessible(true);
public static void tearDownAfterClass() throws Exception {
Field field = SecurityInfoC.class.getDeclaredField("sicMap");
field.setAccessible(true);
- field.set(null, new HashMap<Class<?>,SecurityInfoC<?>>());
+ field.set(null, new HashMap<>());
}
public List<Permission> allAuthorization(Principal fqi) {
}
public List<Permission> allAuthorization(Principal fqi) {
- List<Permission> pond = new ArrayList<Permission>();
+ List<Permission> pond = new ArrayList<>();
aafLur.fishAll(fqi, pond);
return pond;
}
aafLur.fishAll(fqi, pond);
return pond;
}
@Override
public void addHeader(String tag, String value) {
if (headers == null)
@Override
public void addHeader(String tag, String value) {
if (headers == null)
- headers = new ArrayList<Header>();
+ headers = new ArrayList<>();
headers.add(new Header(tag, value));
}
headers.add(new Header(tag, value));
}
throw new LocatorException("No Location List given for PropertyLocator");
}
String[] locarray = Split.split(',',locList);
throw new LocatorException("No Location List given for PropertyLocator");
}
String[] locarray = Split.split(',',locList);
- List<URI> uriList = new ArrayList<URI>();
+ List<URI> uriList = new ArrayList<>();
random = new SecureRandom();
random = new SecureRandom();
public synchronized boolean refresh() {
if(System.currentTimeMillis()>lastRefreshed) {
// Build up list
public synchronized boolean refresh() {
if(System.currentTimeMillis()>lastRefreshed) {
// Build up list
- List<URI> resolve = new ArrayList<URI>();
+ List<URI> resolve = new ArrayList<>();
String realname;
for(int i = 0; i < orig.length ; ++i) {
try {
String realname;
for(int i = 0; i < orig.length ; ++i) {
try {
private static Timer timer;
// Map of userName to User
private final Map<String, User<PERM>> userMap;
private static Timer timer;
// Map of userName to User
private final Map<String, User<PERM>> userMap;
- private static final Map<String, Miss> missMap = new TreeMap<String,Miss>();
+ private static final Map<String, Miss> missMap = new TreeMap<>();
private final Symm missEncrypt;
private Clean clean;
private final Symm missEncrypt;
private Clean clean;
- userMap = new ConcurrentHashMap<String, User<PERM>>();
+ userMap = new ConcurrentHashMap<>();
}
public final List<DumpInfo> dumpInfo() {
}
public final List<DumpInfo> dumpInfo() {
- List<DumpInfo> rv = new ArrayList<DumpInfo>();
+ List<DumpInfo> rv = new ArrayList<>();
for(User<PERM> user : userMap.values()) {
rv.add(new DumpInfo(user));
}
for(User<PERM> user : userMap.values()) {
rv.add(new DumpInfo(user));
}
// Simple map of Group name to a set of User Names
// Simple map of Group name to a set of User Names
- // private Map<String, Set<String>> groupMap = new HashMap<String, Set<String>>();
+ // private Map<String, Set<String>> groupMap = new HashMap<>();
/**
* Class to hold a small subset of the data, because we don't want to expose actual Permission or User Objects
/**
* Class to hold a small subset of the data, because we don't want to expose actual Permission or User Objects
public DumpInfo(User<PERM> user) {
this.user = user.principal.getName();
public DumpInfo(User<PERM> user) {
this.user = user.principal.getName();
- perms = new ArrayList<String>(user.perms.keySet());
+ perms = new ArrayList<>(user.perms.keySet());
int total = 0;
try {
// look at now. If we need to expire more by increasing "now" by "advance"
int total = 0;
try {
// look at now. If we need to expire more by increasing "now" by "advance"
- ArrayList<User<PERM>> al = new ArrayList<User<PERM>>(userMap.values().size());
+ ArrayList<User<PERM>> al = new ArrayList<>(userMap.values().size());
al.addAll(0, userMap.values());
long now = System.currentTimeMillis() + advance;
for(User<PERM> user : al) {
al.addAll(0, userMap.values());
long now = System.currentTimeMillis() + advance;
for(User<PERM> user : al) {
int missTotal = missMap.keySet().size();
int miss = 0;
if(missTotal>0) {
int missTotal = missMap.keySet().size();
int miss = 0;
if(missTotal>0) {
- ArrayList<String> keys = new ArrayList<String>(missTotal);
+ ArrayList<String> keys = new ArrayList<>(missTotal);
keys.addAll(missMap.keySet());
for(String key : keys) {
Miss m = missMap.get(key);
keys.addAll(missMap.keySet());
for(String key : keys) {
Miss m = missMap.get(key);
* To utilize, the Request must be a "CadiWrap" object, then call.
*/
public List<Permission> getPermissions(Principal p) {
* To utilize, the Request must be a "CadiWrap" object, then call.
*/
public List<Permission> getPermissions(Principal p) {
- List<Permission> perms = new ArrayList<Permission>();
+ List<Permission> perms = new ArrayList<>();
lur.fishAll(p, perms);
return perms;
}
lur.fishAll(p, perms);
return perms;
}
*/
public class Capacitor {
private static final int DEFAULT_CHUNK = 256;
*/
public class Capacitor {
private static final int DEFAULT_CHUNK = 256;
- private ArrayList<ByteBuffer> bbs = new ArrayList<ByteBuffer>();
+ private ArrayList<ByteBuffer> bbs = new ArrayList<>();
private ByteBuffer curr = null;
private int idx;
private ByteBuffer curr = null;
private int idx;
String chainProp = props.getProperty(Config.CADI_PROP_FILES);
if(chainProp!=null) {
if(recursionProtection==null) {
String chainProp = props.getProperty(Config.CADI_PROP_FILES);
if(chainProp!=null) {
if(recursionProtection==null) {
- recursionProtection = new ArrayList<String>();
+ recursionProtection = new ArrayList<>();
recursionProtection.add(cadi_prop_files);
}
if(!recursionProtection.contains(chainProp)) {
recursionProtection.add(cadi_prop_files);
}
if(!recursionProtection.contains(chainProp)) {
// There can be time efficiencies gained when the underlying keyset consists mainly of ordered
// data (i.e. abcde...). Therefore, we'll quickly analyze the keyset. If it proves to have
// too much entropy, the "Unordered" algorithm, which is faster in such cases is used.
// There can be time efficiencies gained when the underlying keyset consists mainly of ordered
// data (i.e. abcde...). Therefore, we'll quickly analyze the keyset. If it proves to have
// too much entropy, the "Unordered" algorithm, which is faster in such cases is used.
- ArrayList<int[]> la = new ArrayList<int[]>();
+ ArrayList<int[]> la = new ArrayList<>();
for(int i=0;i<codeset.length;++i) {
curr = codeset[i];
if(prev+1==curr) { // is next character in set
for(int i=0;i<codeset.length;++i) {
curr = codeset[i];
if(prev+1==curr) { // is next character in set
*
*/
public final class User<PERM extends Permission> {
*
*/
public final class User<PERM extends Permission> {
- private static final Map<String,Permission> NULL_MAP = new HashMap<String,Permission>();
+ private static final Map<String,Permission> NULL_MAP = new HashMap<>();
public String name;
private byte[] cred;
public Principal principal;
public String name;
private byte[] cred;
public Principal principal;
}
public Map<String,Permission> newMap() {
}
public Map<String,Permission> newMap() {
- return new ConcurrentHashMap<String,Permission>();
+ return new ConcurrentHashMap<>();
}
public void add(LocalPermission permission) {
}
public void add(LocalPermission permission) {
access.log(Level.INIT, "Hostname set to",hostname);
// Get appropriate TAFs
access.log(Level.INIT, "Hostname set to",hostname);
// Get appropriate TAFs
- ArrayList<HttpTaf> htlist = new ArrayList<HttpTaf>();
+ ArrayList<HttpTaf> htlist = new ArrayList<>();
/////////////////////////////////////////////////////
// Add a Denial of Service TAF
/////////////////////////////////////////////////////
// Add a Denial of Service TAF
public static Lur configLur(SecurityInfoC<HttpURLConnection> si, Connector con, Object ... additionalTafLurs) throws CadiException {
Access access = si.access;
public static Lur configLur(SecurityInfoC<HttpURLConnection> si, Connector con, Object ... additionalTafLurs) throws CadiException {
Access access = si.access;
- List<Lur> lurs = new ArrayList<Lur>();
+ List<Lur> lurs = new ArrayList<>();
/////////////////////////////////////////////////////
// Configure a Local Property Based RBAC/LUR
/////////////////////////////////////////////////////
// Configure a Local Property Based RBAC/LUR
aafConClass = loadClass(access, AAF_V2_0_AAF_CON_HTTP);
if (aafConClass != null) {
for (Constructor<?> c : aafConClass.getConstructors()) {
aafConClass = loadClass(access, AAF_V2_0_AAF_CON_HTTP);
if (aafConClass != null) {
for (Constructor<?> c : aafConClass.getConstructors()) {
- List<Object> lo = new ArrayList<Object>();
+ List<Object> lo = new ArrayList<>();
for (Class<?> pc : c.getParameterTypes()) {
if (pc.equals(Access.class)) {
lo.add(access);
for (Class<?> pc : c.getParameterTypes()) {
if (pc.equals(Access.class)) {
lo.add(access);
public class SecurityInfoC<CLIENT> extends SecurityInfo {
public static final String DEF_ID = "ID not Set";
public class SecurityInfoC<CLIENT> extends SecurityInfo {
public static final String DEF_ID = "ID not Set";
- private static Map<Class<?>,SecurityInfoC<?>> sicMap = new HashMap<Class<?>,SecurityInfoC<?>>();
+ private static Map<Class<?>,SecurityInfoC<?>> sicMap = new HashMap<>();
public SecuritySetter<CLIENT> defSS;
public SecurityInfoC(Access access) throws CadiException {
public SecuritySetter<CLIENT> defSS;
public SecurityInfoC(Access access) throws CadiException {
StringBuilder sb = new StringBuilder();
// Obtain all unique role names
StringBuilder sb = new StringBuilder();
// Obtain all unique role names
- HashSet<String> groups = new HashSet<String>();
+ HashSet<String> groups = new HashSet<>();
for(AbsUserCache<?>.DumpInfo di : lur.dumpInfo()) {
sb.append("\n <user username=\"");
sb.append(di.user);
for(AbsUserCache<?>.DumpInfo di : lur.dumpInfo()) {
sb.append("\n <user username=\"");
sb.append(di.user);
if(map.length>0) {
MapPermConverter mpc=null;
int idx;
if(map.length>0) {
MapPermConverter mpc=null;
int idx;
- mapPairs = new ArrayList<Pair>();
+ mapPairs = new ArrayList<>();
for(String entry : map) {
if((idx=entry.indexOf('='))<0) { // it's a Path, so create a new converter
access.log(Level.INIT,"Loading Perm Conversions for:",entry);
for(String entry : map) {
if((idx=entry.indexOf('='))<0) { // it's a Path, so create a new converter
access.log(Level.INIT,"Loading Perm Conversions for:",entry);
TafResp tresp = null;
TafResp firstTry = null;
List<Redirectable> redirectables = null;
TafResp tresp = null;
TafResp firstTry = null;
List<Redirectable> redirectables = null;
- List<TafResp> log = (access.willLog(Level.DEBUG)) ? new ArrayList<TafResp>() : null;
+ List<TafResp> log;
+ if(access.willLog(Level.DEBUG)) {
+ log = new ArrayList<>();
+ } else {
+ log = null;
+ }
try {
for (HttpTaf taf : tafs) {
tresp = taf.validate(reading, req, resp);
try {
for (HttpTaf taf : tafs) {
tresp = taf.validate(reading, req, resp);
throw new CadiException("X509Taf requires Environment ("+Config.AAF_ENV+") to be set.");
}
// this.lur = lur;
throw new CadiException("X509Taf requires Environment ("+Config.AAF_ENV+") to be set.");
}
// this.lur = lur;
- this.cadiIssuers = new ArrayList<String>();
+ this.cadiIssuers = new ArrayList<>();
for(String ci : access.getProperty(Config.CADI_X509_ISSUERS, "").split(":")) {
access.printf(Level.INIT, "Trusting Identity for Certificates signed by \"%s\"",ci);
cadiIssuers.add(ci);
for(String ci : access.getProperty(Config.CADI_X509_ISSUERS, "").split(":")) {
access.printf(Level.INIT, "Trusting Identity for Certificates signed by \"%s\"",ci);
cadiIssuers.add(ci);
public static synchronized boolean denyIP(String ip) {
boolean rv = false;
if(deniedIP==null) {
public static synchronized boolean denyIP(String ip) {
boolean rv = false;
if(deniedIP==null) {
- deniedIP = new HashMap<String,Counter>();
+ deniedIP = new HashMap<>();
deniedIP.put(ip, new Counter(ip)); // Noted duplicated for minimum time spent
rv= true;
} else if(deniedIP.get(ip)==null) {
deniedIP.put(ip, new Counter(ip)); // Noted duplicated for minimum time spent
rv= true;
} else if(deniedIP.get(ip)==null) {
br = new BufferedReader(new FileReader(dosIP));
try {
if(deniedIP==null) {
br = new BufferedReader(new FileReader(dosIP));
try {
if(deniedIP==null) {
- deniedIP=new HashMap<String,Counter>();
+ deniedIP=new HashMap<>();
public static synchronized boolean denyID(String id) {
boolean rv = false;
if(deniedID==null) {
public static synchronized boolean denyID(String id) {
boolean rv = false;
if(deniedID==null) {
- deniedID = new HashMap<String,Counter>();
+ deniedID = new HashMap<>();
deniedID.put(id, new Counter(id)); // Noted duplicated for minimum time spent
rv = true;
} else if(deniedID.get(id)==null) {
deniedID.put(id, new Counter(id)); // Noted duplicated for minimum time spent
rv = true;
} else if(deniedID.get(id)==null) {
br = new BufferedReader(new FileReader(dosID));
try {
if(deniedID==null) {
br = new BufferedReader(new FileReader(dosID));
try {
if(deniedID==null) {
- deniedID=new HashMap<String,Counter>();
+ deniedID=new HashMap<>();
int initSize = 0;
if(deniedIP!=null)initSize+=deniedIP.size();
if(deniedID!=null)initSize+=deniedID.size();
int initSize = 0;
if(deniedIP!=null)initSize+=deniedIP.size();
if(deniedID!=null)initSize+=deniedID.size();
- ArrayList<String> al = new ArrayList<String>(initSize);
+ ArrayList<String> al = new ArrayList<>(initSize);
if(deniedID!=null) {
for(Counter c : deniedID.values()) {
al.add(c.toString());
if(deniedID!=null) {
for(Counter c : deniedID.values()) {
al.add(c.toString());
public Pool(Creator<T> creator) {
count = spares = 0;
this.creator = creator;
public Pool(Creator<T> creator) {
count = spares = 0;
this.creator = creator;
- list = new LinkedList<Pooled<T>>();
+ list = new LinkedList<>();
for(Tag tag : t.attribs) {
if("xmlns".equals(tag.prefix)) {
if(newnss==null) {
for(Tag tag : t.attribs) {
if("xmlns".equals(tag.prefix)) {
if(newnss==null) {
- newnss = new HashMap<String,String>();
+ newnss = new HashMap<>();
if(nss!=null)newnss.putAll(nss);
}
newnss.put(tag.name, tag.value);
}
}
}
if(nss!=null)newnss.putAll(nss);
}
newnss.put(tag.name, tag.value);
}
}
}
- return newnss==null?(nss==null?new HashMap<String,String>():nss):newnss;
+ //return newnss==null?(nss==null?new HashMap<String,String>():nss):newnss;
+ if(newnss==null) {
+ if(nss==null) {
+ newnss = new HashMap<>();
+ } else {
+ newnss = nss;
+ }
+ }
+ return newnss;
*/
public void add(Tag attrib) {
if(attribs == null) {
*/
public void add(Tag attrib) {
if(attribs == null) {
- attribs = new ArrayList<Tag>();
+ attribs = new ArrayList<>();
assertThat(dumpInfo.size(), is(2));
// Utility lists
assertThat(dumpInfo.size(), is(2));
// Utility lists
- List<String> names = new ArrayList<String>();
+ List<String> names = new ArrayList<>();
names.add(name1);
names.add(name2);
names.add(name1);
names.add(name2);
- List<String> permissions = new ArrayList<String>();
+ List<String> permissions = new ArrayList<>();
permissions.add("NewKey1");
permissions.add("NewKey2");
permissions.add("NewKey1");
permissions.add("NewKey2");
@Test
public void addValuesToNewMapTest() {
User<Permission> user = new User<Permission>(principal);
@Test
public void addValuesToNewMapTest() {
User<Permission> user = new User<Permission>(principal);
- Map<String, Permission> newMap = new HashMap<String,Permission>();
+ Map<String, Permission> newMap = new HashMap<>();
assertFalse(user.contains(permission));
assertFalse(user.contains(permission));
assertTrue(user.contains(permission));
assertTrue(user.contains(permission));
- List<Permission> sink = new ArrayList<Permission>();
+ List<Permission> sink = new ArrayList<>();
user.copyPermsTo(sink);
assertThat(sink.size(), is(1));
user.copyPermsTo(sink);
assertThat(sink.size(), is(1));
public void getTest() throws CadiException {
Pool<Integer> intPool = new Pool<Integer>(new IntegerCreator());
public void getTest() throws CadiException {
Pool<Integer> intPool = new Pool<Integer>(new IntegerCreator());
- List<Pooled<Integer>> gotten = new ArrayList<Pooled<Integer>>();
+ List<Pooled<Integer>> gotten = new ArrayList<>();
for (int i = 0; i < 10; i++) {
gotten.add(intPool.get());
assertThat(gotten.get(i).content, is(i));
for (int i = 0; i < 10; i++) {
gotten.add(intPool.get());
assertThat(gotten.get(i).content, is(i));
@Test
public void convert() {
String test = "test";
@Test
public void convert() {
String test = "test";
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
list.add("method");
assertEquals(Vars.convert(test, list), test);
}
@Test
public void convertTest1() {
list.add("method");
assertEquals(Vars.convert(test, list), test);
}
@Test
public void convertTest1() {
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
list.add("method");
assertEquals(Vars.convert("test", list), "test");
}
@Test
public void convertTest2() {
list.add("method");
assertEquals(Vars.convert("test", list), "test");
}
@Test
public void convertTest2() {
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
list.add("method");
assertEquals(Vars.convert("test", list), "test");
}
list.add("method");
assertEquals(Vars.convert("test", list), "test");
}
\r
public StoreImpl() {\r
staticState = new Object[growSize];\r
\r
public StoreImpl() {\r
staticState = new Object[growSize];\r
- staticMap = new HashMap<String,StaticSlot>();\r
- localMap = new HashMap<String,Slot>();\r
+ staticMap = new HashMap<>();\r
+ localMap = new HashMap<>();\r
}\r
\r
public StoreImpl(String tag) {\r
staticState = new Object[growSize];\r
}\r
\r
public StoreImpl(String tag) {\r
staticState = new Object[growSize];\r
- staticMap = new HashMap<String,StaticSlot>();\r
- localMap = new HashMap<String,Slot>();\r
+ staticMap = new HashMap<>();\r
+ localMap = new HashMap<>();\r
}\r
\r
\r
public StoreImpl(String tag, String[] args) {\r
staticState = new Object[growSize];\r
}\r
\r
\r
public StoreImpl(String tag, String[] args) {\r
staticState = new Object[growSize];\r
- staticMap = new HashMap<String,StaticSlot>();\r
- localMap = new HashMap<String,Slot>();\r
+ staticMap = new HashMap<>();\r
+ localMap = new HashMap<>();\r
\r
if(tag!=null) {\r
String tequals = tag + '=';\r
\r
if(tag!=null) {\r
String tequals = tag + '=';\r
\r
public StoreImpl(String tag, Properties props) {\r
staticState = new Object[growSize];\r
\r
public StoreImpl(String tag, Properties props) {\r
staticState = new Object[growSize];\r
- staticMap = new HashMap<String,StaticSlot>();\r
- localMap = new HashMap<String,Slot>();\r
+ staticMap = new HashMap<>();\r
+ localMap = new HashMap<>();\r
\r
if(tag!=null) {\r
String fname = props.getProperty(tag);\r
\r
if(tag!=null) {\r
String fname = props.getProperty(tag);\r
* @see com.att.env.Store#existingSlotNames()\r
*/\r
public List<String> existingSlotNames() {\r
* @see com.att.env.Store#existingSlotNames()\r
*/\r
public List<String> existingSlotNames() {\r
- return new ArrayList<String>(localMap.keySet());\r
+ return new ArrayList<>(localMap.keySet());\r
}\r
\r
/* (non-Javadoc)\r
}\r
\r
/* (non-Javadoc)\r
}\r
\r
public List<String> existingStaticSlotNames() {\r
}\r
\r
public List<String> existingStaticSlotNames() {\r
- return new ArrayList<String>(staticMap.keySet());\r
+ return new ArrayList<>(staticMap.keySet());\r
private static final Object[] EMPTYO = new Object[0];\r
\r
protected ENV delegate;\r
private static final Object[] EMPTYO = new Object[0];\r
\r
protected ENV delegate;\r
- protected List<TimeTaken> trail = new ArrayList<TimeTaken>(30);\r
+ protected List<TimeTaken> trail = new ArrayList<>(30);\r
private Object[] state;\r
\r
\r
private Object[] state;\r
\r
\r
*/\r
public BasicEnv(Applet applet, String ... tags) {\r
super(null, tags);\r
*/\r
public BasicEnv(Applet applet, String ... tags) {\r
super(null, tags);\r
-// props = new HashMap<String, String>();\r
+// props = new HashMap<>();\r
// String value;\r
// for(int i=0;i<tags.length;++i) {\r
// value = applet.getParameter(tags[i]);\r
// String value;\r
// for(int i=0;i<tags.length;++i) {\r
// value = applet.getParameter(tags[i]);\r
*/\r
public class JAXBmar {\r
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator\r
*/\r
public class JAXBmar {\r
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator\r
- private static Map<Class<?>[],Pool<PMarshaller>> pools = new HashMap<Class<?>[], Pool<PMarshaller>>();\r
+ private static Map<Class<?>[],Pool<PMarshaller>> pools = new HashMap<>();\r
\r
// Handle Marshaller class setting of properties only when needed\r
private class PMarshaller {\r
\r
// Handle Marshaller class setting of properties only when needed\r
private class PMarshaller {\r
*/\r
public class JAXBumar {\r
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator\r
*/\r
public class JAXBumar {\r
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator\r
- private static Map<Class<?>[],Pool<SUnmarshaller>> pools = new HashMap<Class<?>[], Pool<SUnmarshaller>>();\r
+ private static Map<Class<?>[],Pool<SUnmarshaller>> pools = new HashMap<>();\r
\r
private Class<?> cls;\r
private Schema schema;\r
\r
private Class<?> cls;\r
private Schema schema;\r
public Pool(Creator<T> creator) {\r
count = spares = 0;\r
this.creator = creator;\r
public Pool(Creator<T> creator) {\r
count = spares = 0;\r
this.creator = creator;\r
- list = new LinkedList<Pooled<T>>();\r
+ list = new LinkedList<>();\r
* @throws APIException\r
*/\r
public RefreshableThreadObject(Class<T> clss) throws APIException {\r
* @throws APIException\r
*/\r
public RefreshableThreadObject(Class<T> clss) throws APIException {\r
- objs = new ConcurrentHashMap<Thread,T>();\r
+ objs = new ConcurrentHashMap<>();\r
try {\r
cnst = clss.getConstructor(new Class[]{Env.class} );\r
} catch (Exception e) {\r
try {\r
cnst = clss.getConstructor(new Class[]{Env.class} );\r
} catch (Exception e) {\r
String value = sb.toString();
sb.setLength(0);
if(tag !=null && value != null) {
String value = sb.toString();
sb.setLength(0);
if(tag !=null && value != null) {
- if(props==null)props = new ArrayList<Prop>();
+ if(props==null)props = new ArrayList<>();
props.add(new Prop(tag,value));
}
}
props.add(new Prop(tag,value));
}
}
public void push(Prop prop) {
if(attribs==null) {
public void push(Prop prop) {
if(attribs==null) {
- attribs = new ArrayList<Prop>();
+ attribs = new ArrayList<>();
idx = 0;
}
attribs.add(prop);
idx = 0;
}
attribs.add(prop);
private void addNS(Prop prop) {
Map<String,String> existingNS = getNS();
private void addNS(Prop prop) {
Map<String,String> existingNS = getNS();
- if(ns==null)ns = new HashMap<String,String>();
+ if(ns==null)ns = new HashMap<>();
// First make a copy of previous NSs so that we have everything we need, but can overwrite, if necessary
if(existingNS!=null && ns!=existingNS) {
ns.putAll(ns);
// First make a copy of previous NSs so that we have everything we need, but can overwrite, if necessary
if(existingNS!=null && ns!=existingNS) {
ns.putAll(ns);
JaxInfo derived;
// Lazy Instantiation
if(extensions == null) {
JaxInfo derived;
// Lazy Instantiation
if(extensions == null) {
- extensions = new HashMap<String,JaxInfo>();
+ extensions = new HashMap<>();
derived = null;
} else {
derived = extensions.get(derivedName);
derived = null;
} else {
derived = extensions.get(derivedName);
// Build up Method names from JAXB Annotations
XmlType xt;
while((xt = cls.getAnnotation(XmlType.class))!=null) {
// Build up Method names from JAXB Annotations
XmlType xt;
while((xt = cls.getAnnotation(XmlType.class))!=null) {
- if(fields==null)fields = new ArrayList<JaxInfo>();
+ if(fields==null)fields = new ArrayList<>();
for(String field : xt.propOrder()) {
if("".equals(field)) break; // odd bug. "" returned when no fields exist, rather than empty array
Field rf = cls.getDeclaredField(field);
for(String field : xt.propOrder()) {
if("".equals(field)) break; // odd bug. "" returned when no fields exist, rather than empty array
Field rf = cls.getDeclaredField(field);
* @param <T>
*/
public class JaxSet<T> {
* @param <T>
*/
public class JaxSet<T> {
- private static Map<Class<?>,JaxSet<?>> jsets = new HashMap<Class<?>,JaxSet<?>>();
+ private static Map<Class<?>,JaxSet<?>> jsets = new HashMap<>();
private Map<String,Setter<T>> members;
private JaxSet(Class<?> cls) {
private Map<String,Setter<T>> members;
private JaxSet(Class<?> cls) {
- members = new TreeMap<String, Setter<T>>();
+ members = new TreeMap<>();
XmlType xmltype = cls.getAnnotation(XmlType.class);
Class<?> paramType[] = new Class[] {String.class};
for(String str : xmltype.propOrder()) {
XmlType xmltype = cls.getAnnotation(XmlType.class);
Class<?> paramType[] = new Class[] {String.class};
for(String str : xmltype.propOrder()) {
@SuppressWarnings("unchecked")
JaxSet<X> js = (JaxSet<X>)jsets.get(cls);
if(js == null) {
@SuppressWarnings("unchecked")
JaxSet<X> js = (JaxSet<X>)jsets.get(cls);
if(js == null) {
- jsets.put(cls, js = new JaxSet<X>(cls));
+ jsets.put(cls, js = new JaxSet<>(cls));
public OutXML(String root, String ... params) {
this.root = root;
public OutXML(String root, String ... params) {
this.root = root;
- props = new ArrayList<Prop>();
+ props = new ArrayList<>();
for(String p : params) {
String[] tv=p.split("=");
if(tv.length==2)
for(String p : params) {
String[] tv=p.split("=");
if(tv.length==2)
- if(nses == null) nses = new HashMap<String,String>();
+ if(nses == null) nses = new HashMap<>();
nses.put(ns, value);
}
return rv;
nses.put(ns, value);
}
return rv;
- charMap = new TreeMap<String, Integer>();
- intMap = new TreeMap<Integer,String>();
+ charMap = new TreeMap<>();
+ intMap = new TreeMap<>();
charMap.put("quot", 34);
charMap.put("amp",38);
charMap.put("apos",39);
charMap.put("quot", 34);
charMap.put("amp",38);
charMap.put("apos",39);
public final static int HTML5 = 0x8;\r
\r
\r
public final static int HTML5 = 0x8;\r
\r
\r
- private ArrayList<Section<G>> sections = new ArrayList<Section<G>>();\r
+ private ArrayList<Section<G>> sections = new ArrayList<>();\r
private int flags;\r
private final Thematic thematic;\r
\r
private int flags;\r
private final Thematic thematic;\r
\r
\r
gen.html("attributes");\r
\r
\r
gen.html("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
for (char ch : DOCTYPE.toCharArray()) {\r
Integer times = map.get(ch);\r
map.put(ch, (times == null ? 0 : times) + 1);\r
for (char ch : DOCTYPE.toCharArray()) {\r
Integer times = map.get(ch);\r
map.put(ch, (times == null ? 0 : times) + 1);\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "head".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "head".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.body("attributes");\r
\r
\r
gen.body("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "body".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "body".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.charset(charset);\r
\r
\r
gen.charset(charset);\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : CHARSET_LINE.toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : CHARSET_LINE.toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.header("attributes");\r
\r
\r
gen.header("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "header".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "header".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.footer("attributes");\r
\r
\r
gen.footer("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "footer".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "footer".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.section("attributes");\r
\r
\r
gen.section("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "section".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "section".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.article("attributes");\r
\r
\r
gen.article("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "attrib".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "attrib".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.aside("attributes");\r
\r
\r
gen.aside("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "aside".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "aside".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.nav("attributes");\r
\r
\r
gen.nav("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "nav".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "nav".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
public class JU_HTML5GenTest {\r
\r
\r
public class JU_HTML5GenTest {\r
\r
- private final static String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""\r
- + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";\r
+// private final static String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""\r
+// + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";\r
\r
private String charset = "utf-8";\r
\r
\r
private String charset = "utf-8";\r
\r
\r
gen.html("attributes");\r
\r
\r
gen.html("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "html".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "html".toCharArray()) {\r
Integer times = map.get(ch);\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "head".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "head".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.body("attributes");\r
\r
\r
gen.body("attributes");\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : "body".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : "body".toCharArray()) {\r
Integer times = map.get(ch);\r
\r
gen.charset(charset);\r
\r
\r
gen.charset(charset);\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
for (char ch : CHARSET_LINE.toCharArray()) {\r
Integer times = map.get(ch);\r
\r
for (char ch : CHARSET_LINE.toCharArray()) {\r
Integer times = map.get(ch);\r
\r
String XML_TAG = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";\r
\r
\r
String XML_TAG = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";\r
\r
- Map<Character, Integer> map = new TreeMap<Character, Integer>();\r
+ Map<Character, Integer> map = new TreeMap<>();\r
\r
@Before\r
public void setUp() throws Exception {\r
\r
@Before\r
public void setUp() throws Exception {\r