Package org.zeroexchange.model.user

Examples of org.zeroexchange.model.user.User


        if(usersEfforts == null || usersEfforts.isEmpty()) {
            return;
        }
        //List<PayerData> totalUsersEfforts = new ArrayList<PayerData>();
        for(PayerData payerData: usersEfforts) {
            User user =  payerData.getPayer();
            ZECurrency currency = payerData.getCurrency();
            BigDecimal userDebt = payerData.getAmount();
            CurrencyManager currencyManager = getCurrencyManager(currency);
            currencyManager.writeOn(userDebt, currency, user);
        }
View Full Code Here


        tester.getRequest().setParameter("body", "test body!");
       
        @SuppressWarnings("unchecked")
        Form<MessageData> form = (Form<MessageData>) tester.getComponentFromLastRenderedPage("createMessageForm");
        MessageData data = form.getModel().getObject();
        data.setRecipients(Collections.singleton(new User()));
       
        tester.clickLink(
                "toolbarContainer:toolbarGroups:0:toolbarItem:link");

        verify(eventsDispatcher).publishEvent(Matchers.<Event>any());
View Full Code Here

                ContractData postedData = getModelObject();
                updateContract(postedData);
            }
        };

        User currentUser = authorizedUserService.getCurrentUser();
        boolean isEditEditable = contract.getStatus() != ContractStatus.EXECUTED && currentUser != null && currentUser.equals(contract.getOwner());

        //Title field
        TextField<String> titleInput = new TextField<String>(CKEY_CONTRACT_TITLE);
        titleInput.setEnabled(isEditEditable);
        titleInput.setRequired(true);
View Full Code Here

    /**
     * Returns true if the user debt is exceeded.
     */
    private boolean isUserDebtExceeded() {
       
        User user = authorizedUserService.getCurrentUser();
        BigDecimal userContribution = contractInformant.getUserContributionPrice(
                getContract(),
                user,
                moneyManager.getDefaultCurrency());
       
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public Message getUserMessage(Integer messageId, Integer recepientId) {
        Message message = messageDAO.getById(messageId);
        User recipient = message.getRecipient();
        if(recipient == null || !recipient.getId().equals(recepientId)) {
            return null;
        }
       
        return message;
    }
View Full Code Here

        String senderName = sender == null ? null : sender.getDisplayName();
        parameters.put(TKEY_SENDER, senderName == null ? UNKNOWN_USER_NAME : senderName);
        String senderSign = sender == null ? null : sender.getSign();
        parameters.put(TKEY_SENDER_SIGN, senderSign == null ? "" : senderSign);
        if(recipients != null && recipients.size() == 1) {
            User recipient = recipients.iterator().next();
            String recipientName = recipient.getDisplayName();
            parameters.put(TKEY_RECIPIENT, recipientName == null ? UNKNOWN_USER_NAME : recipientName);
        }
        String body = templateGenerator.generate(TEMPLATE_PREFIX + templatePath, parameters, localeService.getCurrentLocale());
       
        send(recipients, sender, subject, body);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public User createNewUser() {
        User user = new User();
       
        Set<Role> roles = new HashSet<Role>();
        roles.add(roleDAO.getRole(Role.ROLE_USER));
        user.setRoles(roles);
       
        return user;
    }
View Full Code Here

        if(!isUserSupplier(contract, currentUserId, true)) {
            return false;
        }
       
        //Create user key
        User user = new User();
        user.setId(currentUserId);
       
        Collection<User> contractUsers = contractDAO.getUsers(contract.getId());
        return contractUsers.contains(user);
    }
View Full Code Here

        ContractStatus contractStatus = contractStatusInformant.getContractStatus(contract, currentUserId);
        if(contractStatus != ContractStatus.UNCOMPLETED &&
                contractStatus != ContractStatus.READY) {
            return false;
        }
        User owner = contract.getOwner();
       
        //The new resources can be added only by the owners of the contract
        //OR
        //by users that occurs in the accepted suppliers.
        if(owner != null && currentUserId.equals(owner.getId())) {
            return true;
        }
        return isUserSupplier(contract, currentUserId, true);
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public void reserveAmount(ResourceTender resourceTender, Resource resource) {
        BigDecimal amount = resourceTender.getAmount();
        User tenderOwner = resourceTender.getUser();
        User userId = tenderOwner == null ? null : tenderOwner;
        if(amount != null) {
            currenciesManager.reserveAmount(amount, currenciesManager.getDefaultCurrency(), userId);
        }
    }
View Full Code Here

TOP

Related Classes of org.zeroexchange.model.user.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.