|
Clearspace API (1.7.0) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.xmpp.IMManager
public class IMManager
Manages connection to the Openfire RTC server. Clearspace connects to Openfire as an external component, which allows it to monitor presence information, run commands, link authentication and user accounts, etc.
In order to connect to Openfire, Clearspace must be configured with the external component address, port, and secret key. A multi-cast DNS service assists Clearspace in discovering all Openfire servers on the local network.
The external component connection is made using the open XMPP protocol. However, Clearspace relies on Ad-Hoc Commands that are specifically implemented in Openfire.
| Nested Class Summary | |
|---|---|
static class |
IMManager.LocalRestartTask
|
| Constructor Summary | |
|---|---|
IMManager()
|
|
| Method Summary | |
|---|---|
void |
addXMPPListener(XMPPListener listener)
Adds an XMPP listener, which listens for connects and disconnects as well as presence updates. |
void |
clusteringStarted()
|
void |
clusteringStopped()
|
void |
destroy()
Notifies the manager to release any resources that may be holding on too. |
com.jivesoftware.community.xmpp.ClearspaceComponent |
getClearspaceComponent()
|
javax.jmdns.ServiceInfo |
getDiscoveredComponentInfo(java.lang.String name)
Returns the external component information for a service name discovered through multi-cast DNS. |
java.util.Collection<javax.jmdns.ServiceInfo> |
getDiscoveredXMPPHosts()
Returns a collection of the Openfire servers that have been discovered through multi-cast DNS. |
java.lang.String |
getHttpBindSecureUrl()
If the HTTP binding service is enabled on the RTC server, see isHttpBindEnabled(),
this method will return the secure URL on which it can be reached. |
java.lang.String |
getHttpBindUnsecureUrl()
If the HTTP binding service is enabled on the RTC server, see isHttpBindEnabled(),
this method will return the unsecure URL on which it can be reached. |
java.lang.String |
getHttpBindUrl()
If the HTTP binding service is enabled on the RTC server, see isHttpBindEnabled(),
this method will return the URL on which it can be reached. |
java.lang.String |
getJavaScriptUrl()
|
org.xmpp.packet.JID |
getJIDForUser(User user)
|
org.xmpp.packet.Presence |
getPresence(org.xmpp.packet.JID xmppAddress)
Returns the presence info for a particular XMPP address, or null if is unavailable (offline) or if no presence information is available. |
org.xmpp.packet.Presence |
getPresence(User user)
Returns the presence info for a User, or null if
is unavailable (offline) or if no presence information is available. |
org.xmpp.packet.Presence |
getPresenceForResource(org.xmpp.packet.JID xmppAddress)
Returns the presence info for a particular XMPP address resource, or null if the resource is unavailable (offline) or if no presence information is available. |
java.util.Collection<org.xmpp.packet.Presence> |
getPresences(org.xmpp.packet.JID xmppAddress)
Returns a collection Presence information for all the user's current resources or null if the user is unavailable (offline) or if no presence information is available. |
com.jivesoftware.community.xmpp.ServerInformation |
getServerInformation()
Returns information about the XMPP server as well as some basic statistics. |
java.lang.String |
getServerVersion()
Returns information about the XMPP server version. |
com.jivesoftware.community.xmpp.UserCommandManager |
getUserCommandManager()
|
User |
getUserForJID(org.xmpp.packet.JID jid)
|
void |
initialize(JiveContext jiveContext)
Initialize the manager. |
boolean |
isConnected()
Returns true if Clearspace is connected as an external component to a Openfire server. |
boolean |
isEnabled()
Returns true if Clearspace is setup as an external component to a Openfire server. |
boolean |
isHttpBindEnabled()
Returns true if the HTTP binding service on the RTC server is currently enabled and false if it is not. |
void |
localReset()
|
void |
removeXMPPListener(XMPPListener listener)
Removes an XMPP listener. |
void |
reset()
Restarts the external component connection to Openfire. |
void |
sendPacket(org.xmpp.packet.Packet packet)
Sends an XMPP packet to the Openfire server. |
protected void |
setHttpBindEnabled(boolean enabled)
|
protected void |
setHttpBindSecureUrl(java.lang.String url)
|
protected void |
setHttpBindUnsecureUrl(java.lang.String url)
|
void |
setJIDNodeForUser(User user,
java.lang.String node)
|
protected void |
setRelativeJavascriptUrl(java.lang.String javaScriptUrl)
|
boolean |
testComponent(java.lang.String host,
int port,
java.lang.String secret)
Tests an external component connection to the Openfire server. |
void |
userCreated(UserEvent event)
Fired when a user is created. |
void |
userDeleted(UserEvent event)
Fired when a user is deleted. |
void |
userLoggedIn(UserEvent event)
This method is called whenever a user logs in. |
void |
userModified(UserEvent event)
Fired when a user is modified. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IMManager()
| Method Detail |
|---|
public void initialize(JiveContext jiveContext)
JiveManager
initialize in interface JiveManagerjiveContext - the context to use during initializationpublic void destroy()
JiveManager
destroy in interface JiveManager
public boolean testComponent(java.lang.String host,
int port,
java.lang.String secret)
host - the external component host.port - the external component portsecret - the shared secret for the component connection.
public void reset()
throws org.xmpp.component.ComponentException
IMSettingsUtils
class to configure external component settings.
org.xmpp.component.ComponentException - if the external component connection failed.
public void localReset()
throws org.xmpp.component.ComponentException
org.xmpp.component.ComponentExceptionpublic void sendPacket(org.xmpp.packet.Packet packet)
isConnected() method before trying to send a packet.
packet - the packet to send.
java.lang.IllegalStateException - if not connected to the server.public boolean isEnabled()
public boolean isConnected()
public void setJIDNodeForUser(User user,
java.lang.String node)
public User getUserForJID(org.xmpp.packet.JID jid)
public org.xmpp.packet.JID getJIDForUser(User user)
public java.util.Collection<javax.jmdns.ServiceInfo> getDiscoveredXMPPHosts()
getDiscoveredComponentInfo(String) with ServiceInfo.getName()
as an argument.
public javax.jmdns.ServiceInfo getDiscoveredComponentInfo(java.lang.String name)
name - the name of the service.
public void addXMPPListener(XMPPListener listener)
listener - the XMPP listener.public void removeXMPPListener(XMPPListener listener)
listener - an XMPP listener.public org.xmpp.packet.Presence getPresence(org.xmpp.packet.JID xmppAddress)
If the XMPP user has several presences (one for each resource), then the presence with the highest priority is returned. If several presence values have the same priority, the presence that is "most available" is returned.
xmppAddress - an XMPP address. If the address contains a resource, it will
be ignored. To retrieve a presence information for a particular resource,
see getPresenceForResource(org.xmpp.packet.JID).
public org.xmpp.packet.Presence getPresence(User user)
User, or null if
is unavailable (offline) or if no presence information is available.
getPresence(org.xmpp.packet.JID)
user - the user to test for presence.
public org.xmpp.packet.Presence getPresenceForResource(org.xmpp.packet.JID xmppAddress)
xmppAddress - a fully qualified XMPP ID, including a resource.
public java.util.Collection<org.xmpp.packet.Presence> getPresences(org.xmpp.packet.JID xmppAddress)
xmppAddress - an XMPP address (JID). It should be the bare address,
e.g. jdoe@example.com, instead of jdoe@example.com/Work.
public com.jivesoftware.community.xmpp.ClearspaceComponent getClearspaceComponent()
public com.jivesoftware.community.xmpp.UserCommandManager getUserCommandManager()
public com.jivesoftware.community.xmpp.ServerInformation getServerInformation()
public java.lang.String getServerVersion()
getServerInformation(), however, that method could return null for
older versions of the server. This method exists as a standards way to always get the version
of the server.
protected void setHttpBindEnabled(boolean enabled)
public boolean isHttpBindEnabled()
protected void setHttpBindUnsecureUrl(java.lang.String url)
public java.lang.String getHttpBindUnsecureUrl()
isHttpBindEnabled(),
this method will return the unsecure URL on which it can be reached. If the service is not
enabled, this method will return null.
protected void setHttpBindSecureUrl(java.lang.String url)
public java.lang.String getHttpBindSecureUrl()
isHttpBindEnabled(),
this method will return the secure URL on which it can be reached. If the service is not
enabled, this method will return null.
public java.lang.String getHttpBindUrl()
isHttpBindEnabled(),
this method will return the URL on which it can be reached. If the service is not
enabled, this method will return null.
protected void setRelativeJavascriptUrl(java.lang.String javaScriptUrl)
public java.lang.String getJavaScriptUrl()
public void userCreated(UserEvent event)
UserListener
userCreated in interface UserListenerevent - the UserEventpublic void userDeleted(UserEvent event)
UserListener
userDeleted in interface UserListenerevent - the UserEventpublic void userModified(UserEvent event)
UserListener
userModified in interface UserListenerevent - the UserEventpublic void userLoggedIn(UserEvent event)
UserListener
userLoggedIn in interface UserListenerevent - method is called whenever a user logs in.public void clusteringStarted()
clusteringStarted in interface com.jivesoftware.community.cache.CacheFactory.ClusteringListenerpublic void clusteringStopped()
clusteringStopped in interface com.jivesoftware.community.cache.CacheFactory.ClusteringListener
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||