use of org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension in project ovirt-engine by oVirt.
the class AddStorageServerConnectionExtensionCommand method getExclusiveLocks.
@Override
protected Map<String, Pair<String, String>> getExclusiveLocks() {
StorageServerConnectionExtension connExt = getParameters().getStorageServerConnectionExtension();
String lock = connExt.getHostId().toString() + connExt.getIqn();
return Collections.singletonMap(lock, LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION_EXTENSION, EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED));
}
use of org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension in project ovirt-engine by oVirt.
the class StorageConnectionExtensionResourceTestHelper method getEntity.
protected static StorageServerConnectionExtension getEntity(Guid extensionID, Guid hostID, String pass, String username, String iqn) {
StorageServerConnectionExtension extension = new StorageServerConnectionExtension();
extension.setId(extensionID);
extension.setHostId(hostID);
extension.setPassword(pass);
extension.setUserName(username);
extension.setIqn(iqn);
return extension;
}
use of org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension in project ovirt-engine by oVirt.
the class StorageServerConnectionExtensionDaoTest method generateNewEntity.
@Override
protected StorageServerConnectionExtension generateNewEntity() {
Guid newId = Guid.newGuid();
StorageServerConnectionExtension newssce = new StorageServerConnectionExtension();
newssce.setId(newId);
fillWithRandomData(newssce);
return newssce;
}
use of org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension in project ovirt-engine by oVirt.
the class StorageConnectionHelperTest method testCredentialsWithConnectionExtension.
@Test
public void testCredentialsWithConnectionExtension() {
StorageServerConnections conn = createConnectionWithCredentials("target1");
StorageServerConnectionExtension connExt = createConnectionExtension(Guid.newGuid());
when(connExtDaoMock.getByHostIdAndTarget(connExt.getHostId(), connExt.getIqn())).thenReturn(connExt);
Pair<String, String> credentials = helper.getStorageConnectionCredentialsForhost(connExt.getHostId(), conn);
assertCredentials(credentials, connExt.getUserName(), connExt.getPassword());
}
use of org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension in project ovirt-engine by oVirt.
the class StorageConnectionHelperTest method testCredentialsWithConnectionExtensionDifferentHostSameTarget.
@Test
public void testCredentialsWithConnectionExtensionDifferentHostSameTarget() {
StorageServerConnections conn = createConnectionWithCredentials("target1");
StorageServerConnectionExtension connExt = createConnectionExtension(Guid.newGuid());
Pair<String, String> credentials = helper.getStorageConnectionCredentialsForhost(connExt.getHostId(), conn);
assertCredentials(credentials, conn.getUserName(), conn.getPassword());
}
Aggregations