public class NotesDao
extends java.lang.Object
| Constructor and Description |
|---|
NotesDao(OsmConnection osm) |
| Modifier and Type | Method and Description |
|---|---|
Note |
close(long id)
Close aka resolve the note with the given id without providing a reason.
|
Note |
close(long id,
java.lang.String reason)
Close aka resolve the note with the given id and reason.
|
Note |
comment(long id,
java.lang.String text) |
Note |
create(LatLon pos,
java.lang.String text)
Create a new note at the given location
|
void |
find(Handler<Note> handler,
QueryNotesFilters filters)
Get a number of notes that match the given filters.
|
Note |
get(long id) |
void |
getAll(BoundingBox bounds,
Handler<Note> handler,
int limit,
int hideClosedNoteAfter)
Retrieve all notes in the given area and feed them to the given handler.
|
void |
getAll(BoundingBox bounds,
java.lang.String search,
Handler<Note> handler,
int limit,
int hideClosedNoteAfter)
Retrieve those notes in the given area that match the given search string
|
Note |
reopen(long id)
Reopens the given note without providing a reason.
|
Note |
reopen(long id,
java.lang.String reason)
Reopen the given note with the given reason.
|
public NotesDao(OsmConnection osm)
public Note create(LatLon pos, java.lang.String text)
pos - position of the note. Must not be null.text - text for the new note. Must not be empty nor null.OsmAuthorizationException - if this application is not authorized to write notes
(Permission.WRITE_NOTES)public Note comment(long id, java.lang.String text)
id - id of the notetext - comment to be added to the note. Must not be null or emptyOsmConflictException - if the note has already been closed.OsmAuthorizationException - if this application is not authorized to write notes
(Permission.WRITE_NOTES)OsmNotFoundException - if the note with the given id does not exist (anymore)public Note reopen(long id)
reopen(long, String)public Note reopen(long id, java.lang.String reason)
OsmConflictException - if the note has already been reopened.OsmAuthorizationException - if this application is not authorized to write notes
(Permission.WRITE_NOTES)OsmNotFoundException - if the note with the given id does not exist (anymore)public Note close(long id, java.lang.String reason)
id - id of the notereason - comment to be added to the note as a reason for it being closed. Optional.OsmConflictException - if the note has already been closed.OsmAuthorizationException - if this application is not authorized to write notes
(Permission.WRITE_NOTES)OsmNotFoundException - if the note with the given id does not exist (anymore)public Note close(long id)
close(long, String)public Note get(long id)
id - id of the noteOsmAuthorizationException - if not logged inpublic void getAll(BoundingBox bounds, Handler<Note> handler, int limit, int hideClosedNoteAfter)
public void getAll(BoundingBox bounds, java.lang.String search, Handler<Note> handler, int limit, int hideClosedNoteAfter)
handler - The handler which is fed the incoming notesbounds - the area within the notes should be queried. This is usually limited at 25
square degrees. Check the server capabilities.search - what to search for. Null to return everything.limit - number of entries returned at maximum. Any value between 1 and 10000hideClosedNoteAfter - number of days until a closed note should not be shown anymore.
-1 means that all notes should be returned, 0 that only open notes
are returned.OsmQueryTooBigException - if the bounds area is too largejava.lang.IllegalArgumentException - if the bounds cross the 180th meridianOsmAuthorizationException - if not logged inpublic void find(Handler<Note> handler, QueryNotesFilters filters)
handler - The handler which is fed the incoming notesfilters - what to search for. I.e.
new QueryNotesFilters().byUser(123).limit(1000)OsmAuthorizationException - if not logged in