Package org.apache.cloudstack.network.dao

Examples of org.apache.cloudstack.network.dao.SspUuidVO


        boolean processed = false;
        for(SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)){
            SspClient.TenantNetwork sspNet = client.createTenantNetwork(tenantUuid, network.getName());
            if(sspNet != null){
                SspUuidVO uuid = new SspUuidVO();
                uuid.setUuid(sspNet.uuid);
                uuid.setObjClass(SspUuidVO.objClassNetwork);
                uuid.setObjId(network.getId());
                _sspUuidDao.persist(uuid);
                return true;
            }
            processed = true;
        }
View Full Code Here


            SspClient.TenantPort sspPort = client.createTenantPort(tenantNetworkUuid);
            if(sspPort != null){
                tenantPortUuid = sspPort.uuid;
                nic.setReservationId(reservationId);

                SspUuidVO uuid = new SspUuidVO();
                uuid.setUuid(tenantPortUuid);
                uuid.setObjClass(SspUuidVO.objClassNicProfile);
                uuid.setObjId(nic.getId());
                uuid.setReservationId(reservationId);
                _sspUuidDao.persist(uuid);
                break;
            }
        }
        if(tenantPortUuid == null){
View Full Code Here

            s_logger.error("ReservationContext was null for "+nic+" "+network);
            return false;
        }
        String reservationId = context.getReservationId();

        SspUuidVO deleteTarget = null;
        SspUuidVO remainingTarget = null;
        List<SspUuidVO> tenantPortUuidVos = _sspUuidDao.listUUidVoByNicProfile(nic);
        for(SspUuidVO tenantPortUuidVo : tenantPortUuidVos){
            if(reservationId.equals(tenantPortUuidVo.getReservationId())){
                deleteTarget = tenantPortUuidVo;
            }else{
                remainingTarget = tenantPortUuidVo;
            }
        }

        if(deleteTarget != null){ // delete the target ssp uuid (tenant-port)
            String tenantPortUuid = deleteTarget.getUuid();
            boolean processed = false;
            for(SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)){
                SspClient.TenantPort sspPort = client.updateTenantVifBinding(tenantPortUuid, null);
                if(sspPort != null){
                    processed = true;
                    break;
                }
            }
            if(!processed){
                s_logger.warn("Ssp api nic detach failed "+nic.toString());
            }
            processed = false;
            for(SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)){
                if(client.deleteTenantPort(tenantPortUuid)){
                    _sspUuidDao.removeUuid(tenantPortUuid);
                    processed = true;
                    break;
                }
            }
            if(!processed){
                s_logger.warn("Ssp api tenant port deletion failed "+nic.toString());
            }
            _sspUuidDao.removeUuid(tenantPortUuid);
        }
        if(remainingTarget != null){
            NicVO nicVo = _nicDao.findById(nic.getId());
            nicVo.setReservationId(remainingTarget.getReservationId());
            _nicDao.persist(nicVo); // persist the new reservationId
        }
        return true;
    }
View Full Code Here

        boolean processed = false;
        for (SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)) {
            SspClient.TenantNetwork sspNet = client.createTenantNetwork(tenantUuid, network.getName());
            if (sspNet != null) {
                SspUuidVO uuid = new SspUuidVO();
                uuid.setUuid(sspNet.uuid);
                uuid.setObjClass(SspUuidVO.objClassNetwork);
                uuid.setObjId(network.getId());
                _sspUuidDao.persist(uuid);
                return true;
            }
            processed = true;
        }
