Projects >> CloudStack-archive >>082d5634d1d7ec8d2d3bb9eac357ceb9ad61a284

Chunk
Conflicting content
}
		return clientHostAddress + ":" + clientHostPort;
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
<<<<<<< HEAD
package com.cloud.servlet;

// To maintain independency of console proxy project, we duplicate this class from console proxy project
public class ConsoleProxyClientParam {
	private String clientHostAddress;
	private int clientHostPort; 
	private String clientHostPassword;
	private String clientTag;
	private String ticket;
	
	private String clientTunnelUrl;
	private String clientTunnelSession;
	
	private String ajaxSessionId;
	
	public ConsoleProxyClientParam() {
		clientHostPort = 0;
	}

	public String getClientHostAddress() {
		return clientHostAddress;
	}

	public void setClientHostAddress(String clientHostAddress) {
		this.clientHostAddress = clientHostAddress;
	}

	public int getClientHostPort() {
		return clientHostPort;
	}

	public void setClientHostPort(int clientHostPort) {
		this.clientHostPort = clientHostPort;
	}

	public String getClientHostPassword() {
		return clientHostPassword;
	}

	public void setClientHostPassword(String clientHostPassword) {
		this.clientHostPassword = clientHostPassword;
	}

	public String getClientTag() {
		return clientTag;
	}

	public void setClientTag(String clientTag) {
		this.clientTag = clientTag;
	}

	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	
	public String getClientTunnelUrl() {
		return clientTunnelUrl;
	}

	}
		return ticket;
	public void setClientTunnelUrl(String clientTunnelUrl) {
		this.clientTunnelUrl = clientTunnelUrl;
	}

	public String getClientTunnelSession() {
		return clientTunnelSession;
	}

	public void setClientTunnelSession(String clientTunnelSession) {
		this.clientTunnelSession = clientTunnelSession;
	}
	
	public String getAjaxSessionId() {
		return this.ajaxSessionId;
	}
	
	public void setAjaxSessionId(String ajaxSessionId) {
		this.ajaxSessionId = ajaxSessionId;
	}

	public String getClientMapKey() {
		if(clientTag != null && !clientTag.isEmpty())
			return clientTag;
		
		return clientHostAddress + ":" + clientHostPort;
	}
}
=======
package com.cloud.servlet;

// To maintain independency of console proxy project, we duplicate this class from console proxy project
public class ConsoleProxyClientParam {
	private String clientHostAddress;
	private int clientHostPort; 
	private String clientHostPassword;
	private String clientTag;
	private String ticket;
	
	private String clientTunnelUrl;
	private String clientTunnelSession;
	
	private String ajaxSessionId;
	
	public ConsoleProxyClientParam() {
		clientHostPort = 0;
	}

	public String getClientHostAddress() {
		return clientHostAddress;
	}

	public void setClientHostAddress(String clientHostAddress) {
		this.clientHostAddress = clientHostAddress;
	}

	public int getClientHostPort() {
		return clientHostPort;
	}

	public void setClientHostPort(int clientHostPort) {
		this.clientHostPort = clientHostPort;
	}

	public String getClientHostPassword() {
		return clientHostPassword;
	}

	public void setClientHostPassword(String clientHostPassword) {
		this.clientHostPassword = clientHostPassword;
	}

	public String getClientTag() {
		return clientTag;
	}

	public void setClientTag(String clientTag) {
		this.clientTag = clientTag;
	}

