Search in sources :

Example 11 with SetMultimap

use of com.google.common.collect.SetMultimap in project batfish by batfish.

the class CommonUtil method initRemoteIpsecVpns.

public static void initRemoteIpsecVpns(Map<String, Configuration> configurations) {
    Map<IpsecVpn, Ip> vpnRemoteIps = new IdentityHashMap<>();
    Map<Ip, Set<IpsecVpn>> externalIpVpnMap = new HashMap<>();
    SetMultimap<Ip, IpWildcardSetIpSpace> privateIpsByPublicIp = initPrivateIpsByPublicIp(configurations);
    for (Configuration c : configurations.values()) {
        for (IpsecVpn ipsecVpn : c.getIpsecVpns().values()) {
            Ip remoteIp = ipsecVpn.getIkeGateway().getAddress();
            vpnRemoteIps.put(ipsecVpn, remoteIp);
            Set<InterfaceAddress> externalAddresses = ipsecVpn.getIkeGateway().getExternalInterface().getAllAddresses();
            for (InterfaceAddress address : externalAddresses) {
                Ip ip = address.getIp();
                Set<IpsecVpn> vpnsUsingExternalAddress = externalIpVpnMap.computeIfAbsent(ip, k -> Sets.newIdentityHashSet());
                vpnsUsingExternalAddress.add(ipsecVpn);
            }
        }
    }
    for (Entry<IpsecVpn, Ip> e : vpnRemoteIps.entrySet()) {
        IpsecVpn ipsecVpn = e.getKey();
        Ip remoteIp = e.getValue();
        Ip localIp = ipsecVpn.getIkeGateway().getLocalIp();
        ipsecVpn.initCandidateRemoteVpns();
        Set<IpsecVpn> remoteIpsecVpnCandidates = externalIpVpnMap.get(remoteIp);
        if (remoteIpsecVpnCandidates != null) {
            for (IpsecVpn remoteIpsecVpnCandidate : remoteIpsecVpnCandidates) {
                Ip remoteIpsecVpnLocalAddress = remoteIpsecVpnCandidate.getIkeGateway().getLocalIp();
                if (remoteIpsecVpnLocalAddress != null && !remoteIpsecVpnLocalAddress.equals(remoteIp)) {
                    continue;
                }
                Ip reciprocalRemoteAddress = vpnRemoteIps.get(remoteIpsecVpnCandidate);
                Set<IpsecVpn> reciprocalVpns = externalIpVpnMap.get(reciprocalRemoteAddress);
                if (reciprocalVpns == null) {
                    Set<IpWildcardSetIpSpace> privateIpsBehindReciprocalRemoteAddress = privateIpsByPublicIp.get(reciprocalRemoteAddress);
                    if (privateIpsBehindReciprocalRemoteAddress != null && privateIpsBehindReciprocalRemoteAddress.stream().anyMatch(ipSpace -> ipSpace.containsIp(localIp))) {
                        reciprocalVpns = externalIpVpnMap.get(localIp);
                        ipsecVpn.setRemoteIpsecVpn(remoteIpsecVpnCandidate);
                        ipsecVpn.getCandidateRemoteIpsecVpns().add(remoteIpsecVpnCandidate);
                        remoteIpsecVpnCandidate.initCandidateRemoteVpns();
                        remoteIpsecVpnCandidate.setRemoteIpsecVpn(ipsecVpn);
                        remoteIpsecVpnCandidate.getCandidateRemoteIpsecVpns().add(ipsecVpn);
                    }
                } else if (reciprocalVpns.contains(ipsecVpn)) {
                    ipsecVpn.setRemoteIpsecVpn(remoteIpsecVpnCandidate);
                    ipsecVpn.getCandidateRemoteIpsecVpns().add(remoteIpsecVpnCandidate);
                }
            }
        }
    }
}
Also used : IpsecVpn(org.batfish.datamodel.IpsecVpn) SSLEngineConfigurator(org.glassfish.grizzly.ssl.SSLEngineConfigurator) SSLContext(javax.net.ssl.SSLContext) FileTime(java.nio.file.attribute.FileTime) StringUtils(org.apache.commons.lang3.StringUtils) Configurations(org.apache.commons.configuration2.builder.fluent.Configurations) Interface(org.batfish.datamodel.Interface) DirectoryStream(java.nio.file.DirectoryStream) BfConsts(org.batfish.common.BfConsts) Flow(org.batfish.datamodel.Flow) Topology(org.batfish.datamodel.Topology) Map(java.util.Map) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) Pair(org.batfish.common.Pair) Path(java.nio.file.Path) DataPlane(org.batfish.datamodel.DataPlane) VrrpGroup(org.batfish.datamodel.VrrpGroup) ClientTracingFeature(io.opentracing.contrib.jaxrs2.client.ClientTracingFeature) Set(java.util.Set) FileAttribute(java.nio.file.attribute.FileAttribute) StandardCharsets(java.nio.charset.StandardCharsets) DirectoryIteratorException(java.nio.file.DirectoryIteratorException) IOUtils(org.apache.commons.io.IOUtils) Stream(java.util.stream.Stream) Supplier(java.util.function.Supplier) TreeSet(java.util.TreeSet) JSONAssert(org.skyscreamer.jsonassert.JSONAssert) MustBeClosed(com.google.errorprone.annotations.MustBeClosed) SSLSession(javax.net.ssl.SSLSession) FlowProcessor(org.batfish.common.plugin.FlowProcessor) BiConsumer(java.util.function.BiConsumer) SSLContextConfigurator(org.glassfish.grizzly.ssl.SSLContextConfigurator) ImmutableSortedMap(com.google.common.collect.ImmutableSortedMap) Nullable(javax.annotation.Nullable) Files(java.nio.file.Files) Route(org.batfish.datamodel.Route) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) KeyManager(javax.net.ssl.KeyManager) TreeMap(java.util.TreeMap) Paths(java.nio.file.Paths) X509TrustManager(javax.net.ssl.X509TrustManager) BufferedReader(java.io.BufferedReader) X509Certificate(java.security.cert.X509Certificate) IpsecVpn(org.batfish.datamodel.IpsecVpn) NoSuchFileException(java.nio.file.NoSuchFileException) IpProtocol(org.batfish.datamodel.IpProtocol) SortedSet(java.util.SortedSet) URL(java.net.URL) TrustManager(javax.net.ssl.TrustManager) FlowTrace(org.batfish.datamodel.FlowTrace) InterfaceAddress(org.batfish.datamodel.InterfaceAddress) OspfNeighbor(org.batfish.datamodel.OspfNeighbor) Edge(org.batfish.datamodel.Edge) IpWildcardSetIpSpace(org.batfish.datamodel.IpWildcardSetIpSpace) OspfProcess(org.batfish.datamodel.OspfProcess) URI(java.net.URI) HostnameVerifier(javax.net.ssl.HostnameVerifier) NamedPort(org.batfish.datamodel.NamedPort) Vrf(org.batfish.datamodel.Vrf) OspfArea(org.batfish.datamodel.OspfArea) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) ImmutableSet(com.google.common.collect.ImmutableSet) IdentityHashMap(java.util.IdentityHashMap) PatternSyntaxException(java.util.regex.PatternSyntaxException) TrustManagerFactory(javax.net.ssl.TrustManagerFactory) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) Collection(java.util.Collection) FlowDisposition(org.batfish.datamodel.FlowDisposition) KeyStore(java.security.KeyStore) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) FileNotFoundException(java.io.FileNotFoundException) List(java.util.List) Entry(java.util.Map.Entry) Pattern(java.util.regex.Pattern) BgpNeighbor(org.batfish.datamodel.BgpNeighbor) SortedMap(java.util.SortedMap) IpWildcard(org.batfish.datamodel.IpWildcard) Ip(org.batfish.datamodel.Ip) NodeInterfacePair(org.batfish.datamodel.collections.NodeInterfacePair) Hashing(com.google.common.hash.Hashing) HashMap(java.util.HashMap) BatfishException(org.batfish.common.BatfishException) BgpProcess(org.batfish.datamodel.BgpProcess) Function(java.util.function.Function) HashSet(java.util.HashSet) ClientBuilder(javax.ws.rs.client.ClientBuilder) Configuration(org.batfish.datamodel.Configuration) OutputStreamWriter(java.io.OutputStreamWriter) OutputStream(java.io.OutputStream) IpLink(org.batfish.datamodel.IpLink) Iterator(java.util.Iterator) MalformedURLException(java.net.MalformedURLException) KeyManagerFactory(javax.net.ssl.KeyManagerFactory) GlobalTracer(io.opentracing.util.GlobalTracer) FileInputStream(java.io.FileInputStream) SetMultimap(com.google.common.collect.SetMultimap) Consumer(java.util.function.Consumer) GrizzlyHttpServerFactory(org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) InputStream(java.io.InputStream) Prefix(org.batfish.datamodel.Prefix) Set(java.util.Set) TreeSet(java.util.TreeSet) SortedSet(java.util.SortedSet) ImmutableSet(com.google.common.collect.ImmutableSet) HashSet(java.util.HashSet) Configuration(org.batfish.datamodel.Configuration) IdentityHashMap(java.util.IdentityHashMap) HashMap(java.util.HashMap) InterfaceAddress(org.batfish.datamodel.InterfaceAddress) Ip(org.batfish.datamodel.Ip) IdentityHashMap(java.util.IdentityHashMap) IpWildcardSetIpSpace(org.batfish.datamodel.IpWildcardSetIpSpace)

