From 5289b69cb84785053bf6b3ce421b268b40e4d7cf Mon Sep 17 00:00:00 2001 From: Mike Conway Date: Thu, 28 Dec 2017 15:50:56 -0500 Subject: [PATCH] #1 init impl profiler --- .../IrodsextDataProfilerService.java | 119 ++++++++++++++++++ .../irodsext/dataprofiler/package-info.java | 9 ++ .../IrodsextDataProfilerServiceTest.java | 76 +++++++++++ 3 files changed, 204 insertions(+) create mode 100644 irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/IrodsextDataProfilerService.java create mode 100644 irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/package-info.java create mode 100644 irodsext-data-profiler/src/test/java/org/irodsext/dataprofiler/IrodsextDataProfilerServiceTest.java diff --git a/irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/IrodsextDataProfilerService.java b/irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/IrodsextDataProfilerService.java new file mode 100644 index 0000000..1fa3cc5 --- /dev/null +++ b/irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/IrodsextDataProfilerService.java @@ -0,0 +1,119 @@ +/** + * + */ +package org.irodsext.dataprofiler; + +import org.irods.jargon.core.connection.IRODSAccount; +import org.irods.jargon.core.exception.DataNotFoundException; +import org.irods.jargon.core.exception.JargonException; +import org.irods.jargon.core.pub.IRODSAccessObjectFactory; +import org.irods.jargon.core.pub.domain.Collection; +import org.irods.jargon.core.pub.domain.DataObject; +import org.irods.jargon.extensions.dataprofiler.DataProfile; +import org.irods.jargon.extensions.dataprofiler.DataProfileService; +import org.irods.jargon.extensions.dataprofiler.DataProfilerSettings; +import org.irods.jargon.extensions.datatyper.DataTypeResolutionService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @author Mike Conway - NIEHS + * + */ +public class IrodsextDataProfilerService extends DataProfileService { + + public static final Logger log = LoggerFactory.getLogger(IrodsextDataProfilerService.class); + + /** + * @param defaultDataProfilerSettings + * @param dataTypeResolutionService + * @param irodsAccessObjectFactory + * @param irodsAccount + */ + public IrodsextDataProfilerService(DataProfilerSettings defaultDataProfilerSettings, + DataTypeResolutionService dataTypeResolutionService, IRODSAccessObjectFactory irodsAccessObjectFactory, + IRODSAccount irodsAccount) { + super(defaultDataProfilerSettings, dataTypeResolutionService, irodsAccessObjectFactory, irodsAccount); + } + + /* + * (non-Javadoc) + * + * @see org.irods.jargon.extensions.dataprofiler.DataProfileService# + * retrieveDataProfile(java.lang.String) + */ + @Override + public DataProfile retrieveDataProfile(String irodsAbsolutePath) throws DataNotFoundException, JargonException { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see org.irods.jargon.extensions.dataprofiler.DataProfileService# + * retrieveDataProfile(java.lang.String, + * org.irods.jargon.extensions.dataprofiler.DataProfilerSettings) + */ + @Override + public DataProfile retrieveDataProfile(String irodsAbsolutePath, DataProfilerSettings dataProfilerSettings) + throws DataNotFoundException, JargonException { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see org.irods.jargon.extensions.dataprofiler.DataProfileService# + * retrieveDataProfileForCollection(java.lang.String) + */ + @Override + public DataProfile retrieveDataProfileForCollection(String irodsAbsolutePath) + throws DataNotFoundException, JargonException { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see org.irods.jargon.extensions.dataprofiler.DataProfileService# + * retrieveDataProfileForCollection(java.lang.String, + * org.irods.jargon.extensions.dataprofiler.DataProfilerSettings) + */ + @Override + public DataProfile retrieveDataProfileForCollection(String irodsAbsolutePath, + DataProfilerSettings dataProfilerSettings) throws DataNotFoundException, JargonException { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see org.irods.jargon.extensions.dataprofiler.DataProfileService# + * retrieveDataProfileForDataObject(java.lang.String) + */ + @Override + public DataProfile retrieveDataProfileForDataObject(String irodsAbsolutePath) + throws DataNotFoundException, JargonException { + // TODO Auto-generated method stub + return null; + } + + /* + * (non-Javadoc) + * + * @see org.irods.jargon.extensions.dataprofiler.DataProfileService# + * retrieveDataProfileForDataObject(java.lang.String, + * org.irods.jargon.extensions.dataprofiler.DataProfilerSettings) + */ + @Override + public DataProfile retrieveDataProfileForDataObject(String irodsAbsolutePath, + DataProfilerSettings dataProfilerSettings) throws DataNotFoundException, JargonException { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/package-info.java b/irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/package-info.java new file mode 100644 index 0000000..10905ce --- /dev/null +++ b/irodsext-data-profiler/src/main/java/org/irodsext/dataprofiler/package-info.java @@ -0,0 +1,9 @@ + +/** + * Data profiler associated with 'info' page functions of metalnx/irods-ext + * schema and conventions + * + * @author Mike Conway - NIEHS + * + */ +package org.irodsext.dataprofiler; \ No newline at end of file diff --git a/irodsext-data-profiler/src/test/java/org/irodsext/dataprofiler/IrodsextDataProfilerServiceTest.java b/irodsext-data-profiler/src/test/java/org/irodsext/dataprofiler/IrodsextDataProfilerServiceTest.java new file mode 100644 index 0000000..48dfe5b --- /dev/null +++ b/irodsext-data-profiler/src/test/java/org/irodsext/dataprofiler/IrodsextDataProfilerServiceTest.java @@ -0,0 +1,76 @@ +/** + * + */ +package org.irodsext.dataprofiler; + +import static org.junit.Assert.fail; + +import java.util.Properties; + +import org.irods.jargon.core.connection.JargonProperties; +import org.irods.jargon.core.connection.SettableJargonProperties; +import org.irods.jargon.core.pub.IRODSFileSystem; +import org.irods.jargon.testutils.IRODSTestSetupUtilities; +import org.irods.jargon.testutils.TestingPropertiesHelper; +import org.irods.jargon.testutils.filemanip.ScratchFileUtils; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * @author Mike Conway - NIEHS + * + */ +public class IrodsextDataProfilerServiceTest { + + private static Properties testingProperties = new Properties(); + private static TestingPropertiesHelper testingPropertiesHelper = new TestingPropertiesHelper(); + private static ScratchFileUtils scratchFileUtils = null; + public static final String IRODS_TEST_SUBDIR_PATH = "IrodsextDataProfilerServiceTest"; + private static IRODSTestSetupUtilities irodsTestSetupUtilities = null; + private static IRODSFileSystem irodsFileSystem; + private static JargonProperties jargonOriginalProperties = null; + + @BeforeClass + public static void setUpBeforeClass() throws Exception { + TestingPropertiesHelper testingPropertiesLoader = new TestingPropertiesHelper(); + testingProperties = testingPropertiesLoader.getTestProperties(); + scratchFileUtils = new ScratchFileUtils(testingProperties); + scratchFileUtils.clearAndReinitializeScratchDirectory(IRODS_TEST_SUBDIR_PATH); + irodsTestSetupUtilities = new IRODSTestSetupUtilities(); + irodsTestSetupUtilities.initializeIrodsScratchDirectory(); + irodsTestSetupUtilities.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH); + irodsFileSystem = IRODSFileSystem.instance(); + SettableJargonProperties settableJargonProperties = new SettableJargonProperties( + irodsFileSystem.getJargonProperties()); + jargonOriginalProperties = settableJargonProperties; + } + + @AfterClass + public static void tearDownAfterClass() throws Exception { + irodsFileSystem.closeAndEatExceptions(); + } + + @Before + public void before() throws Exception { + // be sure that normal config is set up + irodsFileSystem.getIrodsSession().setJargonProperties(jargonOriginalProperties); + } + + @After + public void afterEach() throws Exception { + irodsFileSystem.closeAndEatExceptions(); + } + + /** + * Test method for + * {@link org.irodsext.dataprofiler.IrodsextDataProfilerService#retrieveDataProfile(java.lang.String, org.irods.jargon.extensions.dataprofiler.DataProfilerSettings)}. + */ + @Test + public void testRetrieveDataProfileStringDataProfilerSettings() { + fail("Not yet implemented"); + } + +}