Class RoomWebService


  • @Service("roomWebService")
    @Produces("application/json")
    @Path("/room")
    public class RoomWebService
    extends BaseWebService
    RoomService contains methods to manipulate rooms and create invitation hash
    Author:
    sebawagner
    • Constructor Summary

      Constructors 
      Constructor Description
      RoomWebService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.openmeetings.db.dto.room.RoomDTO add​(java.lang.String sid, org.apache.openmeetings.db.dto.room.RoomDTO room)
      Adds a new Room like through the Frontend
      org.apache.openmeetings.db.dto.basic.ServiceResult cleanWb​(java.lang.String sid, long id)
      Method to clean room white board (all objects will be purged)
      org.apache.openmeetings.db.dto.basic.ServiceResult close​(java.lang.String sid, long id)
      Method to remotely close rooms.
      org.apache.openmeetings.db.dto.basic.ServiceResult count​(java.lang.String sid, java.lang.Long roomId)
      Returns the count of users currently in the Room with given id
      org.apache.openmeetings.db.dto.basic.ServiceResult delete​(java.lang.String sid, long id)
      Delete a room by its room id
      org.apache.openmeetings.db.dto.room.RoomDTO getExternal​(java.lang.String sid, java.lang.String type, java.lang.String externalType, java.lang.String externalId, org.apache.openmeetings.db.dto.room.RoomDTO room)
      Checks if a room with this exteralId + externalType does exist, if yes it returns the room id if not, it will create the room and then return the room id of the newly created room
      java.util.List<org.apache.openmeetings.db.dto.room.RoomDTO> getPublic​(java.lang.String sid, java.lang.String type)
      Returns an Object of Type RoomsList which contains a list of Room-Objects.
      org.apache.openmeetings.db.dto.room.RoomDTO getRoomById​(java.lang.String sid, java.lang.Long id)
      returns a conference room object
      org.apache.openmeetings.db.dto.basic.ServiceResult hash​(java.lang.String sid, org.apache.openmeetings.db.dto.room.InvitationDTO invite, boolean sendmail)
      Method to get invitation hash with given parameters
      org.apache.openmeetings.db.dto.basic.ServiceResult kick​(java.lang.String sid, long id, java.lang.String externalType, java.lang.String externalId)
      kick external user from given room
      org.apache.openmeetings.db.dto.basic.ServiceResult kickAll​(java.lang.String sid, long id)
      kick all uses of a certain room
      org.apache.openmeetings.db.dto.basic.ServiceResult open​(java.lang.String sid, long id)
      Method to remotely open rooms.
      java.util.List<org.apache.openmeetings.db.dto.user.UserDTO> users​(java.lang.String sid, java.lang.Long roomId)
      Returns list of users currently in the Room with given id
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RoomWebService

        public RoomWebService()
    • Method Detail

      • getPublic

        @GET
        @Path("/public/{type}")
        public java.util.List<org.apache.openmeetings.db.dto.room.RoomDTO> getPublic​(@QueryParam("sid")
                                                                                     java.lang.String sid,
                                                                                     @PathParam("type")
                                                                                     java.lang.String type)
        Returns an Object of Type RoomsList which contains a list of Room-Objects. Every Room-Object contains a Roomtype and all informations about that Room. The List of current-users in the room is Null if you get them via SOAP. The Roomtype can be 'conference', 'presentation' or 'interview'.
        Parameters:
        sid - The SID of the User. This SID must be marked as Loggedin
        type - Type of public rooms need to be retrieved
        Returns:
        - list of public rooms
      • getRoomById

        @GET
        @Path("/{id}")
        public org.apache.openmeetings.db.dto.room.RoomDTO getRoomById​(@QueryParam("sid")
                                                                       java.lang.String sid,
                                                                       @PathParam("id")
                                                                       java.lang.Long id)
        returns a conference room object
        Parameters:
        sid - - The SID of the User. This SID must be marked as Loggedin
        id - - the room id
        Returns:
        - room with the id given
      • getExternal

        @GET
        @Path("/{type}/{externaltype}/{externaliId}")
        public org.apache.openmeetings.db.dto.room.RoomDTO getExternal​(@QueryParam("sid")
                                                                       java.lang.String sid,
                                                                       @PathParam("type")
                                                                       java.lang.String type,
                                                                       @PathParam("externaltype")
                                                                       java.lang.String externalType,
                                                                       @PathParam("externalid")
                                                                       java.lang.String externalId,
                                                                       @QueryParam("room")
                                                                       org.apache.openmeetings.db.dto.room.RoomDTO room)
        Checks if a room with this exteralId + externalType does exist, if yes it returns the room id if not, it will create the room and then return the room id of the newly created room
        Parameters:
        sid - The SID of the User. This SID must be marked as Loggedin
        type - type of the room
        externalType - you can specify your system-name or type of room here, for example "moodle"
        externalId - your external room id may set here
        room - details of the room to be created if not found
        Returns:
        - id of the room or error code
      • add

        @POST
        @Path("/")
        public org.apache.openmeetings.db.dto.room.RoomDTO add​(@QueryParam("sid")
                                                               java.lang.String sid,
                                                               @FormParam("room")
                                                               org.apache.openmeetings.db.dto.room.RoomDTO room)
        Adds a new Room like through the Frontend
        Parameters:
        sid - The SID from getSession
        room - room object
        Returns:
        - id of the user added or error code
      • delete

        @DELETE
        @Path("/{id}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult delete​(@QueryParam("sid")
                                                                         java.lang.String sid,
                                                                         @PathParam("id")
                                                                         long id)
        Delete a room by its room id
        Parameters:
        sid - - The SID of the User. This SID must be marked as Loggedin
        id - - The id of the room
        Returns:
        - id of the room deleted
      • close

        @GET
        @Path("/close/{id}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult close​(@QueryParam("sid")
                                                                        java.lang.String sid,
                                                                        @PathParam("id")
                                                                        long id)
        Method to remotely close rooms. If a room is closed all users inside the room and all users that try to enter it will be redirected to the redirectURL that is defined in the Room-Object. Returns positive value if authentication was successful.
        Parameters:
        sid - The SID of the User. This SID must be marked as Loggedin
        id - the room id
        Returns:
        - 1 in case of success, -2 otherwise
      • open

        @GET
        @Path("/open/{id}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult open​(@QueryParam("sid")
                                                                       java.lang.String sid,
                                                                       @PathParam("id")
                                                                       long id)
        Method to remotely open rooms. If a room is closed all users inside the room and all users that try to enter it will be redirected to the redirectURL that is defined in the Room-Object. Returns positive value if authentication was successful.
        Parameters:
        sid - The SID of the User. This SID must be marked as Loggedin
        id - the room id
        Returns:
        - 1 in case of success, -2 otherwise
      • kickAll

        @GET
        @Path("/kick/{id}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult kickAll​(@QueryParam("sid")
                                                                          java.lang.String sid,
                                                                          @PathParam("id")
                                                                          long id)
        kick all uses of a certain room
        Parameters:
        sid - The SID of the User. This SID must be marked as Loggedin _Admin
        id - the room id
        Returns:
        - true if user was kicked, false otherwise
      • kick

        @GET
        @Path("/kick/{id}/{externalType}/{externalId}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult kick​(@QueryParam("sid")
                                                                       java.lang.String sid,
                                                                       @PathParam("id")
                                                                       long id,
                                                                       @PathParam("externalType")
                                                                       java.lang.String externalType,
                                                                       @PathParam("externalId")
                                                                       java.lang.String externalId)
        kick external user from given room
        Parameters:
        sid - The SID of the User. This SID must be marked as Loggedin _Admin
        id - the room id
        externalType - external type of user to kick
        externalId - external id of user to kick
        Returns:
        - true if user was kicked, false otherwise
      • count

        @GET
        @Path("/count/{roomid}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult count​(@QueryParam("sid")
                                                                        java.lang.String sid,
                                                                        @PathParam("roomid")
                                                                        java.lang.Long roomId)
        Returns the count of users currently in the Room with given id
        Parameters:
        sid - The SID from UserService.getSession
        roomId - id of the room to get users
        Returns:
        number of users as int
      • users

        @GET
        @Path("/users/{roomid}")
        public java.util.List<org.apache.openmeetings.db.dto.user.UserDTO> users​(@QueryParam("sid")
                                                                                 java.lang.String sid,
                                                                                 @PathParam("roomid")
                                                                                 java.lang.Long roomId)
        Returns list of users currently in the Room with given id
        Parameters:
        sid - The SID from UserService.getSession
        roomId - id of the room to get users
        Returns:
        List of users in the room
      • hash

        @POST
        @Path("/hash")
        public org.apache.openmeetings.db.dto.basic.ServiceResult hash​(@QueryParam("sid")
                                                                       java.lang.String sid,
                                                                       @QueryParam("invite")
                                                                       org.apache.openmeetings.db.dto.room.InvitationDTO invite,
                                                                       @QueryParam("sendmail")
                                                                       boolean sendmail)
        Method to get invitation hash with given parameters
        Parameters:
        sid - - The SID of the User. This SID must be marked as Loggedin
        invite - - parameters of the invitation
        sendmail - - flag to determine if email should be sent or not
        Returns:
        - serviceResult object with the result
      • cleanWb

        @GET
        @Path("/cleanwb/{id}")
        public org.apache.openmeetings.db.dto.basic.ServiceResult cleanWb​(@QueryParam("sid")
                                                                          java.lang.String sid,
                                                                          @PathParam("id")
                                                                          long id)
        Method to clean room white board (all objects will be purged)
        Parameters:
        sid - - The SID of the User. This SID must be marked as Loggedin
        id - - id of the room to clean
        Returns:
        - serviceResult object with the result