Search in sources :

Example 1 with IntroduceObjectAnswer

use of com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer in project cosmic by MissionCriticalCloud.

the class XenServerStorageProcessor method introduceObject.

@Override
public Answer introduceObject(final IntroduceObjectCommand cmd) {
    try {
        final Connection conn = hypervisorResource.getConnection();
        final DataStoreTO store = cmd.getDataTO().getDataStore();
        final SR poolSr = hypervisorResource.getStorageRepository(conn, store.getUuid());
        poolSr.scan(conn);
        return new IntroduceObjectAnswer(cmd.getDataTO());
    } catch (final Exception e) {
        s_logger.debug("Failed to introduce object", e);
        return new Answer(cmd, false, e.toString());
    }
}
Also used : CreateObjectAnswer(com.cloud.legacymodel.communication.answer.CreateObjectAnswer) AttachPrimaryDataStoreAnswer(com.cloud.legacymodel.communication.answer.AttachPrimaryDataStoreAnswer) Answer(com.cloud.legacymodel.communication.answer.Answer) CopyCmdAnswer(com.cloud.legacymodel.communication.answer.CopyCmdAnswer) IntroduceObjectAnswer(com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer) DettachAnswer(com.cloud.legacymodel.communication.answer.DettachAnswer) SnapshotAndCopyAnswer(com.cloud.legacymodel.communication.answer.SnapshotAndCopyAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) PrimaryDataStoreTO(com.cloud.legacymodel.to.PrimaryDataStoreTO) DataStoreTO(com.cloud.legacymodel.to.DataStoreTO) Connection(com.xensource.xenapi.Connection) IntroduceObjectAnswer(com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer) XenAPIException(com.xensource.xenapi.Types.XenAPIException) InternalErrorException(com.cloud.legacymodel.exceptions.InternalErrorException) XmlRpcException(org.apache.xmlrpc.XmlRpcException) CloudRuntimeException(com.cloud.legacymodel.exceptions.CloudRuntimeException) SR(com.xensource.xenapi.SR)

Example 2 with IntroduceObjectAnswer

use of com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer in project cosmic by MissionCriticalCloud.

the class XenServerStorageProcessor method forgetObject.

@Override
public Answer forgetObject(final ForgetObjectCommand cmd) {
    try {
        final Connection conn = hypervisorResource.getConnection();
        final DataTO data = cmd.getDataTO();
        final VDI vdi = VDI.getByUuid(conn, data.getPath());
        vdi.forget(conn);
        return new IntroduceObjectAnswer(cmd.getDataTO());
    } catch (final Exception e) {
        s_logger.debug("Failed to introduce object", e);
        return new Answer(cmd, false, e.toString());
    }
}
Also used : CreateObjectAnswer(com.cloud.legacymodel.communication.answer.CreateObjectAnswer) AttachPrimaryDataStoreAnswer(com.cloud.legacymodel.communication.answer.AttachPrimaryDataStoreAnswer) Answer(com.cloud.legacymodel.communication.answer.Answer) CopyCmdAnswer(com.cloud.legacymodel.communication.answer.CopyCmdAnswer) IntroduceObjectAnswer(com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer) DettachAnswer(com.cloud.legacymodel.communication.answer.DettachAnswer) SnapshotAndCopyAnswer(com.cloud.legacymodel.communication.answer.SnapshotAndCopyAnswer) AttachAnswer(com.cloud.legacymodel.communication.answer.AttachAnswer) DataTO(com.cloud.legacymodel.to.DataTO) Connection(com.xensource.xenapi.Connection) VDI(com.xensource.xenapi.VDI) IntroduceObjectAnswer(com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer) XenAPIException(com.xensource.xenapi.Types.XenAPIException) InternalErrorException(com.cloud.legacymodel.exceptions.InternalErrorException) XmlRpcException(org.apache.xmlrpc.XmlRpcException) CloudRuntimeException(com.cloud.legacymodel.exceptions.CloudRuntimeException)

Aggregations

Answer (com.cloud.legacymodel.communication.answer.Answer)2 AttachAnswer (com.cloud.legacymodel.communication.answer.AttachAnswer)2 AttachPrimaryDataStoreAnswer (com.cloud.legacymodel.communication.answer.AttachPrimaryDataStoreAnswer)2 CopyCmdAnswer (com.cloud.legacymodel.communication.answer.CopyCmdAnswer)2 CreateObjectAnswer (com.cloud.legacymodel.communication.answer.CreateObjectAnswer)2 DettachAnswer (com.cloud.legacymodel.communication.answer.DettachAnswer)2 IntroduceObjectAnswer (com.cloud.legacymodel.communication.answer.IntroduceObjectAnswer)2 SnapshotAndCopyAnswer (com.cloud.legacymodel.communication.answer.SnapshotAndCopyAnswer)2 CloudRuntimeException (com.cloud.legacymodel.exceptions.CloudRuntimeException)2 InternalErrorException (com.cloud.legacymodel.exceptions.InternalErrorException)2 Connection (com.xensource.xenapi.Connection)2 XenAPIException (com.xensource.xenapi.Types.XenAPIException)2 XmlRpcException (org.apache.xmlrpc.XmlRpcException)2 DataStoreTO (com.cloud.legacymodel.to.DataStoreTO)1 DataTO (com.cloud.legacymodel.to.DataTO)1 PrimaryDataStoreTO (com.cloud.legacymodel.to.PrimaryDataStoreTO)1 SR (com.xensource.xenapi.SR)1 VDI (com.xensource.xenapi.VDI)1