Search in sources :

Example 6 with StorageServerConnectionExtension

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));
}
Also used : StorageServerConnectionExtension(org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension)

Example 7 with StorageServerConnectionExtension

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;
}
Also used : StorageServerConnectionExtension(org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension)

Example 8 with StorageServerConnectionExtension

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;
}
Also used : Guid(org.ovirt.engine.core.compat.Guid) StorageServerConnectionExtension(org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension)

Example 9 with StorageServerConnectionExtension

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());
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageServerConnectionExtension(org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension) Test(org.junit.Test)

Example 10 with StorageServerConnectionExtension

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());
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageServerConnectionExtension(org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension) Test(org.junit.Test)

Aggregations

StorageServerConnectionExtension (org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension)14 Test (org.junit.Test)6 Guid (org.ovirt.engine.core.compat.Guid)4 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)3 StorageServerConnectionExtensionParameters (org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters)2 Response (javax.ws.rs.core.Response)1 Before (org.junit.Before)1 StorageConnectionExtension (org.ovirt.engine.api.model.StorageConnectionExtension)1 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1