Class RestCall
java.lang.Object
edu.university.ecs.lab.common.models.ir.Node
edu.university.ecs.lab.common.models.ir.MethodCall
edu.university.ecs.lab.common.models.ir.RestCall
- All Implemented Interfaces:
JsonSerializable
Represents an extension of a method call. A rest call exists at the service level and represents
a call to an endpoint mapping.
-
Field Summary
Modifier and TypeFieldDescriptionprivate HttpMethod
The httpMethod of the api endpoint e.g.private String
The URL of the rest call e.g.Fields inherited from class edu.university.ecs.lab.common.models.ir.MethodCall
calledFrom, className, microserviceName, objectName, objectType, parameterContents
Fields inherited from class edu.university.ecs.lab.common.models.ir.Node
name, packageAndClassName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
matchEndpoint
(RestCall restcall, Endpoint endpoint) Checks if a rest call matches a given endpointprivate static boolean
matchQueryParams
(RestCall restCall, Endpoint endpoint, int queryParamIndex) Checks if rest call parameters match parameters for the target endpointcom.google.gson.JsonObject
Methods inherited from class edu.university.ecs.lab.common.models.ir.MethodCall
matchMethod
-
Field Details
-
url
The URL of the rest call e.g. /api/v1/users/login, May have dynamic parameters which are converted to {?} -
httpMethod
The httpMethod of the api endpoint e.g. GET, POST, PUT see semantics.models.enums.httpMethod
-
-
Constructor Details
-
RestCall
-
RestCall
-
-
Method Details
-
toJsonObject
public com.google.gson.JsonObject toJsonObject()- Specified by:
toJsonObject
in interfaceJsonSerializable
- Overrides:
toJsonObject
in classMethodCall
- Returns:
- a JsonObject representing this
-
matchEndpoint
Checks if a rest call matches a given endpoint- Parameters:
restcall
- rest call to matchendpoint
- endpoint to match- Returns:
- true if rest call and enpoint match, false otherwise
-
matchQueryParams
Checks if rest call parameters match parameters for the target endpoint- Parameters:
restCall
- rest call to matchendpoint
- endpoint to matchqueryParamIndex
- string index at which query parameters start- Returns:
- true if parameters match, false otherwise
-