Example 12 with SetMultimap

use of com.google.common.collect.SetMultimap in project MinecraftForge by MinecraftForge.

the class ASMDataTable method getAnnotationsFor.

public SetMultimap<String, ASMData> getAnnotationsFor(ModContainer container) {
    if (containerAnnotationData == null) {
        ImmutableMap.Builder<ModContainer, SetMultimap<String, ASMData>> mapBuilder = ImmutableMap.builder();
        for (ModContainer cont : containers) {
            Multimap<String, ASMData> values = Multimaps.filterValues(globalAnnotationData, new ModContainerPredicate(cont));
            mapBuilder.put(cont, ImmutableSetMultimap.copyOf(values));
        }
        containerAnnotationData = mapBuilder.build();
    }
    return containerAnnotationData.get(container);
}
Also used : SetMultimap(com.google.common.collect.SetMultimap) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) ASMData(net.minecraftforge.fml.common.discovery.ASMDataTable.ASMData) ModContainer(net.minecraftforge.fml.common.ModContainer) ImmutableMap(com.google.common.collect.ImmutableMap)

Example 13 with SetMultimap

use of com.google.common.collect.SetMultimap in project android by JetBrains.

the class FmHasDependencyMethod method exec.

@Override
public TemplateModel exec(List args) throws TemplateModelException {
    if (args.size() < 1 || args.size() > 2) {
        throw new TemplateModelException("Wrong arguments");
    }
    String artifact = ((TemplateScalarModel) args.get(0)).getAsString();
    if (artifact.isEmpty()) {
        return TemplateBooleanModel.FALSE;
    }
    // Determine the configuration to check, based on the second argument passed to the function. Defaults to "compile".
    String configuration = SdkConstants.GRADLE_COMPILE_CONFIGURATION;
    if (args.size() > 1) {
        configuration = ((TemplateScalarModel) args.get(1)).getAsString();
    }
    if (myParamMap.containsKey(TemplateMetadata.ATTR_DEPENDENCIES_MULTIMAP)) {
        Object untyped = myParamMap.get(TemplateMetadata.ATTR_DEPENDENCIES_MULTIMAP);
        if (untyped instanceof SetMultimap) {
            @SuppressWarnings("unchecked") SetMultimap<String, String> dependencies = (SetMultimap<String, String>) untyped;
            for (String dependency : dependencies.get(configuration)) {
                if (dependency.contains(artifact)) {
                    return TemplateBooleanModel.TRUE;
                }
            }
        }
    }
    // Find the corresponding module, if any
    String modulePath = (String) myParamMap.get(TemplateMetadata.ATTR_PROJECT_OUT);
    if (modulePath != null) {
        Module module = FmUtil.findModule(modulePath);
        if (module != null) {
            AndroidFacet facet = AndroidFacet.getInstance(module);
            if (facet != null) {
                // TODO: b/23032990
                AndroidModuleModel androidModel = AndroidModuleModel.get(facet);
                if (androidModel != null) {
                    boolean dependsOn;
                    switch(configuration) {
                        case SdkConstants.GRADLE_COMPILE_CONFIGURATION:
                            dependsOn = GradleUtil.dependsOn(androidModel, artifact);
                            break;
                        case SdkConstants.GRADLE_ANDROID_TEST_COMPILE_CONFIGURATION:
                            dependsOn = GradleUtil.dependsOnAndroidTest(androidModel, artifact);
                            break;
                        default:
                            throw new TemplateModelException("Unknown dependency configuration " + configuration);
                    }
                    return dependsOn ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
                }
            }
        }
    }
    // created project will return true since it will be by virtue of appcompat also being installed.)
    if (artifact.contains(SdkConstants.APPCOMPAT_LIB_ARTIFACT) || artifact.contains(SdkConstants.SUPPORT_LIB_ARTIFACT)) {
        // No dependencies: Base it off of the minApi and buildApi versions:
        // If building with Lollipop, and targeting anything earlier than Lollipop, use appcompat.
        // (Also use it if minApi is less than ICS.)
        Object buildApiObject = myParamMap.get(TemplateMetadata.ATTR_BUILD_API);
        Object minApiObject = myParamMap.get(TemplateMetadata.ATTR_MIN_API_LEVEL);
        if (buildApiObject instanceof Integer && minApiObject instanceof Integer) {
            int buildApi = (Integer) buildApiObject;
            int minApi = (Integer) minApiObject;
            return minApi >= 8 && ((buildApi >= 21 && minApi < 21) || minApi < 14) ? TemplateBooleanModel.TRUE : TemplateBooleanModel.FALSE;
        }
    }
    return TemplateBooleanModel.FALSE;
}
Also used : AndroidFacet(org.jetbrains.android.facet.AndroidFacet) SetMultimap(com.google.common.collect.SetMultimap) AndroidModuleModel(com.android.tools.idea.gradle.project.model.AndroidModuleModel) Module(com.intellij.openapi.module.Module)

