Package edu.tufts.hrilab.firebase
Class FirebaseConnectionComponent
java.lang.Object
edu.tufts.hrilab.diarc.DiarcComponent
edu.tufts.hrilab.temiv3.UIComponent
edu.tufts.hrilab.firebase.FirebaseConnectionComponent
- All Implemented Interfaces:
ActionListener
- Direct Known Subclasses:
DesktopFirebaseConnectionComponent
,MockFirebaseConnectionComponent
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class edu.tufts.hrilab.diarc.DiarcComponent
executionLoopCycleTime, log, shouldRunExecutionLoop
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
abstract void
attachCollectionListener
(String path, FirebaseConnectionComponent.Collectionlistener collectionlistener) abstract void
attachWhereGreaterThanCollectionListener
(String param, Object value, String path, FirebaseConnectionComponent.Collectionlistener collectionlistener) abstract boolean
deleteCollection
(String path, int batchSize) abstract boolean
deleteDocument
(String path) abstract String
deleteFromStorage
(String path) boolean
deleteLocationBackupSet
(String documentName) boolean
deleteLocationFromFirebase
(String locationName) boolean
deleteVideoFromFirebase
(String videoName) protected void
This is where any code that needs to be called repeatedly in a dedicated thread should live.getDocumentData
(String path) protected void
init()
Perform any component initialization.protected void
void
onActionGenerated
(ActionDBEntry action, boolean onStartup) void
onActiveGoalsUpdated
(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) void
onAgentActionUpdated
(String actor, String action, String status) void
onBeliefNotificationUpdate
(String queryTermString, Map<String, Object> bindingsStrings) void
onDictionaryEntriesUpdated
(Set<String> dictKeys) void
onPendingGoalsUpdated
(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) protected void
boolean
restoreLocationsFromBackup
(String documentName) boolean
saveCurrentLocationsAsBackupSet
(String collectionName) abstract boolean
updateDocument
(String documentPath, Map<String, Object> data) void
boolean
uploadMap
(ByteArrayOutputStream map, float width, float height, float originX, float originY, float resolution) void
writeASLToFirebase
(ActionDBEntry e, boolean init) boolean
writeLocationToFirebase
(String locationName, HashMap<String, Object> locationData) abstract boolean
writeToCollection
(String collectionPath, Map<String, Object> data) abstract boolean
writeToDocument
(String documentPath, Map<String, Object> data) abstract boolean
writeToStorage
(byte[] data, Map<String, Object> metadata) Methods inherited from class edu.tufts.hrilab.temiv3.UIComponent
actionComplete, actionStarted, additionalUsageInfo, addRelevantDisplayAction, beliefNotificationCallback, convertArgToReadable, notifyActiveGoalUpdated, notifyPendingGoalUpdated, onNewActionsCallback, parseArgs, stepComplete, stepStarted
Methods inherited from class edu.tufts.hrilab.diarc.DiarcComponent
createInstance, createInstance, createInstance, createInstance, getMyGroupConstraints, getMyGroups, getMyService, getMyServices, main, shutdown, shutdownComponent
-
Field Details
-
groupName
-
-
Constructor Details
-
FirebaseConnectionComponent
public FirebaseConnectionComponent()
-
-
Method Details
-
init
protected void init()Description copied from class:DiarcComponent
Perform any component initialization. This should not be used for setting local fields to default values as was the case in DIARC. This method is called after the constructor, and after parseArgs. Setting default values should be done in field declaration or in the constructor.- Overrides:
init
in classUIComponent
-
addFirebaseListeners
protected void addFirebaseListeners() -
writeToDocument
-
updateDocument
-
writeToCollection
-
deleteDocument
-
deleteCollection
-
getCollectionDocumentsData
-
getDocumentData
-
attachCollectionListener
public abstract void attachCollectionListener(String path, FirebaseConnectionComponent.Collectionlistener collectionlistener) -
attachWhereGreaterThanCollectionListener
public abstract void attachWhereGreaterThanCollectionListener(String param, Object value, String path, FirebaseConnectionComponent.Collectionlistener collectionlistener) -
deleteFromStorage
-
writeToStorage
-
executionLoop
protected void executionLoop()Description copied from class:DiarcComponent
This is where any code that needs to be called repeatedly in a dedicated thread should live. It is not called by default and you must set shouldRunExecutionLoop to true in your constructor.- Overrides:
executionLoop
in classUIComponent
-
localshutdown
protected void localshutdown() -
resetExistingCollections
protected void resetExistingCollections() -
onAgentActionUpdated
- Specified by:
onAgentActionUpdated
in classUIComponent
-
onBeliefNotificationUpdate
- Specified by:
onBeliefNotificationUpdate
in classUIComponent
-
onActiveGoalsUpdated
public void onActiveGoalsUpdated(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) - Specified by:
onActiveGoalsUpdated
in classUIComponent
-
onPendingGoalsUpdated
public void onPendingGoalsUpdated(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) - Specified by:
onPendingGoalsUpdated
in classUIComponent
-
onActionGenerated
- Specified by:
onActionGenerated
in classUIComponent
-
updateFirebaseDialogueHistory
-
writeASLToFirebase
-
onDictionaryEntriesUpdated
- Specified by:
onDictionaryEntriesUpdated
in classUIComponent
-
getGroupName
-
writeLocationToFirebase
-
deleteLocationFromFirebase
-
saveCurrentLocationsAsBackupSet
-
deleteLocationBackupSet
-
restoreLocationsFromBackup
-
getLocationBackupSetNames
-
deleteVideoFromFirebase
-
getFirebaseVideoNames
-
uploadMap
public boolean uploadMap(ByteArrayOutputStream map, float width, float height, float originX, float originY, float resolution)
-