@Test public void testCreate() throws DataNode.DataNodeCreationException { Config config = ConfigFactory.empty().withValue(SftpDataNode.SFTP_HOSTNAME, ConfigValueFactory.fromAnyRef("testHost")) .withValue(FlowGraphConfigurationKeys.DATA_NODE_ID_KEY, ConfigValueFactory.fromAnyRef("testId")); SftpDataNode dataNode = new SftpDataNode(config); Assert.assertEquals(dataNode.getId(), "testId"); Assert.assertEquals(dataNode.getHostName(), "testHost"); Assert.assertEquals(dataNode.getPort().intValue(), ConfigurationKeys.SOURCE_CONN_DEFAULT_PORT); Assert.assertEquals(dataNode.getDefaultDatasetDescriptorPlatform(), SftpDataNode.PLATFORM); Assert.assertEquals(dataNode.getDefaultDatasetDescriptorClass(), FSDatasetDescriptor.class.getCanonicalName()); config = config.withValue(SftpDataNode.SFTP_PORT, ConfigValueFactory.fromAnyRef(143)); SftpDataNode dataNodeWithPort = new SftpDataNode(config); Assert.assertEquals(dataNode.getId(), "testId"); Assert.assertEquals(dataNode.getHostName(), "testHost"); Assert.assertEquals(dataNodeWithPort.getPort().intValue(), 143); Assert.assertEquals(dataNode.getDefaultDatasetDescriptorPlatform(), SftpDataNode.PLATFORM); Assert.assertEquals(dataNode.getDefaultDatasetDescriptorClass(), FSDatasetDescriptor.class.getCanonicalName()); Config configMissingProps = ConfigFactory.empty().withValue(FlowGraphConfigurationKeys.DATA_NODE_ID_KEY, ConfigValueFactory.fromAnyRef("testId")); try { DataNode sftpNode = new SftpDataNode(configMissingProps); Assert.fail("Unexpected success in creating Sftp node."); } catch (DataNode.DataNodeCreationException e) { } }
@Override public String getDefaultDatasetDescriptorPlatform() { return PLATFORM; }
SftpDataNode extends FileSystemDataNode { @Override public String getDefaultDatasetDescriptorPlatform() { return PLATFORM; } }
SftpDataNode extends FileSystemDataNode { @Override public String getDefaultDatasetDescriptorPlatform() { return PLATFORM; } SftpDataNode(Config nodeProps); }
SftpDataNode extends FileSystemDataNode { @Override public String getDefaultDatasetDescriptorPlatform() { return PLATFORM; } SftpDataNode(Config nodeProps); @Override boolean isUriValid(URI fsUri); @Override String getDefaultDatasetDescriptorPlatform(); }
SftpDataNode extends FileSystemDataNode { @Override public String getDefaultDatasetDescriptorPlatform() { return PLATFORM; } SftpDataNode(Config nodeProps); @Override boolean isUriValid(URI fsUri); @Override String getDefaultDatasetDescriptorPlatform(); static final String SFTP_SCHEME; static final String DEFAULT_SFTP_URI; static final String PLATFORM; static final String SFTP_HOSTNAME; static final String SFTP_PORT; }