fix compile

This commit is contained in:
Edison Su 2013-01-25 10:24:25 -08:00
parent cb25eed37a
commit a18baf8c83
4 changed files with 11 additions and 11 deletions

View File

@ -54,8 +54,8 @@ import com.cloud.agent.api.Command;
import com.cloud.agent.api.storage.DeleteVolumeCommand; import com.cloud.agent.api.storage.DeleteVolumeCommand;
import com.cloud.hypervisor.xen.resource.CitrixResourceBase.SRType; import com.cloud.hypervisor.xen.resource.CitrixResourceBase.SRType;
import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.storage.encoding.DataStore;
import com.cloud.utils.storage.encoding.DecodedDataObject; import com.cloud.utils.storage.encoding.DecodedDataObject;
import com.cloud.utils.storage.encoding.DecodedDataStore;
import com.cloud.utils.storage.encoding.Decoder; import com.cloud.utils.storage.encoding.Decoder;
import com.xensource.xenapi.Connection; import com.xensource.xenapi.Connection;
import com.xensource.xenapi.Host; import com.xensource.xenapi.Host;
@ -144,7 +144,7 @@ public class XenServerStorageResource {
try { try {
obj = Decoder.decode(uriString); obj = Decoder.decode(uriString);
DataStore store = obj.getStore(); DecodedDataStore store = obj.getStore();
if (obj.getObjType().equalsIgnoreCase("template") && store.getRole().equalsIgnoreCase("image")) { if (obj.getObjType().equalsIgnoreCase("template") && store.getRole().equalsIgnoreCase("image")) {
return getTemplateSize(cmd, obj.getPath()); return getTemplateSize(cmd, obj.getPath());
} }
@ -223,7 +223,7 @@ public class XenServerStorageResource {
} }
} }
protected SR getNfsSR(Connection conn, DataStore store) { protected SR getNfsSR(Connection conn, DecodedDataStore store) {
Map<String, String> deviceConfig = new HashMap<String, String>(); Map<String, String> deviceConfig = new HashMap<String, String>();
String uuid = store.getUuid(); String uuid = store.getUuid();
@ -409,7 +409,7 @@ public class XenServerStorageResource {
try { try {
DecodedDataObject obj = Decoder.decode(storeUrl); DecodedDataObject obj = Decoder.decode(storeUrl);
DataStore store = obj.getStore(); DecodedDataStore store = obj.getStore();
if (store.getScheme().equalsIgnoreCase("nfs")) { if (store.getScheme().equalsIgnoreCase("nfs")) {
SR sr = getNfsSR(conn, store); SR sr = getNfsSR(conn, store);
} else if (store.getScheme().equalsIgnoreCase("iscsi")) { } else if (store.getScheme().equalsIgnoreCase("iscsi")) {
@ -570,7 +570,7 @@ public class XenServerStorageResource {
Connection conn = hypervisorResource.getConnection(); Connection conn = hypervisorResource.getConnection();
try { try {
DecodedDataObject obj = Decoder.decode(dataStoreUri); DecodedDataObject obj = Decoder.decode(dataStoreUri);
DataStore store = obj.getStore(); DecodedDataStore store = obj.getStore();
SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid()); SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid());
hypervisorResource.setupHeartbeatSr(conn, sr, false); hypervisorResource.setupHeartbeatSr(conn, sr, false);
long capacity = sr.getPhysicalSize(conn); long capacity = sr.getPhysicalSize(conn);

View File

@ -23,13 +23,13 @@ public class DecodedDataObject {
private Long size; private Long size;
private String name; private String name;
private String path; private String path;
private EncodedDataStore store; private DecodedDataStore store;
public DecodedDataObject(String objType, public DecodedDataObject(String objType,
Long size, Long size,
String name, String name,
String path, String path,
EncodedDataStore store) { DecodedDataStore store) {
this.objType = objType; this.objType = objType;
this.size = size; this.size = size;
this.path = path; this.path = path;
@ -52,7 +52,7 @@ public class DecodedDataObject {
return this.path; return this.path;
} }
public EncodedDataStore getStore() { public DecodedDataStore getStore() {
return this.store; return this.store;
} }
} }

View File

@ -18,7 +18,7 @@
*/ */
package com.cloud.utils.storage.encoding; package com.cloud.utils.storage.encoding;
public class EncodedDataStore { public class DecodedDataStore {
private final String role; private final String role;
private final String uuid; private final String uuid;
private final String providerName; private final String providerName;
@ -27,7 +27,7 @@ public class EncodedDataStore {
private final String server; private final String server;
private final String path; private final String path;
public EncodedDataStore(String role, public DecodedDataStore(String role,
String uuid, String uuid,
String providerName, String providerName,
String scheme, String scheme,

View File

@ -43,7 +43,7 @@ public class Decoder {
public static DecodedDataObject decode(String url) throws URISyntaxException { public static DecodedDataObject decode(String url) throws URISyntaxException {
URI uri = new URI(url); URI uri = new URI(url);
Map<String, String> params = getParameters(uri); Map<String, String> params = getParameters(uri);
EncodedDataStore store = new EncodedDataStore(params.get(EncodingType.ROLE.toString()), DecodedDataStore store = new DecodedDataStore(params.get(EncodingType.ROLE.toString()),
params.get(EncodingType.STOREUUID.toString()), params.get(EncodingType.STOREUUID.toString()),
params.get(EncodingType.PROVIDERNAME.toString()), params.get(EncodingType.PROVIDERNAME.toString()),
uri.getScheme(), uri.getScheme(),