Package com.infoclinika.mssharing.model.internal.entity

Examples of com.infoclinika.mssharing.model.internal.entity.User


    @Inject
    private UserRepository userRepository;

    @Override
    public Subscription get(long actor) {
        User user = userRepository.findOne(actor);
        return new Subscription(user.getSubscription().getStatus(), user.getSubscription().getLastStatusChange());
    }
View Full Code Here


        return new Subscription(user.getSubscription().getStatus(), user.getSubscription().getLastStatusChange());
    }

    @Override
    public void update(long actor, Subscription.Status status) {
        User user = userRepository.findOne(actor);
        user.getSubscription().setStatus(status);
        user.getSubscription().setLastStatusChange(new Date());
        userRepository.save(user);
    }
View Full Code Here

        restTokenRepository.save(restToken);
    }

    @Override
    public UserDetails getUserDetailsByEmail(String email) {
        User user = userRepository.findByEmail(email);
        if (user == null) {
            return null;
        }
        RestToken restToken = user.getRestToken();
        return new UserDetails(
                user.getId(),
                user.getEmail(),
                user.getPasswordHash(),
                restToken != null ?
                        new Token(restToken.getId(),
                                restToken.getToken(),
                                restToken.getExpirationDate())
                        : null,
                user.isEmailVerified(),
                user.getLabs().size() > 0
        );
    }
View Full Code Here

    public UserDetails checkToken(String token) {
        RestToken restToken = restTokenRepository.findByToken(token);
        if(restToken == null || restToken.getExpirationDate().compareTo(new Date()) <= 0){
            return null;
        }
        User user = userRepository.findOne(restToken.getId());
        if(user == null){
            return null;
        }
        return new UserDetails(
                user.getId(),
                user.getEmail(),
                user.getPasswordHash(),
                new Token(restToken.getId(),
                        restToken.getToken(),
                        restToken.getExpirationDate()),
                user.isEmailVerified(),
                user.getLabs().size() > 0
        );
    }
View Full Code Here

    public UserDetails getUserDetailsByToken(String token) {
        RestToken restToken = restTokenRepository.findByToken(token);
        if (restToken == null) {
            return null;
        }
        User user = userRepository.findOne(restToken.getId());
        if (user == null) {
            return null;
        }
        return new UserDetails(
                user.getId(),
                user.getEmail(),
                user.getPasswordHash(),
                new Token(restToken.getId(),
                        restToken.getToken(),
                        restToken.getExpirationDate()),
                user.isEmailVerified(),
                user.getLabs().size() > 0
        );
    }
View Full Code Here

        this.repository = repository;
    }

    @Override
    public UserShortForm shortForm(long actor) {
        final User user = find(actor);
        return new UserShortForm(user.getId(),
                user.getFullName(),
                user.getEmail(),
                getLabNames(user));
    }
View Full Code Here

                getLabNames(user));
    }

    @Override
    public AccountSettingsForm accountSettingsForm(long actor) {
        final User user = find(actor);
        return new AccountSettingsForm(
                user.getPersonData().getFirstName(),
                user.getPersonData().getLastName(),
                getLabNames(user),
                user.getEmail());
    }
View Full Code Here

    @Inject
    private Transformers transformers;

    @Override
    public long createView(Long user, ColumnViewType type, String name, Set<ColumnInfo> columns, boolean primary) {
        final User user1;
        user1 = user == null ? null : userRepository.findOne(user);
        final ColumnsView view = new ColumnsView(name, transformType(type), user1);
        final Collection<ViewColumn> values = transformViewToModel(columns);
        view.getColumns().addAll(values);
        view.setPrimary(primary);
View Full Code Here

                : Optional.<ColumnView>absent();
    }

    @Override
    public void removeView(long actor, long viewId) {
        final User user = checkPresence(userRepository.findOne(actor));
        final ColumnsView view = columnViewRepository.findOne(viewId);
        if (!user.equals(view.getUser())) {
            throw new AccessDenied("User isn't permitted to remove columns view");
        }
        columnViewRepository.delete(view);
    }
View Full Code Here

        this.userRepository = userRepository;
    }

    @Override
    public UserDetails getUserDetailsByEmail(String email) {
        User user = userRepository.findByEmail(email);
        return USER_DETAILS_FROM_USER.apply(user);
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.model.internal.entity.User

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.