this.groups = this.readProperties(this.repository, properties);
} catch (IOException e) {
PolicyLogger.error(MessageCodes.ERROR_DATA_ISSUE, e, "StdEngine", "Failed to load properties file");
- this.groups = new HashSet<StdPDPGroup>();
+ this.groups = new HashSet<>();
}
//
// Initialize the default group
// Add the default PIP configuration.
String list = props.getProperty(XACMLProperties.PROP_PIP_ENGINES);
if (list != null && list.length() > 0) {
- Set<PDPPIPConfig> pipConfigs = new HashSet<PDPPIPConfig>();
+ Set<PDPPIPConfig> pipConfigs = new HashSet<>();
for (String pipID : list.split("[,]")) {
StdPDPPIPConfig config = new StdPDPPIPConfig(pipID, props);
if (config.isConfigured()) {
//
private Set<StdPDPGroup> readProperties(Path repository, Properties properties) throws PAPException {
- Set<StdPDPGroup> groups = new HashSet<StdPDPGroup>();
+ Set<StdPDPGroup> groups = new HashSet<>();
//
// See if there is a groups property
//
//
// Iterate our groups
//
- List<String> ids = new ArrayList<String>();
+ List<String> ids = new ArrayList<>();
for (PDPGroup group : this.groups) {
ids.add(group.getId());
properties.setProperty(group.getId() + ".name", (group.getName() == null ? "" : group.getName()));
//
// Iterate its PDPs
//
- List<String> pdps = new ArrayList<String>();
+ List<String> pdps = new ArrayList<>();
for (PDP pdp : group.getPdps()) {
pdps.add(pdp.getId());
properties.setProperty(pdp.getId() + ".name", (pdp.getName() == null ? "" : pdp.getName()));
if (group.getPdps().size() == 1) {
pdpList = group.getPdps().iterator().next().getId();
} else if (group.getPdps().size() > 1) {
- Set<String> ids = new HashSet<String>();
+ Set<String> ids = new HashSet<>();
for (PDP pdp : group.getPdps()) {
ids.add(pdp.getId());
}
@Override
public Set<EcompPDPGroup> getEcompPDPGroups() throws PAPException {
- final Set<EcompPDPGroup> grps = new HashSet<EcompPDPGroup>();
+ final Set<EcompPDPGroup> grps = new HashSet<>();
for (EcompPDPGroup g : this.groups) {
grps.add(g);
}
}
// The movePDP function will modify the set of PDPs in the group.
// To avoid concurrent modification exceptions we need to duplicate the list before calling that function.
- List<EcompPDP> pdpList = new ArrayList<EcompPDP>();
+ List<EcompPDP> pdpList = new ArrayList<>();
for (EcompPDP pdp : pdps) {
pdpList.add(pdp);
}