return(true);
} catch (Exception e) {
errorLogger.error( DmaapbcLogMessageEnum.HTTP_CONNECTION_ERROR, pURL, e.getMessage() );
- e.printStackTrace();
return(false);
}
logger.info( "artificial 200 response from doPostFeed because unit_test =" + unit_test );
} else {
logger.warn("Unable to read response " );
- e.printStackTrace();
+ errorLogger.error("Unable to read response ", e.getMessage());
try {
err.setCode( uc.getResponseCode());
err.setMessage(uc.getResponseMessage());
finally {
try {
uc.disconnect();
- } catch ( Exception e ) {}
+ } catch ( Exception e ) {
+ logger.error(e.getMessage(), e);
+ }
}
return responseBody;
logger.info( "artificial 200 response from doXgressPost because unit_test =" + unit_test );
} else {
logger.error("Unable to read response " );
- e.printStackTrace();
+ logger.error(e.getMessage(), e);
}
}
finally {
// without this, Java will connect multiple times to the server to run the same request
uc.setDoOutput(false);
} catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
rc = uc.getResponseCode();
err.setMessage( "simulated response");
logger.info( "artificial 200 response from doPostDr_Sub because unit_test =" + unit_test );
} else {
- System.err.println("Unable to read response " );
- e.printStackTrace();
+ logger.error("Unable to read response ", e.getMessage());
}
}
finally {
try {
uc.disconnect();
- } catch ( Exception e ) {}
+ } catch ( Exception e ) {
+ logger.error(e.getMessage(), e);
+ }
}
return responseBody;
// without this, Java will connect multiple times to the server to run the same request
uc.setDoOutput(false);
} catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
rc = uc.getResponseCode();
logger.info( "artificial 200 response from doPutFeed because unit_test =" + unit_test );
} else {
logger.warn("Unable to read response " );
- e.printStackTrace();
+ logger.error(e.getMessage(), e);
}
try {
err.setCode( uc.getResponseCode());
} catch (Exception e2) {
err.setCode( 500 );
err.setMessage("Unable to determine response message");
+ logger.error(e2.getMessage(), e2);
}
} finally {
try {
uc.disconnect();
- } catch ( Exception e ) {}
+ } catch ( Exception e ) {
+ logger.error(e.getMessage(), e);
+ }
}
return responseBody;
}
// without this, Java will connect multiple times to the server to run the same request
uc.setDoOutput(false);
} catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
rc = uc.getResponseCode();
errorLogger.error( DmaapbcLogMessageEnum.HTTP_CONNECTION_EXCEPTION, provURL, ce.getMessage() );
err.setCode( 500 );
err.setMessage("Backend connection refused");
+ logger.error(ce.getMessage(), ce);
} catch (Exception e) {
if ( unit_test.equals( "Yes" ) ) {
err.setCode(200);
logger.error(e.getMessage(), e);
}
} finally {
- uc.disconnect();
+ if(null != uc){
+ uc.disconnect();
+ }
}
return responseBody;
// without this, Java will connect multiple times to the server to run the same request
uc.setDoOutput(false);
} catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
errorLogger.error( DmaapbcLogMessageEnum.HTTP_CONNECTION_EXCEPTION, provURL, ce.getMessage() );
err.setCode( 500 );
err.setMessage("Backend connection refused");
+ logger.error(ce.getMessage(), ce);
} catch (Exception e) {
if ( unit_test.equals( "Yes" ) ) {
err.setCode(200);
err.setMessage( "simulated response");
logger.info( "artificial 200 response from doGetNodes because unit_test =" + unit_test );
} else {
- System.err.println("Unable to read response " );
- e.printStackTrace();
+ logger.error("Unable to read response ", e.getMessage());
}
} finally {
err.setMessage( "simulated response");
logger.info( "artificial 200 response from doPutNodes because unit_test =" + unit_test );
} else {
- System.err.println("Unable to read response " + e.getMessage() );
- e.printStackTrace();
+ logger.error("Unable to read response ", e.getMessage());
}
} finally {
if ( uc != null ) {
// without this, Java will connect multiple times to the server to run the same request
uc.setDoOutput(false);
} catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
rc = uc.getResponseCode();
errorLogger.error( DmaapbcLogMessageEnum.HTTP_CONNECTION_EXCEPTION, provURL, ce.getMessage() );
err.setCode( 500 );
err.setMessage("Backend connection refused");
+ logger.error(ce.getMessage(), ce);
} catch (SocketException se) {
errorLogger.error( DmaapbcLogMessageEnum.SOCKET_EXCEPTION, se.getMessage(), "response from Prov server" );
err.setCode( 500 );
err.setMessage( "Unable to read response from DR");
+ logger.error(se.getMessage(), se);
} catch (Exception e) {
if ( unit_test.equals( "Yes" ) ) {
err.setCode(200);
logger.info( "artificial 200 response from doDeleteFeed because unit_test =" + unit_test );
} else {
logger.warn("Unable to read response " );
- e.printStackTrace();
+ logger.error(e.getMessage(), e);
try {
err.setCode( uc.getResponseCode());
err.setMessage(uc.getResponseMessage());
} catch (Exception e2) {
err.setCode( 500 );
err.setMessage("Unable to determine response message");
+ logger.error(e2.getMessage(), e2);
}
}
} finally {
try {
- uc.disconnect();
- } catch ( Exception e ) {}
+ if(uc != null) {
+ uc.disconnect();
+ }
+ } catch ( Exception e ) {
+ logger.error(e.getMessage(), e);
+ }
}
return responseBody;
}
// without this, Java will connect multiple times to the server to run the same request
uc.setDoOutput(false);
} catch (Exception e) {
+ logger.error(e.getMessage(), e);
}
}
rc = uc.getResponseCode();
err.setMessage( "simulated response");
logger.info( "artificial 200 response from doDeleteDr_Sub because unit_test =" + unit_test );
} else {
- System.err.println("Unable to read response " );
- e.printStackTrace();
+ logger.error("Unable to read response ", e.getMessage());
}
} finally {
- uc.disconnect();
+ if(uc != null){
+ uc.disconnect();
+ }
}
return responseBody;