Package com.cloud.projects

Examples of com.cloud.projects.ProjectVO


                if (!deleteAccount) {
                    s_logger.warn("Failed to cleanup account id=" + account.getId() + " as a part of domain cleanup");
                }
                success = (success && deleteAccount);   
            } else {
                ProjectVO project = _projectDao.findByProjectAccountId(account.getId());
                s_logger.debug("Deleting project " + project + " as a part of domain id=" + domainId + " cleanup");
                boolean deleteProject = _projectMgr.deleteProject(UserContext.current().getCaller(), UserContext.current().getCallerUserId(), project);
                if (!deleteProject) {
                    s_logger.warn("Failed to cleanup project " + project + " as a part of domain cleanup");
                }
View Full Code Here


    @DB
    public boolean remove(Long projectId) {
        boolean result = false;
        Transaction txn = Transaction.currentTxn();
        txn.start();
        ProjectVO projectToRemove = findById(projectId);
        projectToRemove.setName(null);
        if (!update(projectId, projectToRemove)) {
            s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove");
            return false;
        }
       
View Full Code Here

    @Override
    public String getProjectName(long accountId) {
        Account account = _accountDao.findById(accountId);
        if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) {
            ProjectVO project = _projectDao.findByProjectAccountId(account.getId());
            if (project != null) {
                return project.getName();
            }
        }
        return VNC_DEFAULT_PROJECT;
    }
View Full Code Here

        return null;
    }

    @Override
    public String getProjectId(long domainId, long accountId) throws IOException {
        ProjectVO project = getProject(accountId);
        if (project != null) {
            return project.getUuid();
        }
        DomainVO domain = _domainDao.findById(domainId);
        if (domain.getId() != Domain.ROOT_DOMAIN) {
            net.juniper.contrail.api.types.Domain vncDomain =
                    (net.juniper.contrail.api.types.Domain)_api.findById(net.juniper.contrail.api.types.Domain.class, domain.getUuid());
View Full Code Here

    public void deleteProject(String name) {
        BaseCmd cmd = new DeleteProjectCmd();
        BaseCmd proxy = ComponentContext.inject(cmd);

        ProjectVO project = _projectDao.findByNameAndDomain(name, Domain.ROOT_DOMAIN);
        try {
            ManagementServerMock.setParameter(proxy, "id", BaseCmd.CommandType.LONG, project.getId());
            ((DeleteProjectCmd)proxy).execute();
            if (_api.findById(net.juniper.contrail.api.types.Project.class, project.getUuid()) != null) {
                fail("unable to delete project in vnc");
            }
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception while deleting project");
View Full Code Here

                if (!deleteAccount) {
                    s_logger.warn("Failed to cleanup account id=" + account.getId() + " as a part of domain cleanup");
                }
                success = (success && deleteAccount);
            } else {
                ProjectVO project = _projectDao.findByProjectAccountId(account.getId());
                s_logger.debug("Deleting project " + project + " as a part of domain id=" + domainId + " cleanup");
                boolean deleteProject = _projectMgr.deleteProject(CallContext.current().getCallingAccount(), CallContext.current().getCallingUserId(), project);
                if (!deleteProject) {
                    s_logger.warn("Failed to cleanup project " + project + " as a part of domain cleanup");
                }
View Full Code Here

    public void onProjectCreate(String subject, String topic, org.apache.cloudstack.framework.events.Event event) {
        s_logger.info("onProjectCreate; topic: " + topic + "; subject: " + subject);
        try {
            long id = parseForId(event.getResourceType(), event.getDescription());
            if (id != 0) {
                ProjectVO project = _projectDao.findById(id);
                if (project != null) {
                    s_logger.info("createProject for name: " + project.getName() + "; uuid: " + project.getUuid());
                    StringBuffer logMesg = new StringBuffer();
                    _dbSync.createProject(project, logMesg);
                } else {
                    /* could not find db record, resync complete class */
                    _dbSync.syncClass(net.juniper.contrail.api.types.Project.class);
View Full Code Here

    @DB
    public boolean remove(Long projectId) {
        boolean result = false;
        TransactionLegacy txn = TransactionLegacy.currentTxn();
        txn.start();
        ProjectVO projectToRemove = findById(projectId);
        projectToRemove.setName(null);
        if (!update(projectId, projectToRemove)) {
            s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove");
            return false;
        }
View Full Code Here

    @DB
    public boolean remove(Long projectId) {
        boolean result = false;
        Transaction txn = Transaction.currentTxn();
        txn.start();
        ProjectVO projectToRemove = findById(projectId);
        projectToRemove.setName(null);
        if (!update(projectId, projectToRemove)) {
            s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove");
            return false;
        }
       
View Full Code Here

                success = (success && _accountMgr.deleteAccount(account, UserContext.current().getCallerUserId(), UserContext.current().getCaller()));
                if (!success) {
                    s_logger.warn("Failed to cleanup account id=" + account.getId() + " as a part of domain cleanup");
                }
            } else {
                ProjectVO project = _projectDao.findByProjectAccountId(account.getId());
                s_logger.debug("Deleting project " + project + " as a part of domain id=" + domainId + " cleanup");
                success = (success && _projectMgr.deleteProject(UserContext.current().getCaller(), UserContext.current().getCallerUserId(), project));
                if (!success) {
                    s_logger.warn("Failed to cleanup project " + project + " as a part of domain cleanup");
                }
View Full Code Here

TOP

Related Classes of com.cloud.projects.ProjectVO

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.