CLOUDSTACK-8581: Make the code which initiates the S3TO object more readable

All arguments are now on a own line which makes the code easier to read

Signed-off-by: Wido den Hollander <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4b61f5a1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4b61f5a1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4b61f5a1

Branch: refs/heads/reporter
Commit: 4b61f5a17abbaed8bb412a1c5190147fdd60526c
Parents: 178a9f5
Author: Wido den Hollander <[email protected]>
Authored: Tue Jul 14 13:58:34 2015 +0200
Committer: Wido den Hollander <[email protected]>
Committed: Fri Jul 17 10:07:04 2015 +0200

----------------------------------------------------------------------
 .../driver/S3ImageStoreDriverImpl.java          | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b61f5a1/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git 
a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
 
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
index 8705892..2d723f4 100644
--- 
a/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
+++ 
b/plugins/storage/image/s3/src/org/apache/cloudstack/storage/datastore/driver/S3ImageStoreDriverImpl.java
@@ -54,16 +54,20 @@ public class S3ImageStoreDriverImpl extends 
BaseImageStoreDriverImpl {
     public DataStoreTO getStoreTO(DataStore store) {
         ImageStoreImpl imgStore = (ImageStoreImpl)store;
         Map<String, String> details = 
_imageStoreDetailsDao.getDetails(imgStore.getId());
-        return new S3TO(imgStore.getId(), imgStore.getUuid(), 
details.get(ApiConstants.S3_ACCESS_KEY), 
details.get(ApiConstants.S3_SECRET_KEY),
-            details.get(ApiConstants.S3_END_POINT), 
details.get(ApiConstants.S3_BUCKET_NAME), 
details.get(ApiConstants.S3_HTTPS_FLAG) == null ? false
-                : 
Boolean.parseBoolean(details.get(ApiConstants.S3_HTTPS_FLAG)), 
details.get(ApiConstants.S3_CONNECTION_TIMEOUT) == null ? null
-                : 
Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TIMEOUT)), 
details.get(ApiConstants.S3_MAX_ERROR_RETRY) == null ? null
-                : 
Integer.valueOf(details.get(ApiConstants.S3_MAX_ERROR_RETRY)), 
details.get(ApiConstants.S3_SOCKET_TIMEOUT) == null ? null
-                : 
Integer.valueOf(details.get(ApiConstants.S3_SOCKET_TIMEOUT)), 
imgStore.getCreated(), _configDao.getValue(Config.S3EnableRRS.toString()) == 
null ? false
-                : 
Boolean.parseBoolean(_configDao.getValue(Config.S3EnableRRS.toString())), 
getMaxSingleUploadSizeInBytes(),
-                details.get(ApiConstants.S3_CONNECTION_TTL) == null ? null : 
Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TTL)),
-                details.get(ApiConstants.S3_USE_TCP_KEEPALIVE) == null ? null 
: Boolean.parseBoolean(details.get(ApiConstants.S3_USE_TCP_KEEPALIVE)));
-
+        return new S3TO(imgStore.getId(),
+                        imgStore.getUuid(),
+                        details.get(ApiConstants.S3_ACCESS_KEY),
+                        details.get(ApiConstants.S3_SECRET_KEY),
+                        details.get(ApiConstants.S3_END_POINT), 
details.get(ApiConstants.S3_BUCKET_NAME),
+                        details.get(ApiConstants.S3_HTTPS_FLAG) == null ? 
false : Boolean.parseBoolean(details.get(ApiConstants.S3_HTTPS_FLAG)),
+                        details.get(ApiConstants.S3_CONNECTION_TIMEOUT) == 
null ? null : Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TIMEOUT)),
+                        details.get(ApiConstants.S3_MAX_ERROR_RETRY) == null ? 
null : Integer.valueOf(details.get(ApiConstants.S3_MAX_ERROR_RETRY)),
+                        details.get(ApiConstants.S3_SOCKET_TIMEOUT) == null ? 
null : Integer.valueOf(details.get(ApiConstants.S3_SOCKET_TIMEOUT)),
+                        imgStore.getCreated(),
+                        _configDao.getValue(Config.S3EnableRRS.toString()) == 
null ? false : 
Boolean.parseBoolean(_configDao.getValue(Config.S3EnableRRS.toString())),
+                        getMaxSingleUploadSizeInBytes(),
+                        details.get(ApiConstants.S3_CONNECTION_TTL) == null ? 
null : Integer.valueOf(details.get(ApiConstants.S3_CONNECTION_TTL)),
+                        details.get(ApiConstants.S3_USE_TCP_KEEPALIVE) == null 
? null : Boolean.parseBoolean(details.get(ApiConstants.S3_USE_TCP_KEEPALIVE)));
     }
 
     private long getMaxSingleUploadSizeInBytes() {

Reply via email to