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 voidabstract voidattachCollectionListener(String path, FirebaseConnectionComponent.Collectionlistener collectionlistener) abstract voidattachWhereGreaterThanCollectionListener(String param, Object value, String path, FirebaseConnectionComponent.Collectionlistener collectionlistener) abstract booleandeleteCollection(String path, int batchSize) abstract booleandeleteDocument(String path) abstract StringdeleteFromStorage(String path) booleandeleteLocationBackupSet(String documentName) booleandeleteLocationFromFirebase(String locationName) booleandeleteVideoFromFirebase(String videoName) protected voidThis is where any code that needs to be called repeatedly in a dedicated thread should live.getDocumentData(String path) protected voidinit()Perform any component initialization.protected voidvoidonActionGenerated(ActionDBEntry action, boolean onStartup) voidonActiveGoalsUpdated(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) voidonAgentActionUpdated(String actor, String action, String status) voidonBeliefNotificationUpdate(String queryTermString, Map<String, Object> bindingsStrings) voidonDictionaryEntriesUpdated(Set<String> dictKeys) voidonPendingGoalsUpdated(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) protected voidbooleanrestoreLocationsFromBackup(String documentName) booleansaveCurrentLocationsAsBackupSet(String collectionName) abstract booleanupdateDocument(String documentPath, Map<String, Object> data) voidbooleanuploadMap(ByteArrayOutputStream map, float width, float height, float originX, float originY, float resolution) voidwriteASLToFirebase(ActionDBEntry e, boolean init) booleanwriteLocationToFirebase(String locationName, HashMap<String, Object> locationData) abstract booleanwriteToCollection(String collectionPath, Map<String, Object> data) abstract booleanwriteToDocument(String documentPath, Map<String, Object> data) abstract booleanwriteToStorage(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, stepStartedMethods 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:DiarcComponentPerform 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:
initin 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:DiarcComponentThis 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:
executionLoopin classUIComponent
-
localshutdown
protected void localshutdown() -
resetExistingCollections
protected void resetExistingCollections() -
onAgentActionUpdated
- Specified by:
onAgentActionUpdatedin classUIComponent
-
onBeliefNotificationUpdate
- Specified by:
onBeliefNotificationUpdatein classUIComponent
-
onActiveGoalsUpdated
public void onActiveGoalsUpdated(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) - Specified by:
onActiveGoalsUpdatedin classUIComponent
-
onPendingGoalsUpdated
public void onPendingGoalsUpdated(List<String> agentStrings, List<String> goalStrings, List<Long> gids, List<String> statuses, List<String> priorityTiers) - Specified by:
onPendingGoalsUpdatedin classUIComponent
-
onActionGenerated
- Specified by:
onActionGeneratedin classUIComponent
-
updateFirebaseDialogueHistory
-
writeASLToFirebase
-
onDictionaryEntriesUpdated
- Specified by:
onDictionaryEntriesUpdatedin 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)
-