<commit_before>package io.joynr.accesscontrol;

/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2014 BMW Car IT GmbH
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import io.joynr.accesscontrol.broadcastlistener.LdacDomainRoleEntryChangedBroadcastListener;
import io.joynr.accesscontrol.broadcastlistener.LdacMasterAccessControlEntryChangedBroadcastListener;
import io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener;
import io.joynr.accesscontrol.broadcastlistener.LdacOwnerAccessControlEntryChangedBroadcastListener;
import io.joynr.accesscontrol.primarykey.UserDomainInterfaceOperationKey;
import io.joynr.capabilities.LocalCapabilitiesDirectory;
import io.joynr.dispatcher.rpc.Callback;
import io.joynr.messaging.ConfigurableMessagingSettings;
import io.joynr.proxy.Future;
import io.joynr.proxy.ProxyInvocationHandlerFactory;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.CheckForNull;

import joynr.OnChangeSubscriptionQos;
import joynr.infrastructure.ChannelUrlDirectory;
import joynr.infrastructure.DomainRoleEntry;
import joynr.infrastructure.GlobalCapabilitiesDirectory;
import joynr.infrastructure.GlobalDomainAccessController;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.DomainRoleEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.MasterAccessControlEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.MediatorAccessControlEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.OwnerAccessControlEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.MasterAccessControlEntry;
import joynr.infrastructure.MasterRegistrationControlEntry;
import joynr.infrastructure.OwnerAccessControlEntry;
import joynr.infrastructure.OwnerRegistrationControlEntry;
import joynr.infrastructure.Permission;
import joynr.infrastructure.Role;
import joynr.infrastructure.TrustLevel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.name.Named;

@Singleton
public class LocalDomainAccessControllerImpl implements LocalDomainAccessController {

    // The LDAC subscribes to broadcasts of ACL changes, below are the subscriptionQos parameters
    private static final long QOS_MIN_INTERVAL_MS = 1 * 1000L;
    private static final long QOS_DURATION_MS = 10 * 365 * 24 * 3600 * 1000L; // 10 years
    private static final long QOS_PUBLICATION_TTL_MS = 5 * 1000L;

    private static final Logger LOG = LoggerFactory.getLogger(LocalDomainAccessControllerImpl.class);

    private final String discoveryDirectoriesDomain;
    private AccessControlAlgorithm accessControlAlgorithm = new AccessControlAlgorithm();
    private static final String WILDCARD = "*";
    private Map<UserDomainInterfaceOperationKey, AceSubscription> subscriptionsMap = new HashMap<UserDomainInterfaceOperationKey, AceSubscription>();
    private GlobalDomainAccessControllerClient globalDomainAccessControllerClient;

    private DomainAccessControlStore localDomainAccessStore;

    // Class that holds subscription ids.
    class AceSubscription {
        private final String masterSubscriptionId;
        private final String mediatorSubscriptionId;
        private final String ownerSubscriptionId;

        public AceSubscription(String masterSubscriptionId, String mediatorSubscriptionId, String ownerSubscriptionId) {
            this.masterSubscriptionId = masterSubscriptionId;
            this.mediatorSubscriptionId = mediatorSubscriptionId;
            this.ownerSubscriptionId = ownerSubscriptionId;
        }
<commit_msg>[Java] make AceSubscription static as per findbugs<commit_after>package io.joynr.accesscontrol;

/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2014 BMW Car IT GmbH
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import io.joynr.accesscontrol.broadcastlistener.LdacDomainRoleEntryChangedBroadcastListener;
import io.joynr.accesscontrol.broadcastlistener.LdacMasterAccessControlEntryChangedBroadcastListener;
import io.joynr.accesscontrol.broadcastlistener.LdacMediatorAccessControlEntryChangedBroadcastListener;
import io.joynr.accesscontrol.broadcastlistener.LdacOwnerAccessControlEntryChangedBroadcastListener;
import io.joynr.accesscontrol.primarykey.UserDomainInterfaceOperationKey;
import io.joynr.capabilities.LocalCapabilitiesDirectory;
import io.joynr.dispatcher.rpc.Callback;
import io.joynr.messaging.ConfigurableMessagingSettings;
import io.joynr.proxy.Future;
import io.joynr.proxy.ProxyInvocationHandlerFactory;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.CheckForNull;

import joynr.OnChangeSubscriptionQos;
import joynr.infrastructure.ChannelUrlDirectory;
import joynr.infrastructure.DomainRoleEntry;
import joynr.infrastructure.GlobalCapabilitiesDirectory;
import joynr.infrastructure.GlobalDomainAccessController;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.DomainRoleEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.MasterAccessControlEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.MediatorAccessControlEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.GlobalDomainAccessControllerBroadcastInterface.OwnerAccessControlEntryChangedBroadcastFilterParameters;
import joynr.infrastructure.MasterAccessControlEntry;
import joynr.infrastructure.MasterRegistrationControlEntry;
import joynr.infrastructure.OwnerAccessControlEntry;
import joynr.infrastructure.OwnerRegistrationControlEntry;
import joynr.infrastructure.Permission;
import joynr.infrastructure.Role;
import joynr.infrastructure.TrustLevel;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.name.Named;

@Singleton
public class LocalDomainAccessControllerImpl implements LocalDomainAccessController {

    // The LDAC subscribes to broadcasts of ACL changes, below are the subscriptionQos parameters
    private static final long QOS_MIN_INTERVAL_MS = 1 * 1000L;
    private static final long QOS_DURATION_MS = 10 * 365 * 24 * 3600 * 1000L; // 10 years
    private static final long QOS_PUBLICATION_TTL_MS = 5 * 1000L;

    private static final Logger LOG = LoggerFactory.getLogger(LocalDomainAccessControllerImpl.class);

    private final String discoveryDirectoriesDomain;
    private AccessControlAlgorithm accessControlAlgorithm = new AccessControlAlgorithm();
    private static final String WILDCARD = "*";
    private Map<UserDomainInterfaceOperationKey, AceSubscription> subscriptionsMap = new HashMap<UserDomainInterfaceOperationKey, AceSubscription>();
    private GlobalDomainAccessControllerClient globalDomainAccessControllerClient;

    private DomainAccessControlStore localDomainAccessStore;

    // Class that holds subscription ids.
    static class AceSubscription {
        private final String masterSubscriptionId;
        private final String mediatorSubscriptionId;
        private final String ownerSubscriptionId;

        public AceSubscription(String masterSubscriptionId, String mediatorSubscriptionId, String ownerSubscriptionId) {
            this.masterSubscriptionId = masterSubscriptionId;
            this.mediatorSubscriptionId = mediatorSubscriptionId;
            this.ownerSubscriptionId = ownerSubscriptionId;
        }

{'fraction_non_alphanumeric': 0.05926773455377574, 'fraction_numerical': 0.009382151029748284, 'mean_word_length': 6.200164744645799, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3025709', 'n_tokens_mistral': 2252, 'n_tokens_neox': 2153, 'n_words': 547}