use of org.ovirt.engine.core.common.businessentities.EditableVdsField in project ovirt-engine by oVirt.
the class VdsHandler method init.
/**
* Initialize list containers, for identity and permission check. The initialization should be executed
* before calling ObjectIdentityChecker.
*
* @see Backend#initHandlers
*/
@PostConstruct
public void init() {
Class<?>[] inspectedClasses = new Class<?>[] { VDS.class, VdsStatic.class, VdsDynamic.class };
updateVdsStatic = new ObjectIdentityChecker(VdsHandler.class, Arrays.asList(inspectedClasses));
updateVdsStatic.setContainer(this);
for (Pair<EditableVdsField, Field> pair : extractAnnotatedFields(EditableVdsField.class, inspectedClasses)) {
List<VDSStatus> statusList = Arrays.asList(pair.getFirst().onStatuses());
String fieldName = pair.getSecond().getName();
if (statusList.isEmpty()) {
updateVdsStatic.addPermittedFields(fieldName);
} else {
updateVdsStatic.addField(statusList, fieldName);
}
}
}
Aggregations