}
subscription = getBrokerService().getSubscription(subscription.getId());
if (subscription != null) {
String loggedInUser = EventBrokerUtils.getLoggedInUserName();
if (!loggedInUser.equals("admin") && !loggedInUser.equals(subscription.getOwner())) {
throw new WSEventException("User " + loggedInUser + " does not own subscription " + subscription.getId());
}
if (log.isDebugEnabled()) {
log.debug("Sending GetStatus responce for Subscription ID : " +
subscription.getId());
}
SOAPEnvelope soapEnvelope = builder.fromSubscription(subscription);
dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE, mc, false);
} else {
log.debug("GetStatus failed, sending fault response");
SOAPEnvelope soapEnvelope = BuilderUtils.genFaultResponse(
EventingConstants.WSE_FAULT_CODE_RECEIVER, "EventSourceUnableToProcess",
"Subscription Not Found", "", mc.isSOAP11());
dispatchResponse(soapEnvelope, EventingConstants.WSA_FAULT, mc, true);
}
} catch (InvalidMessageException e) {
throw new WSEventException("Invalid message exception ", e);
} catch (EventBrokerException e) {
throw new WSEventException("Event processing exception ",e);
}
}