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
d52458f7
Commit
d52458f7
authored
Jan 20, 2016
by
Roman S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REST API Plugin update to version 1.2.2
parent
d8980554
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
6 deletions
+43
-6
changelog.html
src/plugins/restAPI/changelog.html
+6
-0
plugin.xml
src/plugins/restAPI/plugin.xml
+2
-2
SessionController.java
...re/openfire/plugin/rest/controller/SessionController.java
+25
-2
SessionEntity.java
...vesoftware/openfire/plugin/rest/entity/SessionEntity.java
+10
-1
UserUtils.java
...rg/jivesoftware/openfire/plugin/rest/utils/UserUtils.java
+0
-1
No files found.
src/plugins/restAPI/changelog.html
View file @
d52458f7
...
...
@@ -44,6 +44,12 @@
REST API Plugin Changelog
</h1>
<p><b>
1.2.2
</b>
-- January 20th, 2015
</p>
<ul>
<li>
Added: Presence status to the Session Enitity. E.g. Online, Away etc.
</li>
<li>
Fixed: Node parameter in the Session Enitity. E.g. Local or Remote
</li>
</ul>
<p><b>
1.2.1
</b>
-- November 24th, 2015
</p>
<ul>
<li>
Fixed: Cluster issue by creating a new chat room
</li>
...
...
src/plugins/restAPI/plugin.xml
View file @
d52458f7
...
...
@@ -5,8 +5,8 @@
<name>
REST API
</name>
<description>
Allows administration over a RESTful API.
</description>
<author>
Roman Soldatow
</author>
<version>
1.2.
1
</version>
<date>
11/24/2015
</date>
<version>
1.2.
2
</version>
<date>
01/20/2016
</date>
<minServerVersion>
4.0.0
</minServerVersion>
<adminconsole>
<tab
id=
"tab-server"
>
...
...
src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/controller/SessionController.java
View file @
d52458f7
...
...
@@ -13,10 +13,12 @@ import org.jivesoftware.openfire.plugin.rest.entity.SessionEntity;
import
org.jivesoftware.openfire.plugin.rest.exceptions.ExceptionType
;
import
org.jivesoftware.openfire.plugin.rest.exceptions.ServiceException
;
import
org.jivesoftware.openfire.session.ClientSession
;
import
org.jivesoftware.openfire.session.LocalClientSession
;
import
org.jivesoftware.openfire.session.Session
;
import
org.jivesoftware.openfire.user.UserNotFoundException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.xmpp.packet.Presence
;
import
org.xmpp.packet.StreamError
;
/**
...
...
@@ -104,7 +106,12 @@ public class SessionController {
}
session
.
setRessource
(
clientSession
.
getAddress
().
getResource
());
session
.
setNode
(
session
.
getNode
());
if
(
clientSession
instanceof
LocalClientSession
)
{
session
.
setNode
(
"Local"
);
}
else
{
session
.
setNode
(
"Remote"
);
}
String
status
=
""
;
if
(
clientSession
.
getStatus
()
==
Session
.
STATUS_CLOSED
)
{
...
...
@@ -119,9 +126,25 @@ public class SessionController {
session
.
setSessionStatus
(
status
);
if
(
clientSession
.
getPresence
()
!=
null
)
{
session
.
setPresenceStatus
(
clientSession
.
getPresence
().
getStatus
());
session
.
setPresenceMessage
(
clientSession
.
getPresence
().
getStatus
());
Presence
.
Show
show
=
clientSession
.
getPresence
().
getShow
();
if
(
show
==
Presence
.
Show
.
away
)
{
session
.
setPresenceStatus
(
"Away"
);
}
else
if
(
show
==
Presence
.
Show
.
chat
)
{
session
.
setPresenceStatus
(
"Available to Chat"
);
}
else
if
(
show
==
Presence
.
Show
.
dnd
)
{
session
.
setPresenceStatus
(
"Do Not Disturb"
);
}
else
if
(
show
==
Presence
.
Show
.
xa
)
{
session
.
setPresenceStatus
(
"Extended Away"
);
}
else
if
(
show
==
null
)
{
session
.
setPresenceStatus
(
"Online"
);
}
else
{
session
.
setPresenceStatus
(
"Unknown/Not Recognized"
);
}
session
.
setPriority
(
clientSession
.
getPresence
().
getPriority
());
}
try
{
session
.
setHostAddress
(
clientSession
.
getHostAddress
());
session
.
setHostName
(
clientSession
.
getHostName
());
...
...
src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/entity/SessionEntity.java
View file @
d52458f7
...
...
@@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import
javax.xml.bind.annotation.XmlType
;
@XmlRootElement
(
name
=
"session"
)
@XmlType
(
propOrder
=
{
"sessionId"
,
"username"
,
"ressource"
,
"node"
,
"sessionStatus"
,
"presenceStatus"
,
"priority"
,
@XmlType
(
propOrder
=
{
"sessionId"
,
"username"
,
"ressource"
,
"node"
,
"sessionStatus"
,
"presenceStatus"
,
"pr
esenceMessage"
,
"pr
iority"
,
"hostAddress"
,
"hostName"
,
"creationDate"
,
"lastActionDate"
,
"secure"
})
public
class
SessionEntity
{
...
...
@@ -17,6 +17,7 @@ public class SessionEntity {
private
String
node
;
private
String
sessionStatus
;
private
String
presenceStatus
;
private
String
presenceMessage
;
private
int
priority
;
private
String
hostAddress
;
private
String
hostName
;
...
...
@@ -83,6 +84,14 @@ public class SessionEntity {
this
.
presenceStatus
=
presenceStatus
;
}
public
String
getPresenceMessage
()
{
return
presenceMessage
;
}
public
void
setPresenceMessage
(
String
presenceMessage
)
{
this
.
presenceMessage
=
presenceMessage
;
}
@XmlElement
public
int
getPriority
()
{
return
priority
;
...
...
src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/utils/UserUtils.java
View file @
d52458f7
...
...
@@ -16,7 +16,6 @@ import org.jivesoftware.openfire.group.GroupJID;
import
org.jivesoftware.openfire.group.GroupNotFoundException
;
import
org.xmpp.packet.JID
;
// TODO: Auto-generated Javadoc
/**
* The Class UserUtils.
*/
...
...
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