Search in sources :

Example 1 with StorageConnections

use of org.ovirt.engine.api.model.StorageConnections in project ovirt-engine by oVirt.

the class V3StorageConnectionsInAdapter method adapt.

@Override
public StorageConnections adapt(V3StorageConnections from) {
    StorageConnections to = new StorageConnections();
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetActive()) {
        to.setActive(from.getActive());
    }
    if (from.isSetSize()) {
        to.setSize(from.getSize());
    }
    if (from.isSetTotal()) {
        to.setTotal(from.getTotal());
    }
    to.getStorageConnections().addAll(adaptIn(from.getStorageConnections()));
    return to;
}
Also used : V3StorageConnections(org.ovirt.engine.api.v3.types.V3StorageConnections) StorageConnections(org.ovirt.engine.api.model.StorageConnections)

Example 2 with StorageConnections

use of org.ovirt.engine.api.model.StorageConnections in project ovirt-engine by oVirt.

the class V3IscsiBondInAdapter method adapt.

@Override
public IscsiBond adapt(V3IscsiBond from) {
    IscsiBond to = new IscsiBond();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDataCenter()) {
        to.setDataCenter(adaptIn(from.getDataCenter()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetNetworks()) {
        to.setNetworks(new Networks());
        to.getNetworks().getNetworks().addAll(adaptIn(from.getNetworks().getNetworks()));
    }
    if (from.isSetStorageConnections()) {
        to.setStorageConnections(new StorageConnections());
        to.getStorageConnections().getStorageConnections().addAll(adaptIn(from.getStorageConnections().getStorageConnections()));
    }
    return to;
}
Also used : Networks(org.ovirt.engine.api.model.Networks) IscsiBond(org.ovirt.engine.api.model.IscsiBond) V3IscsiBond(org.ovirt.engine.api.v3.types.V3IscsiBond) StorageConnections(org.ovirt.engine.api.model.StorageConnections)

Example 3 with StorageConnections

use of org.ovirt.engine.api.model.StorageConnections in project ovirt-engine by oVirt.

the class IscsiBondMapper method map.

@Mapping(from = org.ovirt.engine.core.common.businessentities.IscsiBond.class, to = IscsiBond.class)
public static IscsiBond map(org.ovirt.engine.core.common.businessentities.IscsiBond from, IscsiBond to) {
    IscsiBond iscsiBond = (to != null) ? to : new IscsiBond();
    DataCenter dataCenter = new DataCenter();
    dataCenter.setId(from.getStoragePoolId().toString());
    iscsiBond.setDataCenter(dataCenter);
    iscsiBond.setName(from.getName());
    iscsiBond.setDescription(from.getDescription());
    if (from.getId() != null) {
        iscsiBond.setId(from.getId().toString());
    }
    Networks networks = new Networks();
    for (Guid id : from.getNetworkIds()) {
        Network network = new Network();
        network.setId(id.toString());
        networks.getNetworks().add(network);
    }
    iscsiBond.setNetworks(networks);
    StorageConnections connections = new StorageConnections();
    for (String id : from.getStorageConnectionIds()) {
        StorageConnection conn = new StorageConnection();
        conn.setId(id);
        connections.getStorageConnections().add(conn);
    }
    iscsiBond.setStorageConnections(connections);
    return iscsiBond;
}
Also used : Networks(org.ovirt.engine.api.model.Networks) DataCenter(org.ovirt.engine.api.model.DataCenter) Network(org.ovirt.engine.api.model.Network) IscsiBond(org.ovirt.engine.api.model.IscsiBond) Guid(org.ovirt.engine.core.compat.Guid) StorageConnection(org.ovirt.engine.api.model.StorageConnection) StorageConnections(org.ovirt.engine.api.model.StorageConnections)

Example 4 with StorageConnections

use of org.ovirt.engine.api.model.StorageConnections 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;
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageConnection(org.ovirt.engine.api.model.StorageConnection) StorageConnections(org.ovirt.engine.api.model.StorageConnections)

Aggregations

StorageConnections (org.ovirt.engine.api.model.StorageConnections)4 IscsiBond (org.ovirt.engine.api.model.IscsiBond)2 Networks (org.ovirt.engine.api.model.Networks)2 StorageConnection (org.ovirt.engine.api.model.StorageConnection)2 DataCenter (org.ovirt.engine.api.model.DataCenter)1 Network (org.ovirt.engine.api.model.Network)1 V3IscsiBond (org.ovirt.engine.api.v3.types.V3IscsiBond)1 V3StorageConnections (org.ovirt.engine.api.v3.types.V3StorageConnections)1 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)1 Guid (org.ovirt.engine.core.compat.Guid)1