Package net.i2p.router.news
Class NewsManager
- java.lang.Object
-
- net.i2p.router.news.NewsManager
-
-
Constructor Summary
Constructors Constructor Description NewsManager(I2PAppContext ctx, ClientAppManager listener, String[] args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntries(List<NewsEntry> entries)Add or replace each entry in the list.StringgetDisplayName()The display name of the ClientApp, used in user interfaces.List<NewsEntry>getEntries()NewsEntrygetInitialNews()The initial (welcome to i2p) newsStringgetName()The generic name of the ClientApp, used for registration, e.g.ClientAppStategetState()The current state of the ClientApp.voidshutdown(String[] args)ClientApp interfacevoidstartup()ClientApp interfacebooleanstoreEntries(List<Node> entries)Store each entry.
-
-
-
Field Detail
-
APP_NAME
public static final String APP_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NewsManager
public NewsManager(I2PAppContext ctx, ClientAppManager listener, String[] args)
- Parameters:
args- ignored
-
-
Method Detail
-
getEntries
public List<NewsEntry> getEntries()
- Returns:
- non-null, sorted by updated date, newest first
-
storeEntries
public boolean storeEntries(List<Node> entries)
Store each entry. Old entries are always overwritten, as they may change even without the updated date changing. Does NOT update the NewsEntry list.- Parameters:
entries- each one should be "entry" at the root- Returns:
- success
-
addEntries
public void addEntries(List<NewsEntry> entries)
Add or replace each entry in the list. Does NOT store them to disk.
-
shutdown
public void shutdown(String[] args)
ClientApp interface
-
getState
public ClientAppState getState()
Description copied from interface:ClientAppThe current state of the ClientApp.
-
getName
public String getName()
Description copied from interface:ClientAppThe generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
-
getDisplayName
public String getDisplayName()
Description copied from interface:ClientAppThe display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayNamein interfaceClientApp- Returns:
- non-null
-
getInitialNews
public NewsEntry getInitialNews()
The initial (welcome to i2p) news- Returns:
- entry with first-installed date stamp, or null
- Since:
- 0.9.28
-
-