Exemplo n.º 1
0
  protected void init(
      final RepresentationType representationType,
      final Where where,
      final String urlUnencodedQueryString) {
    if (!IsisContext.inSession()) {
      throw RestfulObjectsApplicationException.create(HttpStatusCode.UNAUTHORIZED);
    }
    if (getAuthenticationSession() == null) {
      throw RestfulObjectsApplicationException.create(HttpStatusCode.UNAUTHORIZED);
    }

    this.resourceContext =
        new ResourceContext(
            representationType,
            httpHeaders,
            providers,
            uriInfo,
            request,
            where,
            urlUnencodedQueryString,
            httpServletRequest,
            httpServletResponse,
            securityContext,
            getDeploymentType(),
            getConfiguration(),
            getServicesInjector(),
            getSpecificationLoader(),
            getAuthenticationSession(),
            getLocalization(),
            getPersistenceSession(),
            InteractionInitiatedBy.USER);
  }
Exemplo n.º 2
0
 private void ensureInSession() {
   ensureThatContext(IsisContext.inSession(), is(true));
 }