use of org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method testRemove.
@Test
public void testRemove() {
dao.remove(FixturesTool.HOOK_ID);
GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID);
assertNull(hook);
GlusterServerHook serverhook = dao.getGlusterServerHook(FixturesTool.HOOK_ID, FixturesTool.VDS_GLUSTER_SERVER2);
assertNull(serverhook);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method testUpdateGlusterHookChecksum.
@Test
public void testUpdateGlusterHookChecksum() {
dao.updateGlusterServerHookChecksum(FixturesTool.HOOK_ID, FixturesTool.VDS_GLUSTER_SERVER2, CHECKSUM);
GlusterServerHook serverhook = dao.getGlusterServerHook(FixturesTool.HOOK_ID, FixturesTool.VDS_GLUSTER_SERVER2);
assertNotNull(serverhook);
assertEquals(GlusterHookStatus.ENABLED, serverhook.getStatus());
assertEquals(CHECKSUM, serverhook.getChecksum());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook in project ovirt-engine by oVirt.
the class GlusterHooksDaoTest method testRemoveServerHook.
@Test
public void testRemoveServerHook() {
dao.removeGlusterServerHook(FixturesTool.HOOK_ID, FixturesTool.VDS_GLUSTER_SERVER2);
GlusterServerHook serverhook = dao.getGlusterServerHook(FixturesTool.HOOK_ID, FixturesTool.VDS_GLUSTER_SERVER2);
assertNull(serverhook);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook in project ovirt-engine by oVirt.
the class GetGlusterHookContentQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
GlusterHookEntity hook = glusterHooksDao.getById(getParameters().getGlusterHookId());
String content = "";
if (getParameters().getGlusterServerId() == null) {
if (hook.getContentType().equals(GlusterHookContentType.TEXT)) {
content = glusterHooksDao.getGlusterHookContent(getParameters().getGlusterHookId());
}
} else {
GlusterServerHook serverHook = glusterHooksDao.getGlusterServerHook(hook.getId(), getParameters().getGlusterServerId());
if (serverHook != null && serverHook.getContentType() == GlusterHookContentType.TEXT) {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterHookContent, new GlusterHookVDSParameters(getParameters().getGlusterServerId(), hook.getGlusterCommand(), hook.getStage(), hook.getName()));
if (returnValue.getSucceeded()) {
content = (String) returnValue.getReturnValue();
}
}
}
content = StringUtils.newStringUtf8(Base64.decodeBase64(content));
getQueryReturnValue().setReturnValue(content);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook in project ovirt-engine by oVirt.
the class GlusterHookCommandTest method getGlusterServerHook.
protected GlusterServerHook getGlusterServerHook(int index, GlusterHookStatus status) {
GlusterServerHook serverHook = new GlusterServerHook();
serverHook.setServerId(GUIDS[index]);
serverHook.setStatus(status);
serverHook.setChecksum("CHECKSUM");
return serverHook;
}
Aggregations