Codota Logo
sockslib.server.manager
Code IndexAdd Codota to your IDE (free)

How to use sockslib.server.manager

Best Java code snippets using sockslib.server.manager (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: theotherp/nzbhydra2

private String generateEncryptPassword(final User user, String newPassword) {
  User tempUser = user.copy();
  if (newPassword != null) {
    tempUser.setPassword(newPassword);
  }
  if (passwordProtector == null) {
    passwordProtector = new NonePasswordProtector();
  }
  return passwordProtector.encrypt(tempUser);
}
origin: theotherp/nzbhydra2

@Override
public User load(String key) throws Exception {
  User user;
  user = fetchUserFromMongoDB(key);
  if (user == null) {
    return new User();
  } else {
    return user;
  }
}
origin: theotherp/nzbhydra2

@Override
public UserManager addUser(String username, String password) {
  create(new User(username, password));
  return this;
}
origin: theotherp/nzbhydra2

/**
 * Constructs a {@link MongoDBBasedUserManager} instance with {@link MongoDBConfiguration}.
 *
 * @param configuration Instance of {@link MongoDBConfiguration}.
 */
public MongoDBBasedUserManager(MongoDBConfiguration configuration) {
  this(configuration.getHost(), configuration.getPort(), configuration.getDatabase(),
      configuration.getUsername(), configuration.getPassword());
}
origin: theotherp/nzbhydra2

@Override
public void create(User user) {
  user.setPassword(generateEncryptPassword(user));
  Object[] args = {user.getUsername(), user.getPassword()};
  jdbcTemplate.execute(createUserSql, args);
}
origin: fengyouchao/sockslib

@Override
public User check(String username, String password) {
 User user = find(username);
 if (user != null && user.getPassword() != null && user.getPassword().equals(password)) {
  return user;
 }
 return null;
}
origin: theotherp/nzbhydra2

@Override
public User check(String username, String password) {
  User user = find(username);
  if (user != null && user.getPassword() != null && user.getPassword().equals(password)) {
    return user;
  }
  return null;
}
origin: theotherp/nzbhydra2

/**
 * Constructs a {@link MongoDBBasedUserManager} instance with configuration file path.
 * This constructor will read a specified file.
 *
 * @param configFile Configuration file path. The path support prefix "classpath:" or "file:".
 */
public MongoDBBasedUserManager(String configFile) {
  this(MongoDBConfiguration.load(configFile));
}
origin: fengyouchao/sockslib

/**
 * Creates a {@link MongoDBBasedUserManager} instance with no parameters.
 * This method is same as <code>new MongoDBBasedUserManager("classpath:mongo.properties")</code>.
 * It will read a configuration file in class path named "mongo.properties".
 *
 * @return Instance of <code>MongoDBBasedUserManager</code>
 */
public static MongoDBBasedUserManager newDefaultUserManager() {
 return new MongoDBBasedUserManager(MONGO_CONFIG_FILE);
}
origin: theotherp/nzbhydra2

@Override
public String encrypt(final User user) {
  return user.getPassword();
}
origin: theotherp/nzbhydra2

private String generateEncryptPassword(final User user, String newPassword) {
  User tempUser = user.copy();
  if (newPassword != null) {
    tempUser.setPassword(newPassword);
  }
  if (passwordProtector == null) {
    passwordProtector = new NonePasswordProtector();
  }
  return passwordProtector.encrypt(tempUser);
}
origin: fengyouchao/sockslib

/**
 * Constructs a {@link MongoDBBasedUserManager} instance with {@link MongoDBConfiguration}.
 *
 * @param configuration Instance of {@link MongoDBConfiguration}.
 */
public MongoDBBasedUserManager(MongoDBConfiguration configuration) {
 this(configuration.getHost(), configuration.getPort(), configuration.getDatabase(),
   configuration.getUsername(), configuration.getPassword());
}
origin: fengyouchao/sockslib

@Override
public User load(String key) throws Exception {
 User user;
 user = fetchUserFromMongoDB(key);
 if (user == null) {
  return new User();
 } else {
  return user;
 }
}
origin: fengyouchao/sockslib

@Override
public UserManager addUser(String username, String password) {
 create(new User(username, password));
 return this;
}
origin: theotherp/nzbhydra2

@Override
public User check(String username, String password) {
  User user = find(username);
  if (user != null && user.getPassword() != null && user.getPassword().equals(password)) {
    return user;
  }
  return null;
}
origin: fengyouchao/sockslib

@Override
public User check(String username, String password) {
 User user = find(username);
 if (user != null && user.getPassword() != null && user.getPassword().equals(password)) {
  return user;
 }
 return null;
}
origin: fengyouchao/sockslib

/**
 * Constructs a {@link MongoDBBasedUserManager} instance with configuration file path.
 * This constructor will read a specified file.
 *
 * @param configFile Configuration file path. The path support prefix "classpath:" or "file:".
 */
public MongoDBBasedUserManager(String configFile) {
 this(MongoDBConfiguration.load(configFile));
}
origin: theotherp/nzbhydra2

/**
 * Creates a {@link MongoDBBasedUserManager} instance with no parameters.
 * This method is same as <code>new MongoDBBasedUserManager("classpath:mongo.properties")</code>.
 * It will read a configuration file in class path named "mongo.properties".
 *
 * @return Instance of <code>MongoDBBasedUserManager</code>
 */
public static MongoDBBasedUserManager newDefaultUserManager() {
  return new MongoDBBasedUserManager(MONGO_CONFIG_FILE);
}
origin: fengyouchao/sockslib

private String generateEncryptPassword(final User user, String newPassword) {
 User tempUser = user.copy();
 if (newPassword != null) {
  tempUser.setPassword(newPassword);
 }
 if (passwordProtector == null) {
  passwordProtector = new NonePasswordProtector();
 }
 return passwordProtector.encrypt(tempUser);
}
origin: fengyouchao/sockslib

private String generateEncryptPassword(final User user, String newPassword) {
 User tempUser = user.copy();
 if (newPassword != null) {
  tempUser.setPassword(newPassword);
 }
 if (passwordProtector == null) {
  passwordProtector = new NonePasswordProtector();
 }
 return passwordProtector.encrypt(tempUser);
}
sockslib.server.manager

Most used classes

  • FileBasedUserManager$AutoReloadService
  • FileBasedUserManager
    The class FileBasedUserManager represents an user manager which can manage users in a file.
  • HashPasswordProtector
    The class HashPasswordProtector implements PasswordProtector. This class will use a specified hash a
  • JdbcBasedUserManager
    The class JdbcBasedUserManager is JDBC based user manager.
  • JdbcConfiguration
    The class JdbcConfiguration is a tool class to config JDBC.
  • MongoDBBasedUserManager,
  • MongoDBConfiguration,
  • NonePasswordProtector,
  • PasswordProtector,
  • User,
  • UserManager
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now