Class Database

java.lang.Object
com.example.oblong.Database

public class Database extends Object
Database This class handles sending and fetching data from the Firebase
  • Constructor Details

    • Database

      public Database()
      The Database method assigns the variables to the Firebase collections
  • Method Details

    • getCurrentUser

      public static void getCurrentUser(Database.OnDataReceivedListener<String> listener)
      The getCurrentUser method retrieves the user ID from Firebase
      Parameters:
      listener -
    • updateDocument

      public void updateDocument(String collection, String document_id, HashMap<String,Object> updates, Database.OnDataReceivedListener<Boolean> listener)
      The updateDocument method updates a document in Firebase
      Parameters:
      collection -
      document_id -
      updates -
      listener -
    • getParticipants

      public void getParticipants(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      The getParticipant method retrieves a participant data from Firebase
      Parameters:
      id -
      listener -
    • getOrganizer

      public void getOrganizer(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      The getOrganizer method retrieves an organizer data from Firebase
      Parameters:
      id -
      listener -
    • getNotification

      public void getNotification(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      getNotification method retrieves a notification data from Firebase}
      Parameters:
      id -
      listener -
    • getFacility

      public void getFacility(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      The getFacility method retrieves a facility data from Firebase
      Parameters:
      id -
      listener -
    • getEntrant

      public void getEntrant(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      The getEntrant method retrieves an entrant data from Firebase
      Parameters:
      id -
      listener -
    • getEvent

      public void getEvent(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      The getEvent method retrieves an event data from Firebase
      Parameters:
      id -
      listener -
    • getUser

      public void getUser(String id, Database.OnDataReceivedListener<HashMap<String,Object>> listener)
      The getUser method retrieves a user data from Firebase
      Parameters:
      id -
      listener -
    • query

      public void query(String collectionName, HashMap<String,Object> conditions, Database.OnDataReceivedListener<List<HashMap<String,Object>>> listener)
      The query method queries a collection in Firebase
      Parameters:
      collectionName -
      conditions -
      listener -
    • addParticipant

      public void addParticipant(String id, String entrant, String event, com.google.firebase.firestore.GeoPoint location, String status)
      The addParticipant method adds a participant to Firebase
      Parameters:
      id -
      entrant -
      event -
      location -
      status -
    • addOrganizer

      public void addOrganizer(String id, String facility, String user)
      The addOrganizer method adds an organizer to Firebase
      Parameters:
      id -
      facility -
      user -
    • addNotification

      public void addNotification(String id, String event, String text, String title)
      The addNotification method adds a notification to Firebase
      Parameters:
      id -
      event -
      text -
      title -
    • addFacility

      public void addFacility(String id, String email, String name, String phone, String photo)
      The addFacility method adds a facility to Firebase
      Parameters:
      id -
      email -
      name -
      phone -
      photo -
    • addEntrant

      public void addEntrant(String id, boolean locationEnabled, boolean notificationsEnabled, String user)
      The addEntrant method adds an entrant to Firebase
      Parameters:
      id -
      locationEnabled -
      notificationsEnabled -
      user -
    • addUser

      public void addUser(String id, String name, String email, String type, String phone, String profilePhoto)
      The addUser method adds a user to Firebase
      Parameters:
      id -
      name -
      email -
      type -
      phone -
      profilePhoto -
    • addEvent

      public void addEvent(String id, String capacity, String dateAndTime, String description, com.google.firebase.firestore.GeoPoint location, String poster)
      The addEvent method adds an event to Firebase
      Parameters:
      id -
      capacity -
      dateAndTime -
      description -
      location -
      poster -