|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.i2p.router.peermanager.ProfilePersistenceHelper
class ProfilePersistenceHelper
Write profiles to disk at shutdown, read at startup. The files are gzip compressed, we previously stored them with a ".dat" extension instead of ".txt.gz", so it wasn't apparent. Now migrated to a ".txt.gz" extension.
| Field Summary | |
|---|---|
static String |
DEFAULT_PEER_PROFILE_DIR
|
static long |
EXPIRE_AGE
If we haven't been able to get a message through to the peer in 3 days, drop the profile. |
static String |
PROP_PEER_PROFILE_DIR
|
| Constructor Summary | |
|---|---|
ProfilePersistenceHelper(RouterContext ctx)
|
|
| Method Summary | |
|---|---|
static void |
main(String[] args)
generate 1000 profiles |
PeerProfile |
readProfile(File file)
|
Set<PeerProfile> |
readProfiles()
|
void |
setUs(Hash routerIdentHash)
|
void |
writeProfile(PeerProfile profile)
write out the data from the profile to the stream |
void |
writeProfile(PeerProfile profile,
OutputStream out)
write out the data from the profile to the stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_PEER_PROFILE_DIR
public static final String DEFAULT_PEER_PROFILE_DIR
public static final long EXPIRE_AGE
| Constructor Detail |
|---|
public ProfilePersistenceHelper(RouterContext ctx)
| Method Detail |
|---|
public void setUs(Hash routerIdentHash)
public void writeProfile(PeerProfile profile)
public void writeProfile(PeerProfile profile,
OutputStream out)
throws IOException
IOExceptionpublic Set<PeerProfile> readProfiles()
public PeerProfile readProfile(File file)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||