Class ProviderHelper
- java.lang.Object
-
- org.apache.abdera.protocol.server.ProviderHelper
-
@Deprecated public class ProviderHelper extends Object
Deprecated.Legacy AEM 6.x API.Provides support methods forProvider
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ResponseContextbadrequest(RequestContext request)Deprecated.static ResponseContextbadrequest(RequestContext request, String reason)Deprecated.Return a 400 bad request errorstatic booleanbeforeOrEqual(Date d1, Date d2)Deprecated.static org.apache.abdera.util.EntityTagcalculateEntityTag(org.apache.abdera.model.Base base)Deprecated.static booleancheckElementNamespaces(org.apache.abdera.model.Element element, List<String> ignore)Deprecated.Return false if the element contains any extension elements that are not supportedstatic Stringcombine(String... vals)Deprecated.static ResponseContextconflict(RequestContext request)Deprecated.static ResponseContextconflict(RequestContext request, String reason)Deprecated.Return a 409 conflict errorstatic AbstractResponseContextcreateErrorResponse(org.apache.abdera.Abdera abdera, int code, String message)Deprecated.Returns an Error document based on the StreamWriterstatic AbstractResponseContextcreateErrorResponse(org.apache.abdera.Abdera abdera, int code, String message, Throwable t)Deprecated.Returns an Error document based on the StreamWriterstatic booleandefaultCheckMethod(RequestContext request, String[] methods)Deprecated.static ResponseContextforbidden(RequestContext request)Deprecated.static ResponseContextforbidden(RequestContext request, String reason)Deprecated.Return an unauthorized errorstatic org.apache.abdera.writer.NamedWritergetAcceptableNamedWriter(org.apache.abdera.Abdera abdera, String accept_header)Deprecated.Returns an appropriate NamedWriter instance given an appropriately formatted HTTP Accept header.static String[]getAcceptableTypes(RequestContext request)Deprecated.static String[]getDefaultMethods(RequestContext request)Deprecated.static StringgetEditUriFromEntry(org.apache.abdera.model.Entry entry)Deprecated.static org.apache.abdera.writer.NamedWritergetNamedWriter(org.apache.abdera.Abdera abdera, String mediatype)Deprecated.static intgetOffset(RequestContext request, String pageparam, int pageSize)Deprecated.static intgetPageSize(RequestContext request, String pagesizeparam, int defaultpagesize)Deprecated.static booleanisAtom(RequestContext request)Deprecated.static booleanisPreferred(String[] accepts, String s1, String s2)Deprecated.static booleanisPreferred(RequestContext request, String s1, String s2)Deprecated.static booleanisValidEntry(org.apache.abdera.model.Entry entry)Deprecated.Check to see if the entry is minimally valid according to RFC4287.static ResponseContextlocked(RequestContext request)Deprecated.static ResponseContextlocked(RequestContext request, String reason)Deprecated.Return a 423 locked errorstatic ResponseContextnocontent()Deprecated.static ResponseContextnocontent(String reason)Deprecated.Return a 204 No Content responsestatic ResponseContextnotallowed(RequestContext request)Deprecated.static ResponseContextnotallowed(RequestContext request, String... methods)Deprecated.static ResponseContextnotallowed(RequestContext request, String reason, String... methods)Deprecated.Return a 405 method not allowed errorstatic ResponseContextnotfound(RequestContext request)Deprecated.static ResponseContextnotfound(RequestContext request, String reason)Deprecated.Return a 404 not found errorstatic ResponseContextnotmodified(RequestContext request)Deprecated.static ResponseContextnotmodified(RequestContext request, String reason)Deprecated.static ResponseContextnotsupported(RequestContext request)Deprecated.static ResponseContextnotsupported(RequestContext request, String reason)Deprecated.Return a 415 media type not-supported errorstatic String[]orderByQ(String header)Deprecated.Utility method for parsing HTTP content negotiation headers and sorting their tokens according to their q parameter values.static ResponseContextpreconditionfailed(RequestContext request)Deprecated.static ResponseContextpreconditionfailed(RequestContext request, String reason)Deprecated.static org.apache.abdera.i18n.iri.IRIresolveBase(RequestContext request)Deprecated.static ResponseContextreturnBase(org.apache.abdera.model.Base base, int status, Date lastModified)Deprecated.Return a documentstatic StringsanitizeSlug(String slug)Deprecated.Sanitize the value of a Slug header.static ResponseContextservererror(RequestContext request, String reason, Throwable t)Deprecated.Return a server errorstatic ResponseContextservererror(RequestContext request, Throwable t)Deprecated.Return a server errorstatic ResponseContextunauthorized(RequestContext request)Deprecated.static ResponseContextunauthorized(RequestContext request, String reason)Deprecated.Return an unauthorized errorstatic ResponseContextunavailable(RequestContext request)Deprecated.static ResponseContextunavailable(RequestContext request, String reason)Deprecated.Return a service unavailable error
-
-
-
Method Detail
-
getPageSize
public static int getPageSize(RequestContext request, String pagesizeparam, int defaultpagesize)
Deprecated.
-
getOffset
public static int getOffset(RequestContext request, String pageparam, int pageSize)
Deprecated.
-
createErrorResponse
public static AbstractResponseContext createErrorResponse(org.apache.abdera.Abdera abdera, int code, String message)
Deprecated.Returns an Error document based on the StreamWriter
-
createErrorResponse
public static AbstractResponseContext createErrorResponse(org.apache.abdera.Abdera abdera, int code, String message, Throwable t)
Deprecated.Returns an Error document based on the StreamWriter
-
servererror
public static ResponseContext servererror(RequestContext request, String reason, Throwable t)
Deprecated.Return a server error
-
servererror
public static ResponseContext servererror(RequestContext request, Throwable t)
Deprecated.Return a server error
-
unauthorized
public static ResponseContext unauthorized(RequestContext request, String reason)
Deprecated.Return an unauthorized error
-
unauthorized
public static ResponseContext unauthorized(RequestContext request)
Deprecated.
-
forbidden
public static ResponseContext forbidden(RequestContext request, String reason)
Deprecated.Return an unauthorized error
-
forbidden
public static ResponseContext forbidden(RequestContext request)
Deprecated.
-
nocontent
public static ResponseContext nocontent(String reason)
Deprecated.Return a 204 No Content response
-
nocontent
public static ResponseContext nocontent()
Deprecated.
-
notfound
public static ResponseContext notfound(RequestContext request, String reason)
Deprecated.Return a 404 not found error
-
notfound
public static ResponseContext notfound(RequestContext request)
Deprecated.
-
notallowed
public static ResponseContext notallowed(RequestContext request, String reason, String... methods)
Deprecated.Return a 405 method not allowed error
-
notallowed
public static ResponseContext notallowed(RequestContext request, String... methods)
Deprecated.
-
notallowed
public static ResponseContext notallowed(RequestContext request)
Deprecated.
-
badrequest
public static ResponseContext badrequest(RequestContext request, String reason)
Deprecated.Return a 400 bad request error
-
badrequest
public static ResponseContext badrequest(RequestContext request)
Deprecated.
-
conflict
public static ResponseContext conflict(RequestContext request, String reason)
Deprecated.Return a 409 conflict error
-
conflict
public static ResponseContext conflict(RequestContext request)
Deprecated.
-
unavailable
public static ResponseContext unavailable(RequestContext request, String reason)
Deprecated.Return a service unavailable error
-
unavailable
public static ResponseContext unavailable(RequestContext request)
Deprecated.
-
notmodified
public static ResponseContext notmodified(RequestContext request, String reason)
Deprecated.
-
notmodified
public static ResponseContext notmodified(RequestContext request)
Deprecated.
-
preconditionfailed
public static ResponseContext preconditionfailed(RequestContext request, String reason)
Deprecated.
-
preconditionfailed
public static ResponseContext preconditionfailed(RequestContext request)
Deprecated.
-
notsupported
public static ResponseContext notsupported(RequestContext request, String reason)
Deprecated.Return a 415 media type not-supported error
-
notsupported
public static ResponseContext notsupported(RequestContext request)
Deprecated.
-
locked
public static ResponseContext locked(RequestContext request, String reason)
Deprecated.Return a 423 locked error
-
locked
public static ResponseContext locked(RequestContext request)
Deprecated.
-
returnBase
public static ResponseContext returnBase(org.apache.abdera.model.Base base, int status, Date lastModified)
Deprecated.Return a document
-
sanitizeSlug
public static String sanitizeSlug(String slug)
Deprecated.Sanitize the value of a Slug header. Any non alphanumeric characters in the slug are replaced with an underscore
-
isValidEntry
public static boolean isValidEntry(org.apache.abdera.model.Entry entry)
Deprecated.Check to see if the entry is minimally valid according to RFC4287. This is not a complete check. It just verifies that the appropriate elements are present and that their values can be accessed.
-
checkElementNamespaces
public static boolean checkElementNamespaces(org.apache.abdera.model.Element element, List<String> ignore)Deprecated.Return false if the element contains any extension elements that are not supported
-
resolveBase
public static org.apache.abdera.i18n.iri.IRI resolveBase(RequestContext request)
Deprecated.
-
getDefaultMethods
public static String[] getDefaultMethods(RequestContext request)
Deprecated.
-
defaultCheckMethod
public static boolean defaultCheckMethod(RequestContext request, String[] methods)
Deprecated.
-
isAtom
public static boolean isAtom(RequestContext request)
Deprecated.
-
orderByQ
public static String[] orderByQ(String header)
Deprecated.Utility method for parsing HTTP content negotiation headers and sorting their tokens according to their q parameter values.
e.g. Accept: audio/*; q=0.2, audio/basic, audio/mpeg; q=0.1
would sort into:
audio/basic audio/* audio/mpeg
-
getAcceptableNamedWriter
public static org.apache.abdera.writer.NamedWriter getAcceptableNamedWriter(org.apache.abdera.Abdera abdera, String accept_header)Deprecated.Returns an appropriate NamedWriter instance given an appropriately formatted HTTP Accept header. The header will be parsed and sorted according to it's q parameter values. The first named writer capable of supporting the specified type, in order of q-value preference, will be returned. The results on this are not always predictable. For instance, if the Accept header says "application/*" it could end up with either the JSON writer or the PrettyXML writer, or any other writer that supports any writer that supports a specific form of "application/*". It's always best to be very specific in the Accept headers.
-
getNamedWriter
public static org.apache.abdera.writer.NamedWriter getNamedWriter(org.apache.abdera.Abdera abdera, String mediatype)Deprecated.
-
calculateEntityTag
public static org.apache.abdera.util.EntityTag calculateEntityTag(org.apache.abdera.model.Base base)
Deprecated.
-
getEditUriFromEntry
public static String getEditUriFromEntry(org.apache.abdera.model.Entry entry)
Deprecated.
-
getAcceptableTypes
public static String[] getAcceptableTypes(RequestContext request)
Deprecated.
-
isPreferred
public static boolean isPreferred(RequestContext request, String s1, String s2)
Deprecated.
-
-