public UserType getUserType() { RequestMessageType requestMessageType = (RequestMessageType) jaxbElement.getValue(); UserType userType = new UserType(); userType.setLogin(requestMessageType.getMessageHeader().getSecurity().getUsername()); userType.setGroup(requestMessageType.getMessageHeader().getSecurity().getDomain()); return userType; }
/** Perform operation for the given request using business class(ejb) and return response */ public BodyType execute() throws I2B2Exception { // call ejb and pass input object QueryProcessorUtil qpUtil = QueryProcessorUtil.getInstance(); String responseString = null; BodyType bodyType = new BodyType(); InstanceResponseType instanceResponseType = null; try { QueryRunLocalHome queryRunLocalHome = qpUtil.getQueryRunLocalHome(); QueryRunLocal queryRunLocal = queryRunLocalHome.create(); UserType userType = headerType.getUser(); String userId = null; if (userType != null) { userId = userType.getLogin(); } instanceResponseType = queryRunLocal.getQueryInstanceFromMasterId( getDataSourceLookup(), userId, masterRequestType); instanceResponseType.setStatus( this.buildCRCStausType(RequestHandlerDelegate.DONE_TYPE, "DONE")); // ResponseMessageType responseMessageType = new ResponseMessageType(); // responseMessageType.setMessageBody(bodyType); // responseString = getResponseString(responseMessageType); } catch (I2B2Exception e) { instanceResponseType = new InstanceResponseType(); instanceResponseType.setStatus( this.buildCRCStausType(RequestHandlerDelegate.ERROR_TYPE, e.getMessage())); } catch (ServiceLocatorException e) { log.error(e); throw new I2B2Exception("Servicelocator exception", e); } catch (CreateException e) { log.error(e); throw new I2B2Exception("Ejb create exception", e); } finally { edu.harvard.i2b2.crc.datavo.setfinder.query.ObjectFactory of = new edu.harvard.i2b2.crc.datavo.setfinder.query.ObjectFactory(); bodyType.getAny().add(of.createResponse(instanceResponseType)); } return bodyType; }