use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHookSyncJob method saveHookContent.
private void saveHookContent(List<Callable<Pair<GlusterHookEntity, VDSReturnValue>>> contentTasksList) {
if (contentTasksList.isEmpty()) {
return;
}
List<Pair<GlusterHookEntity, VDSReturnValue>> pairResults = ThreadPoolUtil.invokeAll(contentTasksList);
for (Pair<GlusterHookEntity, VDSReturnValue> pairResult : pairResults) {
final GlusterHookEntity hook = pairResult.getFirst();
if (!pairResult.getSecond().getSucceeded()) {
log.info("Failed to get content of hook '{}' with error: {}", hook.getHookKey(), pairResult.getSecond().getVdsError().getMessage());
logMessage(hook.getClusterId(), hook.getHookKey(), AuditLogType.GLUSTER_HOOK_GETCONTENT_FAILED);
continue;
}
final String content = (String) pairResult.getSecond().getReturnValue();
hooksDao.updateGlusterHookContent(hook.getId(), hook.getChecksum(), content);
}
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHooksListReturn method getHook.
private GlusterHookEntity getHook(Map<String, Object> map) {
GlusterHookEntity hook = new GlusterHookEntity();
hook.setName(map.get(NAME).toString());
hook.setGlusterCommand(map.get(COMMAND).toString());
hook.setStage(map.get(LEVEL).toString());
hook.setChecksum(map.get(CHECKSUM).toString());
hook.setContentType(GlusterHookContentType.fromMimeType(map.get(CONTENT_TYPE).toString()));
hook.setStatus(map.get(HOOK_STATUS).toString());
return hook;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class SubTabClusterGlusterHookView method initTable.
void initTable() {
getTable().enableColumnResizing();
getTable().addColumn(new GlusterHookSyncStatusColumn(), constants.empty(), // $NON-NLS-1$
"10px");
AbstractTextColumn<GlusterHookEntity> nameColumn = new AbstractTextColumn<GlusterHookEntity>() {
@Override
public String getValue(GlusterHookEntity object) {
return object.getName();
}
};
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.nameHook(), "200px");
AbstractTextColumn<GlusterHookEntity> statusColumn = new AbstractEnumColumn<GlusterHookEntity, GlusterHookStatus>() {
@Override
protected GlusterHookStatus getRawValue(GlusterHookEntity object) {
return object.getStatus();
}
};
// $NON-NLS-1$
getTable().addColumn(statusColumn, constants.statusHook(), "150px");
AbstractTextColumn<GlusterHookEntity> glusterCommandColumn = new AbstractTextColumn<GlusterHookEntity>() {
@Override
public String getValue(GlusterHookEntity object) {
return object.getGlusterCommand();
}
};
getTable().addColumn(glusterCommandColumn, constants.glusterVolumeEventHook(), // $NON-NLS-1$;
"100px");
AbstractTextColumn<GlusterHookEntity> stageColumn = new AbstractEnumColumn<GlusterHookEntity, GlusterHookStage>() {
@Override
protected GlusterHookStage getRawValue(GlusterHookEntity object) {
return object.getStage();
}
};
// $NON-NLS-1$
getTable().addColumn(stageColumn, constants.stageHook(), "100px");
AbstractTextColumn<GlusterHookEntity> contentTypeColumn = new AbstractEnumColumn<GlusterHookEntity, GlusterHookContentType>() {
@Override
protected GlusterHookContentType getRawValue(GlusterHookEntity object) {
return object.getContentType();
}
};
// $NON-NLS-1$
getTable().addColumn(contentTypeColumn, constants.contentTypeHook(), "150px");
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class GlusterHookCommandTest method getHookEntity.
protected GlusterHookEntity getHookEntity() {
GlusterHookEntity hook = new GlusterHookEntity();
hook.setClusterId(CLUSTER_ID);
hook.setId(HOOK_ID);
hook.setServerHooks(getGlusterServerHooks());
return hook;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity in project ovirt-engine by oVirt.
the class AddGlusterHookCommandTest method getHookEntityWithMissing.
private GlusterHookEntity getHookEntityWithMissing() {
GlusterHookEntity hook = getHookEntity();
List<GlusterServerHook> serverHooks = new ArrayList<>();
serverHooks.add(getGlusterServerHook(0, GlusterHookStatus.MISSING));
serverHooks.add(getGlusterServerHook(1, GlusterHookStatus.MISSING));
serverHooks.add(getGlusterServerHook(2, GlusterHookStatus.MISSING));
hook.setServerHooks(serverHooks);
return hook;
}
Aggregations