Skip to content

Commit

Permalink
#365 make cart unencrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Sep 24, 2020
1 parent f61df51 commit 1f61f43
Show file tree
Hide file tree
Showing 9 changed files with 531 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@
*/
public interface DataCacheServiceFactory {

/*
* (non-Javadoc)
*
* @see
* org.irods.jargon.datautils.image.ImageServiceFactory#instanceThumbnailService
* (org.irods.jargon.core.connection.IRODSAccount)
/**
* Get the normal encrypting data cache service
*
* @param irodsAccount {@link IRODSAccount}
* @return {@link DataCacheService} implementation
*/
public abstract DataCacheService instanceDataCacheService(IRODSAccount irodsAccount);

/**
* Get a data cache service that does not encrypt
*
* @param irodsAccount {@link IRODSAccount}
* @return {@link DataCacheService} implementation
*/
public DataCacheService instanceNoEncryptDataCacheService(IRODSAccount irodsAccount);

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ public DataCacheService instanceDataCacheService(final IRODSAccount irodsAccount
return new DataCacheServiceImpl(irodsAccessObjectFactory, irodsAccount);
}

@Override
public DataCacheService instanceNoEncryptDataCacheService(final IRODSAccount irodsAccount) {
if (irodsAccount == null) {
throw new IllegalArgumentException("null irodsAccount");
}
return new NoEncryptDataCacheServiceImpl(irodsAccessObjectFactory, irodsAccount);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ public class DataCacheServiceImpl extends AbstractDataUtilsServiceImpl implement
/**
* Constructor with required dependencies
*
* @param irodsAccessObjectFactory
* {@link IRODSAccessObjectFactory} that can create necessary objects
* @param irodsAccount
* {@link IRODSAccount} that contains the login information
* @param irodsAccessObjectFactory {@link IRODSAccessObjectFactory} that can
* create necessary objects
* @param irodsAccount {@link IRODSAccount} that contains the login
* information
*/
public DataCacheServiceImpl(final IRODSAccessObjectFactory irodsAccessObjectFactory,
final IRODSAccount irodsAccount) {
Expand Down Expand Up @@ -179,10 +179,6 @@ public String putSerializedEncryptedObjectIntoCache(final Object informationObje
throw new IllegalArgumentException("null informationObject");
}

if (key == null || key.isEmpty()) {
throw new IllegalArgumentException("null key");
}

checkContracts();
log.info("putInformationIntoCache()");

Expand Down Expand Up @@ -273,10 +269,8 @@ public Object retrieveObjectFromCache(final String userName, final String key) t
* Based on the configuration, come up with an absolute path to the file name
* for the cache file
*
* @param keyHash
* {@code int}
* @param userName
* {@code String}
* @param keyHash {@code int}
* @param userName {@code String}
* @return {@code String}
*/
private String buildIRODSFileAbsolutePath(final int keyHash, final String userName) {
Expand All @@ -297,9 +291,8 @@ private String buildIRODSFileAbsolutePath(final int keyHash, final String userNa
* parent directory based on the standard /zone/home/user/cacheDir as configured
* in the CacheDirConfig
*
* @param userName
* {@code String} with the name of the user for whom the home cache
* directory will be computed
* @param userName {@code String} with the name of the user for whom the home
* cache directory will be computed
* @return {@code StringBuilder} with computed part of the abs path
*/
private StringBuilder computeCacheDirPathFromHomeDirFromUserAndZone(final String userName) {
Expand Down
Loading

0 comments on commit 1f61f43

Please sign in to comment.