|
Openfire 3.9.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.container.BasicModule org.jivesoftware.openfire.clearspace.ClearspaceManager
public class ClearspaceManager
Centralized administration of Clearspace connections. The getInstance()
method
should be used to get an instance. The following properties configure this manager:
Nested Class Summary | |
---|---|
static class |
ClearspaceManager.HttpType
Different kind of HTTP request types |
Field Summary | |
---|---|
protected static String |
CHAT_URL_PREFIX
|
static String |
CLEARSPACE_COMPONENT
|
protected static String |
IM_URL_PREFIX
|
static String |
MUC_SUBDOMAIN
|
Constructor Summary | |
---|---|
ClearspaceManager()
Constructs a new ClearspaceManager instance. |
|
ClearspaceManager(Map<String,String> properties)
Constructs a new ClearspaceManager instance. |
Method Summary | |
---|---|
void |
certificateCreated(KeyStore keyStore,
String alias,
X509Certificate cert)
Event triggered when a new certificate is created. |
void |
certificateDeleted(KeyStore keyStore,
String alias)
Event triggered when a certificate is being deleted from the keystore. |
void |
certificateSigned(KeyStore keyStore,
String alias,
List<X509Certificate> certificates)
Event triggered when a certificate has been signed by a Certificate Authority. |
Boolean |
checkAuthentication(String username,
String password)
Check a username/password pair for valid authentication. |
void |
componentAllowed(String subdomain,
ExternalComponentConfiguration configuration)
Notification indicating that a new component was allowed to connect using a given configuration. |
void |
componentBlocked(String subdomain)
Notification indicating that a component was blocked to connect to the server. |
void |
componentConfigurationDeleted(String subdomain)
Notification indicating that the configuration of a component, that was either blocked or allowed to connect, is being deleted. |
void |
componentInfoReceived(org.xmpp.packet.IQ iq)
The server has received a disco#info response from the component. |
void |
componentRegistered(org.xmpp.packet.JID componentJID)
A component was registered with the Component Manager. |
void |
componentSecretUpdated(String subdomain,
String newSecret)
Notification indicating that the configuration of a component, that was either blocked or allowed to connect, is being deleted. |
void |
componentUnregistered(org.xmpp.packet.JID componentJID)
A component was removed. |
boolean |
configClearspace()
|
void |
defaultSecretChanged(String newSecret)
Notification indicating that the default secret is being modified. |
org.dom4j.Element |
executeRequest(ClearspaceManager.HttpType type,
String urlSuffix)
Makes a rest request of either type GET or DELETE at the specified urlSuffix. |
org.dom4j.Element |
executeRequest(ClearspaceManager.HttpType type,
String urlSuffix,
String xmlParams)
Makes a rest request of any type at the specified urlSuffix. |
String |
generateNonce()
Generates a new nonce. |
String |
getConnectionURI()
Returns the Clearspace service URI; e.g. |
protected long |
getGroupID(String groupname)
Returns the Clearspace group id of the group. |
static ClearspaceManager |
getInstance()
Provides singleton access to an instance of the ClearspaceManager class. |
String |
getNonce()
Returns a nonce generated by Clearspace to be used in a SSO login. |
Map<String,String> |
getProperties()
|
String |
getSharedSecret()
Returns the password, configured in Clearspace, that Openfire will use to authenticate with Clearspace to perform it's integration. |
protected long |
getUserID(org.xmpp.packet.JID user)
Returns the Clearspace user id the user by JID. |
protected long |
getUserID(String username)
Returns the Clearspace user id the user by username. |
protected String |
getUsernameByID(Long id)
Returns the Clearspace username of the user by id. |
boolean |
isClearspaceConfigured()
Returns true if Clerspace was configured at least one time since Openfire startup. |
Boolean |
isClearspaceConnected()
Returns true if Clearspce is connected to Openfire. |
static boolean |
isEnabled()
Returns true if Clearspace is being used as the backend of Openfire. |
boolean |
isFromClearspace(org.xmpp.packet.JID address)
Returns true if a given JID belongs to a known Clearspace component domain. |
Boolean |
isOpenfireConnected()
Returns true if Openfire is connected to Clearspace. |
boolean |
isValidNonce(String nonce)
Returns true if the nonce was generated usig generateNonce
and if this is the first check for that nonce. |
void |
permissionPolicyChanged(ExternalComponentManager.PermissionPolicy newPolicy)
Notification indicating that the permission policy is being modified. |
void |
portChanged(int newPort)
Notification indicating that the port used by external components is being modified. |
void |
propertyDeleted(String property,
Map params)
A property was deleted. |
void |
propertySet(String property,
Map params)
A property was set. |
org.xmpp.packet.IQ |
query(org.xmpp.packet.IQ packet,
int timeout)
Sends an IQ packet to the Clearspace external component and returns the IQ packet returned by CS or null if no answer was received before the specified timeout. |
void |
serviceEnabled(boolean enabled)
Notification indicating whether the service is being enabled or disabled. |
void |
setConnectionURI(String uri)
Sets the URI of the Clearspace service; e.g., https://localhost:80/clearspace. |
void |
setSharedSecret(String sharedSecret)
Sets the shared secret for the Clearspace service we're connecting to. |
void |
start()
Starts the basic module. |
void |
stop()
Stops the basic module. |
Throwable |
testConnection()
Tests the web services connection with Clearspace given the manager's current configuration. |
void |
xmlPropertyDeleted(String property,
Map params)
An XML property was deleted. |
void |
xmlPropertySet(String property,
Map params)
An XML property was set. |
Methods inherited from class org.jivesoftware.openfire.container.BasicModule |
---|
destroy, getName, initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String IM_URL_PREFIX
protected static final String CHAT_URL_PREFIX
public static final String MUC_SUBDOMAIN
public static final String CLEARSPACE_COMPONENT
Constructor Detail |
---|
public ClearspaceManager(Map<String,String> properties)
getInstance()
should be
called instead of this method. ClearspaceManager instances should only be created directly
for testing purposes.
properties
- the Map that contains properties used by the Clearspace manager, such as
Clearspace host and shared secret.public ClearspaceManager()
getInstance()
should be
called instead of this method. ClearspaceManager instances should only be created directly
for testing purposes.
Method Detail |
---|
public static ClearspaceManager getInstance()
public Boolean checkAuthentication(String username, String password)
username
- Username to authenticate against.password
- Password to use for authentication.
public Throwable testConnection()
public Boolean isOpenfireConnected()
public Boolean isClearspaceConnected()
public Map<String,String> getProperties()
public String getConnectionURI()
public void setConnectionURI(String uri)
uri
- the Clearspace service URI.public String getSharedSecret()
public void setSharedSecret(String sharedSecret)
sharedSecret
- the password configured in Clearspace to authenticate Openfire.public static boolean isEnabled()
public void start() throws IllegalStateException
BasicModule
Starts the basic module.
Inheriting classes that choose to override this method MUST call this start() method before accessing BasicModule resources.
start
in interface Module
start
in class BasicModule
IllegalStateException
- If start is called before initialize
successfully returnspublic void stop()
BasicModule
Stops the basic module.
Inheriting classes that choose to override this method MUST call this stop() method before accessing BasicModule resources.
stop
in interface Module
stop
in class BasicModule
public boolean configClearspace()
public boolean isClearspaceConfigured()
public void serviceEnabled(boolean enabled) throws ModificationNotAllowedException
ExternalComponentManagerListener
serviceEnabled
in interface ExternalComponentManagerListener
enabled
- true if the service is being enabled.
ModificationNotAllowedException
- if the operation was denied.public void portChanged(int newPort) throws ModificationNotAllowedException
ExternalComponentManagerListener
portChanged
in interface ExternalComponentManagerListener
newPort
- new default secret being set.
ModificationNotAllowedException
- if the operation was denied.public void defaultSecretChanged(String newSecret) throws ModificationNotAllowedException
ExternalComponentManagerListener
defaultSecretChanged
in interface ExternalComponentManagerListener
newSecret
- new default secret being set.
ModificationNotAllowedException
- if the operation was denied.public void permissionPolicyChanged(ExternalComponentManager.PermissionPolicy newPolicy) throws ModificationNotAllowedException
ExternalComponentManagerListener
ExternalComponentManager.PermissionPolicy
for more information. The
listener may throw an exception to not allow the change from taking place.
permissionPolicyChanged
in interface ExternalComponentManagerListener
newPolicy
- new permission policy being set.
ModificationNotAllowedException
- if the operation was denied.public void componentAllowed(String subdomain, ExternalComponentConfiguration configuration) throws ModificationNotAllowedException
ExternalComponentManagerListener
componentAllowed
in interface ExternalComponentManagerListener
subdomain
- subdomain of the added component.configuration
- configuration for the external component.
ModificationNotAllowedException
- if the operation was denied.public void componentBlocked(String subdomain) throws ModificationNotAllowedException
ExternalComponentManagerListener
componentBlocked
in interface ExternalComponentManagerListener
subdomain
- subdomain of the blocked component.
ModificationNotAllowedException
- if the operation was denied.public void componentSecretUpdated(String subdomain, String newSecret) throws ModificationNotAllowedException
ExternalComponentManagerListener
componentSecretUpdated
in interface ExternalComponentManagerListener
subdomain
- subdomain of the component.newSecret
- new secret being set for the component.
ModificationNotAllowedException
- if the operation was denied.public void componentConfigurationDeleted(String subdomain) throws ModificationNotAllowedException
ExternalComponentManagerListener
componentConfigurationDeleted
in interface ExternalComponentManagerListener
subdomain
- subdomain of the component.
ModificationNotAllowedException
- if the operation was denied.public org.dom4j.Element executeRequest(ClearspaceManager.HttpType type, String urlSuffix) throws ConnectionException, Exception
Exception
with the message of the CS exception.
type
- Must be GET or DELETEurlSuffix
- The url suffix of the rest request
ConnectionException
- Thrown if there are issues perfoming the request.
Exception
- Thrown if the response from Clearspace contains an exception.public org.dom4j.Element executeRequest(ClearspaceManager.HttpType type, String urlSuffix, String xmlParams) throws ConnectionException, Exception
type
- Must be GET or DELETEurlSuffix
- The url suffix of the rest requestxmlParams
- The xml with the request params, must be null if type is GET or DELETE only
ConnectionException
- Thrown if there are issues perfoming the request.
Exception
- Thrown if the response from Clearspace contains an exception.protected long getUserID(String username) throws UserNotFoundException
username
- Username to retrieve ID of.
UserNotFoundException
- If the user was not found.protected long getUserID(org.xmpp.packet.JID user) throws UserNotFoundException
user
- JID of user to retrieve ID of.
UserNotFoundException
- If the user was not found.protected String getUsernameByID(Long id) throws UserNotFoundException
id
- ID to retrieve Username of.
UserNotFoundException
- If the user was not found.protected long getGroupID(String groupname) throws GroupNotFoundException
groupname
- Name of the group to retrieve ID of.
GroupNotFoundException
- If the group was not found.public boolean isFromClearspace(org.xmpp.packet.JID address)
address
- Address to check.
public org.xmpp.packet.IQ query(org.xmpp.packet.IQ packet, int timeout)
packet
- IQ packet to send.timeout
- milliseconds to wait before timing out.
public void componentRegistered(org.xmpp.packet.JID componentJID)
ComponentEventListener
componentRegistered
in interface ComponentEventListener
componentJID
- address where the component can be located (e.g. search.myserver.com)public void componentUnregistered(org.xmpp.packet.JID componentJID)
ComponentEventListener
componentUnregistered
in interface ComponentEventListener
componentJID
- address where the component was located (e.g. search.myserver.com)public void componentInfoReceived(org.xmpp.packet.IQ iq)
ComponentEventListener
componentInfoReceived
in interface ComponentEventListener
iq
- the IQ packet with the disco#info sent by the component.public String getNonce()
public String generateNonce()
isValidNonce
method will return
true when using nonces generated by this method.
public boolean isValidNonce(String nonce)
generateNonce
and if this is the first check for that nonce.
nonce
- the nonce to be checked
public void propertySet(String property, Map params)
PropertyEventListener
propertySet
in interface PropertyEventListener
property
- the name of the property.params
- event parameters.public void propertyDeleted(String property, Map params)
PropertyEventListener
propertyDeleted
in interface PropertyEventListener
property
- the name of the property deleted.params
- event parameters.public void xmlPropertySet(String property, Map params)
PropertyEventListener
xmlPropertySet
in interface PropertyEventListener
property
- the name of the property.params
- event parameters.public void xmlPropertyDeleted(String property, Map params)
PropertyEventListener
xmlPropertyDeleted
in interface PropertyEventListener
property
- the name of the property.params
- event parameters.public void certificateCreated(KeyStore keyStore, String alias, X509Certificate cert)
CertificateEventListener
certificateCreated
in interface CertificateEventListener
keyStore
- key store where the certificate has been added.alias
- the alias of the certificate in the keystore.cert
- the new certificate created.public void certificateDeleted(KeyStore keyStore, String alias)
CertificateEventListener
certificateDeleted
in interface CertificateEventListener
keyStore
- key store where the certificate is being deleted.alias
- the alias of the certificate in the keystore.public void certificateSigned(KeyStore keyStore, String alias, List<X509Certificate> certificates)
CertificateEventListener
certificateSigned
in interface CertificateEventListener
keyStore
- key store where the certificate is stored.alias
- the alias of the certificate in the keystore.certificates
- chain of certificates. First certificate in the list is the certificate
being signed and last certificate in the list is the root certificate.
|
Openfire 3.9.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |