Examples of UserProfile


Examples of org.gudy.azureus2.ui.console.UserProfile

      {       
        ci.out.println("> AddUser error: user '" + userName + "' already exists");
        return;
      }
     
      UserProfile profile = new UserProfile(userName, userType);
      profile.setPassword(password);
      String defaultSaveDirectory = commandLine.getOptionValue('d', null);
      profile.setDefaultSaveDirectory(defaultSaveDirectory);
     
      getUserManager().addUser(profile);
      ci.out.println("> AddUser: user '" + userName + "' added");
      saveUserManagerConfig(ci.out);
    }
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

      {
        ci.out.println("> ModifyUser: (u)sername option not specified");
        return;
      }
     
      UserProfile profile = getUserManager().getUser(userName);
      if( profile == null )
      {       
        ci.out.println("> ModifyUser: error - user '" + userName + "' not found");
        return;
      }

      boolean modified = false;
     
      String userType = commandLine.getOptionValue('t');
      if( userType != null )
      {
        if( UserProfile.isValidUserType(userType.toLowerCase()))
        {
          profile.setUserType(userType.toLowerCase());
          modified = true;
        }
        else
        {
          ci.out.println("> ModifyUser: invalid profile type '" + userType + "'. Valid values are: " + UserProfile.ADMIN + "," + UserProfile.USER + "," + UserProfile.GUEST);
          return;
        }
      }     
     
      String password = commandLine.getOptionValue('p');
      if( password != null )
      {
        profile.setPassword(password);
        modified = true;
      }
      String defaultSaveDirectory = commandLine.getOptionValue('d');
     
      if( defaultSaveDirectory != null ){
       
        modified = true;

        if defaultSaveDirectory.length() > 0 ){
       
          profile.setDefaultSaveDirectory(defaultSaveDirectory);
        }else{
     
          profile.setDefaultSaveDirectory(null);
        }
      }
     
      if( modified )
      {
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

    public void execute(String commandName, ConsoleInput ci, List args)
    {
      ci.out.println("> -----");
      ci.out.println("> Username\tProfile\t\tSave Directory");
      for (Iterator iter = getUserManager().getUsers().iterator(); iter.hasNext();) {
        UserProfile profile = (UserProfile) iter.next();
        String saveDir = profile.getDefaultSaveDirectory();
        if( saveDir == null ) saveDir = "(default)";
        ci.out.println("> " + profile.getUsername() + "\t\t" + profile.getUserType() + "\t\t" + saveDir);
      }
      ci.out.println("> -----");
    }
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

   */
  protected void setUp() throws Exception {
    super.setUp();
   
    manager = new InMemoryUserManager(null);
    profile1 = new UserProfile();
    profile1.setUsername("myuser1");
    profile1.setPassword("mypassword");
    manager.addUser(profile1);
    profile2 = new UserProfile();
    profile2.setUsername("myuser2");
    profile2.setPassword("zigzag");
    profile2.setUserType(UserProfile.USER);
    manager.addUser(profile2);   
  }
View Full Code Here

Examples of org.gudy.azureus2.ui.console.UserProfile

    manager.save(out);
    System.out.println("Saved to: " + new String(out.toByteArray()));
    ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
    InMemoryUserManager newManager = new InMemoryUserManager(null);
    newManager.load(in);
    UserProfile profile3 = new UserProfile();
    profile3.setUserType(UserProfile.GUEST);
    profile3.setUsername("user3");
    profile3.setPassword("whatever");
    assertTrue( manager.getUsers().contains(profile1 ) );
    assertTrue( manager.getUsers().contains(profile2 ) );
    assertFalse( manager.getUsers().contains(profile3 ) );
    assertTrue( newManager.getUsers().contains(profile1 ) );
    assertTrue( newManager.getUsers().contains(profile2 ) );
View Full Code Here

Examples of org.hive2hive.core.model.UserProfile

  public static File downloadFile(NetworkManager networkManager, PublicKey fileKey) throws NoSessionException,
      GetFailedException, NoPeerConnectionException {
    IProcessComponent process = ProcessFactory.instance().createDownloadFileProcess(fileKey, networkManager);
    executeProcess(process);
    UserProfile userProfile = getUserProfile(networkManager, networkManager.getSession().getCredentials());
    return FileUtil.getPath(networkManager.getSession().getRoot(), userProfile.getFileById(fileKey)).toFile();
  }
View Full Code Here

Examples of org.jasig.portal.UserProfile

      } else if (action.equals("managePreferences")) {
          if (profileId != null) {
              // find the profile mapping
            try {
              if (systemProfile) {
                  UserProfile newProfile = ulsdb.getSystemProfileById(profileId.intValue());
                  if(newProfile!=null && (!(editedProfile.isSystemProfile() && editedProfile.getProfileId()==newProfile.getProfileId()))) {
                      // new profile has been selected
                      editedProfile=newProfile;
                      instantiateManagePreferencesState(editedProfile);
                  }
              } else {
                  UserProfile newProfile = ulsdb.getUserProfileById(upm.getPerson(), profileId.intValue());
                  if(newProfile!=null && (editedProfile.isSystemProfile() || (editedProfile.getProfileId()!=newProfile.getProfileId()))) {
                      // new profile has been selected
                      editedProfile=newProfile;
                      instantiateManagePreferencesState(editedProfile);
                  }
              }
View Full Code Here

Examples of org.jboss.seam.social.oauth.UserProfile

    * return "ok"; }
    */

   public UserProfile getUser()
   {
      UserProfile res = currentServiceHdl == null ? null : currentServiceHdl.getUser();

      return res;
   }
View Full Code Here

Examples of org.oasis.wsrp.v2.UserProfile

      String jobTitle = userInfos.get(INFO_USER_JOB_TITLE);
      EmployerInfo employerInfo = WSRPTypeFactory.createEmployerInfo(employer, department, jobTitle);

      Contact homeInfo = createContactFrom(userInfos, false);
      Contact businessInfo = createContactFrom(userInfos, true);
      UserProfile userProfile = WSRPTypeFactory.createUserProfile(name, bdate, userInfos.get(INFO_USER_GENDER), employerInfo, homeInfo, businessInfo);

      return userProfile;
   }
View Full Code Here

Examples of org.pac4j.core.profile.UserProfile

            final HtmlPage redirectionPage = getRedirectionPage(webClient, client, context);

            updateContextForAuthn(webClient, redirectionPage, context);

            final UserProfile profile = getCredentialsAndProfile(client, context);

            verifyProfile(profile);

            // Java serialization
            byte[] bytes = TestsHelper.serialize(profile);
            final UserProfile profile2 = (UserProfile) TestsHelper.unserialize(bytes);
            verifyProfile(profile2);

            // like CAS serialization
            final Map<String, Object> attributes = profile2.getAttributes();
            final Map<String, Object> newAttributes = new HashMap<String, Object>();
            for (final String key : attributes.keySet()) {
                newAttributes.put(key, attributes.get(key).toString());
            }
            final UserProfile profile3 = ProfileHelper.buildProfile(profile2.getTypedId(), newAttributes);
            verifyProfile(profile3);

            // Kryo serialization
            final Kryo kryo = new Kryo();
            kryo.register(HashMap.class);
            kryo.register(Locale.class, new LocaleSerializer());
            kryo.register(Date.class);
            kryo.register(FormattedDate.class, new FormattedDateSerializer());
            kryo.register(Gender.class);
            kryo.register(Color.class, new ColorSerializer());
            kryo.register(ArrayList.class);
            registerForKryo(kryo);
            bytes = TestsHelper.serializeKryo(kryo, profile);
            final UserProfile profile4 = (UserProfile) TestsHelper.unserializeKryo(kryo, bytes);
            verifyProfile(profile4);
        } finally {
            ProfileHelper.setKeepRawData(false);
        }
    }
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.