Package net.i2p.router.news
Class NewsManager
java.lang.Object
net.i2p.router.news.NewsManager
- All Implemented Interfaces:
ClientApp
Manage current news.
Keeps current entries in memory, and provide methods to
add new entries and store them to disk.
- Since:
- 0.9.23
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntries
(List<NewsEntry> entries) Add or replace each entry in the list.The display name of the ClientApp, used in user interfaces.The initial (welcome to i2p) newsgetName()
The generic name of the ClientApp, used for registration, e.g.getState()
The current state of the ClientApp.void
ClientApp interfacevoid
startup()
ClientApp interfaceboolean
storeEntries
(List<Node> entries) Store each entry.
-
Field Details
-
APP_NAME
- See Also:
-
-
Constructor Details
-
NewsManager
- Parameters:
args
- ignored
-
-
Method Details
-
getEntries
- Returns:
- non-null, sorted by updated date, newest first
-
storeEntries
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:
- true if any new entry was written (not if changed)
-
addEntries
Add or replace each entry in the list. Does NOT store them to disk. -
startup
public void startup()ClientApp interface -
shutdown
ClientApp interface -
getState
Description copied from interface:ClientApp
The current state of the ClientApp. -
getName
Description copied from interface:ClientApp
The generic name of the ClientApp, used for registration, e.g. "console". Do not translate. -
getDisplayName
Description copied from interface:ClientApp
The display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayName
in interfaceClientApp
- Returns:
- non-null
-
getInitialNews
The initial (welcome to i2p) news- Returns:
- entry with first-installed date stamp, or null
- Since:
- 0.9.28
-