Class GetImage
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetImage
A Data Access Object to retrieve image data from the database.
- Since:
- 1.0
- Version:
- 10.5
- Author:
- Luke
-
Field Summary
Fields inherited from class DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRIDModifier and TypeFieldDescriptionprotected intThe maximum number of rows to return.protected intThe row number at which to start returning results.protected intThe query timeout, in seconds.protected static final intThe SRID used for geolocation queries. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getChart(int id) Returns a Chart.byte[]getEventBanner(int id) Returns an Online Event banner image.byte[]getExamResource(int id) Returns a Testing Center resource image.byte[]getGalleryImage(int id, String dbName) Returns a Picture Gallery image.byte[]getNews(int id) Returns a System News banner image.byte[]getNOTAM(int id) Returns a NOTAM banner image.byte[]getPartnerBanner(int id) Returns a Partner banner image.getSigModified(int id, String dbName) Returns the last modification date of a Pilot signature.byte[]getSignatureImage(int id, String dbName) Returns a signature image for a Pilot.byte[]getTile(TileAddress addr) Returns an ACARS track tile.booleanisSignatureAuthorized(int id) Returns if a Water Cooler signature image is officially approved.Methods inherited from class DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstantModifier and TypeMethodDescriptionprotected voidCommits a multi-step transaction to the database.protected static TimestampNull-safe conversion of an Instant to a Timestamp.Helper method to extract database ID data from the result set.protected static intexecuteUpdate(PreparedStatement ps, int minUpdateCount) Executes an UPDATE transaction on a prepared statement, and throws aSQLExceptionif less than the expected number of rows were updated.protected static intexecuteUpdate(PreparedStatement ps, int minPerUpdate, int minTotal) Executes an batched UPDATE transaction on a prepared statement, and throws aSQLExceptionif less than the expected number of rows were updated per batch entry.protected static InstantexpandDate(Date dt) Converts a date-only JDBC value into a full timestamp.protected static StringformatDBName(String db) Formats a database name by converting to lowercase.protected static StringConverts a geographic location into a MySQL WKT formatted point.protected intgetNewID()Returns the AUTO_INC column value generated by the previous JDBC transaction.static final longReturns the total number of queries executed since the JVM was started.protected PreparedStatementInitialize the prepared statement with an arbitrary SQL statement.protected PreparedStatementInitialize the prepared statement with an abitrary SQL statement, without applying the DAO's query result limitations.protected voidRolls back a multi-step transaction before it is completed.final voidsetQueryMax(int maxRows) Sets the maximum number of rows in the returned result set.final voidsetQueryStart(int rowStart) Sets the first row of the results to return.voidsetQueryTimeout(int timeout) Sets the timeout for any SQL operations.protected voidMarks the start of a multi-step database transaction.protected static IntegerConverts a Database bean or an Integer into an Integer.protected static Collection<Integer> toID(Collection<?> ids) Converts a collection of Objects into Integer IDs.protected static InstantNull-safe conversion of a Timestamp to an Instant.
-
Constructor Details
-
GetImage
Initializes the DAO from a JDBC connection.- Parameters:
c- the JDBC connection
-
-
Method Details
-
getSignatureImage
Returns a signature image for a Pilot.- Parameters:
id- the pilot IDdbName- the database containing the signature- Returns:
- the signature image data
- Throws:
DAOException- if a JDBC error occurs
-
getSigModified
Returns the last modification date of a Pilot signature.- Parameters:
id- the Pilot's database IDdbName- the database containing the signature- Returns:
- the signature last modified date/time, or null if not found
- Throws:
DAOException- if a JDBC error occurs
-
getEventBanner
Returns an Online Event banner image.- Parameters:
id- the Event database ID- Returns:
- the banner image data
- Throws:
DAOException- if a JDBC error occurs
-
getPartnerBanner
Returns a Partner banner image.- Parameters:
id- the Partner database ID- Returns:
- the banner image data
- Throws:
DAOException- if a JDBC error occurs
-
getChart
Returns a Chart.- Parameters:
id- the chart ID- Returns:
- the chart image data
- Throws:
DAOException- if a JDBC error occurs
-
getNews
Returns a System News banner image.- Parameters:
id- the News entry id- Returns:
- the banner image data
- Throws:
DAOException- if a JDBC error occurs
-
getNOTAM
Returns a NOTAM banner image.- Parameters:
id- the NOTAM id- Returns:
- the banner image data
- Throws:
DAOException- if a JDBC error occurs
-
getGalleryImage
Returns a Picture Gallery image.- Parameters:
id- the gallery image IDdbName- the database name- Returns:
- the gallery image data
- Throws:
DAOException- if a JDBC error occurs
-
getExamResource
Returns a Testing Center resource image.- Parameters:
id- the question ID- Returns:
- the question image data
- Throws:
DAOException- if a JDBC error occurs
-
getTile
Returns an ACARS track tile.- Parameters:
addr- the TileAddress- Returns:
- the PNG tile data, or null if not found
- Throws:
DAOException- if a JDBC error occurs
-
isSignatureAuthorized
Returns if a Water Cooler signature image is officially approved.- Parameters:
id- the Pilot's database ID- Returns:
- TRUE if approved, otherwise FALSE
- Throws:
DAOException- if a JDBC error occurs
-