View Full Code Here

            SspClient.TenantPort sspPort = client.createTenantPort(tenantNetworkUuid);
            if (sspPort != null) {
                tenantPortUuid = sspPort.uuid;
                nic.setReservationId(reservationId);

                SspUuidVO uuid = new SspUuidVO();
                uuid.setUuid(tenantPortUuid);
                uuid.setObjClass(SspUuidVO.objClassNicProfile);
                uuid.setObjId(nic.getId());
                uuid.setReservationId(reservationId);
                _sspUuidDao.persist(uuid);
                break;
            }
        }
        if (tenantPortUuid == null) {
View Full Code Here

            s_logger.error("ReservationContext was null for " + nic + " " + network);
            return false;
        }
        String reservationId = context.getReservationId();

        SspUuidVO deleteTarget = null;
        SspUuidVO remainingTarget = null;
        List<SspUuidVO> tenantPortUuidVos = _sspUuidDao.listUUidVoByNicProfile(nic);
        for (SspUuidVO tenantPortUuidVo : tenantPortUuidVos) {
            if (reservationId.equals(tenantPortUuidVo.getReservationId())) {
                deleteTarget = tenantPortUuidVo;
            } else {
                remainingTarget = tenantPortUuidVo;
            }
        }

        if (deleteTarget != null) { // delete the target ssp uuid (tenant-port)
            String tenantPortUuid = deleteTarget.getUuid();
            boolean processed = false;
            for (SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)) {
                SspClient.TenantPort sspPort = client.updateTenantVifBinding(tenantPortUuid, null);
                if (sspPort != null) {
                    processed = true;
                    break;
                }
            }
            if (!processed) {
                s_logger.warn("Ssp api nic detach failed " + nic.toString());
            }
            processed = false;
            for (SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)) {
                if (client.deleteTenantPort(tenantPortUuid)) {
                    _sspUuidDao.removeUuid(tenantPortUuid);
                    processed = true;
                    break;
                }
            }
            if (!processed) {
                s_logger.warn("Ssp api tenant port deletion failed " + nic.toString());
            }
            _sspUuidDao.removeUuid(tenantPortUuid);
        }
        if (remainingTarget != null) {
            NicVO nicVo = _nicDao.findById(nic.getId());
            nicVo.setReservationId(remainingTarget.getReservationId());
            _nicDao.persist(nicVo); // persist the new reservationId
        }
        return true;
    }
View Full Code Here

        boolean processed = false;
        for(SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)){
            SspClient.TenantNetwork sspNet = client.createTenantNetwork(tenantUuid, network.getName());
            if(sspNet != null){
                SspUuidVO uuid = new SspUuidVO();
                uuid.setUuid(sspNet.uuid);
                uuid.setObjClass(SspUuidVO.objClassNetwork);
                uuid.setObjId(network.getId());
                _sspUuidDao.persist(uuid);
                return true;
            }
            processed = true;
        }
View Full Code Here

            SspClient.TenantPort sspPort = client.createTenantPort(tenantNetworkUuid);
            if(sspPort != null){
                tenantPortUuid = sspPort.uuid;
                nic.setReservationId(reservationId);

                SspUuidVO uuid = new SspUuidVO();
                uuid.setUuid(tenantPortUuid);
                uuid.setObjClass(SspUuidVO.objClassNicProfile);
                uuid.setObjId(nic.getId());
                uuid.setReservationId(reservationId);
                _sspUuidDao.persist(uuid);
                break;
            }
        }
        if(tenantPortUuid == null){
View Full Code Here

            s_logger.error("ReservationContext was null for "+nic+" "+network);
            return false;
        }
        String reservationId = context.getReservationId();

        SspUuidVO deleteTarget = null;
        SspUuidVO remainingTarget = null;
        List<SspUuidVO> tenantPortUuidVos = _sspUuidDao.listUUidVoByNicProfile(nic);
        for(SspUuidVO tenantPortUuidVo : tenantPortUuidVos){
            if(reservationId.equals(tenantPortUuidVo.getReservationId())){
                deleteTarget = tenantPortUuidVo;
            }else{
                remainingTarget = tenantPortUuidVo;
            }
        }

        if(deleteTarget != null){ // delete the target ssp uuid (tenant-port)
            String tenantPortUuid = deleteTarget.getUuid();
            boolean processed = false;
            for(SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)){
                SspClient.TenantPort sspPort = client.updateTenantVifBinding(tenantPortUuid, null);
                if(sspPort != null){
                    processed = true;
                    break;
                }
            }
            if(!processed){
                s_logger.warn("Ssp api nic detach failed "+nic.toString());
            }
            processed = false;
            for(SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)){
                if(client.deleteTenantPort(tenantPortUuid)){
                    _sspUuidDao.removeUuid(tenantPortUuid);
                    processed = true;
                    break;
                }
            }
            if(!processed){
                s_logger.warn("Ssp api tenant port deletion failed "+nic.toString());
            }
            _sspUuidDao.removeUuid(tenantPortUuid);
        }
        if(remainingTarget != null){
            NicVO nicVo = _nicDao.findById(nic.getId());
            nicVo.setReservationId(remainingTarget.getReservationId());
            _nicDao.persist(nicVo); // persist the new reservationId
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.network.dao.SspUuidVO

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.