|
Openfire 3.5.0.rc1 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 |
IM_URL_PREFIX
|
Constructor Summary | |
---|---|
ClearspaceManager()
Constructs a new ClearspaceManager instance. |
|
ClearspaceManager(Map<String,String> properties)
Constructs a new ClearspaceManager instance. |
Method Summary | |
---|---|
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 |
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 |
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)
|
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 |
getSharedSecret()
Returns the password, configured in Clearspace, that Openfire will use to authenticate with Clearspace to perform it's integration. |
protected long |
getUserID(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. |
boolean |
isEnabled()
Returns true if Clearspace is being used as the backend of Openfire. |
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 |
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. |
Boolean |
testConnection()
Tests the web services connection with Clearspace given the manager's current configuration. |
Methods inherited from class org.jivesoftware.openfire.container.BasicModule |
---|
destroy, getName, initialize, stop |
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
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 Boolean testConnection()
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 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 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 ConnectException, Exception
type
- Must be GET or DELETEurlSuffix
- The url suffix of the rest request
ConnectException
- 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 ConnectException, Exception
ConnectException
Exception
protected long getUserID(String username) throws UserNotFoundException
username
- Username to retrieve ID of.
UserNotFoundException
- If the user was not found.protected long getUserID(JID user) throws UserNotFoundException
user
- JID of user to retrieve ID 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.
|
Openfire 3.5.0.rc1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |