com.atlassian.studio.jira.integration.crowd.directory
Class DefaultDirectoryFacade

java.lang.Object
  extended by com.atlassian.studio.jira.integration.crowd.directory.DefaultDirectoryFacade
All Implemented Interfaces:
DirectoryFacade

public class DefaultDirectoryFacade
extends Object
implements DirectoryFacade


Constructor Summary
DefaultDirectoryFacade(com.atlassian.crowd.embedded.api.CrowdDirectoryService directoryService)
           
 
Method Summary
 Iterable<com.atlassian.crowd.embedded.api.Directory> all()
           
 void apply(com.google.common.base.Function<com.atlassian.crowd.embedded.api.Directory,com.atlassian.crowd.embedded.api.Directory> function, Iterable<com.atlassian.crowd.embedded.api.Directory> candidates)
          Applies the given function to the given list of directories
 DirectoryBuilder compose()
           
 DirectoryMutator create(com.atlassian.crowd.embedded.api.Directory template)
          Returns a builder which will call CrowdDirectoryService.addDirectory(Directory) the composed directory once DirectoryMutator.persist() is called.
 DirectoryFilter filter()
           
 Iterable<com.atlassian.crowd.embedded.api.Directory> find(com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.Directory> filter, Iterable<com.atlassian.crowd.embedded.api.Directory> candidates)
          Apply the given filter to the list of candidates.
 DirectoryMutator modify(com.atlassian.crowd.embedded.api.Directory template)
          The same as DirectoryFacade.create(Directory), but it will call CrowdDirectoryService.updateDirectory(Directory) once DirectoryMutator.persist() is called.
 boolean synchronise(com.atlassian.crowd.embedded.api.Directory directory, boolean waitForSynchronisation)
          Synchronise the given directory.
<D extends com.atlassian.crowd.embedded.api.Directory>
Iterable<D>
transform(com.google.common.base.Function<com.atlassian.crowd.embedded.api.Directory,D> transformer, Iterable<com.atlassian.crowd.embedded.api.Directory> candidates)
          Will apply the given transformation function once the client iterates over the returned iterable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDirectoryFacade

public DefaultDirectoryFacade(com.atlassian.crowd.embedded.api.CrowdDirectoryService directoryService)
Method Detail

compose

public DirectoryBuilder compose()
Specified by:
compose in interface DirectoryFacade
Returns:
a builder for directories

create

public DirectoryMutator create(com.atlassian.crowd.embedded.api.Directory template)
Description copied from interface: DirectoryFacade
Returns a builder which will call CrowdDirectoryService.addDirectory(Directory) the composed directory once DirectoryMutator.persist() is called.

Specified by:
create in interface DirectoryFacade
Parameters:
template - a template used for this builder, the id is set to null
Returns:
the builder for the given template
See Also:
DirectoryFacade.compose()

modify

public DirectoryMutator modify(com.atlassian.crowd.embedded.api.Directory template)
Description copied from interface: DirectoryFacade
The same as DirectoryFacade.create(Directory), but it will call CrowdDirectoryService.updateDirectory(Directory) once DirectoryMutator.persist() is called.

Specified by:
modify in interface DirectoryFacade
Parameters:
template - a template used for this builder, the id has to be set
Returns:
the builder for the given template
See Also:
DirectoryFacade.create(Directory)

filter

public DirectoryFilter filter()
Specified by:
filter in interface DirectoryFacade
Returns:
a builder for directory filters

all

public Iterable<com.atlassian.crowd.embedded.api.Directory> all()
Specified by:
all in interface DirectoryFacade
Returns:
all directories
See Also:
CrowdDirectoryService.findAllDirectories()

find

public Iterable<com.atlassian.crowd.embedded.api.Directory> find(com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.Directory> filter,
                                                                 Iterable<com.atlassian.crowd.embedded.api.Directory> candidates)
Description copied from interface: DirectoryFacade
Apply the given filter to the list of candidates.

Specified by:
find in interface DirectoryFacade
Parameters:
filter - filter for the candidate directories
candidates - the directories to be filtered
Returns:
the filtered list of directories

synchronise

public boolean synchronise(com.atlassian.crowd.embedded.api.Directory directory,
                           boolean waitForSynchronisation)
Description copied from interface: DirectoryFacade
Synchronise the given directory.

Specified by:
synchronise in interface DirectoryFacade
Parameters:
directory - the directory to synchronise
waitForSynchronisation - true to execute the synchronisation in the caller's thread, false to return immediately
Returns:
true if the synchronisation was triggered by this call, false if the directory is not active, not synchronisable or the synchronisation is running already or was triggered by another thread
See Also:
CrowdDirectoryService.synchroniseDirectory(long, boolean)

apply

public void apply(com.google.common.base.Function<com.atlassian.crowd.embedded.api.Directory,com.atlassian.crowd.embedded.api.Directory> function,
                  Iterable<com.atlassian.crowd.embedded.api.Directory> candidates)
Description copied from interface: DirectoryFacade
Applies the given function to the given list of directories

Specified by:
apply in interface DirectoryFacade
Parameters:
function - the function to apply, the return value is irrelevant
candidates - the list of directories

transform

public <D extends com.atlassian.crowd.embedded.api.Directory> Iterable<D> transform(com.google.common.base.Function<com.atlassian.crowd.embedded.api.Directory,D> transformer,
                                                                                    Iterable<com.atlassian.crowd.embedded.api.Directory> candidates)
Description copied from interface: DirectoryFacade
Will apply the given transformation function once the client iterates over the returned iterable.

Specified by:
transform in interface DirectoryFacade
Type Parameters:
D - the type of the transformed directory
Parameters:
transformer - the function used to transform, may return null
candidates - the list of directories
Returns:
the iterable of transformed directories, all values retrieved will be null-safe
See Also:
DirectoryFacade.apply(Function, Iterable)


Copyright © 2002-2012 Atlassian. All Rights Reserved.