com.atlassian.crowd.integration.atlassianuser
Class CrowdClientControl

java.lang.Object
  extended by com.atlassian.crowd.integration.atlassianuser.CrowdClientControl

public class CrowdClientControl
extends java.lang.Object

A class that holds an instance of RestCrowdClient and of UserGroupCache, initialised through system properties or a properties file from the classpath.


Field Summary
static java.lang.String CACHE_MINUTES_PROPERTY
           
static long DEFAULT_CACHE_MINUTES
           
 
Method Summary
 void flush()
          Clear the underlying cache of users and groups.
 com.atlassian.crowd.integration.atlassianuser.UserGroupCache getCache()
           
 com.atlassian.crowd.service.client.CrowdClient getClient()
           
 com.atlassian.crowd.service.client.ClientProperties getClientProperties()
           
 CrowdSynchronisationResult getSynchronisationResult()
          Get details of the last attempted snapshot retrieval.
 SnapshotFetchingInfo refreshCache()
          Unconditionally attempt to refresh the cache and propagate any exceptions.
 void refreshCacheIfNecessary()
          Trigger a refresh of the cache unless there is a current valid snapshot.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_MINUTES_PROPERTY

public static final java.lang.String CACHE_MINUTES_PROPERTY
See Also:
Constant Field Values

DEFAULT_CACHE_MINUTES

public static final long DEFAULT_CACHE_MINUTES
Method Detail

getClient

public com.atlassian.crowd.service.client.CrowdClient getClient()

getCache

public com.atlassian.crowd.integration.atlassianuser.UserGroupCache getCache()

getClientProperties

public com.atlassian.crowd.service.client.ClientProperties getClientProperties()
Returns:
the ClientProperties that were used to construct this client

flush

public void flush()
Clear the underlying cache of users and groups. This is for the benefit of host applications that know about changes and want them to be picked up immediately.


refreshCacheIfNecessary

public void refreshCacheIfNecessary()
Trigger a refresh of the cache unless there is a current valid snapshot.


refreshCache

public SnapshotFetchingInfo refreshCache()
                                  throws com.atlassian.crowd.exception.ApplicationPermissionException,
                                         com.atlassian.user.EntityException,
                                         com.atlassian.crowd.exception.CrowdException
Unconditionally attempt to refresh the cache and propagate any exceptions.

Throws:
com.atlassian.crowd.exception.CrowdException
com.atlassian.user.EntityException
com.atlassian.crowd.exception.ApplicationPermissionException

getSynchronisationResult

public CrowdSynchronisationResult getSynchronisationResult()
Get details of the last attempted snapshot retrieval. If no snapshot has been attempted then this will return null.



Copyright © 2011 Atlassian. All Rights Reserved.