use of org.ovirt.engine.api.model.StorageConnection in project ovirt-engine by oVirt.
the class BackendIscsiBondStorageConnectionsResource method mapCollection.
private StorageConnections mapCollection(List<StorageServerConnections> entities) {
StorageConnections conns = new StorageConnections();
for (StorageServerConnections entity : entities) {
StorageConnection conn = StorageDomainMapper.map(entity, null);
conns.getStorageConnections().add(addLinks(populate(conn, entity)));
}
return conns;
}
use of org.ovirt.engine.api.model.StorageConnection in project ovirt-engine by oVirt.
the class StorageDomainMapperTest method checkNFSStorageConnectionsMappings.
@Test
public void checkNFSStorageConnectionsMappings() {
StorageServerConnections connection = new StorageServerConnections();
Guid connId = Guid.newGuid();
connection.setId(connId.toString());
connection.setStorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType.NFS);
connection.setConnection("1.2.135.255:/myshare/data");
connection.setNfsRetrans((short) 200);
connection.setNfsTimeo((short) 400);
connection.setNfsVersion(org.ovirt.engine.core.common.businessentities.NfsVersion.V3);
connection.setMountOptions("tcp");
HostStorage RESTConnection = new HostStorage();
RESTConnection.setId(connId.toString());
RESTConnection.setType(StorageType.NFS);
RESTConnection.setAddress("1.2.135.255");
RESTConnection.setPath("/myshare/data");
RESTConnection.setNfsRetrans(200);
RESTConnection.setNfsTimeo(400);
RESTConnection.setNfsVersion(NfsVersion.V3);
RESTConnection.setMountOptions("tcp");
StorageConnection mappedResult = StorageDomainMapper.map(connection, null);
assertEquals(RESTConnection.getId(), mappedResult.getId());
assertEquals(RESTConnection.getType(), mappedResult.getType());
assertEquals(RESTConnection.getAddress(), mappedResult.getAddress());
assertEquals(RESTConnection.getPath(), mappedResult.getPath());
assertEquals(RESTConnection.getNfsRetrans(), mappedResult.getNfsRetrans());
assertEquals(RESTConnection.getNfsTimeo(), mappedResult.getNfsTimeo());
assertEquals(RESTConnection.getNfsVersion(), mappedResult.getNfsVersion());
assertEquals(RESTConnection.getMountOptions(), mappedResult.getMountOptions());
}
use of org.ovirt.engine.api.model.StorageConnection in project ovirt-engine by oVirt.
the class StorageDomainMapperTest method checkPosixStorageConnectionsMappingsToBll.
@Test
public void checkPosixStorageConnectionsMappingsToBll() {
StorageServerConnections connection = new StorageServerConnections();
Guid connId = Guid.newGuid();
connection.setId(connId.toString());
connection.setStorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType.POSIXFS);
connection.setConnection("1.2.135.255:/myshare/data");
connection.setVfsType("nfs");
connection.setMountOptions("timeo=30");
StorageConnection RESTConnection = new StorageConnection();
RESTConnection.setId(connId.toString());
RESTConnection.setType(StorageType.POSIXFS);
RESTConnection.setAddress("1.2.135.255");
RESTConnection.setPath("/myshare/data");
RESTConnection.setVfsType("nfs");
RESTConnection.setMountOptions("timeo=30");
StorageServerConnections mappedResult = StorageDomainMapper.map(RESTConnection, null);
assertEquals(connection.getId(), mappedResult.getId());
assertEquals(connection.getStorageType(), mappedResult.getStorageType());
assertEquals(connection.getConnection(), mappedResult.getConnection());
assertEquals(connection.getVfsType(), mappedResult.getVfsType());
assertEquals(connection.getMountOptions(), mappedResult.getMountOptions());
}
Aggregations