Package com.cloud.utils.storage.encoding

Examples of com.cloud.utils.storage.encoding.DecodedDataObject


    protected Answer execute(AttachPrimaryDataStoreCmd cmd) {
        String dataStoreUri = cmd.getDataStore();
        Connection conn = hypervisorResource.getConnection();
        try {
            DecodedDataObject obj = Decoder.decode(dataStoreUri);

            DecodedDataStore store = obj.getStore();

            SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid());
            hypervisorResource.setupHeartbeatSr(conn, sr, false);
            long capacity = sr.getPhysicalSize(conn);
            long available = capacity - sr.getPhysicalUtilisation(conn);
View Full Code Here


    protected Answer execute(AttachPrimaryDataStoreCmd cmd) {
        String dataStoreUri = cmd.getDataStore();
        Connection conn = hypervisorResource.getConnection();
        try {
            DecodedDataObject obj = Decoder.decode(dataStoreUri);

            DecodedDataStore store = obj.getStore();

            SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid());
            hypervisorResource.setupHeartbeatSr(conn, sr, false);
            long capacity = sr.getPhysicalSize(conn);
            long available = capacity - sr.getPhysicalUtilisation(conn);
View Full Code Here

    protected Answer execute(AttachPrimaryDataStoreCmd cmd) {
        String dataStoreUri = cmd.getDataStore();
        Connection conn = hypervisorResource.getConnection();
        try {
            DecodedDataObject obj = Decoder.decode(dataStoreUri);

            DecodedDataStore store = obj.getStore();

            SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid());
            hypervisorResource.setupHeartbeatSr(conn, sr, false);
            long capacity = sr.getPhysicalSize(conn);
            long available = capacity - sr.getPhysicalUtilisation(conn);
View Full Code Here

    protected Answer execute(AttachPrimaryDataStoreCmd cmd) {
        String dataStoreUri = cmd.getDataStore();
        Connection conn = hypervisorResource.getConnection();
        try {
            DecodedDataObject obj = Decoder.decode(dataStoreUri);

            DecodedDataStore store = obj.getStore();

            SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid());
            hypervisorResource.setupHeartbeatSr(conn, sr, false);
            long capacity = sr.getPhysicalSize(conn);
            long available = capacity - sr.getPhysicalUtilisation(conn);
View Full Code Here

        long size = this.getTemplateSize(conn, templateUrl);
        return new CreateObjectAnswer(cmd, templateUrl, size);
    }
    protected CreateObjectAnswer execute(CreateObjectCommand cmd) {
        String uriString = cmd.getObjectUri();
        DecodedDataObject obj = null;

        Connection conn = hypervisorResource.getConnection();
        VDI vdi = null;
        boolean result = false;
        String errorMsg = null;
       
        try {
            obj = Decoder.decode(uriString);
            DecodedDataStore store = obj.getStore();
            if (obj.getObjType().equalsIgnoreCase("template") && store.getRole().equalsIgnoreCase("image")) {
                return getTemplateSize(cmd, obj.getPath());
            }
           
            long size = obj.getSize();
            String name = obj.getName();
            String storeUuid = store.getUuid();
            SR primaryDataStoreSR = getSRByNameLabel(conn, storeUuid);
            vdi = createVdi(conn, name, primaryDataStoreSR, size);
            VDI.Record record = vdi.getRecord(conn);
            result = true;
View Full Code Here

    protected Answer execute(CreatePrimaryDataStoreCmd cmd) {
        Connection conn = hypervisorResource.getConnection();
        String storeUrl = cmd.getDataStore();

        try {
            DecodedDataObject obj = Decoder.decode(storeUrl);
            DecodedDataStore store = obj.getStore();
            if (store.getScheme().equalsIgnoreCase("nfs")) {
                SR sr = getNfsSR(conn, store);
            } else if (store.getScheme().equalsIgnoreCase("iscsi")) {
                //getIscsiSR(conn, dataStore);
            } else if (store.getScheme().equalsIgnoreCase("presetup")) {
View Full Code Here

   
    protected Answer execute(AttachPrimaryDataStoreCmd cmd) {
        String dataStoreUri = cmd.getDataStore();
        Connection conn = hypervisorResource.getConnection();
        try {
            DecodedDataObject obj = Decoder.decode(dataStoreUri);
            DecodedDataStore store = obj.getStore();
            SR sr = hypervisorResource.getStorageRepository(conn, store.getUuid());
            hypervisorResource.setupHeartbeatSr(conn, sr, false);
            long capacity = sr.getPhysicalSize(conn);
            long available = capacity - sr.getPhysicalUtilisation(conn);
            if (capacity == -1) {
View Full Code Here

            return new Answer(cmd, false, msg);
        }
    }
   
    protected Answer execute(CopyCmd cmd) {
        DecodedDataObject srcObj = null;
        DecodedDataObject destObj = null;
        try {
            srcObj = Decoder.decode(cmd.getSrcUri());
            destObj = Decoder.decode(cmd.getDestUri());
        } catch (URISyntaxException e) {
            return new Answer(cmd, false, e.toString());
View Full Code Here

    public String grantAccess(DataObject object, EndPoint ep) {
        //StoragePoolHostVO poolHost = storeHostDao.findByPoolHost(object.getDataStore().getId(), ep.getId());
       
        String uri = object.getUri();
        try {
            DecodedDataObject obj = Decoder.decode(uri);
            if (obj.getPath() == null) {
                //create an obj
                EndPoint newEp = selector.select(object);
                CreateObjectCommand createCmd = new CreateObjectCommand(uri);
                CreateObjectAnswer answer = (CreateObjectAnswer)ep.sendMessage(createCmd);
                if (answer.getResult()) {
View Full Code Here

TOP

Related Classes of com.cloud.utils.storage.encoding.DecodedDataObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.