LayerContextKey fullKey = new LayerContextKey(layer, appContext); Registration registration = layerContextRegistration.get(fullKey); registration = layerContextRegistration.get(new LayerContextKey(null, appContext)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider; registration = layerContextRegistration.get(new LayerContextKey(layer, null)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider; registration = layerContextRegistration.get(new LayerContextKey(null, null)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider;
LayerContextKey fullKey = new LayerContextKey(layer, appContext); Registration registration = layerContextRegistration.get(fullKey); registration = layerContextRegistration.get(new LayerContextKey(null, appContext)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider; registration = layerContextRegistration.get(new LayerContextKey(layer, null)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider; registration = layerContextRegistration.get(new LayerContextKey(null, null)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider;
LayerContextKey fullKey = new LayerContextKey(layer, appContext); Registration registration = layerContextRegistration.get(fullKey); registration = layerContextRegistration.get(new LayerContextKey(null, appContext)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider; registration = layerContextRegistration.get(new LayerContextKey(layer, null)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider; registration = layerContextRegistration.get(new LayerContextKey(null, null)); if (registration != null && registration.activeRegistration()) { return registration.authConfigProvider;
boolean matchesRegistration(final String layer, final String appContext) { synchronized (layerContextRegistration) { // Step 1 - Exact Match Registration registration = layerContextRegistration.get(new LayerContextKey(layer, appContext)); if (registration != null && registration.activeRegistration()) { return true; } // Step 2 - appContext only registration = layerContextRegistration.get(new LayerContextKey(null, appContext)); if (registration != null && registration.activeRegistration()) { return true; } // Step 3 - layer only registration = layerContextRegistration.get(new LayerContextKey(layer, null)); if (registration != null && registration.activeRegistration()) { return true; } // Step 4 - No appContext or layer registration = layerContextRegistration.get(new LayerContextKey(null, null)); if (registration != null && registration.activeRegistration()) { return true; } } return false; }
String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description, boolean persistent) { Registration registration = null; List<RegistrationListener> existingListeners; synchronized(layerContextRegistration) { LayerContextKey key = new LayerContextKey(layer, appContext); registration = layerContextRegistration.get(key); if (registration == null) { registration = new Registration(layer, appContext); layerContextRegistration.put(key, registration); existingListeners = Collections.emptyList(); } else { existingListeners = registration.clearListeners(); } registration.setDescription(description); registration.setPersistent(persistent); registration.setAuthConfigProvider(provider, provider == null); } // Handle notify outside the synchronized block in case they want to re-register. for (RegistrationListener current : existingListeners) { current.notify(layer, appContext); } return registration.getRegistrationId(); }
boolean matchesRegistration(final String layer, final String appContext) { synchronized (layerContextRegistration) { // Step 1 - Exact Match Registration registration = layerContextRegistration.get(new LayerContextKey(layer, appContext)); if (registration != null && registration.activeRegistration()) { return true; } // Step 2 - appContext only registration = layerContextRegistration.get(new LayerContextKey(null, appContext)); if (registration != null && registration.activeRegistration()) { return true; } // Step 3 - layer only registration = layerContextRegistration.get(new LayerContextKey(layer, null)); if (registration != null && registration.activeRegistration()) { return true; } // Step 4 - No appContext or layer registration = layerContextRegistration.get(new LayerContextKey(null, null)); if (registration != null && registration.activeRegistration()) { return true; } } return false; }
String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description, boolean persistent) { Registration registration = null; List<RegistrationListener> existingListeners; synchronized(layerContextRegistration) { LayerContextKey key = new LayerContextKey(layer, appContext); registration = layerContextRegistration.get(key); if (registration == null) { registration = new Registration(layer, appContext); layerContextRegistration.put(key, registration); existingListeners = Collections.emptyList(); } else { existingListeners = registration.clearListeners(); } registration.setDescription(description); registration.setPersistent(persistent); registration.setAuthConfigProvider(provider, provider == null); } // Handle notify outside the synchronized block in case they want to re-register. for (RegistrationListener current : existingListeners) { current.notify(layer, appContext); } return registration.getRegistrationId(); }
@Override public boolean equals(Object other) { return other instanceof LayerContextKey ? equals((LayerContextKey) other) : false; }
@Override public boolean equals(Object other) { return other instanceof LayerContextKey ? equals((LayerContextKey) other) : false; }
boolean matchesRegistration(final String layer, final String appContext) { synchronized (layerContextRegistration) { // Step 1 - Exact Match Registration registration = layerContextRegistration.get(new LayerContextKey(layer, appContext)); if (registration != null && registration.activeRegistration()) { return true; } // Step 2 - appContext only registration = layerContextRegistration.get(new LayerContextKey(null, appContext)); if (registration != null && registration.activeRegistration()) { return true; } // Step 3 - layer only registration = layerContextRegistration.get(new LayerContextKey(layer, null)); if (registration != null && registration.activeRegistration()) { return true; } // Step 4 - No appContext or layer registration = layerContextRegistration.get(new LayerContextKey(null, null)); if (registration != null && registration.activeRegistration()) { return true; } } return false; }
String registerConfigProvider(AuthConfigProvider provider, String layer, String appContext, String description, boolean persistent) { Registration registration = null; List<RegistrationListener> existingListeners; synchronized(layerContextRegistration) { LayerContextKey key = new LayerContextKey(layer, appContext); registration = layerContextRegistration.get(key); if (registration == null) { registration = new Registration(layer, appContext); layerContextRegistration.put(key, registration); existingListeners = Collections.emptyList(); } else { existingListeners = registration.clearListeners(); } registration.setDescription(description); registration.setPersistent(persistent); registration.setAuthConfigProvider(provider, provider == null); } // Handle notify outside the synchronized block in case they want to re-register. for (RegistrationListener current : existingListeners) { current.notify(layer, appContext); } return registration.getRegistrationId(); }
@Override public boolean equals(Object other) { return other instanceof LayerContextKey ? equals((LayerContextKey) other) : false; }