private boolean isConnectionAssumed(LogicalUnit unit) { // either 'target' and 'address' should both be provided, or none. Validate this if (unit.getAddress() != null || unit.getTarget() != null) { validateParameters(unit, "address", "target"); } boolean connectionAssumed = unit.getAddress() == null || unit.getTarget() == null; return connectionAssumed; }
private void connectStorageToHost(Guid hostId, StorageType storageType, LogicalUnit unit) { StorageServerConnections cnx = StorageDomainHelper.getConnection(storageType, unit.getAddress(), unit.getTarget(), unit.getUsername(), unit.getPassword(), unit.getPort()); performAction(ActionType.ConnectStorageToVds, new StorageServerConnectionParametersBase(cnx, hostId, false)); }
@Mapping(from = LogicalUnit.class, to = StorageServerConnections.class) public static StorageServerConnections map(LogicalUnit logicalUnit, StorageServerConnections connection) { StorageServerConnections entity = connection != null ? connection : new StorageServerConnections(); if (logicalUnit.isSetAddress()) { entity.setConnection(logicalUnit.getAddress()); } if (logicalUnit.isSetTarget()) { entity.setIqn(logicalUnit.getTarget()); } if (logicalUnit.isSetPort()) { entity.setPort(logicalUnit.getPort().toString()); } if (logicalUnit.isSetUsername()) { entity.setUserName(logicalUnit.getUsername()); } if (logicalUnit.isSetPassword()) { entity.setPassword(logicalUnit.getPassword()); } return entity; }
private IscsiDetails mapLogicalUnitToIscsiDetails(LogicalUnit logicalUnit) { IscsiDetails iscsiDetails = new IscsiDetails(); iscsiDetails.setAddress(logicalUnit.getAddress()); iscsiDetails.setPort(logicalUnit.getPort()); iscsiDetails.setTarget(logicalUnit.getTarget()); iscsiDetails.setPortal(logicalUnit.getPortal()); iscsiDetails.setPaths(logicalUnit.getPaths()); iscsiDetails.setVendorId(logicalUnit.getVendorId()); iscsiDetails.setProductId(logicalUnit.getProductId()); iscsiDetails.setSerial(logicalUnit.getSerial()); return iscsiDetails; }
&& disk.getLunStorage()!=null && disk.getLunStorage().getLogicalUnits()!=null && disk.getLunStorage().getLogicalUnits().getLogicalUnits()!=null && disk.getLunStorage().getLogicalUnits().getLogicalUnits().size() > 0 && disk.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).getPort()!=null && disk.getLunStorage()!=null && disk.getLunStorage().getLogicalUnits()!=null && disk.getLunStorage().getLogicalUnits().getLogicalUnits()!=null && disk.getLunStorage().getLogicalUnits().getLogicalUnits().size() > 0 && disk.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).getId()!=null && disk.getLunStorage()!=null && disk.getLunStorage().getLogicalUnits()!=null && disk.getLunStorage().getLogicalUnits().getLogicalUnits()!=null && disk.getLunStorage().getLogicalUnits().getLogicalUnits().size() > 0 && disk.getLunStorage().getLogicalUnits().getLogicalUnits().get(0).getAddress()!=null && disk.getLunStorage()!=null && disk.getLunStorage().getType()!=null ) {
&& storageDomain.getStorage()!=null && storageDomain.getStorage().getLogicalUnits()!=null && storageDomain.getStorage().getLogicalUnits().getLogicalUnits()!=null && storageDomain.getStorage().getLogicalUnits().getLogicalUnits().size() > 0 && storageDomain.getStorage().getLogicalUnits().getLogicalUnits().get(0).getPort()!=null && storageDomain.getStorage()!=null && storageDomain.getStorage().getLogicalUnits()!=null && storageDomain.getStorage().getLogicalUnits().getLogicalUnits()!=null && storageDomain.getStorage().getLogicalUnits().getLogicalUnits().size() > 0 && storageDomain.getStorage().getLogicalUnits().getLogicalUnits().get(0).getId()!=null && storageDomain.getStorage()!=null && storageDomain.getStorage().getLogicalUnits()!=null && storageDomain.getStorage().getLogicalUnits().getLogicalUnits()!=null && storageDomain.getStorage().getLogicalUnits().getLogicalUnits().size() > 0 && storageDomain.getStorage().getLogicalUnits().getLogicalUnits().get(0).getAddress()!=null ) { return StorageDomainsResource.class.getMethod("addDirectLun", StorageDomain.class);
protected void verifyIscsi(StorageDomain model) { assertEquals(GUIDS[0].toString(), model.getId()); assertEquals(NAMES[0], model.getName()); assertEquals(TYPES[0], model.getType()); assertNotNull(model.getStorage()); assertEquals(StorageType.ISCSI, model.getStorage().getType()); assertNotNull(model.getStorage().getVolumeGroup()); assertEquals(GUIDS[GUIDS.length - 1].toString(), model.getStorage().getVolumeGroup().getId()); assertTrue(model.getStorage().getVolumeGroup().isSetLogicalUnits()); assertNotNull(model.getStorage().getVolumeGroup().getLogicalUnits().getLogicalUnits().get(0)); assertEquals(LUN, model.getStorage().getVolumeGroup().getLogicalUnits().getLogicalUnits().get(0).getId()); assertEquals(TARGET, model.getStorage().getVolumeGroup().getLogicalUnits().getLogicalUnits().get(0).getTarget()); assertEquals(ADDRESSES[0], model.getStorage().getVolumeGroup().getLogicalUnits().getLogicalUnits().get(0).getAddress()); assertEquals(PORT, model.getStorage().getVolumeGroup().getLogicalUnits().getLogicalUnits().get(0).getPort()); assertEquals(7, model.getLinks().size()); assertNotNull(getLinkByName(model, "permissions")); assertNotNull(model.getLinks().get(0).getHref()); verifyLinks(model); } }
V3LogicalUnit to = new V3LogicalUnit(); if (from.isSetAddress()) { to.setAddress(from.getAddress());