import java.util.Date;
import java.util.Enumeration;
import java.util.TimeZone;
+import javax.servlet.http.HttpServletResponse;
import org.apache.commons.codec.binary.Base64;
import org.apache.log4j.Logger;
import org.onap.dmaap.datarouter.node.eelf.EelfMsgs;
public class NodeUtils {
private static EELFLogger eelfLogger = EELFManager.getInstance()
- .getLogger("org.onap.dmaap.datarouter.node.NodeUtils");
+ .getLogger("org.onap.dmaap.datarouter.node.NodeUtils");
private static Logger nodeUtilsLogger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeUtils");
private NodeUtils() {
return (getAuthHdr(node, base64Encode(md.digest())));
} catch (Exception exception) {
nodeUtilsLogger
- .error("Exception in generating Credentials for given node name:= " + exception.toString(), exception);
+ .error("Exception in generating Credentials for given node name:= " + exception.toString(),
+ exception);
return (null);
}
}
ks.load(fileInputStream, kspass.toCharArray());
} catch (IOException ioException) {
nodeUtilsLogger.error("IOException occurred while opening FileInputStream: " + ioException.getMessage(),
- ioException);
+ ioException);
return (null);
}
} catch (Exception e) {
return (InetAddress.getByName(ip).getAddress());
} catch (Exception exception) {
nodeUtilsLogger
- .error("Exception in generating byte array for given IP address := " + exception.toString(), exception);
+ .error("Exception in generating byte array for given IP address := " + exception.toString(),
+ exception);
}
return (null);
}
MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
} catch (Exception exception) {
nodeUtilsLogger
- .error("Exception in generating byte array for given IP address := " + exception.toString(), exception);
+ .error("Exception in generating byte array for given IP address := " + exception.toString(),
+ exception);
}
}
+ public static void sendResponseError(HttpServletResponse response, int errorCode, Logger intlogger) {
+ try {
+ response.sendError(errorCode);
+ } catch (IOException ioe) {
+ intlogger.error("IOException" + ioe.getMessage());
+ }
+ }
+
}