/** * Logs a message with trace log level. * * @param message log this message */ @Override public final void trace(final Object msg) { String sMsg = msg == null ? "TRACE???" : msg.toString(); this.logger.debug(null, getClass(), sMsg); }
/** * Logs a message with debug log level. * * @param message log this message */ @Override public final void debug(final Object msg) { if (this.logger.getIsShowDebugMessages()) { String sMsg = msg == null ? "???" : msg.toString(); this.logger.debug(null, getClass(), sMsg); } }
/** * Log a message object at level VERBOSE. * * @param msg * - the message object to be logged */ @Override public void trace(String msg) { if (this.logger.getIsShowDebugMessages()) { this.logger.debug(null, getClass(), msg); } }
/** * Log a message object at level DEBUG. * * @param msg * - the message object to be logged */ @Override public void debug(String msg) { if (this.logger.getIsShowDebugMessages()) { this.logger.debug(null, getClass(), msg); } }
/** * Log an exception (throwable) at level VERBOSE with an accompanying message. * * @param msg * the message accompanying the exception * @param t * the exception (throwable) to log */ @Override public void trace(String msg, Throwable t) { if (this.logger.getIsShowDebugMessages()) { this.logger.debug(null, getClass(), msg, t); } }
/** * Log an exception (throwable) at level DEBUG with an accompanying message. * * @param msg * the message accompanying the exception * @param t * the exception (throwable) to log */ @Override public void debug(String msg, Throwable t) { if (this.logger.getIsShowDebugMessages()) { this.logger.debug(null, getClass(), msg, t); } }
/** * <p>Rollback transaction to savepoint.</p> * @param pSavepointName savepoint name * @throws Exception - an exception **/ @Override public final void rollBackTransaction(final String pSavepointName) throws Exception { getLogger().debug(SrvDatabase.class, "try to rollback to savepoint: " + pSavepointName); this.threadConnection.get(). rollback(savepointsMap.get(pSavepointName)); savepointsMap.remove(pSavepointName); }
/** * <p>Rollback transaction to savepoint.</p> * @param pSavepointName savepoint name * @throws Exception - an exception **/ @Override public final void rollBackTransaction(final String pSavepointName) throws Exception { if (getLogger().getIsShowDebugMessagesFor(getClass())) { getLogger().debug(null, SrvDatabase.class, "try to rollback to savepoint: " + pSavepointName); } this.threadConnection.get(). rollback(savepointsMap.get(pSavepointName)); savepointsMap.remove(pSavepointName); }
/** * Log a message at level DEBUG according to the specified format and argument. * * <p> * This form avoids superfluous object creation when the logger is disabled * for level DEBUG. * </p> * * @param format * the format string * @param arg * the argument */ @Override public void debug(String format, Object arg) { if (this.logger.getIsShowDebugMessages()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, new Object[] {arg}); this.logger.debug(null, getClass(), ft.getMessage(), ft.getThrowable()); } }
/** * Log a message at level VERBOSE according to the specified format and * arguments. * * <p> * This form avoids superfluous object creation when the logger is disabled * for the VERBOSE level. * </p> * * @param format * the format string * @param argArray * an array of arguments */ @Override public void trace(String format, Object... argArray) { if (this.logger.getIsShowDebugMessages()) { FormattingTuple ft = MessageFormatter.arrayFormat(format, argArray); this.logger.debug(null, getClass(), ft.getMessage(), ft.getThrowable()); } }
/** * <p>Rollback transaction to savepoint.</p> * @param pSavepointName savepoint name * @throws Exception - an exception **/ @Override public final void rollBackTransaction(final String pSavepointName) throws Exception { //according https://code.google.com/p/android/issues/detail?id=38706 //its very easy to make simple things complicated getLogger().debug(SrvDatabase.class, "try to rollback to savepoint: " + pSavepointName); executeQuery(";ROLLBACK TRANSACTION TO SAVEPOINT " + pSavepointName + ";"); }
/** * <p>Checks if request public.</p> * @param pReq request * @return if public * @throws Exception - an exception **/ public final Boolean evaluate( final HttpServletRequest pReq) throws Exception { String nameHandler = pReq.getParameter("nmHnd"); if (this.publicHandlerNames.contains(nameHandler)) { return Boolean.TRUE; } this.logger.error(null, CheckerPublicReqHndl.class, nameHandler + " IS NOT PUBLIC!!!"); if (this.logger.getIsShowDebugMessages() && this.logger.getDetailLevel() > 10000) { StringBuffer sb = new StringBuffer("Public handlers: "); for (String nmHnd : this.publicHandlerNames) { sb.append("/" + nmHnd); } this.logger.debug(null, CheckerPublicReqHndl.class, sb.toString()); } return Boolean.FALSE; }
/** * <p>Execute any SQL query that returns no data. * E.g. PRAGMA, etc.</p> * @param pQuery query * @throws ExceptionWithCode - if an exception occured **/ @Override public final void executeQuery(final String pQuery) throws Exception { try { getLogger().debug(SrvDatabase.class, "try to execute query: " + pQuery); this.sqliteDatabase.execSQL(pQuery); } catch (Exception ex) { String msg = ex.getMessage() + ", query:\n" + pQuery; ExceptionWithCode ewc = new ExceptionWithCode(SrvDatabase.SQL_EXEC_ERROR, msg); ewc.setStackTrace(ex.getStackTrace()); throw ewc; } }
/** * <p>Retrieve records from DB.</p> * @param pSelect query SELECT * @return IRecordSet record set * @throws Exception - an exception **/ @Override public final IRecordSet<ResultSet> retrieveRecords(final String pSelect) throws Exception { try { getLogger().debug(SrvDatabase.class, "Thread ID=" + Thread.currentThread() .getId() + ", try to retrieve records: " + pSelect); final Statement stmt = getOrEstablishConnection().createStatement(); final ResultSet rs = stmt.executeQuery(pSelect); return new RecordSetJdbc(rs, stmt); } catch (SQLException sqle) { String msg = sqle.getMessage() + ", RDBMS error code " + sqle.getErrorCode() + ", query:\n" + pSelect; throw new ExceptionWithCode(ASrvDatabase.SQL_EXEC_ERROR, msg); } }
/** * <p>Rollback transaction to savepoint.</p> * @param pSavepointName savepoint name * @throws Exception - an exception **/ @Override public final void rollBackTransaction(final String pSavepointName) throws Exception { //according https://code.google.com/p/android/issues/detail?id=38706 //its very easy to make simple things complicated if (getLogger().getIsShowDebugMessagesFor(getClass())) { getLogger().debug(null, SrvDatabase.class, "try to rollback to savepoint: " + pSavepointName); } executeQuery(";ROLLBACK TRANSACTION TO SAVEPOINT " + pSavepointName + ";"); }
/** * <p>Execute any SQL query that returns no data. * E.g. PRAGMA, etc.</p> * @param pQuery query * @throws ExceptionWithCode - if an exception occured **/ @Override public final void executeQuery(final String pQuery) throws Exception { try { if (getLogger().getIsShowDebugMessagesFor(getClass()) && getLogger().getDetailLevel() > 30000) { getLogger().debug(null, SrvDatabase.class, "try to execute query: " + pQuery); } this.sqliteDatabase.execSQL(pQuery); } catch (Exception ex) { String msg = ex.getMessage() + ", query:\n" + pQuery; ExceptionWithCode ewc = new ExceptionWithCode(SrvDatabase.SQL_EXEC_ERROR, msg); ewc.setStackTrace(ex.getStackTrace()); throw ewc; } }
/** * <p>Handle new accounting entry is created to check dirty. * This is implementation of dirty check for all accounts.</p> * @param pAcc account * @param pSubaccId subaccount ID * @param pDateAt date at * @throws Exception - an exception **/ @Override public final synchronized void handleNewAccountEntry(final Account pAcc, final Long pSubaccId, final Date pDateAt) throws Exception { if (lazyGetBalanceAtAllDirtyCheck().getLeastAccountingEntryDate() .getTime() > pDateAt.getTime()) { getLogger().debug(SrvBalanceStd.class, SrvBalanceStd.class.getSimpleName() + ": changing least last entry date from " + lazyGetBalanceAtAllDirtyCheck().getLeastAccountingEntryDate() + " to " + pDateAt); lazyGetBalanceAtAllDirtyCheck().setLeastAccountingEntryDate(pDateAt); } }
/** * <p>Fpgm loader.</p> * @param pTtf font * @param pTde table entry * @param pIs input stream * @throws Exception an Exception **/ public final void loadFpgm(final TtfFont pTtf, final TtfTableDirEntry pTde, final TtfInputStream pIs) throws Exception { pIs.goAhead(pTde.getOffset()); byte[] buf = new byte[(int) pTde.getLength()]; pIs.read(buf); TableForEmbeddingBf tfebf = new TableForEmbeddingBf(pTde, true, true, buf); tfebf.setTdeMaker(this.tdeMaker); tfebf.setTableMaker(this.tableMakerFc); pTtf.getTablesForEmbedding().add(tfebf); if (this.isShowDebugMessages) { this.logger.debug(null, TtfLoader.class, "Added fpgm table"); } }
/** * <p>Prep loader.</p> * @param pTtf font * @param pTde table entry * @param pIs input stream * @throws Exception an Exception **/ public final void loadPrep(final TtfFont pTtf, final TtfTableDirEntry pTde, final TtfInputStream pIs) throws Exception { pIs.goAhead(pTde.getOffset()); byte[] buf = new byte[(int) pTde.getLength()]; pIs.read(buf); TableForEmbeddingBf tfebf = new TableForEmbeddingBf(pTde, true, true, buf); tfebf.setTdeMaker(this.tdeMaker); tfebf.setTableMaker(this.tableMakerFc); pTtf.getTablesForEmbedding().add(tfebf); if (this.isShowDebugMessages) { this.logger.debug(null, TtfLoader.class, "Added prep table"); } }
/** * <p>Cvt loader.</p> * @param pTtf font * @param pTde table entry * @param pIs input stream * @throws Exception an Exception **/ public final void loadCvt(final TtfFont pTtf, final TtfTableDirEntry pTde, final TtfInputStream pIs) throws Exception { pIs.goAhead(pTde.getOffset()); byte[] buf = new byte[(int) pTde.getLength()]; pIs.read(buf); TableForEmbeddingBf tfebf = new TableForEmbeddingBf(pTde, true, true, buf); tfebf.setTdeMaker(this.tdeMaker); tfebf.setTableMaker(this.tableMakerFc); pTtf.getTablesForEmbedding().add(tfebf); if (this.isShowDebugMessages) { this.logger.debug(null, TtfLoader.class, "Added cvt table"); } }