You can use the @Endpoint annotation to annotate resource methods and configure the various setting for the endpoint, such as transactions, security, and cache.

Use the following annotations when creating an endpoint method:

Naming Endpoint Annotations

When you define an ID in a @Endpoint annotation, it is best to name it as a combination of the resource URI and the method request type. For example, a product resource might be:

@Endpoint(id="/products/{productId}#GET, isSingular = true)
Ordering Endpoint Annotations

When creating an endpoint, it is best to be consistent with the order of the annotations. For example:

@GET
@Path("/{productId}")
@Endpoint(id="/products/{productId}#GET", isSingular = true)

The following is an example of the metadata definitions of login endpoints of the CurrentUserRestResource:

@POST
@Endpoint(id = "/loginId", isSingular = true)
public Object login(JSONObject pJSON)
    throws RestException {}

Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices