-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7938beb
commit d153360
Showing
6 changed files
with
170 additions
and
4 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
...ata-profiler/src/main/java/org/irodsext/dataprofiler/IrodsextDataProfilerFactoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/** | ||
* | ||
*/ | ||
package org.irodsext.dataprofiler; | ||
|
||
import org.irods.jargon.core.connection.IRODSAccount; | ||
import org.irods.jargon.core.exception.JargonRuntimeException; | ||
import org.irods.jargon.core.pub.IRODSAccessObjectFactory; | ||
import org.irods.jargon.extensions.dataprofiler.DataProfilerService; | ||
import org.irods.jargon.extensions.dataprofiler.DataProfilerFactory; | ||
import org.irods.jargon.extensions.dataprofiler.DataProfilerSettings; | ||
import org.irods.jargon.extensions.datatyper.DataTypeResolutionServiceFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
/** | ||
* Factory for {@link DataProfiler} implementation | ||
* | ||
* @author Mike Conway - NIEHS | ||
* | ||
*/ | ||
public class IrodsextDataProfilerFactoryImpl implements DataProfilerFactory { | ||
|
||
@Autowired | ||
private IRODSAccessObjectFactory irodsAccessObjectFactory; | ||
|
||
@Autowired | ||
private DataProfilerSettings dataProfilerSettings; | ||
|
||
@Autowired | ||
private DataTypeResolutionServiceFactory dataTypeResolutionServiceFactory; | ||
|
||
/* (non-Javadoc) | ||
* @see org.irodsext.dataprofiler.DataProfilerFactory#instanceDataProfilerService(org.irods.jargon.core.connection.IRODSAccount) | ||
*/ | ||
@Override | ||
public DataProfilerService instanceDataProfilerService(final IRODSAccount irodsAccount) { | ||
validateDependencies(); | ||
DataProfilerService dataProfilerService = new IrodsextDataProfilerService(dataProfilerSettings, | ||
irodsAccessObjectFactory, irodsAccount); | ||
dataProfilerService.setDataTypeResolutionService( | ||
dataTypeResolutionServiceFactory.instanceDataTypeResolutionService(irodsAccount)); | ||
return dataProfilerService; | ||
} | ||
|
||
public IRODSAccessObjectFactory getIrodsAccessObjectFactory() { | ||
return irodsAccessObjectFactory; | ||
} | ||
|
||
public void setIrodsAccessObjectFactory(IRODSAccessObjectFactory irodsAccessObjectFactory) { | ||
this.irodsAccessObjectFactory = irodsAccessObjectFactory; | ||
} | ||
|
||
public DataProfilerSettings getDataProfilerSettings() { | ||
return dataProfilerSettings; | ||
} | ||
|
||
public void setDataProfilerSettings(DataProfilerSettings dataProfilerSettings) { | ||
this.dataProfilerSettings = dataProfilerSettings; | ||
} | ||
|
||
public DataTypeResolutionServiceFactory getDataTypeResolutionServiceFactory() { | ||
return dataTypeResolutionServiceFactory; | ||
} | ||
|
||
public void setDataTypeResolutionServiceFactory(DataTypeResolutionServiceFactory dataTypeResolutionServiceFactory) { | ||
this.dataTypeResolutionServiceFactory = dataTypeResolutionServiceFactory; | ||
} | ||
|
||
/** | ||
* Just a sanity check | ||
*/ | ||
private void validateDependencies() { | ||
if (irodsAccessObjectFactory == null) { | ||
throw new JargonRuntimeException("null irodsAccessObjectFactory"); | ||
} | ||
|
||
if (dataProfilerSettings == null) { | ||
throw new JargonRuntimeException("null dataProfilerSettings"); | ||
} | ||
|
||
if (dataTypeResolutionServiceFactory == null) { | ||
throw new IllegalArgumentException("null dataTypeResolutionServiceFactory"); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...er/src/main/java/org/irodsext/datatyper/IrodsextDataTypeResolutionServiceFactoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* | ||
*/ | ||
package org.irodsext.datatyper; | ||
|
||
import org.irods.jargon.core.connection.IRODSAccount; | ||
import org.irods.jargon.core.exception.JargonRuntimeException; | ||
import org.irods.jargon.core.pub.IRODSAccessObjectFactory; | ||
import org.irods.jargon.extensions.datatyper.DataTypeResolutionService; | ||
import org.irods.jargon.extensions.datatyper.DataTypeResolutionServiceFactory; | ||
import org.irods.jargon.extensions.datatyper.DataTyperSettings; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
|
||
/** | ||
* Factory for {@link IrodsextDataTypeResolutionService} | ||
* | ||
* @author Mike Conway - NIEHS | ||
* | ||
*/ | ||
public class IrodsextDataTypeResolutionServiceFactoryImpl implements DataTypeResolutionServiceFactory { | ||
|
||
@Autowired | ||
private IRODSAccessObjectFactory irodsAccessObjectFactory; | ||
|
||
@Autowired | ||
private DataTyperSettings dataTyperSettings; | ||
|
||
public IRODSAccessObjectFactory getIrodsAccessObjectFactory() { | ||
return irodsAccessObjectFactory; | ||
} | ||
|
||
public void setIrodsAccessObjectFactory(IRODSAccessObjectFactory irodsAccessObjectFactory) { | ||
this.irodsAccessObjectFactory = irodsAccessObjectFactory; | ||
} | ||
|
||
public DataTyperSettings getDataTyperSettings() { | ||
return dataTyperSettings; | ||
} | ||
|
||
public void setDataTyperSettings(DataTyperSettings dataTyperSettings) { | ||
this.dataTyperSettings = dataTyperSettings; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.irodsext.datatyper.DataTypeResolutionServiceFactory#instanceDataTypeResolutionService(org.irods.jargon.core.connection.IRODSAccount) | ||
*/ | ||
@Override | ||
public DataTypeResolutionService instanceDataTypeResolutionService(final IRODSAccount irodsAccount) { | ||
validateDependencies(); | ||
DataTypeResolutionService dataTypeResolutionService = new IrodsextDataTypeResolutionService( | ||
irodsAccessObjectFactory, irodsAccount, dataTyperSettings); | ||
return dataTypeResolutionService; | ||
} | ||
|
||
/** | ||
* Just a sanity check | ||
*/ | ||
private void validateDependencies() { | ||
if (irodsAccessObjectFactory == null) { | ||
throw new JargonRuntimeException("null irodsAccessObjectFactory"); | ||
} | ||
|
||
if (dataTyperSettings == null) { | ||
throw new JargonRuntimeException("null dataTyperSettings"); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.