@HTTPService(name="carb") public class BackendService extends java.lang.Object
Constructor and Description |
---|
BackendService() |
Modifier and Type | Method and Description |
---|---|
void |
addTask(InputStreamParameter xml)
The request is to be sent in the body of POST method.
|
Response |
queryTaskStatus(LongParameter taskId,
DataGroups dataGroups,
Limits limits)
This method can be used to query the current status of an analysis task from the back-end.
|
Response |
similarPhotosByContent(StringParameter url,
StringParameter analysisType,
DataGroups dataGroups,
Limits limits,
IntegerParameter serviceIds,
LongParameter userIdFilters)
This method can be used to retrieve photos similar to the reference photo provided as a URL parameter.
|
Response |
similarPhotosById(StringParameter guid,
StringParameter analysisType,
DataGroups dataGroups,
Limits limits,
IntegerParameter serviceIds,
LongParameter userIdFilters)
This method is applicable for analysis back-ends that store the GUID and user information.
|
public BackendService()
@HTTPServiceMethod(name="addTask", acceptedMethods="POST") public void addTask(@HTTPMethodParameter(name="body",bodyParameter=true) InputStreamParameter xml)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <taskDetails> <backendId>1916565043</backendId> <taskId>2912468626334865800</taskId> <taskType>ANALYSIS</taskType> <callbackUri>http://fe.example.org/rest/cars/taskFinished</callbackUri> <taskParameters> <analysisTypeList> <analysisType>FACE_DETECTION</analysisType> <analysisType>KEYWORD_EXTRACTION</analysisType> <analysisType>VISUAL</analysisType> </analysisTypeList> </taskParameters> <userId>7106344664856443831</userId> <mediaList> <media> <credits>pSVoiPbtVFUTaZAaZFTwwqFhtKiSJgVoHJqtkQZzTGmQHtrlXQUYFYxozmqURtXI</credits> <description>SrsgiopONURBhYFAwiEcapBEdBqlnvMdwHMoGTJUzRaHicwnyajhvcdVimnDXmtO</description> <UID>43831cde-f633-40c4-b3da-2e95e9e9447d</UID> <name>PaZipnFuAHIZnelxxdVgsLfvwGsAMdHoZeWkJoEjlXPwlcuTJodkxUpPBqLLKkKT</name> <serviceId>6</serviceId> <visibility>PUBLIC</visibility> <objectList> <object> <backendId>121237316</backendId> <confidence>0.14703198741216017</confidence> <mediaObjectId>198658109480396088</mediaObjectId> <mediaType>PHOTO</mediaType> <objectId>XhUfPLvdXoLDRJvdRbhnVvNylAlOXKsmTaelwQaTGzCAzwenwxDOTCMaJIWgWEGI</objectId> <rank>1276795380</rank> <serviceId>4</serviceId> <status>NO_FRIENDLY_KEYWORD</status> <objectType>KEYWORD</objectType> <value>NlszQrNJnopzjqAZibCKDJImflOpsCEaKPgHSbMnfZBYKdvbMLqtQJByNEuASrUL</value> <visibility>PRIVATE</visibility> <userId>7106344664856443831</userId> </object> </objectList> <mediaType>PHOTO</mediaType> <userId>7106344664856443831</userId> <url>http://fe.example.org/rest/carc/r?uid=43831cde-f633-40c4-b3da-2e95e9e9447d&service_id=6</url> </media> </mediaList> </taskDetails>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response method="addTask" service="carb"> <status>OK</status> </response>
xml
- Only the workload data should be in the body. See PhotoTaskDetails
@HTTPServiceMethod(name="queryTaskStatus", acceptedMethods="GET") public Response queryTaskStatus(@HTTPMethodParameter(name="task_id") LongParameter taskId, @HTTPMethodParameter(name="data_groups",required=false) DataGroups dataGroups, @HTTPMethodParameter(name="limits",required=false) Limits limits)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response method="queryTaskStatus" service="carb"> <taskResults> <backendId>841687647</backendId> <message>hswxrkfgreWiWljbQcYbXYgZLllaXfGngtevPixESVfshFYbdukEzUlqXlcxFDYZ</message> <status>COMPLETED</status> <taskId>1</taskId> <taskType>ANALYSIS</taskType> <mediaList> <media> <UID>d84a9868-9f5e-4bdb-ac74-daae46a5357f</UID> <serviceId>1</serviceId> <objectList> <object> <backendId>841687647</backendId> <confidence>0.21839112972110253</confidence> <mediaObjectId>4658075583542523510</mediaObjectId> <mediaType>PHOTO</mediaType> <objectId>cMSJCOBopsKcPNdbuoyaxDcShgAaeyJzyGqawTgLrTOwCqWhpivnCkLaNESaMgsT</objectId> <rank>346631555</rank> <serviceId>4</serviceId> <status>USER_REJECTED</status> <objectType>KEYWORD</objectType> <value>SmbwijEmDkOzWFAjLHIvBLcWUfOIELPuXEBLLqLfCqaftXCQhKFlYGpwjbshEDbD</value> <visibility>GROUP</visibility> <userId>4785358824626845157</userId> </object> </objectList> <mediaType>PHOTO</mediaType> <userId>4785358824626845157</userId> <url>http://fe.example.org/rest/carc/r?uid=d84a9868-9f5e-4bdb-ac74-daae46a5357f&service_id=1</url> </media> </mediaList> </taskResults> <status>OK</status> </response>
taskId
- dataGroups
- For supported data groups, see ClientService.retrieveMediaObjects(core.tut.pori.http.parameters.AuthenticationParameter, DataGroups, Limits, core.tut.pori.http.parameters.IntegerParameter, core.tut.pori.http.parameters.StringParameter)
.limits
- paging limitsPhotoTaskResponse
@HTTPServiceMethod(name="similarPhotosByContent", acceptedMethods="GET") public Response similarPhotosByContent(@HTTPMethodParameter(name="url") StringParameter url, @HTTPMethodParameter(name="analysis_type",required=false) StringParameter analysisType, @HTTPMethodParameter(name="data_groups",required=false) DataGroups dataGroups, @HTTPMethodParameter(name="limits",required=false) Limits limits, @HTTPMethodParameter(name="service_id",required=false) IntegerParameter serviceIds, @HTTPMethodParameter(name="user_id",required=false) LongParameter userIdFilters)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response method="similarPhotosByContent" service="carb"> <mediaList> <media> <UID>c9076b17-59e7-4eaf-9056-7c54a28e24b3</UID> <serviceId>1</serviceId> <objectList> <object> <backendId>2111129197</backendId> <confidence>0.5631182947090244</confidence> <mediaObjectId>4081506386498315912</mediaObjectId> <mediaType>PHOTO</mediaType> <objectId>QrUdrvackDBmTlplkZIwbdRrLCfGzBhHGkTIVNhZVcKsQKWTuuiqVfHEbaKvTHuT</objectId> <rank>1618823153</rank> <serviceId>4</serviceId> <status>NO_FRIENDLY_KEYWORD</status> <objectType>KEYWORD</objectType> <value>wZXEpuSKCUuCdbrlxdzXlFkdbmQhbNVGHqyONdFpmbutDFzdniwfdFcyUEcSpIIj</value> <visibility>GROUP</visibility> <userId>3783494211507500787</userId> </object> </objectList> <mediaType>PHOTO</mediaType> <userId>3783494211507500787</userId> <url>http://fe.example.org/rest/carc/r?uid=c9076b17-59e7-4eaf-9056-7c54a28e24b3&service_id=1</url> </media> </mediaList> <status>OK</status> </response>
url
- publicly accessible URL with photo contentanalysisType
- optional list of analysis types to use for the search operation PhotoParameters.AnalysisType
dataGroups
- For supported data groups, see ClientService.retrieveMediaObjects(core.tut.pori.http.parameters.AuthenticationParameter, DataGroups, Limits, core.tut.pori.http.parameters.IntegerParameter, core.tut.pori.http.parameters.StringParameter)
.limits
- paging limitsserviceIds
- serviceIds If given, search is targeted only to the services with the listed ids. For supported service types, see CAContentCore.ServiceType
.userIdFilters
- If parameter is missing, search should be targeted only to publicly available photos.PhotoList
@HTTPServiceMethod(name="similarPhotosById", acceptedMethods="GET") public Response similarPhotosById(@HTTPMethodParameter(name="uid") StringParameter guid, @HTTPMethodParameter(name="analysis_type",required=false) StringParameter analysisType, @HTTPMethodParameter(name="data_groups",required=false) DataGroups dataGroups, @HTTPMethodParameter(name="limits",required=false) Limits limits, @HTTPMethodParameter(name="service_id",required=false) IntegerParameter serviceIds, @HTTPMethodParameter(name="user_id",required=false) LongParameter userIdFilters)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <response method="similarPhotosById" service="carb"> <mediaList> <media> <UID>fc6539fa-851b-4edb-8c53-32c2203690ce</UID> <serviceId>4</serviceId> <objectList> <object> <backendId>247772649</backendId> <confidence>0.6535018929207621</confidence> <mediaObjectId>7661947995671148237</mediaObjectId> <mediaType>PHOTO</mediaType> <objectId>VGbTDhNPTfJaPJAZlCeQfUZuDGZxnOAhULnoZIbPfnaigszkQxNNWAOLjPPCgrGV</objectId> <rank>834748654</rank> <serviceId>6</serviceId> <status>NO_FRIENDLY_KEYWORD</status> <objectType>KEYWORD</objectType> <value>XBnQGNAxfWAmNodRbhKZraKrmShoKBrEipOZzCRnGpCTCfGWVOUxwQqvwRwHiBok</value> <visibility>GROUP</visibility> <userId>2245408408598435643</userId> </object> </objectList> <mediaType>PHOTO</mediaType> <userId>2245408408598435643</userId> <url>http://fe.example.org/rest/carc/r?uid=fc6539fa-851b-4edb-8c53-32c2203690ce&service_id=4</url> </media> </mediaList> <status>OK</status> </response>
guid
- video GUIDanalysisType
- optional list of analysis types to use for the search operation PhotoParameters.AnalysisType
dataGroups
- For supported data groups, see ClientService.retrieveMediaObjects(core.tut.pori.http.parameters.AuthenticationParameter, DataGroups, Limits, core.tut.pori.http.parameters.IntegerParameter, core.tut.pori.http.parameters.StringParameter)
.limits
- paging limitsserviceIds
- serviceIds If given, search is targeted only to the services with the listed ids. For supported service types, see CAContentCore.ServiceType
.userIdFilters
- If parameter is missing, search should be targeted only to publicly available photos.PhotoList
Copyright © 2015 Tampere University of Technology, Pori Department.