Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community.lifecycle
Class JiveApplication

java.lang.Object
  extended by com.jivesoftware.community.lifecycle.JiveApplication

public class JiveApplication
extends java.lang.Object

This class is the main entry point for the system. Almost all uses of this class will be concerned solely with the getContext(AuthToken) method which is used to get an instance of the JiveContext interface. The AuthToken parameter is used to determine permissions for all retrieved objects. That is, if an admin auth token is used then all objects retrieved will have admin access rights. If a normal user auth token is used, then all objects will have that normal user's access rights.

The first steps of most code would be:

It is also possible to access content with anonymous permissions. See the AuthFactory class for more information.

Fine-grained pluggability of the user and group system is also available. See the UserManager and GroupManager classes for more information.

See Also:
AuthFactory, JiveContext

Nested Class Summary
static class JiveApplication.ManagerHandler
          A class that is used to initialize and retrieve instances of JiveManager.
 
Method Summary
protected static void clearTestContext()
          z For testing purposes only.
static void destroy()
          Destroys the application.
static ApplicationLifeCycle getApplicationLifeCycle()
          Method used internally by Jive to retrieve the ApplicationLifeCycle.
static JiveContext getContext(AuthToken authToken)
          Returns a concrete JiveContext instance.
static JiveApplication.ManagerHandler getManagerHandler()
          -- Jive Internal Use -- Returns a manager handler used for initializing and acquring managers.
static void initialize()
          Initializes the application.
static boolean isInitialized()
          Returns true if the application is initialized, false otherwise.
static void setApplicationLifeCycle(ApplicationLifeCycle lifeCycle)
          Method used internally by Jive to set the ApplicationLifeCycle.
protected static void setTestContext(JiveContext context)
          For testing purposes only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isInitialized

public static boolean isInitialized()
Returns true if the application is initialized, false otherwise.

Returns:
true if the application is initialized, false otherwise.

initialize

public static void initialize()
Initializes the application. Normal users of the API will not need to call this as this is a method called internally. To get an instance of the application, call getContext(AuthToken).


destroy

public static void destroy()
Destroys the application. Normal users of the API will not need to call this as this is a method called internally.


getContext

public static JiveContext getContext(AuthToken authToken)
Returns a concrete JiveContext instance. Permissions to all resources retrieved from the JiveContext are calculated using the AuthToken parameter.

Note, this method will return null if this application has not been initialized. If you're calling this method outside of the normal Jive application then you'll need to call the init method first.

Parameters:
authToken - the auth token used for calculating permissions.
Returns:
a concrete JiveContext instance.

setApplicationLifeCycle

public static void setApplicationLifeCycle(ApplicationLifeCycle lifeCycle)
Method used internally by Jive to set the ApplicationLifeCycle. Users of the application should not call this method.

Parameters:
lifeCycle - an ApplicationLifeCycle instance

getApplicationLifeCycle

public static ApplicationLifeCycle getApplicationLifeCycle()
Method used internally by Jive to retrieve the ApplicationLifeCycle. Users of the application rarely would use this method except to register a life cycle listener.

Returns:
application an ApplicationLifeCycle instance

getManagerHandler

public static JiveApplication.ManagerHandler getManagerHandler()
-- Jive Internal Use -- Returns a manager handler used for initializing and acquring managers.

Returns:
a manager handler used for initializing and acquring managers.

setTestContext

protected static void setTestContext(JiveContext context)
For testing purposes only. Used to override the jivecontext returned.

Make sure to run clearTestContext() after you are done.

Parameters:
context - The test jive context

clearTestContext

protected static void clearTestContext()
z For testing purposes only. Used to reset the jivecontext after using setTestContext.


Clearspace Project Page

Copyright © 1999-2007 Jive Software.