Example 14 with SetMultimap

use of com.google.common.collect.SetMultimap in project android by JetBrains.

the class NewModuleWizardState method updateDependencies.

/**
   * Updates the dependencies stored in the parameters map, to include support libraries required by the extra features selected.
   */
public void updateDependencies() {
    @SuppressWarnings("unchecked") SetMultimap<String, String> dependencies = (SetMultimap<String, String>) get(ATTR_DEPENDENCIES_MULTIMAP);
    if (dependencies == null) {
        dependencies = HashMultimap.create();
    }
    RepositoryUrlManager urlManager = RepositoryUrlManager.get();
    // Support Library
    Object fragmentsExtra = get(ATTR_FRAGMENTS_EXTRA);
    Object navigationDrawerExtra = get(ATTR_NAVIGATION_DRAWER_EXTRA);
    if ((fragmentsExtra != null && Boolean.parseBoolean(fragmentsExtra.toString())) || (navigationDrawerExtra != null && Boolean.parseBoolean(navigationDrawerExtra.toString()))) {
        dependencies.put(SdkConstants.GRADLE_COMPILE_CONFIGURATION, urlManager.getLibraryStringCoordinate(SupportLibrary.SUPPORT_V4, true));
    }
    // AppCompat Library
    Object actionBarExtra = get(ATTR_ACTION_BAR_EXTRA);
    if (actionBarExtra != null && Boolean.parseBoolean(actionBarExtra.toString())) {
        dependencies.put(SdkConstants.GRADLE_COMPILE_CONFIGURATION, urlManager.getLibraryStringCoordinate(SupportLibrary.APP_COMPAT_V7, true));
    }
    // GridLayout Library
    Object gridLayoutExtra = get(ATTR_GRID_LAYOUT_EXTRA);
    if (gridLayoutExtra != null && Boolean.parseBoolean(gridLayoutExtra.toString())) {
        dependencies.put(SdkConstants.GRADLE_COMPILE_CONFIGURATION, urlManager.getLibraryStringCoordinate(SupportLibrary.GRID_LAYOUT_V7, true));
    }
    put(ATTR_DEPENDENCIES_MULTIMAP, dependencies);
}
Also used : SetMultimap(com.google.common.collect.SetMultimap) RepositoryUrlManager(com.android.tools.idea.templates.RepositoryUrlManager)

