Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ public DbException(String message, Exception cause)
{
super(message, cause);
}

public DbException(String message)
{
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
import javax.ws.rs.core.Context;

import decodes.cwms.CwmsDatabaseProvider;
import decodes.db.Database;
import decodes.db.DatabaseException;
import decodes.db.DatabaseIO;
import decodes.tsdb.TimeSeriesDb;
import decodes.util.DecodesSettings;
import opendcs.opentsdb.OpenTsdbProvider;
import org.opendcs.database.DatabaseService;
Expand Down Expand Up @@ -81,7 +84,18 @@ final OpenDcsDatabase createDb()
{
throw new IllegalStateException("Error connecting to the database via JNDI", ex);
}
// throw new IllegalStateException("Error connecting to the database via JNDI", e);
}
}

DatabaseIO getLegacyDatabase()
{
return createDb().getLegacyDatabase(Database.class).map(Database::getDbIo)
.orElseThrow(() -> new UnsupportedOperationException("Endpoint is unsupported by the OpenDCS REST API."));
}

TimeSeriesDb getLegacyTimeseriesDB()
{
return createDb().getLegacyDatabase(TimeSeriesDb.class)
.orElseThrow(() -> new UnsupportedOperationException("Endpoint is unsupported by the OpenDCS REST API."));
}
}
Loading