Tabnine Logo
AuthConfigFactory$RegistrationContext
Code IndexAdd Tabnine to your IDE (free)

How to use
AuthConfigFactory$RegistrationContext
in
javax.security.auth.message.config

Best Java code snippets using javax.security.auth.message.config.AuthConfigFactory$RegistrationContext (Showing top 20 results out of 315)

origin: eclipse-ee4j/glassfish

private void writeRegEntry(EntryInfo info, PrintWriter out, int i) {
  out.println(INDENT[i++] + REG_ENTRY + " {");
  if (info.getClassName() != null) {
    writeConEntry(info, out, i);
  }
  for (RegistrationContext ctx : info.getRegContexts()) {
    out.println(INDENT[i++] + REG_CTX + " {");
    if (ctx.getMessageLayer() != null) {
      out.println(INDENT[i] + LAYER + SEP + ctx.getMessageLayer());
    }
    if (ctx.getAppContext() != null) {
      out.println(INDENT[i] + APP_CTX + SEP + ctx.getAppContext());
    }
    if (ctx.getDescription() != null) {
      out.println(INDENT[i] + DESCRIPTION +
        SEP + ctx.getDescription());
    }
    out.println(INDENT[--i] + "}");
  }
  out.println(INDENT[--i] + "}");
}
origin: eclipse-ee4j/glassfish

} else if (prevRegisContext != null && prevRegisContext.isPersistent()) {
  _deleteStoredRegistration(regisID, prevRegisContext);
origin: org.glassfish.main.security/jaspic.provider.framework

} else if (prevRegisContext != null && prevRegisContext.isPersistent()) {
  _deleteStoredRegistration(regisID, prevRegisContext);
origin: org.glassfish.main.security/jaspic.provider.framework

  if (selfRegistered.contains(i)) {
    RegistrationContext c = getFactory().getRegistrationContext(i);
    if (c != null && !c.isPersistent()) {
      toBeUnregistered.add(i);
if (r != null) {
  String id = getFactory().registerConfigProvider(this,
      r.getMessageLayer(), r.getAppContext(),
      r.getDescription());
  selfRegistered.add(id);
origin: eclipse-ee4j/glassfish

  if (selfRegistered.contains(i)) {
    RegistrationContext c = getFactory().getRegistrationContext(i);
    if (c != null && !c.isPersistent()) {
      toBeUnregistered.add(i);
if (r != null) {
  String id = getFactory().registerConfigProvider(this,
      r.getMessageLayer(), r.getAppContext(),
      r.getDescription());
  selfRegistered.add(id);
origin: eclipse-ee4j/glassfish

private boolean _unRegister(String regisID) {
  boolean rvalue = false;
  RegistrationContext rc = null;
  Map<String, List<RegistrationListener>> listenerMap;
  wLock.lock();
  try {
    rc = id2RegisContextMap.remove(regisID);
    rvalue = id2ProviderMap.containsKey(regisID);
    AuthConfigProvider provider = id2ProviderMap.remove(regisID);
    List<String> regisIDs = provider2IdsMap.get(provider);
    if (regisIDs != null) {
      regisIDs.remove(regisID);
    }
    if (regisIDs == null || regisIDs.isEmpty()) {
      provider2IdsMap.remove(provider);
    }            
    if (!rvalue) {
      return false;
    }
    listenerMap = getEffectedListeners(regisID);
    if (rc != null && rc.isPersistent()) {
        _deleteStoredRegistration(regisID, rc);
    }
  } finally {
    wLock.unlock();
  }
  // outside wLock to prevent dead lock
  notifyListeners(listenerMap);
  return rvalue;
}
origin: org.glassfish.main.security/jaspic.provider.framework

private boolean _unRegister(String regisID) {
  boolean rvalue = false;
  RegistrationContext rc = null;
  Map<String, List<RegistrationListener>> listenerMap;
  wLock.lock();
  try {
    rc = id2RegisContextMap.remove(regisID);
    rvalue = id2ProviderMap.containsKey(regisID);
    AuthConfigProvider provider = id2ProviderMap.remove(regisID);
    List<String> regisIDs = provider2IdsMap.get(provider);
    if (regisIDs != null) {
      regisIDs.remove(regisID);
    }
    if (regisIDs == null || regisIDs.isEmpty()) {
      provider2IdsMap.remove(provider);
    }            
    if (!rvalue) {
      return false;
    }
    listenerMap = getEffectedListeners(regisID);
    if (rc != null && rc.isPersistent()) {
        _deleteStoredRegistration(regisID, rc);
    }
  } finally {
    wLock.unlock();
  }
  // outside wLock to prevent dead lock
  notifyListeners(listenerMap);
  return rvalue;
}
origin: eclipse-ee4j/glassfish

protected void _loadFactory() {
  try {
    initializeMaps();
    List<EntryInfo> entryList = getRegStore().getPersistedEntries();
    for (EntryInfo info : entryList) {
      if (info.isConstructorEntry()) {
        _constructProvider(info.getClassName(),
            info.getProperties(), this);
      } else {
        boolean first = true;
        AuthConfigProvider p = null;
        List<RegistrationContext> contexts = (info.getRegContexts());
        for (RegistrationContext ctx : contexts) {
          if (first) {
            p = _constructProvider(info.getClassName(),
                info.getProperties(), null);
          }
          _loadRegistration(p, ctx.getMessageLayer(),
              ctx.getAppContext(), ctx.getDescription());
        }
      }
    }
  } catch (Exception e) {
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,
          "jmac.factory_auth_config_loader_failure", e);
    }
  }
}
origin: org.glassfish.main.security/jaspic.provider.framework

protected void _loadFactory() {
  try {
    initializeMaps();
    List<EntryInfo> entryList = getRegStore().getPersistedEntries();
    for (EntryInfo info : entryList) {
      if (info.isConstructorEntry()) {
        _constructProvider(info.getClassName(),
            info.getProperties(), this);
      } else {
        boolean first = true;
        AuthConfigProvider p = null;
        List<RegistrationContext> contexts = (info.getRegContexts());
        for (RegistrationContext ctx : contexts) {
          if (first) {
            p = _constructProvider(info.getClassName(),
                info.getProperties(), null);
          }
          _loadRegistration(p, ctx.getMessageLayer(),
              ctx.getAppContext(), ctx.getDescription());
        }
      }
    }
  } catch (Exception e) {
    if (logger.isLoggable(Level.WARNING)) {
      logger.log(Level.WARNING,
          "jmac.factory_auth_config_loader_failure", e);
    }
  }
}
origin: org.glassfish.main.security/security-ee

/**
 * Check if there is a provider register for a given layer and appCtxt.
 */
protected boolean hasExactMatchAuthProvider() {
  boolean exactMatch = false;
  // XXX this may need to be optimized
  AuthConfigProvider p = 
      factory.getConfigProvider(layer, appCtxt, null);
  if (p != null) {
    String[] IDs = factory.getRegistrationIDs(p);
    for (String i : IDs) {
      RegistrationContext c = factory.getRegistrationContext(i);
      if (layer.equals(c.getMessageLayer()) && 
          appCtxt.equals(c.getAppContext())) {
        exactMatch = true;
        break;
      }
    }
  }
  return exactMatch;
}
origin: org.glassfish.security/security

/**
 * Check if there is a provider register for a given layer and appCtxt.
 */
protected boolean hasExactMatchAuthProvider() {
  boolean exactMatch = false;
  // XXX this may need to be optimized
  AuthConfigProvider p = 
      factory.getConfigProvider(layer, appCtxt, null);
  if (p != null) {
    String[] IDs = factory.getRegistrationIDs(p);
    for (String i : IDs) {
      RegistrationContext c = factory.getRegistrationContext(i);
      if (layer.equals(c.getMessageLayer()) && 
          appCtxt.equals(c.getAppContext())) {
        exactMatch = true;
        break;
      }
    }
  }
  return exactMatch;
}
origin: eclipse-ee4j/glassfish

/**
 * to be called by refresh on provider subclass, and after subclass impl.
 * has reloaded its underlying configuration system.
 * Note: Spec is silent as to whether self-registrations should be reprocessed.
 */
public void oldRefresh() {
  if (getFactory() != null) {
    String[] regID = getFactory().getRegistrationIDs(this);
    for (String i : regID) {
      if (selfRegistered.contains(i)) {
        RegistrationContext c = getFactory().getRegistrationContext(i);
        if (c != null && !c.isPersistent()) {
          getFactory().removeRegistration(i);
        }
      }
    }
  }
  epochCarrier.increment();
  selfRegister();
}
origin: org.glassfish.main.security/jaspic.provider.framework

private void writeRegEntry(EntryInfo info, PrintWriter out, int i) {
  out.println(INDENT[i++] + REG_ENTRY + " {");
  if (info.getClassName() != null) {
    writeConEntry(info, out, i);
  }
  for (RegistrationContext ctx : info.getRegContexts()) {
    out.println(INDENT[i++] + REG_CTX + " {");
    if (ctx.getMessageLayer() != null) {
      out.println(INDENT[i] + LAYER + SEP + ctx.getMessageLayer());
    }
    if (ctx.getAppContext() != null) {
      out.println(INDENT[i] + APP_CTX + SEP + ctx.getAppContext());
    }
    if (ctx.getDescription() != null) {
      out.println(INDENT[i] + DESCRIPTION +
        SEP + ctx.getDescription());
    }
    out.println(INDENT[--i] + "}");
  }
  out.println(INDENT[--i] + "}");
}
origin: org.jboss.security/jbosssx-bare

  /**
  * @see AuthConfigFactory#removeRegistration(String)
  */
  public boolean removeRegistration(String registrationID)
  { 
   if(registrationID == null)
     throw new IllegalArgumentException("registrationID is null");
   
   String key = (String)idKeyMap.get(registrationID);
   if(key != null)
   {
     RegistrationListener listener = (RegistrationListener)this.keyListenerMap.get(key);
     RegistrationContext rc = this.getRegistrationContext(registrationID);
          this.keyProviderMap.remove(key);
     //Notify the listener of the change
     if(listener != null)
      listener.notify(rc.getMessageLayer(),rc.getAppContext()); 
     return true;
   }
   return false;
  } 
}
origin: org.glassfish.main.security/jaspic.provider.framework

/**
 * to be called by refresh on provider subclass, and after subclass impl.
 * has reloaded its underlying configuration system.
 * Note: Spec is silent as to whether self-registrations should be reprocessed.
 */
public void oldRefresh() {
  if (getFactory() != null) {
    String[] regID = getFactory().getRegistrationIDs(this);
    for (String i : regID) {
      if (selfRegistered.contains(i)) {
        RegistrationContext c = getFactory().getRegistrationContext(i);
        if (c != null && !c.isPersistent()) {
          getFactory().removeRegistration(i);
        }
      }
    }
  }
  epochCarrier.increment();
  selfRegister();
}
origin: eclipse-ee4j/glassfish

public boolean contextsAreEqual(RegistrationContext a, RegistrationContext b) {
  if (a == null || b == null) {
    return false;
  } else if (a.isPersistent() != b.isPersistent()) {
    return false;
  } else if (!a.getAppContext().equals(b.getAppContext())) {
    return false;
  } else if (!a.getMessageLayer().equals(b.getMessageLayer())) {
    return false;
  } else if (!a.getDescription().equals(b.getDescription())) {
    return false;
  }
  return true;
}
origin: eclipse-ee4j/glassfish

EntryInfo(String className, Map<String, String> properties,
  RegistrationContext ctx) {
  this.className = className;
  this.properties = properties;
  if (ctx != null) {
    RegistrationContext ctxImpl =
      new RegistrationContextImpl(ctx.getMessageLayer(),
      ctx.getAppContext(), ctx.getDescription(), ctx.isPersistent());
    List<RegistrationContext> newList =
      new ArrayList<RegistrationContext>(1);
    newList.add(ctxImpl);
    this.regContexts = newList;
  }
}
origin: org.glassfish.main.security/jaspic.provider.framework

EntryInfo(String className, Map<String, String> properties,
  RegistrationContext ctx) {
  this.className = className;
  this.properties = properties;
  if (ctx != null) {
    RegistrationContext ctxImpl =
      new RegistrationContextImpl(ctx.getMessageLayer(),
      ctx.getAppContext(), ctx.getDescription(), ctx.isPersistent());
    List<RegistrationContext> newList =
      new ArrayList<RegistrationContext>(1);
    newList.add(ctxImpl);
    this.regContexts = newList;
  }
}
origin: org.glassfish.main.security/jaspic.provider.framework

public boolean contextsAreEqual(RegistrationContext a, RegistrationContext b) {
  if (a == null || b == null) {
    return false;
  } else if (a.isPersistent() != b.isPersistent()) {
    return false;
  } else if (!a.getAppContext().equals(b.getAppContext())) {
    return false;
  } else if (!a.getMessageLayer().equals(b.getMessageLayer())) {
    return false;
  } else if (!a.getDescription().equals(b.getDescription())) {
    return false;
  }
  return true;
}
origin: org.glassfish.main.security/jaspic.provider.framework

private void _storeRegistration(String regId,
    RegistrationContext ctx, AuthConfigProvider p, Map properties) {
  String className = null;
  if (p != null) {
    className = p.getClass().getName();
  }
  if (propertiesContainAnyNonStringValues(properties)) {
    throw new IllegalArgumentException("AuthConfigProvider cannot be registered - properties must all be of type String.");
  }
  if (ctx.isPersistent()) {
    getRegStore().store(className, ctx, properties);
  }
}
javax.security.auth.message.configAuthConfigFactory$RegistrationContext

Javadoc

Represents the layer identifier, application context identifier., and description components of an AuthConfigProvider registration at the factory.

Most used methods

  • getAppContext
    Get the application context identifier from the registration context
  • getMessageLayer
    Get the layer name from the registration context
  • getDescription
    Get the description from the registration context
  • isPersistent
    Get the persisted status from the registration context.

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • IsNull (org.hamcrest.core)
    Is the value null?
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now