com.atlassian.studio.jira.integration.crowd.directory
Interface DirectoryFacade

All Known Implementing Classes:
DefaultDirectoryFacade

public interface DirectoryFacade


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 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.
 

Method Detail

all

Iterable<com.atlassian.crowd.embedded.api.Directory> all()
Returns:
all directories
See Also:
CrowdDirectoryService.findAllDirectories()

synchronise

boolean synchronise(com.atlassian.crowd.embedded.api.Directory directory,
                    boolean waitForSynchronisation)
Synchronise the given directory.

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)

filter

DirectoryFilter filter()
Returns:
a builder for directory filters

find

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.

Parameters:
filter - filter for the candidate directories
candidates - the directories to be filtered
Returns:
the filtered list of directories

compose

DirectoryBuilder compose()
Returns:
a builder for directories

create

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.

Parameters:
template - a template used for this builder, the id is set to null
Returns:
the builder for the given template
See Also:
compose()

modify

DirectoryMutator modify(com.atlassian.crowd.embedded.api.Directory template)
The same as create(Directory), but it will call CrowdDirectoryService.updateDirectory(Directory) once DirectoryMutator.persist() is called.

Parameters:
template - a template used for this builder, the id has to be set
Returns:
the builder for the given template
See Also:
create(Directory)

apply

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

Parameters:
function - the function to apply, the return value is irrelevant
candidates - the list of directories

transform

<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.

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:
apply(Function, Iterable)


Copyright © 2002-2012 Atlassian. All Rights Reserved.