net.i2p.router.peermanager
Class ProfilePersistenceHelper

java.lang.Object
  extended by net.i2p.router.peermanager.ProfilePersistenceHelper

 class ProfilePersistenceHelper
extends java.lang.Object


Field Summary
static java.lang.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 java.lang.String PROP_PEER_PROFILE_DIR
           
 
Constructor Summary
ProfilePersistenceHelper(RouterContext ctx)
           
 
Method Summary
static void main(java.lang.String[] args)
          generate 1000 profiles
 PeerProfile readProfile(java.io.File file)
           
 java.util.Set readProfiles()
           
 void setUs(Hash routerIdentHash)
           
 void writeProfile(PeerProfile profile)
          write out the data from the profile to the stream
 void writeProfile(PeerProfile profile, java.io.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

PROP_PEER_PROFILE_DIR

public static final java.lang.String PROP_PEER_PROFILE_DIR
See Also:
Constant Field Values

DEFAULT_PEER_PROFILE_DIR

public static final java.lang.String DEFAULT_PEER_PROFILE_DIR
See Also:
Constant Field Values

EXPIRE_AGE

public static final long EXPIRE_AGE
If we haven't been able to get a message through to the peer in 3 days, drop the profile. They may reappear, but if they do, their config may have changed (etc).

See Also:
Constant Field Values
Constructor Detail

ProfilePersistenceHelper

public ProfilePersistenceHelper(RouterContext ctx)
Method Detail

setUs

public void setUs(Hash routerIdentHash)

writeProfile

public void writeProfile(PeerProfile profile)
write out the data from the profile to the stream


writeProfile

public void writeProfile(PeerProfile profile,
                         java.io.OutputStream out)
                  throws java.io.IOException
write out the data from the profile to the stream

Throws:
java.io.IOException

readProfiles

public java.util.Set readProfiles()

readProfile

public PeerProfile readProfile(java.io.File file)

main

public static void main(java.lang.String[] args)
generate 1000 profiles