Create DBEntry from scratch using legacy modeΒΆ

This example focuses on creating DBEntry using legacy mode method.

See also

API documentation for imas.createEnv (legacy)

Warning

The legacy method is deprecated from AL>=5.0.0.

It is recommended to use the URI approach instead.

public static void createDBEntryLegacy() throws Exception {
    String user           = System.getenv("USER");
    String dbName         = "test";
    String ddMajorVersion = "3";
    int pulse             = 1;
    int run               = 10;
    int backendID         = LowLevel.HDF5_BACKEND;

    int entry = 0;
    try {
        // Create new entry, catch exceptions if failed
        entry = imas.createEnv(pulse, run, user, dbName, ddMajorVersion, backendID);
        /*
         * You can access IDSes in here - take a look at sample code dealing with IDSes for details
         */
    } catch (Exception e) {
        System.err.println("\nFailed to create DBEntry with legacy arguments\n" + e.getMessage());
        throw e;
    } finally {
        imas.close(entry);
    }
}