Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
384005c4
Commit
384005c4
authored
Jul 11, 2014
by
Dele Olajide
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #53 from Redor/master
MUC Service Plugin 0.2.0
parents
e0562d9f
a98343cc
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1871 additions
and
13609 deletions
+1871
-13609
changelog.html
src/plugins/mucservice/changelog.html
+6
-0
logo_small.gif
src/plugins/mucservice/logo_small.gif
+0
-0
plugin.xml
src/plugins/mucservice/plugin.xml
+2
-2
readme.html
src/plugins/mucservice/readme.html
+1510
-13561
MUCRoomEntity.java
.../java/org/jivesoftware/openfire/entity/MUCRoomEntity.java
+55
-6
ParticipantEntities.java
...org/jivesoftware/openfire/entity/ParticipantEntities.java
+27
-0
ParticipantEntity.java
...a/org/jivesoftware/openfire/entity/ParticipantEntity.java
+43
-0
MUCRoomController.java
...a/org/jivesoftware/openfire/plugin/MUCRoomController.java
+160
-28
MUCRoomService.java
...ava/org/jivesoftware/openfire/service/MUCRoomService.java
+16
-12
MUCRoomUtils.java
...rc/java/org/jivesoftware/openfire/utils/MUCRoomUtils.java
+52
-0
No files found.
src/plugins/mucservice/changelog.html
View file @
384005c4
...
...
@@ -44,6 +44,12 @@
MUC Service Plugin Changelog
</h1>
<p><b>
0.2.0
</b>
-- 07.07.2014
</p>
<ul>
<li>
Extended the service with /participants endpoint to get all room participants
</li>
<li>
Extended the muc service to manage chat room roles (owners, admins, members, outcasts)
</li>
</ul>
<p><b>
0.1.0
</b>
-- 23.06.2014
</p>
<ul>
<li>
Initial setup of MUC Service Plugin
</li>
...
...
src/plugins/mucservice/logo_small.gif
0 → 100644
View file @
384005c4
983 Bytes
src/plugins/mucservice/plugin.xml
View file @
384005c4
...
...
@@ -5,7 +5,7 @@
<name>
MUC Service
</name>
<description>
MUC administration over REST Interface
</description>
<author>
Roman Soldatow
</author>
<version>
0.
1
.0
</version>
<date>
23.06
.2014
</date>
<version>
0.
2
.0
</version>
<date>
07.07
.2014
</date>
<minServerVersion>
3.9.1
</minServerVersion>
</plugin>
src/plugins/mucservice/readme.html
View file @
384005c4
This diff is collapsed.
Click to expand it.
src/plugins/mucservice/src/java/org/jivesoftware/openfire/entity/MUCRoomEntity.java
View file @
384005c4
...
...
@@ -35,6 +35,14 @@ public class MUCRoomEntity {
private
List
<
String
>
broadcastPresenceRoles
;
private
List
<
String
>
owners
;
private
List
<
String
>
admins
;
private
List
<
String
>
members
;
private
List
<
String
>
outcasts
;
public
MUCRoomEntity
()
{
}
...
...
@@ -170,12 +178,6 @@ public class MUCRoomEntity {
this
.
canOccupantsInvite
=
canOccupantsInvite
;
}
@XmlElement
(
name
=
"broadcastPresenceRole"
)
@XmlElementWrapper
(
name
=
"broadcastPresenceRoles"
)
public
List
<
String
>
getBroadcastPresenceRoles
()
{
return
broadcastPresenceRoles
;
}
public
void
setBroadcastPresenceRoles
(
List
<
String
>
broadcastPresenceRoles
)
{
this
.
broadcastPresenceRoles
=
broadcastPresenceRoles
;
}
...
...
@@ -224,4 +226,51 @@ public class MUCRoomEntity {
public
void
setModerated
(
boolean
moderated
)
{
this
.
moderated
=
moderated
;
}
@XmlElement
(
name
=
"broadcastPresenceRole"
)
@XmlElementWrapper
(
name
=
"broadcastPresenceRoles"
)
public
List
<
String
>
getBroadcastPresenceRoles
()
{
return
broadcastPresenceRoles
;
}
@XmlElementWrapper
(
name
=
"owners"
)
@XmlElement
(
name
=
"owner"
)
public
List
<
String
>
getOwners
()
{
return
owners
;
}
public
void
setOwners
(
List
<
String
>
owners
)
{
this
.
owners
=
owners
;
}
@XmlElementWrapper
(
name
=
"members"
)
@XmlElement
(
name
=
"member"
)
public
List
<
String
>
getMembers
()
{
return
members
;
}
public
void
setMembers
(
List
<
String
>
members
)
{
this
.
members
=
members
;
}
@XmlElementWrapper
(
name
=
"outcasts"
)
@XmlElement
(
name
=
"outcast"
)
public
List
<
String
>
getOutcasts
()
{
return
outcasts
;
}
public
void
setOutcasts
(
List
<
String
>
outcasts
)
{
this
.
outcasts
=
outcasts
;
}
@XmlElementWrapper
(
name
=
"admins"
)
@XmlElement
(
name
=
"admin"
)
public
List
<
String
>
getAdmins
()
{
return
admins
;
}
public
void
setAdmins
(
List
<
String
>
admins
)
{
this
.
admins
=
admins
;
}
}
\ No newline at end of file
src/plugins/mucservice/src/java/org/jivesoftware/openfire/entity/ParticipantEntities.java
0 → 100644
View file @
384005c4
package
org
.
jivesoftware
.
openfire
.
entity
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
(
name
=
"participants"
)
public
class
ParticipantEntities
{
List
<
ParticipantEntity
>
participants
;
public
ParticipantEntities
()
{
}
public
ParticipantEntities
(
List
<
ParticipantEntity
>
participants
)
{
this
.
participants
=
participants
;
}
@XmlElement
(
name
=
"participant"
)
public
List
<
ParticipantEntity
>
getParticipants
()
{
return
participants
;
}
public
void
setParticipants
(
List
<
ParticipantEntity
>
participants
)
{
this
.
participants
=
participants
;
}
}
src/plugins/mucservice/src/java/org/jivesoftware/openfire/entity/ParticipantEntity.java
0 → 100644
View file @
384005c4
package
org
.
jivesoftware
.
openfire
.
entity
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
(
name
=
"participant"
)
public
class
ParticipantEntity
{
private
String
jid
;
private
String
role
;
private
String
affiliation
;
public
ParticipantEntity
()
{
}
@XmlElement
public
String
getJid
()
{
return
jid
;
}
public
void
setJid
(
String
jid
)
{
this
.
jid
=
jid
;
}
@XmlElement
public
String
getRole
()
{
return
role
;
}
public
void
setRole
(
String
role
)
{
this
.
role
=
role
;
}
@XmlElement
public
String
getAffiliation
()
{
return
affiliation
;
}
public
void
setAffiliation
(
String
affiliation
)
{
this
.
affiliation
=
affiliation
;
}
}
\ No newline at end of file
src/plugins/mucservice/src/java/org/jivesoftware/openfire/plugin/MUCRoomController.java
View file @
384005c4
This diff is collapsed.
Click to expand it.
src/plugins/mucservice/src/java/org/jivesoftware/openfire/service/MUCRoomService.java
View file @
384005c4
...
...
@@ -14,14 +14,14 @@ import javax.ws.rs.core.MediaType;
import
org.jivesoftware.openfire.entity.MUCChannelType
;
import
org.jivesoftware.openfire.entity.MUCRoomEntities
;
import
org.jivesoftware.openfire.entity.MUCRoomEntity
;
import
org.jivesoftware.openfire.entity.ParticipantEntities
;
import
org.jivesoftware.openfire.exception.MUCServiceException
;
import
org.jivesoftware.openfire.plugin.MUCRoomController
;
@Path
(
"mucservice"
)
@Path
(
"mucservice
/chatrooms
"
)
public
class
MUCRoomService
{
@GET
@Path
(
"/chatrooms"
)
@Produces
(
MediaType
.
APPLICATION_XML
)
public
MUCRoomEntities
getMUCRooms
(
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
,
@DefaultValue
(
MUCChannelType
.
PUBLIC
)
@QueryParam
(
"type"
)
String
channelType
,
...
...
@@ -30,7 +30,7 @@ public class MUCRoomService {
}
@GET
@Path
(
"/
chatrooms/
{roomName}"
)
@Path
(
"/{roomName}"
)
@Produces
(
MediaType
.
APPLICATION_XML
)
public
MUCRoomEntity
getMUCRoom
(
@PathParam
(
"roomName"
)
String
roomName
,
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
)
throws
MUCServiceException
{
...
...
@@ -38,27 +38,31 @@ public class MUCRoomService {
}
@DELETE
@Path
(
"/
chatrooms/
{roomName}"
)
@Path
(
"/{roomName}"
)
public
void
deleteMUCRoom
(
@PathParam
(
"roomName"
)
String
roomName
,
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
)
throws
MUCServiceException
{
MUCRoomController
.
getInstance
().
deleteChatRoom
(
roomName
,
serviceName
);
}
@POST
@Path
(
"/chatrooms"
)
public
void
createMUCRoom
(
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
,
@DefaultValue
(
"admin"
)
@QueryParam
(
"owner"
)
String
owner
,
MUCRoomEntity
mucRoomEntity
)
throws
MUCServiceException
{
MUCRoomController
.
getInstance
().
createChatRoom
(
serviceName
,
owner
,
mucRoomEntity
);
MUCRoomEntity
mucRoomEntity
)
throws
MUCServiceException
{
MUCRoomController
.
getInstance
().
createChatRoom
(
serviceName
,
mucRoomEntity
);
}
@PUT
@Path
(
"/
chatrooms/
{roomName}"
)
@Path
(
"/{roomName}"
)
public
void
udpateMUCRoom
(
@PathParam
(
"roomName"
)
String
roomName
,
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
,
@DefaultValue
(
"admin"
)
@QueryParam
(
"owner"
)
String
owner
,
MUCRoomEntity
mucRoomEntity
)
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
,
MUCRoomEntity
mucRoomEntity
)
throws
MUCServiceException
{
MUCRoomController
.
getInstance
().
updateChatRoom
(
roomName
,
serviceName
,
owner
,
mucRoomEntity
);
MUCRoomController
.
getInstance
().
updateChatRoom
(
roomName
,
serviceName
,
mucRoomEntity
);
}
@GET
@Path
(
"/{roomName}/participants"
)
@Produces
(
MediaType
.
APPLICATION_XML
)
public
ParticipantEntities
getMUCRoomParticipants
(
@PathParam
(
"roomName"
)
String
roomName
,
@DefaultValue
(
"conference"
)
@QueryParam
(
"servicename"
)
String
serviceName
)
throws
MUCServiceException
{
return
MUCRoomController
.
getInstance
().
getRoomParticipants
(
roomName
,
serviceName
);
}
}
src/plugins/mucservice/src/java/org/jivesoftware/openfire/utils/MUCRoomUtils.java
0 → 100644
View file @
384005c4
package
org
.
jivesoftware
.
openfire
.
utils
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.List
;
import
org.xmpp.packet.JID
;
/**
* The Class MUCRoomUtils.
*/
public
class
MUCRoomUtils
{
/**
* Instantiates a new MUC room utils.
*/
private
MUCRoomUtils
()
{
throw
new
AssertionError
();
}
/**
* Convert jids to string list.
*
* @param jids
* the jids
* @return the array list< string>
*/
public
static
ArrayList
<
String
>
convertJIDsToStringList
(
Collection
<
JID
>
jids
)
{
ArrayList
<
String
>
result
=
new
ArrayList
<
String
>();
for
(
JID
jid
:
jids
)
{
result
.
add
(
jid
.
toBareJID
());
}
return
result
;
}
/**
* Convert strings to jids.
*
* @param jids
* the jids
* @return the list<jid>
*/
public
static
List
<
JID
>
convertStringsToJIDs
(
List
<
String
>
jids
)
{
List
<
JID
>
result
=
new
ArrayList
<
JID
>();
for
(
String
jidString
:
jids
)
{
result
.
add
(
new
JID
(
jidString
));
}
return
result
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment