private LinkFollowSpecs asProvidedElseCreate(final LinkFollowSpecs linkFollower) { if (linkFollower != null) { return linkFollower; } return LinkFollowSpecs.create(rendererContext.getFollowLinks()); }
public static RestfulObjectsApplicationException createWithCause( final HttpStatusCode httpStatusCode, final Exception cause) { return createWithCauseAndMessage(httpStatusCode, cause, null); }
RepresentationServiceContextAdapter( final RendererContext6 rendererContext, final ObjectAdapterLinkTo adapterLinkTo) { this.rendererContext = rendererContext; this.adapterLinkTo = adapterLinkTo; this.intent = rendererContext.getIntent(); }
@Override public Response deleteServicesNotAllowed() { throw RestfulObjectsApplicationException.createWithMessage(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED, "Deleting the services resource is not allowed."); }
public static Response.ResponseBuilder ofOk( final ReprRenderer<?, ?> renderer, final Caching caching) { return ofOk(renderer, caching, null, null); }
public static RestfulObjectsApplicationException createWithBody( final HttpStatusCode httpStatusCode, final JsonRepresentation body, final String message, final Object... args) { return new RestfulObjectsApplicationException(httpStatusCode, formatString(message, args), null, body); }
@Override public PersistenceSession getPersistenceSession() { return rendererContext.getPersistenceSession(); }
private static DeploymentCategory determineDeploymentCategoryFrom(final RendererContext rendererContext) { if(rendererContext instanceof RendererContext3) { return ((RendererContext3) rendererContext).getDeploymentCategory(); } else { return DeploymentCategory.PRODUCTION; // fallback } }
@Override public boolean isValidateOnly() { return rendererContext.isValidateOnly(); }
@Override public boolean suppressMemberDisabledReason() { return rendererContext.suppressMemberDisabledReason(); }
@Override public IsisConfiguration getConfiguration() { return rendererContext.getConfiguration(); }
@Override public boolean suppressMemberId() { return rendererContext.suppressMemberId(); }
@Override public boolean suppressMemberLinks() { return rendererContext.suppressMemberLinks(); }
private LinkFollowSpecs asProvidedElseCreate(final LinkFollowSpecs linkFollower) { if (linkFollower != null) { return linkFollower; } return LinkFollowSpecs.create(rendererContext.getFollowLinks()); }
@Override public Response putServicesNotAllowed() { throw RestfulObjectsApplicationException.createWithMessage(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED, "Putting to the services resource is not allowed."); }
public static RestfulObjectsApplicationException createWithMessage( final HttpStatusCode httpStatusCode, final String message, final Object... args) { return createWithCauseAndMessage(httpStatusCode, null, message, args); }
@Override public AdapterManager getAdapterManager() { return rendererContext.getPersistenceSession(); }
@Override public Response deleteHealthNotAllowed() { throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.METHOD_NOT_ALLOWED, "Deleting the health resource is not allowed."); }
@Override public Response postHealthNotAllowed() { throw RestfulObjectsApplicationException.createWithMessage(HttpStatusCode.METHOD_NOT_ALLOWED, "Posting to the version resource is not allowed."); }
@Override public Response postServicesNotAllowed() { throw RestfulObjectsApplicationException.createWithMessage(RestfulResponse.HttpStatusCode.METHOD_NOT_ALLOWED, "Posting to the services resource is not allowed."); }