Example 15 with SetMultimap

use of com.google.common.collect.SetMultimap in project gerrit by GerritCodeReview.

the class ChangeJson method labelsForClosedChange.

private Map<String, LabelWithStatus> labelsForClosedChange(PermissionBackend.ForChange basePerm, ChangeData cd, LabelTypes labelTypes, boolean standard, boolean detailed) throws OrmException, PermissionBackendException {
    Set<Account.Id> allUsers = new HashSet<>();
    if (detailed) {
        // the latest patch set (in the next loop).
        for (PatchSetApproval psa : cd.approvals().values()) {
            allUsers.add(psa.getAccountId());
        }
    }
    Set<String> labelNames = new HashSet<>();
    SetMultimap<Account.Id, PatchSetApproval> current = MultimapBuilder.hashKeys().hashSetValues().build();
    for (PatchSetApproval a : cd.currentApprovals()) {
        allUsers.add(a.getAccountId());
        LabelType type = labelTypes.byLabel(a.getLabelId());
        if (type != null) {
            labelNames.add(type.getName());
            // Not worth the effort to distinguish between votable/non-votable for 0
            // values on closed changes, since they can't vote anyway.
            current.put(a.getAccountId(), a);
        }
    }
    Map<String, LabelWithStatus> labels;
    if (cd.change().getStatus() == Change.Status.MERGED) {
        // Since voting on merged changes is allowed all labels which apply to
        // the change must be returned. All applying labels can be retrieved from
        // the submit records, which is what initLabels does.
        // It's not possible to only compute the labels based on the approvals
        // since merged changes may not have approvals for all labels (e.g. if not
        // all labels are required for submit or if the change was auto-closed due
        // to direct push or if new labels were defined after the change was
        // merged).
        labels = initLabels(cd, labelTypes, standard);
        // it wouldn't be included in the submit records.
        for (String name : labelNames) {
            if (!labels.containsKey(name)) {
                labels.put(name, LabelWithStatus.create(new LabelInfo(), null));
            }
        }
    } else {
        // For abandoned changes return only labels for which approvals exist.
        // Other labels are not needed since voting on abandoned changes is not
        // allowed.
        labels = new TreeMap<>(labelTypes.nameComparator());
        for (String name : labelNames) {
            labels.put(name, LabelWithStatus.create(new LabelInfo(), null));
        }
    }
    if (detailed) {
        labels.entrySet().stream().filter(e -> labelTypes.byLabel(e.getKey()) != null).forEach(e -> setLabelValues(labelTypes.byLabel(e.getKey()), e.getValue()));
    }
    for (Account.Id accountId : allUsers) {
        Map<String, ApprovalInfo> byLabel = Maps.newHashMapWithExpectedSize(labels.size());
        Map<String, VotingRangeInfo> pvr = Collections.emptyMap();
        if (detailed) {
            PermissionBackend.ForChange perm = basePerm.user(userFactory.create(accountId));
            pvr = getPermittedVotingRanges(permittedLabels(perm, cd));
            for (Map.Entry<String, LabelWithStatus> entry : labels.entrySet()) {
                ApprovalInfo ai = approvalInfo(accountId, 0, null, null, null);
                byLabel.put(entry.getKey(), ai);
                addApproval(entry.getValue().label(), ai);
            }
        }
        for (PatchSetApproval psa : current.get(accountId)) {
            LabelType type = labelTypes.byLabel(psa.getLabelId());
            if (type == null) {
                continue;
            }
            short val = psa.getValue();
            ApprovalInfo info = byLabel.get(type.getName());
            if (info != null) {
                info.value = Integer.valueOf(val);
                info.permittedVotingRange = pvr.getOrDefault(type.getName(), null);
                info.date = psa.getGranted();
                info.tag = psa.getTag();
                if (psa.isPostSubmit()) {
                    info.postSubmit = true;
                }
            }
            if (!standard) {
                continue;
            }
            setLabelScores(type, labels.get(type.getName()), val, accountId);
        }
    }
    return labels;
}
Also used : REVIEWER_UPDATES(com.google.gerrit.extensions.client.ListChangesOption.REVIEWER_UPDATES) PushCertificateInfo(com.google.gerrit.extensions.common.PushCertificateInfo) LabelInfo(com.google.gerrit.extensions.common.LabelInfo) ProjectCache(com.google.gerrit.server.project.ProjectCache) MultimapBuilder(com.google.common.collect.MultimapBuilder) HashBasedTable(com.google.common.collect.HashBasedTable) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) PatchSetApproval(com.google.gerrit.reviewdb.client.PatchSetApproval) RevWalk(org.eclipse.jgit.revwalk.RevWalk) MergeUtil(com.google.gerrit.server.git.MergeUtil) FluentIterable(com.google.common.collect.FluentIterable) Map(java.util.Map) WEB_LINKS(com.google.gerrit.extensions.client.ListChangesOption.WEB_LINKS) AnonymousUser(com.google.gerrit.server.AnonymousUser) LABELS(com.google.gerrit.extensions.client.ListChangesOption.LABELS) LinkedHashMultimap(com.google.common.collect.LinkedHashMultimap) ApprovalInfo(com.google.gerrit.extensions.common.ApprovalInfo) DownloadScheme(com.google.gerrit.extensions.config.DownloadScheme) ChangeMessage(com.google.gerrit.reviewdb.client.ChangeMessage) Set(java.util.Set) ReviewerStatusUpdate(com.google.gerrit.server.ReviewerStatusUpdate) SUBMITTABLE(com.google.gerrit.extensions.client.ListChangesOption.SUBMITTABLE) MESSAGES(com.google.gerrit.extensions.client.ListChangesOption.MESSAGES) AutoValue(com.google.auto.value.AutoValue) DETAILED_ACCOUNTS(com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS) Joiner(com.google.common.base.Joiner) ChangeMessagesUtil(com.google.gerrit.server.ChangeMessagesUtil) Singleton(com.google.inject.Singleton) Iterables(com.google.common.collect.Iterables) ReviewDb(com.google.gerrit.reviewdb.server.ReviewDb) PermissionBackendException(com.google.gerrit.server.permissions.PermissionBackendException) RevCommit(org.eclipse.jgit.revwalk.RevCommit) Change(com.google.gerrit.reviewdb.client.Change) DOWNLOAD_COMMANDS(com.google.gerrit.extensions.client.ListChangesOption.DOWNLOAD_COMMANDS) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) CURRENT_COMMIT(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_COMMIT) Lists(com.google.common.collect.Lists) Project(com.google.gerrit.reviewdb.client.Project) CURRENT_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_ACTIONS) DownloadCommand(com.google.gerrit.extensions.config.DownloadCommand) MoreObjects(com.google.common.base.MoreObjects) Throwables(com.google.common.base.Throwables) ChangeNotes(com.google.gerrit.server.notedb.ChangeNotes) IOException(java.io.IOException) ReviewerUpdateInfo(com.google.gerrit.extensions.common.ReviewerUpdateInfo) SubmitRuleOptions(com.google.gerrit.server.project.SubmitRuleOptions) WebLinks(com.google.gerrit.server.WebLinks) VotingRangeInfo(com.google.gerrit.extensions.common.VotingRangeInfo) SubmitTypeRecord(com.google.gerrit.common.data.SubmitTypeRecord) WebLinkInfo(com.google.gerrit.extensions.common.WebLinkInfo) GitRepositoryManager(com.google.gerrit.server.git.GitRepositoryManager) TreeMap(java.util.TreeMap) DynamicMap(com.google.gerrit.extensions.registration.DynamicMap) IdentifiedUser(com.google.gerrit.server.IdentifiedUser) PatchSet(com.google.gerrit.reviewdb.client.PatchSet) ChangeIndexCollection(com.google.gerrit.server.index.change.ChangeIndexCollection) Repository(org.eclipse.jgit.lib.Repository) ChangeControl(com.google.gerrit.server.project.ChangeControl) OrmException(com.google.gwtorm.server.OrmException) ALL_REVISIONS(com.google.gerrit.extensions.client.ListChangesOption.ALL_REVISIONS) Inject(com.google.inject.Inject) LoggerFactory(org.slf4j.LoggerFactory) RevisionInfo(com.google.gerrit.extensions.common.RevisionInfo) PUSH_CERTIFICATES(com.google.gerrit.extensions.client.ListChangesOption.PUSH_CERTIFICATES) Assisted(com.google.inject.assistedinject.Assisted) AccountInfo(com.google.gerrit.extensions.common.AccountInfo) GpgException(com.google.gerrit.server.GpgException) REVIEWED(com.google.gerrit.extensions.client.ListChangesOption.REVIEWED) CHECK(com.google.gerrit.extensions.client.ListChangesOption.CHECK) ChangedLines(com.google.gerrit.server.query.change.ChangeData.ChangedLines) ALL_FILES(com.google.gerrit.extensions.client.ListChangesOption.ALL_FILES) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) Timestamp(java.sql.Timestamp) Collection(java.util.Collection) DETAILED_LABELS(com.google.gerrit.extensions.client.ListChangesOption.DETAILED_LABELS) CommitInfo(com.google.gerrit.extensions.common.CommitInfo) LabelType(com.google.gerrit.common.data.LabelType) Sets(com.google.common.collect.Sets) Preconditions.checkState(com.google.common.base.Preconditions.checkState) ChangeData(com.google.gerrit.server.query.change.ChangeData) List(java.util.List) Nullable(com.google.gerrit.common.Nullable) FetchInfo(com.google.gerrit.extensions.common.FetchInfo) LabelTypes(com.google.gerrit.common.data.LabelTypes) Ref(org.eclipse.jgit.lib.Ref) Url(com.google.gerrit.extensions.restapi.Url) Optional(java.util.Optional) LabelValue(com.google.gerrit.common.data.LabelValue) LabelPermission(com.google.gerrit.server.permissions.LabelPermission) GpgApiAdapter(com.google.gerrit.server.api.accounts.GpgApiAdapter) PatchListNotAvailableException(com.google.gerrit.server.patch.PatchListNotAvailableException) AccountLoader(com.google.gerrit.server.account.AccountLoader) FixInput(com.google.gerrit.extensions.api.changes.FixInput) PluginDefinedAttributesFactory(com.google.gerrit.server.query.change.PluginDefinedAttributesFactory) QueryResult(com.google.gerrit.server.query.QueryResult) ReviewerState(com.google.gerrit.extensions.client.ReviewerState) Patch(com.google.gerrit.reviewdb.client.Patch) HashMap(java.util.HashMap) CommonConverters.toGitPerson(com.google.gerrit.server.CommonConverters.toGitPerson) SubmitRecord(com.google.gerrit.common.data.SubmitRecord) HashSet(java.util.HashSet) Account(com.google.gerrit.reviewdb.client.Account) CURRENT_REVISION(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION) ChangeInfo(com.google.gerrit.extensions.common.ChangeInfo) ListChangesOption(com.google.gerrit.extensions.client.ListChangesOption) ProblemInfo(com.google.gerrit.extensions.common.ProblemInfo) CurrentUser(com.google.gerrit.server.CurrentUser) Logger(org.slf4j.Logger) ReviewerStateInternal(com.google.gerrit.server.notedb.ReviewerStateInternal) ChangeMessageInfo(com.google.gerrit.extensions.common.ChangeMessageInfo) CHANGE_ACTIONS(com.google.gerrit.extensions.client.ListChangesOption.CHANGE_ACTIONS) Maps(com.google.common.collect.Maps) Ints(com.google.common.primitives.Ints) SetMultimap(com.google.common.collect.SetMultimap) ApprovalsUtil(com.google.gerrit.server.ApprovalsUtil) ObjectId(org.eclipse.jgit.lib.ObjectId) ChangeField(com.google.gerrit.server.index.change.ChangeField) Collectors.toList(java.util.stream.Collectors.toList) Address(com.google.gerrit.server.mail.Address) Provider(com.google.inject.Provider) CURRENT_FILES(com.google.gerrit.extensions.client.ListChangesOption.CURRENT_FILES) AccountInfoComparator(com.google.gerrit.server.api.accounts.AccountInfoComparator) COMMIT_FOOTERS(com.google.gerrit.extensions.client.ListChangesOption.COMMIT_FOOTERS) ALL_COMMITS(com.google.gerrit.extensions.client.ListChangesOption.ALL_COMMITS) Table(com.google.common.collect.Table) Collections(java.util.Collections) StarredChangesUtil(com.google.gerrit.server.StarredChangesUtil) Account(com.google.gerrit.reviewdb.client.Account) PermissionBackend(com.google.gerrit.server.permissions.PermissionBackend) VotingRangeInfo(com.google.gerrit.extensions.common.VotingRangeInfo) PatchSetApproval(com.google.gerrit.reviewdb.client.PatchSetApproval) LabelInfo(com.google.gerrit.extensions.common.LabelInfo) ApprovalInfo(com.google.gerrit.extensions.common.ApprovalInfo) LabelType(com.google.gerrit.common.data.LabelType) ObjectId(org.eclipse.jgit.lib.ObjectId) Map(java.util.Map) LinkedHashMap(java.util.LinkedHashMap) TreeMap(java.util.TreeMap) DynamicMap(com.google.gerrit.extensions.registration.DynamicMap) ImmutableMap(com.google.common.collect.ImmutableMap) HashMap(java.util.HashMap) HashSet(java.util.HashSet)

Aggregations

SetMultimap (com.google.common.collect.SetMultimap)21 List (java.util.List)11 Map (java.util.Map)11 Set (java.util.Set)11 HashSet (java.util.HashSet)9 Optional (java.util.Optional)9 ImmutableSet (com.google.common.collect.ImmutableSet)8 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)8 ImmutableMap (com.google.common.collect.ImmutableMap)7 Collections (java.util.Collections)7 HashMultimap (com.google.common.collect.HashMultimap)6 Sets (com.google.common.collect.Sets)6 ImmutableList (com.google.common.collect.ImmutableList)5 ImmutableSetMultimap (com.google.common.collect.ImmutableSetMultimap)5 Collection (java.util.Collection)4 VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 Preconditions.checkState (com.google.common.base.Preconditions.checkState)3 LinkedHashMultimap (com.google.common.collect.LinkedHashMultimap)3 MultimapBuilder (com.google.common.collect.MultimapBuilder)3