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
df47742b
Commit
df47742b
authored
Jan 20, 2016
by
daryl herzmann
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #519 from Redor/master
REST API Plugin update to version 1.2.2
parents
d8980554
d52458f7
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 @
df47742b
...
@@ -44,6 +44,12 @@
...
@@ -44,6 +44,12 @@
REST API Plugin Changelog
REST API Plugin Changelog
</h1>
</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>
<p><b>
1.2.1
</b>
-- November 24th, 2015
</p>
<ul>
<ul>
<li>
Fixed: Cluster issue by creating a new chat room
</li>
<li>
Fixed: Cluster issue by creating a new chat room
</li>
...
...
src/plugins/restAPI/plugin.xml
View file @
df47742b
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
<name>
REST API
</name>
<name>
REST API
</name>
<description>
Allows administration over a RESTful API.
</description>
<description>
Allows administration over a RESTful API.
</description>
<author>
Roman Soldatow
</author>
<author>
Roman Soldatow
</author>
<version>
1.2.
1
</version>
<version>
1.2.
2
</version>
<date>
11/24/2015
</date>
<date>
01/20/2016
</date>
<minServerVersion>
4.0.0
</minServerVersion>
<minServerVersion>
4.0.0
</minServerVersion>
<adminconsole>
<adminconsole>
<tab
id=
"tab-server"
>
<tab
id=
"tab-server"
>
...
...
src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/controller/SessionController.java
View file @
df47742b
...
@@ -13,10 +13,12 @@ import org.jivesoftware.openfire.plugin.rest.entity.SessionEntity;
...
@@ -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.ExceptionType
;
import
org.jivesoftware.openfire.plugin.rest.exceptions.ServiceException
;
import
org.jivesoftware.openfire.plugin.rest.exceptions.ServiceException
;
import
org.jivesoftware.openfire.session.ClientSession
;
import
org.jivesoftware.openfire.session.ClientSession
;
import
org.jivesoftware.openfire.session.LocalClientSession
;
import
org.jivesoftware.openfire.session.Session
;
import
org.jivesoftware.openfire.session.Session
;
import
org.jivesoftware.openfire.user.UserNotFoundException
;
import
org.jivesoftware.openfire.user.UserNotFoundException
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.xmpp.packet.Presence
;
import
org.xmpp.packet.StreamError
;
import
org.xmpp.packet.StreamError
;
/**
/**
...
@@ -104,7 +106,12 @@ public class SessionController {
...
@@ -104,7 +106,12 @@ public class SessionController {
}
}
session
.
setRessource
(
clientSession
.
getAddress
().
getResource
());
session
.
setRessource
(
clientSession
.
getAddress
().
getResource
());
session
.
setNode
(
session
.
getNode
());
if
(
clientSession
instanceof
LocalClientSession
)
{
session
.
setNode
(
"Local"
);
}
else
{
session
.
setNode
(
"Remote"
);
}
String
status
=
""
;
String
status
=
""
;
if
(
clientSession
.
getStatus
()
==
Session
.
STATUS_CLOSED
)
{
if
(
clientSession
.
getStatus
()
==
Session
.
STATUS_CLOSED
)
{
...
@@ -119,9 +126,25 @@ public class SessionController {
...
@@ -119,9 +126,25 @@ public class SessionController {
session
.
setSessionStatus
(
status
);
session
.
setSessionStatus
(
status
);
if
(
clientSession
.
getPresence
()
!=
null
)
{
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
());
session
.
setPriority
(
clientSession
.
getPresence
().
getPriority
());
}
}
try
{
try
{
session
.
setHostAddress
(
clientSession
.
getHostAddress
());
session
.
setHostAddress
(
clientSession
.
getHostAddress
());
session
.
setHostName
(
clientSession
.
getHostName
());
session
.
setHostName
(
clientSession
.
getHostName
());
...
...
src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/entity/SessionEntity.java
View file @
df47742b
...
@@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
...
@@ -7,7 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
import
javax.xml.bind.annotation.XmlType
;
import
javax.xml.bind.annotation.XmlType
;
@XmlRootElement
(
name
=
"session"
)
@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"
})
"hostAddress"
,
"hostName"
,
"creationDate"
,
"lastActionDate"
,
"secure"
})
public
class
SessionEntity
{
public
class
SessionEntity
{
...
@@ -17,6 +17,7 @@ public class SessionEntity {
...
@@ -17,6 +17,7 @@ public class SessionEntity {
private
String
node
;
private
String
node
;
private
String
sessionStatus
;
private
String
sessionStatus
;
private
String
presenceStatus
;
private
String
presenceStatus
;
private
String
presenceMessage
;
private
int
priority
;
private
int
priority
;
private
String
hostAddress
;
private
String
hostAddress
;
private
String
hostName
;
private
String
hostName
;
...
@@ -83,6 +84,14 @@ public class SessionEntity {
...
@@ -83,6 +84,14 @@ public class SessionEntity {
this
.
presenceStatus
=
presenceStatus
;
this
.
presenceStatus
=
presenceStatus
;
}
}
public
String
getPresenceMessage
()
{
return
presenceMessage
;
}
public
void
setPresenceMessage
(
String
presenceMessage
)
{
this
.
presenceMessage
=
presenceMessage
;
}
@XmlElement
@XmlElement
public
int
getPriority
()
{
public
int
getPriority
()
{
return
priority
;
return
priority
;
...
...
src/plugins/restAPI/src/java/org/jivesoftware/openfire/plugin/rest/utils/UserUtils.java
View file @
df47742b
...
@@ -16,7 +16,6 @@ import org.jivesoftware.openfire.group.GroupJID;
...
@@ -16,7 +16,6 @@ import org.jivesoftware.openfire.group.GroupJID;
import
org.jivesoftware.openfire.group.GroupNotFoundException
;
import
org.jivesoftware.openfire.group.GroupNotFoundException
;
import
org.xmpp.packet.JID
;
import
org.xmpp.packet.JID
;
// TODO: Auto-generated Javadoc
/**
/**
* The Class UserUtils.
* 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