requestType.setEnvironment(environmentType); requestCtx.setRequest(requestType); requestCtx.marshall(baos); log.trace(new String(baos.toByteArray()));
private RequestContext getRequestContext( String ejbName, ActionType actionType, Principal principal, RoleGroup callerRoles ) throws IOException { if(principal == null) throw PicketBoxMessages.MESSAGES.invalidNullArgument("principal"); RequestContext requestCtx = RequestResponseContextFactory.createRequestCtx(); //Create a subject type SubjectType subject = this.getSubjectType( principal, callerRoles ); //Create a resource type ResourceType resourceType = getResourceType( ejbName ); //Create an Environment Type (Optional) EnvironmentType environmentType = getEnvironmentType(); //Create a Request Type RequestType requestType = getRequestType( subject, resourceType, actionType, environmentType ); requestCtx.setRequest( requestType ); return requestCtx; }
/** * * @param ejbName * @param methodName * @param principal * @param callerRoles * @return * @throws Exception */ public RequestContext createXACMLRequest(String ejbName, String methodName, Principal principal, RoleGroup callerRoles) throws Exception { String action = methodName; //Create an action type ActionType actionType = getActionType( action ); RequestContext requestCtx = this.getRequestContext(ejbName, actionType, principal, callerRoles); if(PicketBoxLogger.LOGGER.isDebugEnabled()) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); requestCtx.marshall(baos); PicketBoxLogger.LOGGER.debug(new String(baos.toByteArray())); } return requestCtx; }
requestContext.setRequest(requestType); } catch (IOException e) { throw new ProcessingException(e);
requestCtx.marshall(baos); PicketBoxLogger.LOGGER.debug(new String(baos.toByteArray()));
requestContext.setRequest(requestType); } catch (IOException e) { throw new ProcessingException(e);
requestType.setEnvironment(environmentType); requestCtx.setRequest(requestType); requestCtx.marshall(baos); log.trace(new String(baos.toByteArray()));
requestContext.setRequest(requestType); } catch (IOException e) { throw new ProcessingException(e);
requestType.setEnvironment(environmentType); requestCtx.setRequest(requestType); requestCtx.marshall(baos); PicketBoxLogger.LOGGER.debug(new String(baos.toByteArray()));
try requestContext.setRequest(requestType);
try requestContext.setRequest(requestType);