@Mapping(from = StorageServerConnections.class, to = LogicalUnit.class) public static LogicalUnit map(StorageServerConnections entity, LogicalUnit template) { LogicalUnit model = template != null ? template : new LogicalUnit(); model.setAddress(entity.getConnection()); model.setTarget(entity.getIqn()); model.setPort(Integer.parseInt(entity.getPort())); model.setUsername(entity.getUserName()); if (entity.getConnection()!=null && entity.getPort()!=null && entity.getPortal()!=null) { model.setPortal(entity.getConnection() + ":" + entity.getPort() + "," + entity.getPortal()); } return model; }
protected void postDiscoverTargetsInternal(ArrayList<StorageServerConnections> items) { ArrayList<SanTargetModel> newItems = new ArrayList<>(); for (StorageServerConnections a : items) { SanTargetModel model = new SanTargetModel(); model.setAddress(a.getConnection()); model.setPort(a.getPort()); model.setPortal(a.getPortal()); model.setName(a.getIqn()); model.setLuns(new ObservableCollection<>()); model.getLoggedInEvent().addListener(this); newItems.add(model); } if (items.isEmpty()) { setMessage(ConstantsManager.getInstance().getConstants().noNewDevicesWereFoundMsg()); } postDiscoverTargets(newItems); }
private ArrayList<SanTargetModel> createTargetModelList(LUNs a) { ArrayList<SanTargetModel> targetModelList = new ArrayList<>(); if (a.getLunConnections() != null) { for (StorageServerConnections b : a.getLunConnections()) { SanTargetModel model = new SanTargetModel(); model.setAddress(b.getConnection()); model.setPort(b.getPort()); model.setPortal(b.getPortal()); model.setName(b.getIqn()); model.setIsSelected(true); model.setIsLoggedIn(true); model.setLuns(new ObservableCollection<>()); model.getLoginCommand().setIsExecutionAllowed(false); targetModelList.add(model); } } return targetModelList; }
@Override public List<StorageServerConnections> getAllForConnection( StorageServerConnections connection) { // NOTE - any change to this stored procedure parameters should require a change in // the StorageServerConnections class, as those fields can be set only with null or a // actual value (empty string can't be used). return getCallsHandler().executeReadList("Getstorage_server_connectionsByKey", mapper, getCustomMapSqlParameterSource() .addValue("iqn", connection.getIqn()) .addValue("connection", connection.getConnection()) .addValue("port", connection.getPort()) .addValue("portal", connection.getPortal()) .addValue("username", connection.getUserName())); }
_writer.writeAttributeString(getOvfUri(), LUNS_PORT, conn.getPort()); _writer.writeAttributeString(XSI_URI, LUNS_STORAGE_TYPE, conn.getStorageType().name()); _writer.writeAttributeString(XSI_URI, LUNS_PORTAL, conn.getPortal()); _writer.writeEndElement();
private MapSqlParameterSource getFullParameterSource(final StorageServerConnections connection) { return getIdParameterSource(connection.getId()) .addValue("connection", connection.getConnection()) .addValue("iqn", connection.getIqn()) .addValue("port", connection.getPort()) .addValue("portal", connection.getPortal()) .addValue("password", DbFacadeUtils.encryptPassword(connection.getPassword())) .addValue("storage_type", connection.getStorageType()) .addValue("user_name", connection.getUserName()) .addValue("mount_options", connection.getMountOptions()) .addValue("vfs_type", connection.getVfsType()) .addValue("nfs_version", (connection.getNfsVersion() != null) ? connection.getNfsVersion().getValue() : null) .addValue("nfs_timeo", connection.getNfsTimeo()) .addValue("nfs_retrans", connection.getNfsRetrans()) .addValue("gluster_volume_id", connection.getGlusterVolumeId()); }