List<SubjectType> subjectList = subjects.getSubjects();
if (!subjectList.isEmpty()) {
if (subjectList.size() > 1) {
throw new UnsupportedTargetException("Only one SubjectType is allowed");
}
attributeList.addAll(SubjectMatchHelper.getAttributeList(subjectList.get(0).getSubjectMatches()));
}
}
// get resources
ResourcesType resources = target.getResources();
if (resources != null) {
List<ResourceType> resourceList = resources.getResources();
if (!resourceList.isEmpty()) {
if (resourceList.size() > 1) {
throw new UnsupportedTargetException("Only one ResourceType is allowed");
}
attributeList.addAll(ResourceMatchHelper.getAttributeList(resourceList.get(0).getResourceMatches()));
}
}
// get actions
ActionsType actions = target.getActions();
if (actions != null) {
List<ActionType> actionList = actions.getActions();
if (!actionList.isEmpty()) {
if (actionList.size() > 1) {
throw new UnsupportedTargetException("Only one ActionType is allowed");
}
attributeList.addAll(ActionMatchHelper.getAttributeList(actionList.get(0).getActionMatches()));
}
}
// get environments
EnvironmentsType environments = target.getEnvironments();
if (environments != null) {
List<EnvironmentType> environmentList = environments.getEnvrionments();
if (!environmentList.isEmpty()) {
if (environmentList.size() > 1) {
throw new UnsupportedTargetException("Only one EnvironmentType is allowed");
}
attributeList.addAll(EnvironmentMatchHelper.getAttributeList(environmentList.get(0).getEnvrionmentMatches()));
}
}