public class StringPeerDAO extends Object implements PeerDAO
A simple implementation of a PeerDAO that assumes two strings contains a list of users and passwords in corresponding places. For example a user string of "bob,joe,jane" and a password string of "foo,bar,baz" would assume that bob's password is "foo" and jane's password is "baz"
Gloming all users in a single String and all passwords in a single String is useful in the situation where your application can only assume a single environment variable exported to it for users and a single environment variable exported to it for passwords
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DELIMITER |
| Constructor and Description |
|---|
StringPeerDAO(String users,
String passwords) |
StringPeerDAO(String users,
String passwords,
String delimiter) |
public static final String DEFAULT_DELIMITER
public StringPeerDAO(String users, String passwords, String delimiter)
users - A string containing one or more usernamespasswords - A string containing as many passwords as there are usersdelimiter - The delimiter string for both users and passwordspublic Collection<Peer> findAll()
Copyright © 2015. All rights reserved.