public interface CommunicationManager
Modifier and Type | Interface and Description |
---|---|
static interface |
CommunicationManager.Code
The error codes received in
Handler.onFailure(Error) on the CommunicationManager |
static interface |
CommunicationManager.PropertyKey |
Modifier and Type | Method and Description |
---|---|
boolean |
eventClicked(EventOccurrence occurrence,
Handler<EventOccurrence> callback)
Notifies that the user has clicked a previously seen event.
|
boolean |
eventClicked(EventOccurrence occurrence,
Map<String,Object> options,
Handler<EventOccurrence> callback)
Notifies that the user has clicked a previously seen event.
|
boolean |
eventConverted(EventOccurrence occurrence,
Handler<EventOccurrence> callback)
Notifies that a previously seen and clicked event has been converted.
|
boolean |
eventConverted(EventOccurrence occurrence,
Map<String,Object> options,
Handler<EventOccurrence> callback)
Notifies that a previously seen and clicked event has been converted.
|
boolean |
eventSeen(SitumEvent event,
Handler<EventOccurrence> callback)
Notifies that the user has seen an event.
|
boolean |
eventSeen(SitumEvent event,
Map<String,Object> options,
Handler<EventOccurrence> callback)
Notifies that the user has seen an event.
|
boolean |
fetchBuildingInfo(Building building,
Handler<BuildingInfo> callback)
Download all the building data for the selected building.
|
boolean |
fetchBuildingInfo(Building building,
Map<String,Object> options,
Handler<BuildingInfo> callback)
Download all the building data from the selected building.
|
boolean |
fetchBuildings(Handler<Collection<Building>> callback)
Download all the buildings for the current user
|
boolean |
fetchBuildings(Map<String,Object> options,
Handler<Collection<Building>> callback)
Download all the buildings for the current user
|
boolean |
fetchCalibratedArea(Building building,
Floor floor,
Handler<Collection<CalibrationArea>> callback)
Get the calibrated areas for a floor
|
boolean |
fetchEventsFromBuilding(Building building,
Handler<Collection<SitumEvent>> callback)
Download the events of a building
|
boolean |
fetchEventsFromBuilding(Building building,
Map<String,Object> options,
Handler<Collection<SitumEvent>> callback)
Download the events of a building
|
boolean |
fetchFloorsFromBuilding(Building building,
Handler<Collection<Floor>> callback)
Download all the floors of a building
|
boolean |
fetchFloorsFromBuilding(Building building,
Map<String,Object> options,
Handler<Collection<Floor>> callback)
Download all the floors of a building
|
boolean |
fetchIndoorPOIsFromBuilding(Building building,
Handler<Collection<Poi>> callback)
Download the indoor POIs of a building
|
boolean |
fetchIndoorPOIsFromBuilding(Building building,
Map<String,Object> options,
Handler<Collection<Poi>> callback)
Download the indoor POIs of a building
|
boolean |
fetchMapFromFloor(Floor floor,
Handler<android.graphics.Bitmap> callback)
Download the map image of a floor
|
boolean |
fetchMapFromFloor(Floor floor,
Map<String,Object> options,
Handler<android.graphics.Bitmap> callback)
Download the map image of a floor
|
boolean |
fetchOutdoorPOIsFromBuilding(Building building,
Handler<Collection<Poi>> callback)
Download the outdoor POIs of a building
|
boolean |
fetchOutdoorPOIsFromBuilding(Building building,
Map<String,Object> options,
Handler<Collection<Poi>> callback)
Download the outdoor POIs of a building
|
boolean |
fetchPoiCategories(Handler<Collection<PoiCategory>> callback)
Get all POI categories, download and cache their icons asynchronously
|
boolean |
fetchPoiCategories(Map<String,Object> options,
Handler<Collection<PoiCategory>> callback)
Get all POI categories, download and cache their icons asynchronously.
|
boolean |
fetchPoiCategoryIconNormal(PoiCategory category,
Handler<android.graphics.Bitmap> callback)
Get the normal category icon for a category
|
boolean |
fetchPoiCategoryIconNormal(PoiCategory category,
Map<String,Object> options,
Handler<android.graphics.Bitmap> callback)
Get the normal category icon for a category
|
boolean |
fetchPoiCategoryIconSelected(PoiCategory category,
Handler<android.graphics.Bitmap> callback)
Get the selected category icon for a category
|
boolean |
fetchPoiCategoryIconSelected(PoiCategory category,
Map<String,Object> options,
Handler<android.graphics.Bitmap> callback)
Get the selected category icon for a category
|
HttpRequestExecutor |
getHttpRequestExecutor()
Return the HTTP Request Executor to make custom requests to the Dashboard
|
void |
invalidateCache()
Invalidate all the resources in the cache
|
boolean |
logout(Handler<Object> callback)
Invalidate user's token and remove it from internal credentials, if exist.
|
boolean |
validateUserCredentials(Handler<Object> callback)
Check if the user credentials previously set with
Configuration.setUserPass(String, String) , SitumSdk.configuration()
or in the AndroidManifest.xml are right. |
boolean validateUserCredentials(Handler<Object> callback)
Configuration.setUserPass(String, String)
, SitumSdk.configuration()
or in the AndroidManifest.xml are right.callback
- invoked when login is finished. If the user and/or password/api key aren't valid a
CommunicationManager.Code.HTTP_UNAUTHORIZED
will be received
in Handler.onFailure(Error)
boolean logout(Handler<Object> callback)
callback
- invoked when logout is finishedboolean fetchBuildings(Handler<Collection<Building>> callback)
callback
- Callback to asynchronously receive the buildings. Not null.boolean fetchBuildings(Map<String,Object> options, Handler<Collection<Building>> callback)
options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- Callback to asynchronously receive the buildings. Not null.boolean fetchBuildingInfo(Building building, Handler<BuildingInfo> callback)
building
- selected building for download info. Not null.callback
- Callback to asynchronously receive the buildings. Not null.boolean fetchBuildingInfo(Building building, Map<String,Object> options, Handler<BuildingInfo> callback)
building
- selected building for download info. Not null.options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- Callback to asynchronously receive the buildings. Not null.boolean fetchFloorsFromBuilding(Building building, Handler<Collection<Floor>> callback)
building
- the building. Not null.callback
- Callback to asynchronously receive the floors. Not null.boolean fetchFloorsFromBuilding(Building building, Map<String,Object> options, Handler<Collection<Floor>> callback)
building
- the building. Not null.options
- the request options. Can be null. Accepted options: FORCE_DOWNLOAD (download regardless cache)callback
- Callback to asynchronously receive the floors. Not null.boolean fetchMapFromFloor(Floor floor, Handler<android.graphics.Bitmap> callback)
floor
- the floor. Not null.callback
- callback to asynchronously receive the floor image. Not null.boolean fetchMapFromFloor(Floor floor, Map<String,Object> options, Handler<android.graphics.Bitmap> callback)
floor
- the floor. Not null.options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- callback to asynchronously receive the image. Not null.boolean fetchIndoorPOIsFromBuilding(Building building, Handler<Collection<Poi>> callback)
building
- the building. Not null.callback
- Callback to asynchronously receive the points of interest. Not null.boolean fetchIndoorPOIsFromBuilding(Building building, Map<String,Object> options, Handler<Collection<Poi>> callback)
building
- the building. Not null.options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- callback to asynchronously receive the points of interest. Not null.boolean fetchPoiCategories(Handler<Collection<PoiCategory>> callback)
To get some of those icons from local storage use fetchPoiCategoryIconNormal(PoiCategory, Handler)
or fetchPoiCategoryIconSelected(PoiCategory, Handler)
callback
- Callback to asynchronously receive the POI categories. Not null.boolean fetchPoiCategories(Map<String,Object> options, Handler<Collection<PoiCategory>> callback)
To get some of those icons from local storage use fetchPoiCategoryIconNormal(PoiCategory, Handler)
or fetchPoiCategoryIconSelected(PoiCategory, Handler)
options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- Callback to asynchronously receive the POI categoriesboolean fetchPoiCategoryIconNormal(PoiCategory category, Handler<android.graphics.Bitmap> callback)
category
- the category. Not null.callback
- the callback. Not null.boolean fetchPoiCategoryIconNormal(PoiCategory category, Map<String,Object> options, Handler<android.graphics.Bitmap> callback)
category
- the category. Not null.options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- the callback. Not null.boolean fetchPoiCategoryIconSelected(PoiCategory category, Handler<android.graphics.Bitmap> callback)
category
- the category. Not null.callback
- the callback. Not null.boolean fetchPoiCategoryIconSelected(PoiCategory category, Map<String,Object> options, Handler<android.graphics.Bitmap> callback)
category
- the category. Not null.options
- the request options. Can be null. Accepted options: FORCE_DOWNLOAD (download regardless cache)callback
- the callback. Not null.boolean fetchOutdoorPOIsFromBuilding(Building building, Handler<Collection<Poi>> callback)
building
- the building. Not null.callback
- Callback to asynchronously receive the points of interest. Not null.boolean fetchOutdoorPOIsFromBuilding(Building building, Map<String,Object> options, Handler<Collection<Poi>> callback)
building
- the building. Not null.options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- Callback to asynchronously receive the points of interest. Not null.boolean fetchEventsFromBuilding(Building building, Handler<Collection<SitumEvent>> callback)
building
- the building. Not null.callback
- Callback to asynchronously receive the events of a building. Not null.boolean fetchEventsFromBuilding(Building building, Map<String,Object> options, Handler<Collection<SitumEvent>> callback)
building
- the building. Not null.options
- the request options. Can be null. Accepted options: CommunicationOptions.FORCE_DOWNLOAD
callback
- Callback to asynchronously receive the events of a building. Not null.boolean eventSeen(SitumEvent event, Handler<EventOccurrence> callback)
event
- event that has been seen. Not null.callback
- receives an event occurrence, necessary to notify a click and conversion of the same event. Not null.EventOccurrence
,
eventClicked(EventOccurrence, Handler)
,
eventConverted(EventOccurrence, Handler)
boolean eventSeen(SitumEvent event, Map<String,Object> options, Handler<EventOccurrence> callback)
event
- event that has been seen. Not null.options
- the request options. Can be null.callback
- receives an event occurrence, necessary to notify a click of the same event. Not null.EventOccurrence
,
eventClicked(EventOccurrence, Handler)
boolean eventClicked(EventOccurrence occurrence, Handler<EventOccurrence> callback)
occurrence
; if not, new Date()
is assumed.occurrence
- object obtained when the event was seen (with eventSeen(SitumEvent, Handler)
). Not null. occurrence.getId() not null.callback
- receives the updated occurrence, necessary to notify a conversion of the same event. Not null.EventOccurrence
,
eventConverted(EventOccurrence, Handler)
boolean eventClicked(EventOccurrence occurrence, Map<String,Object> options, Handler<EventOccurrence> callback)
occurrence
; if not, new Date()
is assumed.occurrence
- object obtained when the event was seen (with eventSeen(SitumEvent, Handler)
). Not null. occurrence.getId() not null.options
- the request options. Can be null.callback
- receives the updated occurrence, necessary to notify a conversion of the same event. Not null.eventConverted(EventOccurrence, Handler)
boolean eventConverted(EventOccurrence occurrence, Handler<EventOccurrence> callback)
occurrence
; if not, new Date()
is assumed.occurrence
- object obtained when the event was clicked (with eventClicked(EventOccurrence, Handler)
). Not null. occurrence.getId() and occurrence.getWhenClicked() can't be null neither.callback
- receives the updated occurrence. Not null.EventOccurrence
,
3eventConverted( EventOccurrence , Handler)
boolean eventConverted(EventOccurrence occurrence, Map<String,Object> options, Handler<EventOccurrence> callback)
occurrence
; if not, new Date()
is assumed.occurrence
- object obtained when the event was clicked (with eventClicked(EventOccurrence, Handler)
). Not null. occurrence.getId() and occurrence.getWhenClicked() can't be null neither.options
- the request options. Can be null.callback
- receives the updated occurrence. Not null.EventOccurrence
,
eventConverted(EventOccurrence, Handler)
boolean fetchCalibratedArea(Building building, Floor floor, Handler<Collection<CalibrationArea>> callback)
building
- the building. Not nullfloor
- the floor. Not nullcallback
- the callback. Not nullvoid invalidateCache()
HttpRequestExecutor getHttpRequestExecutor()