Package br.edu.utfpr.cm.JGitMinerWeb.model.miner

Examples of br.edu.utfpr.cm.JGitMinerWeb.model.miner.EntityUser


        if (gitPullReqMaker == null) {
            return null;
        }

        EntityRepository repository = RepositoryServices.createEntity(gitPullReqMaker.getRepo(), dao, false);
        EntityUser user = UserServices.createEntity(gitPullReqMaker.getUser(), dao, false);

        EntityPullRequestMarker pullReMaker = getByRefRepoUser(gitPullReqMaker.getRef(), repository, user, dao);

        if (pullReMaker == null) {
            pullReMaker = new EntityPullRequestMarker();
View Full Code Here


        EntityRepository repository = dao.findByID(repositoryToMinerId, EntityRepository.class);
        int i = 0;
        calculeSubProgress(i, collaborators.size());
        while (!canceled && i < collaborators.size()) {
            User gitCollab = collaborators.get(i);
            EntityUser colab = minerCollaborator(gitCollab);
            colab.addCollaboratedRepository(repository);
            dao.edit(colab);
            i++;
            calculeSubProgress(i, collaborators.size());
        }
    }
View Full Code Here

            calculeSubProgress(i, collaborators.size());
        }
    }

    private EntityUser minerCollaborator(User gitCollab) {
        EntityUser colab = null;
        try {
            colab = UserServices.createEntity(gitCollab, dao, false);
            out.printLog("Collaborator gravado com sucesso: " + gitCollab.getLogin() + " - ID: " + gitCollab.getId());
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

        EntityRepository repository = dao.findByID(repositoryToMinerId, EntityRepository.class);
        int i = 0;
        calculeSubProgress(i, watchers.size());
        while (!canceled && i < watchers.size()) {
            User gitWatcher = watchers.get(i);
            EntityUser watcher = minerWatcher(gitWatcher);
            watcher.addWatchedRepository(repository);
            dao.edit(watcher);
            i++;
            calculeSubProgress(i, watchers.size());
        }
    }
View Full Code Here

            calculeSubProgress(i, watchers.size());
        }
    }

    private EntityUser minerWatcher(User gitWatcher) {
        EntityUser watcher = null;
        try {
            watcher = UserServices.createEntity(gitWatcher, dao, false);
            out.printLog("Watcher gravado com sucesso: " + gitWatcher.getLogin() + " - ID: " + gitWatcher.getId());
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

    public static EntityUser createEntity(User gitUser, GenericDao dao, boolean firstMiner) {
        if (gitUser == null) {
            return null;
        }

        EntityUser user = getUserByLogin(gitUser.getLogin(), dao);

        if (firstMiner || user == null) {
            if (user == null) {
                user = new EntityUser();
            }
            if (gitUser.getLogin() != null
                    && (gitUser.getEmail() == null
                    || gitUser.getName() == null)) {
                gitUser = getGitUserByLogin(gitUser.getLogin());
            }
            user.setCreatedAt(gitUser.getCreatedAt());
            user.setCollaborators(gitUser.getCollaborators());
            user.setDiskUsage(gitUser.getDiskUsage());
            user.setFollowers(gitUser.getFollowers());
            user.setFollowing(gitUser.getFollowing());
            user.setOwnedPrivateRepos(gitUser.getOwnedPrivateRepos());
            user.setPrivateGists(gitUser.getPrivateGists());
            user.setPublicGists(gitUser.getPublicGists());
            user.setPublicRepos(gitUser.getPublicRepos());
            user.setTotalPrivateRepos(gitUser.getTotalPrivateRepos());
            user.setAvatarUrl(gitUser.getBlog());
            user.setCompany(gitUser.getCompany());
            user.setEmail(gitUser.getEmail());
            user.setHtmlUrl(gitUser.getHtmlUrl());
            user.setLocation(gitUser.getLocation());
            user.setName(gitUser.getName());
            user.setType(gitUser.getType());
        }

        user.setMineredAt(new Date());
        user.setGravatarId(gitUser.getGravatarId());
        user.setIdUser(gitUser.getId());
        user.setLogin(gitUser.getLogin());
        user.setUrl(gitUser.getUrl());

        if (user.getId() == null || user.getId().equals(0l)) {
            dao.insert(user);
        } else {
            dao.edit(user);
        }
View Full Code Here

TOP

Related Classes of br.edu.utfpr.cm.JGitMinerWeb.model.miner.EntityUser

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.