RecordingWebService.java (apache-openmeetings-6.1.0-src) | : | RecordingWebService.java (apache-openmeetings-6.2.0-src) | ||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
import javax.ws.rs.QueryParam; | import javax.ws.rs.QueryParam; | |||
import javax.ws.rs.core.MediaType; | import javax.ws.rs.core.MediaType; | |||
import org.apache.cxf.feature.Features; | import org.apache.cxf.feature.Features; | |||
import org.apache.openmeetings.db.dao.record.RecordingDao; | import org.apache.openmeetings.db.dao.record.RecordingDao; | |||
import org.apache.openmeetings.db.dto.basic.ServiceResult; | import org.apache.openmeetings.db.dto.basic.ServiceResult; | |||
import org.apache.openmeetings.db.dto.basic.ServiceResult.Type; | import org.apache.openmeetings.db.dto.basic.ServiceResult.Type; | |||
import org.apache.openmeetings.db.dto.record.RecordingDTO; | import org.apache.openmeetings.db.dto.record.RecordingDTO; | |||
import org.apache.openmeetings.db.entity.user.User; | import org.apache.openmeetings.db.entity.user.User; | |||
import org.apache.openmeetings.webservice.error.ServiceException; | import org.apache.openmeetings.webservice.error.ServiceException; | |||
import org.apache.openmeetings.webservice.schema.RecordingDTOListWrapper; | ||||
import org.apache.openmeetings.webservice.schema.ServiceResultWrapper; | ||||
import org.slf4j.Logger; | import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | |||
import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | |||
import io.swagger.v3.oas.annotations.Operation; | ||||
import io.swagger.v3.oas.annotations.Parameter; | ||||
import io.swagger.v3.oas.annotations.media.Content; | ||||
import io.swagger.v3.oas.annotations.media.Schema; | ||||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||||
import io.swagger.v3.oas.annotations.tags.Tag; | ||||
/** | /** | |||
* | * | |||
* The Service contains methods to work with recordings | * The Service contains methods to work with recordings | |||
* | * | |||
* @author solomax | * @author solomax | |||
* | * | |||
*/ | */ | |||
@Service("recordWebService") | @Service("recordWebService") | |||
@WebService(serviceName="org.apache.openmeetings.webservice.RecordingWebService" , targetNamespace = TNS) | @WebService(serviceName="org.apache.openmeetings.webservice.RecordingWebService" , targetNamespace = TNS) | |||
@Features(features = "org.apache.cxf.ext.logging.LoggingFeature") | @Features(features = "org.apache.cxf.ext.logging.LoggingFeature") | |||
@Produces({MediaType.APPLICATION_JSON}) | @Produces({MediaType.APPLICATION_JSON}) | |||
@Tag(name = "RecordingService") | ||||
@Path("/record") | @Path("/record") | |||
public class RecordingWebService extends BaseWebService { | public class RecordingWebService extends BaseWebService { | |||
private static final Logger log = LoggerFactory.getLogger(RecordingWebSer vice.class); | private static final Logger log = LoggerFactory.getLogger(RecordingWebSer vice.class); | |||
@Autowired | @Autowired | |||
private RecordingDao recordingDao; | private RecordingDao recordingDao; | |||
/** | /** | |||
* Deletes a flv recording | * Deletes a recording | |||
* | * | |||
* @param sid | * @param sid | |||
* The SID of the User. This SID must be marked as Loggedin | * The SID of the User. This SID must be marked as Loggedin | |||
* @param id | * @param id | |||
* the id of the recording | * the id of the recording | |||
* | * | |||
* @return {@link ServiceResult} with result type | * @return {@link ServiceResult} with result type | |||
* @throws {@link ServiceException} in case of any errors | * @throws {@link ServiceException} in case of any errors | |||
*/ | */ | |||
@DELETE | @DELETE | |||
@Path("/{id}") | @Path("/{id}") | |||
public ServiceResult delete(@QueryParam("sid") @WebParam(name="sid") Stri | @Operation( | |||
ng sid | description = "Deletes a recording", | |||
, @PathParam("id") @WebParam(name="id") Long id | responses = { | |||
@ApiResponse(responseCode = "200", descri | ||||
ption = "serviceResult object with the result", | ||||
content = @Content(schema | ||||
= @Schema(implementation = ServiceResultWrapper.class))), | ||||
@ApiResponse(responseCode = "500", descri | ||||
ption = "Error in case of invalid credentials or server error") | ||||
} | ||||
) | ||||
public ServiceResult delete( | ||||
@Parameter(required = true, description = "The SID of the | ||||
User. This SID must be marked as Loggedin") @QueryParam("sid") @WebParam(name=" | ||||
sid") String sid | ||||
, @Parameter(required = true, description = "the id of th | ||||
e recording") @PathParam("id") @WebParam(name="id") Long id | ||||
) throws ServiceException | ) throws ServiceException | |||
{ | { | |||
return performCall(sid, User.Right.SOAP, sd -> { | return performCall(sid, User.Right.SOAP, sd -> { | |||
recordingDao.delete(recordingDao.get(id)); | recordingDao.delete(recordingDao.get(id)); | |||
return new ServiceResult("Deleted", Type.SUCCESS); | return new ServiceResult("Deleted", Type.SUCCESS); | |||
}); | }); | |||
} | } | |||
/** | /** | |||
* Gets a list of recordings created by particular external USER | * Gets a list of recordings created by particular external USER | |||
skipping to change at line 102 | skipping to change at line 121 | |||
* @param sid The SID of the User. This SID must be marked as Loggedin | * @param sid The SID of the User. This SID must be marked as Loggedin | |||
* @param externalId the externalUserId | * @param externalId the externalUserId | |||
* @param externalType the externalUserType | * @param externalType the externalUserType | |||
* | * | |||
* @return - list of recordings | * @return - list of recordings | |||
* @throws {@link ServiceException} in case of any errors | * @throws {@link ServiceException} in case of any errors | |||
*/ | */ | |||
@WebMethod | @WebMethod | |||
@GET | @GET | |||
@Path("/{externaltype}/{externalid}") | @Path("/{externaltype}/{externalid}") | |||
public List<RecordingDTO> getExternal(@WebParam(name="sid") @QueryParam(" | @Operation( | |||
sid") String sid | description = "Gets a list of recordings created by parti | |||
, @PathParam("externaltype") @WebParam(name="externaltype | cular external USER", | |||
") String externalType | responses = { | |||
, @PathParam("externalid") @WebParam(name="externalid") S | @ApiResponse(responseCode = "200", descri | |||
tring externalId | ption = "list of recordings", | |||
content = @Content(schema | ||||
= @Schema(implementation = RecordingDTOListWrapper.class))), | ||||
@ApiResponse(responseCode = "500", descri | ||||
ption = "Error in case of invalid credentials or server error") | ||||
} | ||||
) | ||||
public List<RecordingDTO> getExternal( | ||||
@Parameter(required = true, description = "The SID of the | ||||
User. This SID must be marked as Loggedin") @WebParam(name="sid") @QueryParam(" | ||||
sid") String sid | ||||
, @Parameter(required = true, description = "the external | ||||
UserId") @PathParam("externaltype") @WebParam(name="externaltype") String extern | ||||
alType | ||||
, @Parameter(required = true, description = "the external | ||||
UserType") @PathParam("externalid") @WebParam(name="externalid") String external | ||||
Id | ||||
) throws ServiceException | ) throws ServiceException | |||
{ | { | |||
log.debug("getExternal:: type {}, id {}", externalType, externalI d); | log.debug("getExternal:: type {}, id {}", externalType, externalI d); | |||
return performCall(sid, User.Right.SOAP, sd -> RecordingDTO.list( recordingDao.getByExternalUser(externalId, externalType))); | return performCall(sid, User.Right.SOAP, sd -> RecordingDTO.list( recordingDao.getByExternalUser(externalId, externalType))); | |||
} | } | |||
/** | /** | |||
* Gets a list of flv recordings | * Gets a list of recordings | |||
* | * | |||
* @param sid | * @param sid | |||
* The SID of the User. This SID must be marked as Loggedin | * The SID of the User. This SID must be marked as Loggedin | |||
* @param externalType | * @param externalType | |||
* externalType specified when creating the room | * externalType specified when creating the room | |||
* @return - list of flv recordings | * @return - list of flv recordings | |||
* @throws {@link ServiceException} in case of any errors | * @throws {@link ServiceException} in case of any errors | |||
*/ | */ | |||
@WebMethod | @WebMethod | |||
@GET | @GET | |||
@Path("/{externaltype}") | @Path("/{externaltype}") | |||
public List<RecordingDTO> getExternalByType(@WebParam(name="sid") @QueryP | @Operation( | |||
aram("sid") String sid | description = "Gets a list of recordings", | |||
, @PathParam("externaltype") @WebParam(name="externaltype | responses = { | |||
") String externalType | @ApiResponse(responseCode = "200", descri | |||
ption = "list of recordings", | ||||
content = @Content(schema | ||||
= @Schema(implementation = RecordingDTOListWrapper.class))), | ||||
@ApiResponse(responseCode = "500", descri | ||||
ption = "Error in case of invalid credentials or server error") | ||||
} | ||||
) | ||||
public List<RecordingDTO> getExternalByType( | ||||
@Parameter(required = true, description = "The SID of the | ||||
User. This SID must be marked as Loggedin") @WebParam(name="sid") @QueryParam(" | ||||
sid") String sid | ||||
, @Parameter(required = true, description = "externalType | ||||
specified when creating the room") @PathParam("externaltype") @WebParam(name="e | ||||
xternaltype") String externalType | ||||
) throws ServiceException | ) throws ServiceException | |||
{ | { | |||
return performCall(sid, User.Right.SOAP, sd -> RecordingDTO.list( recordingDao.getByExternalType(externalType))); | return performCall(sid, User.Right.SOAP, sd -> RecordingDTO.list( recordingDao.getByExternalType(externalType))); | |||
} | } | |||
/** | /** | |||
* Get list of recordings | * Get list of recordings | |||
* | * | |||
* @param sid | * @param sid | |||
* The SID of the User. This SID must be marked as Loggedin | * The SID of the User. This SID must be marked as Loggedin | |||
* @param roomId | * @param roomId | |||
* the room id | * the room id | |||
* @return - list of recordings | * @return - list of recordings | |||
* @throws {@link ServiceException} in case of any errors | * @throws {@link ServiceException} in case of any errors | |||
*/ | */ | |||
@WebMethod | @WebMethod | |||
@GET | @GET | |||
@Path("/room/{roomid}") | @Path("/room/{roomid}") | |||
public List<RecordingDTO> getExternalByRoom(@WebParam(name="sid") @QueryP | @Operation( | |||
aram("sid") String sid | description = "Gets a list of recordings", | |||
, @PathParam("roomid") @WebParam(name="roomid") Long room | responses = { | |||
Id | @ApiResponse(responseCode = "200", descri | |||
ption = "list of recordings", | ||||
content = @Content(schema | ||||
= @Schema(implementation = RecordingDTOListWrapper.class))), | ||||
@ApiResponse(responseCode = "500", descri | ||||
ption = "Error in case of invalid credentials or server error") | ||||
} | ||||
) | ||||
public List<RecordingDTO> getExternalByRoom( | ||||
@Parameter(required = true, description = "The SID of the | ||||
User. This SID must be marked as Loggedin") @WebParam(name="sid") @QueryParam(" | ||||
sid") String sid | ||||
, @Parameter(required = true, description = "the room id" | ||||
) @PathParam("roomid") @WebParam(name="roomid") Long roomId | ||||
) throws ServiceException | ) throws ServiceException | |||
{ | { | |||
return performCall(sid, User.Right.SOAP, sd -> RecordingDTO.list( recordingDao.getByRoomId(roomId))); | return performCall(sid, User.Right.SOAP, sd -> RecordingDTO.list( recordingDao.getByRoomId(roomId))); | |||
} | } | |||
} | } | |||
End of changes. 9 change blocks. | ||||
19 lines changed or deleted | 86 lines changed or added |