Examples of User


Examples of eu.franzoni.domain.User

    userRepository.save(new User("admin", "admin", "ROLE_ADMIN"));
  }
 
  @Override
  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    User user = userRepository.findByUsername(username);
    if(user == null) {
      throw new UsernameNotFoundException("user not found");
    }
    GrantedAuthority authority = new SimpleGrantedAuthority(user.getRole());
    return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), Collections.singleton(authority));
  }
View Full Code Here

Examples of eu.lsem.bakalarka.model.User

     * @return
     */
    public Resolution save() {
        String encodedPassword = passwordEncoder.encodePassword(password, applicationConfiguration.getSystemWideSalt());
        if (id == null) {
            User u = new User();
            u.setUsername(username);
            u.setPassword(encodedPassword);
            u.setEnabled(false);
            u.setLastLogin(null);
            List<String> roles = new LinkedList<String>();
            roles.add("ROLE_ADMIN");
            u.setRoles(roles);

            try {
                userDao.insertUser(u);
            } catch (DataIntegrityViolationException e) {
                getContext().getValidationErrors().add("username", new SimpleError("Tento u�ivatel ji� existuje."));
View Full Code Here

Examples of eu.planets_project.ifr.core.security.api.model.User

  public boolean isUsernameAvailable(String username) {
    log.info("SelfRegistrationManagerImpl.isUsernameAvailable");
    log.info("Checking availability of " + username);
    try {
      log.info("Who you gonna call, SelfRegistrationManagerImpl.getUserByUsername for " + username);
      User user = this.getUserByUsername(username);
      log.info("Checking for null username");
      if( user != null ) {
        log.info("Found a user :" + user.getUsername());
        log.info("username " + username + " NOT available");
        return false;
      } else {
        log.info("username " + username + " available");
        return true;
View Full Code Here

Examples of eu.planets_project.pp.plato.model.User

            planetsUser = um.getUserByUsername(userId);
        } catch(UserNotFoundException e){
            return null;
        }

        User user = new User();

        user.setUsername(planetsUser.getUsername());
        user.setFirstName(planetsUser.getFirstName());
        user.setLastName(planetsUser.getLastName());
       
        Set<eu.planets_project.ifr.core.security.api.model.Role> planetsRoles = planetsUser.getRoles();
       
        for (eu.planets_project.ifr.core.security.api.model.Role r : planetsRoles) {
            Role role = new Role();
            role.setName(r.getName());
            user.getRoles().add(role);
        }
       
        return user;
    }
View Full Code Here

Examples of eu.scape_project.planning.model.User

    /**
     * Discards changes.
     */
    public void discard() {
        User origUser = em.find(User.class, user.getId());
        user.setUserGroup(origUser.getUserGroup());

        init();

        log.debug("Group changes discarted for user " + user.getUsername());
    }
View Full Code Here

Examples of eu.semberal.reminders.entity.User

    @Override
    public void addAttachment(InputStream stream, String filename, Long userId) throws Exception {
        if (stream == null || filename == null || userId == null)
            throw new IllegalArgumentException("Argument is null"); //if sth is null, throw exception
        User u = entityManager.find(User.class, userId);
        if (u == null)
            throw new IllegalArgumentException("User with specified ID was not found."); //if user not found, throw error

        Attachment a = new Attachment();
        a.setDateAdded(new Date());
View Full Code Here

Examples of eu.stratosphere.api.java.record.io.avro.generated.User

    HashMap<CharSequence, Long> longMap = new HashMap<CharSequence, Long>();
    longMap.put(TEST_MAP_KEY1, TEST_MAP_VALUE1);
    longMap.put(TEST_MAP_KEY2, TEST_MAP_VALUE2);
   
   
    User user1 = new User();
    user1.setName(TEST_NAME);
    user1.setFavoriteNumber(256);
    user1.setTypeDoubleTest(123.45d);
    user1.setTypeBoolTest(true);
    user1.setTypeArrayString(stringArray);
    user1.setTypeArrayBoolean(booleanArray);
    user1.setTypeEnum(TEST_ENUM_COLOR);
    user1.setTypeMap(longMap);
      
    // Construct via builder
    User user2 = User.newBuilder()
                 .setName("Charlie")
                 .setFavoriteColor("blue")
                 .setFavoriteNumber(null)
                 .setTypeBoolTest(false)
                 .setTypeDoubleTest(1.337d)
View Full Code Here

Examples of evolaris.framework.um.datamodel.User

     
    // execute the commands 
    Set<CommandEntry> commandEntries = invocation.getCommandEntries();
    // table-driven action evaluation
    UserManager userManager = new UserManager(locale,session);
    User user = userManager.registerUserByMsisdn(Long.parseLong(msisdn), null, invocation.getGroup());
   
    InteractionLogManager interactionLogManager = new InteractionLogManager(locale, session);   
    EventParameters eventParameters = null;
   
    ReceivedSms receivedSms = new ReceivedSms();
View Full Code Here

Examples of example.User

        }
        return 0;
    }

    public String execute() throws Exception {
        User user = getUser();
        String name = user.getName();
        if ((name == null) || (name.trim().equals(""))) {
            addFieldError("user.name", "You must enter a name.");
        }
        if (hasErrors()) {
            return INPUT;
View Full Code Here

Examples of example.angularspring.dto.User

public class SpringUserService implements UserService {

    public User getCurrentUser() {
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication == null || !(authentication.getPrincipal() instanceof UserDetails)) {
            return new User("");
        }

        return new User(((UserDetails) authentication.getPrincipal()).getUsername());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.