Skip to content

Commit a2f843d

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
CSTACKEX-37 Utility Issue
1 parent eb21332 commit a2f843d

File tree

1 file changed

+7
-9
lines changed
  • plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils

1 file changed

+7
-9
lines changed

plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/Utility.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,18 @@
3535
import org.apache.cloudstack.storage.service.model.ProtocolType;
3636
import org.apache.logging.log4j.LogManager;
3737
import org.apache.logging.log4j.Logger;
38-
import org.springframework.stereotype.Component;
3938
import org.springframework.util.Base64Utils;
4039

4140
import javax.inject.Inject;
4241
import java.net.URI;
4342
import java.util.Map;
4443

45-
@Component
4644
public class Utility {
4745

4846
private static final Logger s_logger = LogManager.getLogger(Utility.class);
49-
@Inject private OntapStorage ontapStorage;
50-
@Inject private PrimaryDataStoreDao storagePoolDao;
51-
@Inject private StoragePoolDetailsDao storagePoolDetailsDao;
47+
@Inject private static OntapStorage ontapStorage;
48+
@Inject private static PrimaryDataStoreDao storagePoolDao;
49+
@Inject private static StoragePoolDetailsDao storagePoolDetailsDao;
5250

5351
private static final String BASIC = "Basic";
5452
private static final String AUTH_HEADER_COLON = ":";
@@ -60,17 +58,17 @@ public class Utility {
6058
* @param password -->> normal decoded password of the storage backend
6159
* @return
6260
*/
63-
public String generateAuthHeader (String username, String password) {
61+
public static String generateAuthHeader (String username, String password) {
6462
byte[] encodedBytes = Base64Utils.encode((username + AUTH_HEADER_COLON + password).getBytes());
6563
return BASIC + StringUtils.SPACE + new String(encodedBytes);
6664
}
6765

68-
public URI generateURI (String path) {
66+
public static URI generateURI (String path) {
6967
String uriString = Constants.HTTPS + ontapStorage.getManagementLIF() + path;
7068
return URI.create(uriString);
7169
}
7270

73-
public CloudStackVolume createCloudStackVolumeRequestByProtocol(StoragePoolVO storagePool, Map<String, String> details, DataObject dataObject) {
71+
public static CloudStackVolume createCloudStackVolumeRequestByProtocol(StoragePoolVO storagePool, Map<String, String> details, DataObject dataObject) {
7472
CloudStackVolume cloudStackVolumeRequest = null;
7573

7674
String protocol = details.get(Constants.PROTOCOL);
@@ -108,7 +106,7 @@ public CloudStackVolume createCloudStackVolumeRequestByProtocol(StoragePoolVO st
108106
}
109107
}
110108

111-
public StorageStrategy getStrategyByStoragePoolDetails(Map<String, String> details) {
109+
public static StorageStrategy getStrategyByStoragePoolDetails(Map<String, String> details) {
112110
if (details == null || details.isEmpty()) {
113111
s_logger.error("getStrategyByStoragePoolDetails: Storage pool details are null or empty");
114112
throw new CloudRuntimeException("getStrategyByStoragePoolDetails: Storage pool details are null or empty");

0 commit comments

Comments
 (0)