Package org.springframework.nanotrader.service.domain

Examples of org.springframework.nanotrader.service.domain.Accountprofile


  public UserDetails loadUserByUsername(String token) throws UsernameNotFoundException  {
    if (token == null) {
      log.error("UserDetailsServiceImpl.loadUserByUsername(): User not found with null token");
      throw new UsernameNotFoundException("UserDetailsServiceImpl.loadUserByUsername(): User not found with null token");
    }
    Accountprofile accountProfile = null;
    try {
      accountProfile = tradingServiceFacade.findAccountprofileByAuthtoken(token);
    } catch (AuthenticationException ae) {
      throw new UsernameNotFoundException("UserDetailsServiceImpl.loadUserByUsername(): User not found with token:" + token);
    }
   
    @SuppressWarnings("rawtypes")
    List<Map> accounts = accountProfile.getAccounts();
    Integer accountId = null;
    for(Map<?, ?> account: accounts ) {
      accountId = (Integer)account.get("accountid");
    }
   
   
 
    User user = new CustomUser(accountProfile.getUserid(), accountProfile.getPasswd(), getAuthorities(accountProfile.getUserid()), accountId, accountProfile.getProfileid(), token);
    if (log.isDebugEnabled()) {
      log.debug("UserDetailsServiceImpl.loadUserByUsername(): user=" + user  + " username::token" + token);
    }
   
    return user;
View Full Code Here


public class AccountProfileController extends BaseController {

  @RequestMapping(value = "/accountProfile/{id}", method = RequestMethod.GET)
  public  ResponseEntity<Accountprofile> find(@PathVariable("id") final Integer id) {
    this.getSecurityUtil().checkAccountProfile(id);
    Accountprofile accountProfile = getTradingServiceFacade().findAccountProfile(id);
    return new ResponseEntity<Accountprofile>(accountProfile, getNoCacheHeaders(),
        HttpStatus.OK);
   
  }
View Full Code Here

    @Cacheable(value="authorizationCache")
    public Accountprofile findAccountprofileByAuthtoken(String token) {
        if (token == null) {
            log.error("TradingServiceFacadeImpl.findAccountprofileByAuthtoken(): token is null");
        }
        Accountprofile accountProfileResponse = null;
        org.springframework.nanotrader.data.domain.Accountprofile accountProfile = new org.springframework.nanotrader.data.domain.Accountprofile();
        accountProfile = tradingService.findByAuthtoken(token);
        if (accountProfile != null) {
            accountProfileResponse = new Accountprofile();
            mapper.map(accountProfile, accountProfileResponse, ACCOUNT_PROFILE_MAPPING);
        } else {
            log.error("TradingServiceFacadeImpl.findAccountprofileByAuthtoken(): accountProfile is null for token=" + token);
            throw new AuthenticationException("Authorization Token not found");
        }
View Full Code Here

    }
   
    public Accountprofile findAccountprofileByUserId(String username) {
        org.springframework.nanotrader.data.domain.Accountprofile accountProfile = new org.springframework.nanotrader.data.domain.Accountprofile();
        accountProfile = tradingService.findAccountByUserId(username);
        Accountprofile accountProfileResponse = new Accountprofile();
        mapper.map(accountProfile, accountProfileResponse, "accountProfile-no-accounts");
        return accountProfileResponse;
    }
View Full Code Here

    public Accountprofile findAccountProfile(Integer id) {
        if (log.isDebugEnabled()) {
            log.debug("TradingServiceFacade.findAccountProfile: id=" + id);
        }
        org.springframework.nanotrader.data.domain.Accountprofile accountProfile = tradingService.findAccountProfile(id);
        Accountprofile accountProfileResponse = new Accountprofile();
        if (accountProfile == null) {
            throw new NoRecordsFoundException();
        }

        mapper.map(accountProfile, accountProfileResponse, "accountProfile");
View Full Code Here

TOP

Related Classes of org.springframework.nanotrader.service.domain.Accountprofile

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.