Search in sources :

Example 6 with Annotation

use of org.ballerinalang.connector.api.Annotation in project ballerina by ballerina-lang.

the class WebSubHttpResource method buildWebSubHttpResource.

/**
 * Builds the WebSub HTTP resource representation for the resource.
 *
 * @param resource      the resource of the service for which the HTTP resource is built
 * @param httpService   the HTTP service representation of the service
 * @return  the built HTTP resource
 */
static HttpResource buildWebSubHttpResource(Resource resource, HttpService httpService) {
    WebSubHttpResource httpResource = new WebSubHttpResource(resource, httpService);
    Annotation resourceConfigAnnotation = getResourceConfigAnnotation(resource);
    if (resourceConfigAnnotation != null) {
        throw new BallerinaException("resourceConfig annotation not allowed for WebSubSubscriber resource");
    }
    httpResource.setPath("/");
    httpResource.prepareAndValidateSignatureParams();
    return httpResource;
}
Also used : BallerinaException(org.ballerinalang.util.exceptions.BallerinaException) Annotation(org.ballerinalang.connector.api.Annotation)

Aggregations

Annotation (org.ballerinalang.connector.api.Annotation)6 Struct (org.ballerinalang.connector.api.Struct)4 ArrayList (java.util.ArrayList)2 Resource (org.ballerinalang.connector.api.Resource)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 BallerinaConnectorException (org.ballerinalang.connector.api.BallerinaConnectorException)1 Service (org.ballerinalang.connector.api.Service)1 BString (org.ballerinalang.model.values.BString)1 HttpResource (org.ballerinalang.net.http.HttpResource)1 URITemplateException (org.ballerinalang.net.uri.URITemplateException)1 BallerinaException (org.ballerinalang.util.exceptions.BallerinaException)1