Commit 58909b33 authored by Rohan  Kumar's avatar Rohan Kumar
Browse files

?

parent 6cf58666
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Spring Boot Starter Web -->
        <dependency>
+0 −10
Original line number Diff line number Diff line
package database;

import object_detection.types.ObjectSet;

public class DatabaseUpdater {

    public static boolean updateDB(ObjectSet objSet){
        return true;
    }
}
+0 −0

Empty file deleted.

src/main/java/database/Main.java

deleted100644 → 0
+0 −64
Original line number Diff line number Diff line
//package database;
//
//import object_detection.types.ObjectSet;
//import object_detection.types.Point;
//import object_detection.types.PointSet;
//
//public class Main {
//
//    public static void main(String[] args) {
//        MongoDBInteraction dbInteraction = new MongoDBInteraction();
//
//        // Test PointSet Operations
//        String pointSetId = "set101";
//        PointSet testPointSet = new PointSet(new Point(1.0f, 2.0f, 3.0f));
//        System.out.println("Attempting to update/insert PointSet with ID: " + pointSetId);
//        dbInteraction.update(pointSetId, testPointSet);
//        System.out.println("PointSet Added/Updated");
//
//        System.out.println("Attempting to retrieve PointSet with ID: " + pointSetId);
//        PointSet retrievedPointSet = dbInteraction.retrieve(pointSetId);
//        if (retrievedPointSet != null && !retrievedPointSet.getPoints().isEmpty()) {
//            System.out.println("PointSet Retrieved Successfully");
//        } else {
//            System.out.println("PointSet Retrieve Failed");
//        }
//
////        System.out.println("Attempting to delete PointSet with ID: " + pointSetId);
////        dbInteraction.delete(pointSetId);
////        PointSet deletedPointSet = dbInteraction.retrieve(pointSetId);
////        if (deletedPointSet == null) {
////            System.out.println("PointSet Successfully Deleted");
////        } else {
////            System.out.println("PointSet Delete Failed");
////        }
//
//        // Test ObjectSet Operations
//        ObjectSet objectSet = new ObjectSet();
//        System.out.println("Creating and populating ObjectSet with two PointSets.");
//        objectSet.makeObject(new Point(1, 2, 3), new Point(4, 5, 6));
//        objectSet.makeObject(new Point(7, 8, 9), new Point(10, 11, 12));
//
//        int index = 1;
//        System.out.println("Attempting to update/insert ObjectSet at index: " + index);
//        dbInteraction.updateObjectSet(index, objectSet);
//        System.out.println("ObjectSet Add/Update Completed");
//
//        System.out.println("Attempting to retrieve ObjectSet at index: " + index);
//        ObjectSet retrievedObjectSet = dbInteraction.retrieveObjectSet(index);
//        if (retrievedObjectSet != null && !retrievedObjectSet.objects.isEmpty()) {
//            System.out.println("ObjectSet Retrieved Successfully");
//        } else {
//            System.out.println("ObjectSet Retrieve Failed");
//        }
//
////        System.out.println("Attempting to delete ObjectSet at index: " + index);
////        dbInteraction.deleteObjectSet(index);
////        ObjectSet deletedObjectSet = dbInteraction.retrieveObjectSet(index);
////        if (deletedObjectSet == null) {
////            System.out.println("ObjectSet Successfully Deleted");
////        } else {
////            System.out.println("ObjectSet Delete Failed");
////        }
//    }
//}
+0 −47
Original line number Diff line number Diff line
//package database;
//
///*
//import com.mongodb.ConnectionString;
//import com.mongodb.MongoClientSettings;
//import com.mongodb.MongoException;
//import com.mongodb.ServerApi;
//import com.mongodb.ServerApiVersion;
//import com.mongodb.client.MongoClient;
//import com.mongodb.client.MongoClients;
//import com.mongodb.client.MongoDatabase;
//import org.bson.Document;
//
// */
//
//public class MongoDBAtlasConnection {
//    public static void main(String[] args) {
//        /*
//
//        String connectionString = "mongodb+srv://zanem:<YXQiSFkSVqxPTs3M>@cluster0.axhv9kg.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0";
//
//        ServerApi serverApi = ServerApi.builder()
//                .version(ServerApiVersion.V1)
//                .build();
//
//        MongoClientSettings settings = MongoClientSettings.builder()
//                .applyConnectionString(new ConnectionString(connectionString))
//                .serverApi(serverApi)
//                .build();
//
//        try (MongoClient mongoClient = MongoClients.create(settings)) {
//            try {
//                MongoDatabase database = mongoClient.getDatabase("admin");
//                database.runCommand(new Document("ping", 1));
//                System.out.println("Pinged your deployment. You successfully connected to MongoDB!");
//            } catch (MongoException e) {
//                e.printStackTrace();
//            }
//        }
//
//         */
//    }
//}
//
//
//
////YXQiSFkSVqxPTs3M
Loading