	public String getTicket() {
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	
	public String getClientTunnelUrl() {
		return clientTunnelUrl;
	}

	public void setClientTunnelUrl(String clientTunnelUrl) {
		this.clientTunnelUrl = clientTunnelUrl;
	}

	public String getClientTunnelSession() {
		return clientTunnelSession;
	}

	public void setClientTunnelSession(String clientTunnelSession) {
		this.clientTunnelSession = clientTunnelSession;
	}
	
	public String getAjaxSessionId() {
		return this.ajaxSessionId;
	}
	
	public void setAjaxSessionId(String ajaxSessionId) {
		this.ajaxSessionId = ajaxSessionId;
	}

	public String getClientMapKey() {
		if(clientTag != null && !clientTag.isEmpty())
			return clientTag;
		
>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
Solution content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.servlet;

// To maintain independency of console proxy project, we duplicate this class from console proxy project
public class ConsoleProxyClientParam {
	private String clientHostAddress;
	private int clientHostPort; 
	private String clientHostPassword;
	private String clientTag;
	private String ticket;
	
	private String clientTunnelUrl;
	private String clientTunnelSession;
	
	private String ajaxSessionId;
	
	public ConsoleProxyClientParam() {
		clientHostPort = 0;
	}

	public String getClientHostAddress() {
		return clientHostAddress;
	}

	public void setClientHostAddress(String clientHostAddress) {
		this.clientHostAddress = clientHostAddress;
	}

	public int getClientHostPort() {
		return clientHostPort;
	}

	public void setClientHostPort(int clientHostPort) {
		this.clientHostPort = clientHostPort;
	}

	public String getClientHostPassword() {
		return clientHostPassword;
	}

	public void setClientHostPassword(String clientHostPassword) {
		this.clientHostPassword = clientHostPassword;
	}

	public String getClientTag() {
		return clientTag;
	}

	public void setClientTag(String clientTag) {
		this.clientTag = clientTag;
	}

	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	
	public String getClientTunnelUrl() {
		return clientTunnelUrl;
	}

	public void setClientTunnelUrl(String clientTunnelUrl) {
		this.clientTunnelUrl = clientTunnelUrl;
	}

	public String getClientTunnelSession() {
		return clientTunnelSession;
	}

	public void setClientTunnelSession(String clientTunnelSession) {
		this.clientTunnelSession = clientTunnelSession;
	}
	
	public String getAjaxSessionId() {
		return this.ajaxSessionId;
	}
	
	public void setAjaxSessionId(String ajaxSessionId) {
		this.ajaxSessionId = ajaxSessionId;
	}

	public String getClientMapKey() {
		if(clientTag != null && !clientTag.isEmpty())
			return clientTag;
		
		return clientHostAddress + ":" + clientHostPort;
	}
}
File
ConsoleProxyClientParam.java
Developer's decision
Version 1
Kind of conflict
Class declaration
Comment
Package declaration
Chunk
Conflicting content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
<<<<<<< HEAD
package com.cloud.servlet;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;

import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

// To maintain independency of console proxy project, we duplicate this class from console proxy project
public class ConsoleProxyPasswordBasedEncryptor {
	private static final Logger s_logger = Logger.getLogger(ConsoleProxyPasswordBasedEncryptor.class);
	
	private String password;
	private Gson gson;
	
	public ConsoleProxyPasswordBasedEncryptor(String password) {
		this.password = password;
		gson = new GsonBuilder().create();
	}
	
	public String encryptText(String text) {
		if(text == null || text.isEmpty())
			return text;
		
		assert(password != null);
		assert(!password.isEmpty());
		
		try {
			Cipher cipher = Cipher.getInstance("DES");
			int maxKeySize = 8;
			SecretKeySpec keySpec = new SecretKeySpec(normalizeKey(password.getBytes(), maxKeySize), "DES");
			cipher.init(Cipher.ENCRYPT_MODE, keySpec);
			byte[] encryptedBytes = cipher.doFinal(text.getBytes());
			return Base64.encodeBase64URLSafeString(encryptedBytes);
		} catch (NoSuchAlgorithmException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (NoSuchPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (IllegalBlockSizeException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (BadPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (InvalidKeyException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		}
	}

	public String decryptText(String encryptedText) {
		if(encryptedText == null || encryptedText.isEmpty())
			return encryptedText;

		assert(password != null);
		assert(!password.isEmpty());

		try {
			Cipher cipher = Cipher.getInstance("DES");
			int maxKeySize = 8;
			SecretKeySpec keySpec = new SecretKeySpec(normalizeKey(password.getBytes(), maxKeySize), "DES");
			cipher.init(Cipher.DECRYPT_MODE, keySpec);
			
			byte[] encryptedBytes = Base64.decodeBase64(encryptedText);
			return new String(cipher.doFinal(encryptedBytes));
		} catch (NoSuchAlgorithmException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (NoSuchPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (IllegalBlockSizeException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (BadPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (InvalidKeyException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		}
	}
	
	public  String encryptObject(Class clz, T obj) {
		if(obj == null)
			return null;
		
		String json = gson.toJson(obj);
		return encryptText(json);
	}
	
	@SuppressWarnings("unchecked")
	public  T decryptObject(Class clz, String encrypted) {
		if(encrypted == null || encrypted.isEmpty())
			return null;
		
		String json = decryptText(encrypted);
		return (T)gson.fromJson(json, clz);
	}
	
	private static byte[] normalizeKey(byte[] keyBytes, int keySize) {
		assert(keySize > 0);
		byte[] key = new byte[keySize];
		
		for(int i = 0; i < keyBytes.length; i++)
			key[i%keySize] ^= keyBytes[i];
		
		return key;
	}
}
=======
package com.cloud.servlet;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;

import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

// To maintain independency of console proxy project, we duplicate this class from console proxy project
public class ConsoleProxyPasswordBasedEncryptor {
	private static final Logger s_logger = Logger.getLogger(ConsoleProxyPasswordBasedEncryptor.class);
	
	private String password;
	private Gson gson;
	
	public ConsoleProxyPasswordBasedEncryptor(String password) {
		this.password = password;
		gson = new GsonBuilder().create();
	}
	
	public String encryptText(String text) {
		if(text == null || text.isEmpty())
			return text;
		
		assert(password != null);
		assert(!password.isEmpty());
		
		try {
			Cipher cipher = Cipher.getInstance("DES");
			int maxKeySize = 8;
			SecretKeySpec keySpec = new SecretKeySpec(normalizeKey(password.getBytes(), maxKeySize), "DES");
			cipher.init(Cipher.ENCRYPT_MODE, keySpec);
			byte[] encryptedBytes = cipher.doFinal(text.getBytes());
			return Base64.encodeBase64URLSafeString(encryptedBytes);
		} catch (NoSuchAlgorithmException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (NoSuchPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (IllegalBlockSizeException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (BadPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (InvalidKeyException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		}
	}

	public String decryptText(String encryptedText) {
		if(encryptedText == null || encryptedText.isEmpty())
			return encryptedText;

		assert(password != null);
		assert(!password.isEmpty());

		try {
			Cipher cipher = Cipher.getInstance("DES");
			int maxKeySize = 8;
			SecretKeySpec keySpec = new SecretKeySpec(normalizeKey(password.getBytes(), maxKeySize), "DES");
			cipher.init(Cipher.DECRYPT_MODE, keySpec);
			
			byte[] encryptedBytes = Base64.decodeBase64(encryptedText);
			return new String(cipher.doFinal(encryptedBytes));
		} catch (NoSuchAlgorithmException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (NoSuchPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (IllegalBlockSizeException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (BadPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (InvalidKeyException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		}
	}
	
	public  String encryptObject(Class clz, T obj) {
		if(obj == null)
			return null;
		
		String json = gson.toJson(obj);
		return encryptText(json);
	}
	
	@SuppressWarnings("unchecked")
	public  T decryptObject(Class clz, String encrypted) {
		if(encrypted == null || encrypted.isEmpty())
			return null;
		
		String json = decryptText(encrypted);
		return (T)gson.fromJson(json, clz);
	}
	
	private static byte[] normalizeKey(byte[] keyBytes, int keySize) {
		assert(keySize > 0);
		byte[] key = new byte[keySize];
		
		for(int i = 0; i < keyBytes.length; i++)
			key[i%keySize] ^= keyBytes[i];
		
		return key;
	}
}
>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
Solution content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.servlet;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;

import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

// To maintain independency of console proxy project, we duplicate this class from console proxy project
public class ConsoleProxyPasswordBasedEncryptor {
	private static final Logger s_logger = Logger.getLogger(ConsoleProxyPasswordBasedEncryptor.class);
	
	private String password;
	private Gson gson;
	
	public ConsoleProxyPasswordBasedEncryptor(String password) {
		this.password = password;
		gson = new GsonBuilder().create();
	}
	
	public String encryptText(String text) {
		if(text == null || text.isEmpty())
			return text;
		
		assert(password != null);
		assert(!password.isEmpty());
		
		try {
			Cipher cipher = Cipher.getInstance("DES");
			int maxKeySize = 8;
			SecretKeySpec keySpec = new SecretKeySpec(normalizeKey(password.getBytes(), maxKeySize), "DES");
			cipher.init(Cipher.ENCRYPT_MODE, keySpec);
			byte[] encryptedBytes = cipher.doFinal(text.getBytes());
			return Base64.encodeBase64URLSafeString(encryptedBytes);
		} catch (NoSuchAlgorithmException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (NoSuchPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (IllegalBlockSizeException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (BadPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (InvalidKeyException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		}
	}

	public String decryptText(String encryptedText) {
		if(encryptedText == null || encryptedText.isEmpty())
			return encryptedText;

		assert(password != null);
		assert(!password.isEmpty());

		try {
			Cipher cipher = Cipher.getInstance("DES");
			int maxKeySize = 8;
			SecretKeySpec keySpec = new SecretKeySpec(normalizeKey(password.getBytes(), maxKeySize), "DES");
			cipher.init(Cipher.DECRYPT_MODE, keySpec);
			
			byte[] encryptedBytes = Base64.decodeBase64(encryptedText);
			return new String(cipher.doFinal(encryptedBytes));
		} catch (NoSuchAlgorithmException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (NoSuchPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (IllegalBlockSizeException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (BadPaddingException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		} catch (InvalidKeyException e) {
			s_logger.error("Unexpected exception ", e);
			return null;
		}
	}
	
	public  String encryptObject(Class clz, T obj) {
		if(obj == null)
			return null;
		
		String json = gson.toJson(obj);
		return encryptText(json);
	}
	
	@SuppressWarnings("unchecked")
	public  T decryptObject(Class clz, String encrypted) {
		if(encrypted == null || encrypted.isEmpty())
			return null;
		
		String json = decryptText(encrypted);
		return (T)gson.fromJson(json, clz);
	}
	
	private static byte[] normalizeKey(byte[] keyBytes, int keySize) {
		assert(keySize > 0);
		byte[] key = new byte[keySize];
		
		for(int i = 0; i < keyBytes.length; i++)
			key[i%keySize] ^= keyBytes[i];
		
		return key;
	}
}
File
ConsoleProxyPasswordBasedEncryptor.java
Developer's decision
Version 1
Kind of conflict
Class declaration
Comment
Import
Package declaration
Chunk
Conflicting content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
<<<<<<< HEAD
package com.cloud.servlet;

=======
package com.cloud.servlet;

>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
Solution content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.servlet;

import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
File
ConsoleProxyServlet.java
Developer's decision
Version 1
Kind of conflict
Package declaration
Chunk
Conflicting content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
<<<<<<< HEAD
package com.cloud.storage.dao;

import java.util.List;

import com.cloud.host.HostVO;
import com.cloud.storage.VolumeHostVO;
import com.cloud.utils.db.GenericDao;

public interface VolumeHostDao extends GenericDao {

	VolumeHostVO findByHostVolume(long hostId, long volumeId);

	VolumeHostVO findByVolumeId(long volumeId);

	List listBySecStorage(long sserverId);

	List listDestroyed(long hostId);

	VolumeHostVO findVolumeByZone(long zoneId, long volumeId);

}
=======
package com.cloud.storage.dao;

import java.util.List;

import com.cloud.host.HostVO;
import com.cloud.storage.VolumeHostVO;
import com.cloud.utils.db.GenericDao;

public interface VolumeHostDao extends GenericDao {

	VolumeHostVO findByHostVolume(long hostId, long volumeId);

	VolumeHostVO findByVolumeId(long volumeId);

	List listBySecStorage(long sserverId);

	List listDestroyed(long hostId);

	VolumeHostVO findVolumeByZone(long zoneId, long volumeId);

}
>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
Solution content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.storage.dao;

import java.util.List;

import com.cloud.host.HostVO;
import com.cloud.storage.VolumeHostVO;
import com.cloud.utils.db.GenericDao;

public interface VolumeHostDao extends GenericDao {

	VolumeHostVO findByHostVolume(long hostId, long volumeId);

	VolumeHostVO findByVolumeId(long volumeId);

	List listBySecStorage(long sserverId);

	List listDestroyed(long hostId);

	VolumeHostVO findVolumeByZone(long zoneId, long volumeId);

}
File
VolumeHostDao.java
Developer's decision
Version 1
Kind of conflict
Import
Interface declaration
Package declaration
Chunk
Conflicting content
import javax.ejb.Local;
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
<<<<<<< HEAD
package com.cloud.storage.dao;


import java.util.List;

import com.cloud.host.HostVO;
import com.cloud.storage.VMTemplateHostVO;
import com.cloud.storage.VolumeHostVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
@Local(value={VolumeHostDao.class})
public class VolumeHostDaoImpl extends GenericDaoBase implements VolumeHostDao {

	protected final SearchBuilder HostVolumeSearch;
	protected final SearchBuilder ZoneVolumeSearch;
	protected final SearchBuilder VolumeSearch;
	protected final SearchBuilder HostSearch;
	protected final SearchBuilder HostDestroyedSearch;
	
	VolumeHostDaoImpl(){
		HostVolumeSearch = createSearchBuilder();
		HostVolumeSearch.and("host_id", HostVolumeSearch.entity().getHostId(), SearchCriteria.Op.EQ);
		HostVolumeSearch.and("volume_id", HostVolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		HostVolumeSearch.and("destroyed", HostVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostVolumeSearch.done();
		
		ZoneVolumeSearch = createSearchBuilder();
		ZoneVolumeSearch.and("zone_id", ZoneVolumeSearch.entity().getZoneId(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.and("volume_id", ZoneVolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.and("destroyed", ZoneVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.done();
		
		HostSearch = createSearchBuilder();
		HostSearch.and("host_id", HostSearch.entity().getHostId(), SearchCriteria.Op.EQ);		
		HostSearch.and("destroyed", HostSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostSearch.done();
		
		VolumeSearch = createSearchBuilder();
		VolumeSearch.and("volume_id", VolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		VolumeSearch.and("destroyed", VolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		VolumeSearch.done();
		
		HostDestroyedSearch = createSearchBuilder();
		HostDestroyedSearch.and("host_id", HostDestroyedSearch.entity().getHostId(), SearchCriteria.Op.EQ);
		HostDestroyedSearch.and("destroyed", HostDestroyedSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostDestroyedSearch.done();	
	}
    
    
    
	@Override
	public VolumeHostVO findByHostVolume(long hostId, long volumeId) {
		SearchCriteria sc = HostVolumeSearch.create();
	    sc.setParameters("host_id", hostId);
	    sc.setParameters("volume_id", volumeId);
        sc.setParameters("destroyed", false);
        return findOneIncludingRemovedBy(sc);
	}	
	
	@Override
	public VolumeHostVO findVolumeByZone(long volumeId, long zoneId) {
		SearchCriteria sc = ZoneVolumeSearch.create();
	    sc.setParameters("zone_id", zoneId);
	    sc.setParameters("volume_id", volumeId);
        sc.setParameters("destroyed", false);
        return findOneIncludingRemovedBy(sc);
	}
	
	@Override
	public VolumeHostVO findByVolumeId(long volumeId) {
	    SearchCriteria sc = VolumeSearch.create();
	    sc.setParameters("volume_id", volumeId);
	    sc.setParameters("destroyed", false);
	    return findOneBy(sc);
	}



	@Override
	public List listBySecStorage(long ssHostId) {
	    SearchCriteria sc = HostSearch.create();
	    sc.setParameters("host_id", ssHostId);
	    sc.setParameters("destroyed", false);
	    return listAll();
	}
	
	@Override
	public List listDestroyed(long hostId){
		SearchCriteria sc = HostDestroyedSearch.create();
		sc.setParameters("host_id", hostId);
		sc.setParameters("destroyed", true);
		return listIncludingRemovedBy(sc);
	}

}
=======
package com.cloud.storage.dao;


import java.util.List;

import javax.ejb.Local;

import com.cloud.host.HostVO;
import com.cloud.storage.VMTemplateHostVO;
import com.cloud.storage.VolumeHostVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
@Local(value={VolumeHostDao.class})
public class VolumeHostDaoImpl extends GenericDaoBase implements VolumeHostDao {

	protected final SearchBuilder HostVolumeSearch;
	protected final SearchBuilder ZoneVolumeSearch;
	protected final SearchBuilder VolumeSearch;
	protected final SearchBuilder HostSearch;
	protected final SearchBuilder HostDestroyedSearch;
	
	VolumeHostDaoImpl(){
		HostVolumeSearch = createSearchBuilder();
		HostVolumeSearch.and("host_id", HostVolumeSearch.entity().getHostId(), SearchCriteria.Op.EQ);
		HostVolumeSearch.and("volume_id", HostVolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		HostVolumeSearch.and("destroyed", HostVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostVolumeSearch.done();
		
		ZoneVolumeSearch = createSearchBuilder();
		ZoneVolumeSearch.and("zone_id", ZoneVolumeSearch.entity().getZoneId(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.and("volume_id", ZoneVolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.and("destroyed", ZoneVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.done();
		
		HostSearch = createSearchBuilder();
		HostSearch.and("host_id", HostSearch.entity().getHostId(), SearchCriteria.Op.EQ);		
		HostSearch.and("destroyed", HostSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostSearch.done();
		
		VolumeSearch = createSearchBuilder();
		VolumeSearch.and("volume_id", VolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		VolumeSearch.and("destroyed", VolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		VolumeSearch.done();
		
		HostDestroyedSearch = createSearchBuilder();
		HostDestroyedSearch.and("host_id", HostDestroyedSearch.entity().getHostId(), SearchCriteria.Op.EQ);
		HostDestroyedSearch.and("destroyed", HostDestroyedSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostDestroyedSearch.done();	
	}
    
    
    
	@Override
	public VolumeHostVO findByHostVolume(long hostId, long volumeId) {
		SearchCriteria sc = HostVolumeSearch.create();
	    sc.setParameters("host_id", hostId);
	    sc.setParameters("volume_id", volumeId);
        sc.setParameters("destroyed", false);
        return findOneIncludingRemovedBy(sc);
	}	
	
	@Override
	public VolumeHostVO findVolumeByZone(long volumeId, long zoneId) {
		SearchCriteria sc = ZoneVolumeSearch.create();
	    sc.setParameters("zone_id", zoneId);
	    sc.setParameters("volume_id", volumeId);
        sc.setParameters("destroyed", false);
        return findOneIncludingRemovedBy(sc);
	}
	
	@Override
	public VolumeHostVO findByVolumeId(long volumeId) {
	    SearchCriteria sc = VolumeSearch.create();
	    sc.setParameters("volume_id", volumeId);
	    sc.setParameters("destroyed", false);
	    return findOneBy(sc);
	}



	@Override
	public List listBySecStorage(long ssHostId) {
	    SearchCriteria sc = HostSearch.create();
	    sc.setParameters("host_id", ssHostId);
	    sc.setParameters("destroyed", false);
	    return listAll();
	}
	
	@Override
	public List listDestroyed(long hostId){
		SearchCriteria sc = HostDestroyedSearch.create();
		sc.setParameters("host_id", hostId);
		sc.setParameters("destroyed", true);
		return listIncludingRemovedBy(sc);
	}

}
>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
Solution content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.storage.dao;


import java.util.List;

import javax.ejb.Local;

import com.cloud.host.HostVO;
import com.cloud.storage.VMTemplateHostVO;
import com.cloud.storage.VolumeHostVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
@Local(value={VolumeHostDao.class})
public class VolumeHostDaoImpl extends GenericDaoBase implements VolumeHostDao {

	protected final SearchBuilder HostVolumeSearch;
	protected final SearchBuilder ZoneVolumeSearch;
	protected final SearchBuilder VolumeSearch;
	protected final SearchBuilder HostSearch;
	protected final SearchBuilder HostDestroyedSearch;
	
	VolumeHostDaoImpl(){
		HostVolumeSearch = createSearchBuilder();
		HostVolumeSearch.and("host_id", HostVolumeSearch.entity().getHostId(), SearchCriteria.Op.EQ);
		HostVolumeSearch.and("volume_id", HostVolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		HostVolumeSearch.and("destroyed", HostVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostVolumeSearch.done();
		
		ZoneVolumeSearch = createSearchBuilder();
		ZoneVolumeSearch.and("zone_id", ZoneVolumeSearch.entity().getZoneId(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.and("volume_id", ZoneVolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.and("destroyed", ZoneVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		ZoneVolumeSearch.done();
		
		HostSearch = createSearchBuilder();
		HostSearch.and("host_id", HostSearch.entity().getHostId(), SearchCriteria.Op.EQ);		
		HostSearch.and("destroyed", HostSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostSearch.done();
		
		VolumeSearch = createSearchBuilder();
		VolumeSearch.and("volume_id", VolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
		VolumeSearch.and("destroyed", VolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		VolumeSearch.done();
		
		HostDestroyedSearch = createSearchBuilder();
		HostDestroyedSearch.and("host_id", HostDestroyedSearch.entity().getHostId(), SearchCriteria.Op.EQ);
		HostDestroyedSearch.and("destroyed", HostDestroyedSearch.entity().getDestroyed(), SearchCriteria.Op.EQ);
		HostDestroyedSearch.done();	
	}
    
    
    
	@Override
	public VolumeHostVO findByHostVolume(long hostId, long volumeId) {
		SearchCriteria sc = HostVolumeSearch.create();
	    sc.setParameters("host_id", hostId);
	    sc.setParameters("volume_id", volumeId);
        sc.setParameters("destroyed", false);
        return findOneIncludingRemovedBy(sc);
	}	
	
	@Override
	public VolumeHostVO findVolumeByZone(long volumeId, long zoneId) {
		SearchCriteria sc = ZoneVolumeSearch.create();
	    sc.setParameters("zone_id", zoneId);
	    sc.setParameters("volume_id", volumeId);
        sc.setParameters("destroyed", false);
        return findOneIncludingRemovedBy(sc);
	}
	
	@Override
	public VolumeHostVO findByVolumeId(long volumeId) {
	    SearchCriteria sc = VolumeSearch.create();
	    sc.setParameters("volume_id", volumeId);
	    sc.setParameters("destroyed", false);
	    return findOneBy(sc);
	}



	@Override
	public List listBySecStorage(long ssHostId) {
	    SearchCriteria sc = HostSearch.create();
	    sc.setParameters("host_id", ssHostId);
	    sc.setParameters("destroyed", false);
	    return listAll();
	}
	
	@Override
	public List listDestroyed(long hostId){
		SearchCriteria sc = HostDestroyedSearch.create();
		sc.setParameters("host_id", hostId);
		sc.setParameters("destroyed", true);
		return listIncludingRemovedBy(sc);
	}

}
>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
File
VolumeHostDaoImpl.java
Developer's decision
Manual
Kind of conflict
Annotation
Class declaration
Import
Package declaration
Chunk
Conflicting content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
<<<<<<< HEAD
package com.cloud.uuididentity.dao;

=======
package com.cloud.uuididentity.dao;

>>>>>>> f157b702e4c6821fc4af4c27e085dea097b79101
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
Solution content
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.uuididentity.dao;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
File
IdentityDaoImpl.java
Developer's decision
Version 1
Kind of conflict
Package declaration