}
byte[] onMessage(Connection conn, Socket s, HL7Segment msh, byte[] msg, int off,
int len, int mshlen) throws HL7Exception {
if (!(isInstalled() && conns.contains(conn)))
throw new HL7Exception(HL7Exception.AR, "Receiving Application not recognized");
if (!(acceptedSendingApplications.isEmpty()
|| acceptedSendingApplications.contains(msh.getSendingApplicationWithFacility())))
throw new HL7Exception(HL7Exception.AR, "Sending Application not recognized");
if (!(acceptedMessageTypes.contains("*")
|| acceptedMessageTypes.contains(msh.getMessageType())))
throw new HL7Exception(HL7Exception.AR, "Message Type not supported");
HL7MessageListener listener = getHL7MessageListener();
if (listener == null)
throw new HL7Exception(HL7Exception.AE, "No HL7 Message Listener configured");
return listener.onMessage(this, conn, s, msh, msg, off, len, mshlen);
}