protected static DRDAProtocolException newDisconnectException(DRDAConnThread agent,Object[] args) { return new DRDAProtocolException(DRDA_Disconnect, agent, NO_CODPNT_ARG, NO_ASSOC_ERRCD, args); }
/** * Agent error - something very bad happened * * @param msg Message describing error * * @exception DRDAProtocolException newAgentError always thrown */ protected void agentError(String msg) throws DRDAProtocolException { String dbname = null; if (database != null) dbname = database.dbName; throw DRDAProtocolException.newAgentError(this, CodePoint.SVRCOD_PRMDMG, dbname, msg); } /**
/** * This method is used by EXTDTAReaderInputStream to read the next chunk * of data. * * Furthermore, when Layer B streaming is carried out, * calling this method finishes layer B streaming * if continuation of DSS segment was finished. * * @param desiredLength the desired length of chunk. This parameter is ignored when layerB Streaming is doing. * @exception IOException IOException */ ByteArrayInputStream readLOBContinuationStream (final long desiredLength) throws IOException { try { return readLOBChunk(true, desiredLength); } catch (DRDAProtocolException e) { e.printStackTrace(agent.getServer().logWriter); throw new IOException(e.getMessage()); } }
/** * Notice the client about a protocol error. * * @param de <code>DRDAProtocolException</code> to be sent */ private void sendProtocolException(DRDAProtocolException de) { String dbname = null; if (database != null) { dbname = database.dbName; } try { println2Log(dbname, session.drdaID, de.getMessage()); server.consoleExceptionPrintTrace(de); reader.clearBuffer(); de.write(writer); finalizeChain(); } catch (DRDAProtocolException ioe) { // There may be an IO exception in the write. println2Log(dbname, session.drdaID, de.getMessage()); server.consoleExceptionPrintTrace(ioe); } }
/** * Send unpexpected error to the client * @param e Exception to be sent */ private void sendUnexpectedException(Exception e) { DRDAProtocolException unExpDe; String dbname = null; try { if (database != null) dbname = database.dbName; println2Log(dbname,session.drdaID, e.getMessage()); server.consoleExceptionPrintTrace(e); unExpDe = DRDAProtocolException.newAgentError(this, CodePoint.SVRCOD_PRMDMG, dbname, e.getMessage()); reader.clearBuffer(); unExpDe.write(writer); finalizeChain(); } catch (DRDAProtocolException nde) { // we can't tell the client, but we tried. } }
/** * Send SysInfo information from server to client * * @param writer writer to use for sending sysinfo * * @throws Exception if a problem occurs sending value */ private void sendSysInfo(DDMWriter writer) throws Exception { StringBuilder sysinfo = new StringBuilder(); sysinfo.append(getNetSysInfo()); sysinfo.append(getCLSSysInfo()); try { writeCommandReplyHeader(writer); writer.writeByte(0); //O.K. writer.writeLDString(sysinfo.toString()); } catch (DRDAProtocolException e) { consolePropertyMessage("DRDA_SysInfoWriteError.S", e.getMessage()); } writer.flush(); }
/** * Indicate a communications failure. Log to gemfirexd.log * * @param e - Source exception that was thrown * @param arg1 - info about the communications failure * @param arg2 - info about the communications failure * @param arg3 - info about the communications failure * @param arg4 - info about the communications failure * * @exception DRDAProtocolException disconnect exception always thrown */ protected void markCommunicationsFailure(Exception e, String arg1, String arg2, String arg3, String arg4) throws DRDAProtocolException { String dbname = null; if (database != null) { dbname = database.dbName; } if (e != null) { println2Log(dbname,session.drdaID, e.getMessage()); server.consoleExceptionPrintTrace(e); } Object[] oa = {arg1,arg2,arg3,arg4}; throw DRDAProtocolException.newDisconnectException(this,oa); }
/** * This method is used by EXTDTAReaderInputStream to read the next chunk * of data. * * Furthermore, when Layer B streaming is carried out, * calling this method finishes layer B streaming * if continuation of DSS segment was finished. * * @param desiredLength the desired length of chunk. This parameter is ignored when layerB Streaming is doing. * @exception IOException IOException */ ByteArrayInputStream readLOBContinuationStream (final long desiredLength) throws IOException { try { return readLOBChunk(true, desiredLength); } catch (DRDAProtocolException e) { e.printStackTrace(agent.getServer().logWriter); throw new IOException(e.getMessage()); } }
/** * Notice the client about a protocol error. * * @param de <code>DRDAProtocolException</code> to be sent */ private void sendProtocolException(DRDAProtocolException de) { String dbname = null; if (database != null) { dbname = database.dbName; } try { println2Log(dbname, session.drdaID, de.getMessage()); server.consoleExceptionPrintTrace(de); reader.clearBuffer(); de.write(writer); finalizeChain(); } catch (DRDAProtocolException ioe) { // There may be an IO exception in the write. println2Log(dbname, session.drdaID, de.getMessage()); server.consoleExceptionPrintTrace(ioe); } }
/** * Send unpexpected error to the client * @param e Exception to be sent */ private void sendUnexpectedException(Exception e) { DRDAProtocolException unExpDe; String dbname = null; try { if (database != null) dbname = database.dbName; println2Log(dbname,session.drdaID, e.getMessage()); server.consoleExceptionPrintTrace(e); unExpDe = DRDAProtocolException.newAgentError(this, CodePoint.SVRCOD_PRMDMG, dbname, e.getMessage()); reader.clearBuffer(); unExpDe.write(writer); finalizeChain(); } catch (DRDAProtocolException nde) { // we can't tell the client, but we tried. } }
/** * Send SysInfo information from server to client * * @param writer writer to use for sending sysinfo * * @throws Exception if a problem occurs sending value */ private void sendSysInfo(DDMWriter writer) throws Exception { StringBuilder sysinfo = new StringBuilder(); sysinfo.append(getNetSysInfo()); sysinfo.append(getCLSSysInfo()); try { writeCommandReplyHeader(writer); writer.writeByte(0); //O.K. writer.writeLDString(sysinfo.toString()); } catch (DRDAProtocolException e) { consolePropertyMessage("DRDA_SysInfoWriteError.S", e.getMessage()); } writer.flush(); }
/** * Indicate a communications failure. Log to gemfirexd.log * * @param e - Source exception that was thrown * @param arg1 - info about the communications failure * @param arg2 - info about the communications failure * @param arg3 - info about the communications failure * @param arg4 - info about the communications failure * * @exception DRDAProtocolException disconnect exception always thrown */ protected void markCommunicationsFailure(Exception e, String arg1, String arg2, String arg3, String arg4) throws DRDAProtocolException { String dbname = null; if (database != null) { dbname = database.dbName; } if (e != null) { println2Log(dbname,session.drdaID, e.getMessage()); server.consoleExceptionPrintTrace(e); } Object[] oa = {arg1,arg2,arg3,arg4}; throw DRDAProtocolException.newDisconnectException(this,oa); }
protected static DRDAProtocolException newDisconnectException(DRDAConnThread agent,Object[] args) { return new DRDAProtocolException(DRDA_Disconnect, agent, NO_CODPNT_ARG, NO_ASSOC_ERRCD, args); }
/** * This method is used by EXTDTAReaderInputStream to read the next chunk * of data. * * Furthermore, when Layer B streaming is carried out, * calling this method finishes layer B streaming * if continuation of DSS segment was finished. * * @param desiredLength the desired length of chunk. This parameter is ignored when layerB Streaming is doing. * @exception IOException IOException */ ByteArrayInputStream readLOBContinuationStream (final long desiredLength) throws IOException { try { return readLOBChunk(true, desiredLength); } catch (DRDAProtocolException e) { e.printStackTrace(agent.getServer().logWriter); throw new IOException(e.getMessage()); } }
/** * Notice the client about a protocol error. * * @param de <code>DRDAProtocolException</code> to be sent */ private void sendProtocolException(DRDAProtocolException de) { String dbname = null; if (database != null) { dbname = database.dbName; } try { println2Log(dbname, session.drdaID, de.getMessage()); server.consoleExceptionPrintTrace(de); reader.clearBuffer(); de.write(writer); finalizeChain(); } catch (DRDAProtocolException ioe) { // There may be an IO exception in the write. println2Log(dbname, session.drdaID, de.getMessage()); server.consoleExceptionPrintTrace(ioe); } }
/** * Send unpexpected error to the client * @param e Exception to be sent */ private void sendUnexpectedException(Exception e) { DRDAProtocolException unExpDe; String dbname = null; try { if (database != null) dbname = database.dbName; println2Log(dbname,session.drdaID, e.getMessage()); server.consoleExceptionPrintTrace(e); unExpDe = DRDAProtocolException.newAgentError(this, CodePoint.SVRCOD_PRMDMG, dbname, e.getMessage()); reader.clearBuffer(); unExpDe.write(writer); finalizeChain(); } catch (DRDAProtocolException nde) { // we can't tell the client, but we tried. } }
/** * Send SysInfo information from server to client * * @param writer writer to use for sending sysinfo * * @throws Exception if a problem occurs sending value */ private void sendSysInfo(DDMWriter writer) throws Exception { StringBuilder sysinfo = new StringBuilder(); sysinfo.append(getNetSysInfo()); sysinfo.append(getCLSSysInfo()); try { writeCommandReplyHeader(writer); writer.writeByte(0); //O.K. writer.writeLDString(sysinfo.toString()); } catch (DRDAProtocolException e) { consolePropertyMessage("DRDA_SysInfoWriteError.S", e.getMessage()); } writer.flush(); }