Examples of LdapSchema


Examples of com.google.gerrit.server.auth.ldap.Helper.LdapSchema

    try {
      DirContext ctx = helper.open();
      try {
        // Do exact lookups until there are at least 3 characters.
        name = Rdn.escapeValue(name) + ((name.length() >= 3) ? "*" : "");
        LdapSchema schema = helper.getSchema(ctx);
        ParameterizedString filter = ParameterizedString.asis(
            schema.groupPattern.replace(GROUPNAME, name).toString());
        Set<String> returnAttrs = Collections.<String>emptySet();
        Map<String, String> params = Collections.emptyMap();
        for (String groupBase : schema.groupBases) {
View Full Code Here

Examples of netscape.ldap.LDAPSchema

            throw new Exception(SOSClassUtil.getMethodName() +
                ": sorry, there is no successful connection established." +
                " may be the connect method was not called");
        }
         
          LDAPSchema dirSchema = new LDAPSchema();
     
          // Gib schemas.
          dirSchema.fetchSchema( connection);
          Enumeration ocs = dirSchema.getObjectClasses();
          while ( ocs.hasMoreElements() ) {
              LDAPObjectClassSchema oc = (LDAPObjectClassSchema)ocs.nextElement();
             
              if(logger != null){
                  logger.debug5(SOSClassUtil.getMethodName()+" Object = "+oc.getName());
View Full Code Here

Examples of netscape.ldap.LDAPSchema

            throw new Exception(SOSClassUtil.getMethodName() +
                ": sorry, there is no successful connection established." +
                " may be the connect method was not called");
        }
         
          LDAPSchema dirSchema = new LDAPSchema();
       
          // Get the schema from the directory.
          dirSchema.fetchSchema( connection );
         
          LDAPObjectClassSchema objClass = dirSchema.getObjectClass(object);
          if ( objClass == null ) {
              System.out.println("Object = "+object+" not found ");
          }
          else{
              System.out.println("-------------------------");
View Full Code Here

Examples of netscape.ldap.LDAPSchema

  throws ImportExportException
    {
  Enumeration enumeration;
  String[]    attrs;
  MozillaProducer  producer;
  LDAPSchema  schema;
  int         scope;

  if ( getSearchDescriptor() == null )
      throw new IllegalStateException( Messages.message( "dsml.searchDescriptorRequired" ) );

  attrs = getSearchDescriptor().getReturnAttrs();
  try {
      scope = getSearchDescriptor().getScope();
      switch ( scope ) {
      case SearchDescriptor.Scope.OneLevel:
    scope = LDAPv2.SCOPE_ONE;
    break;
      case SearchDescriptor.Scope.Base:
    scope = LDAPv2.SCOPE_BASE;
    break;
      case SearchDescriptor.Scope.SubTree:
    scope = LDAPv2.SCOPE_SUB;
    break;
      }
      enumeration = _conn.search( getSearchDescriptor().getBaseDN(), scope,
        getSearchDescriptor().getFilter(), attrs, false );
  } catch ( LDAPException except ) {
      // Object does not exist, was not removed, ignore.
      // Anything else, we must complain.
      if ( except.getLDAPResultCode() != LDAPException.NO_SUCH_OBJECT )
    throw new ImportExportException( except );
      enumeration = null;
  }

  try {
      producer = new MozillaProducer( docHandler, false );
      producer.startDocument();
      if ( serverSchema ) {
    schema = new LDAPSchema();
    schema.fetchSchema( _conn );
    producer.produce( schema );
      }
      if ( enumeration != null )
    producer.produce( enumeration );
      if ( importPolicy && getImportDescriptor() != null )
View Full Code Here

Examples of netscape.ldap.LDAPSchema

  throws ImportExportException
    {
  Enumeration enumeration;
  String[]    attrs;
  MozillaProducer  producer;
  LDAPSchema  schema;
  int         count;
  int         scope;

  if ( getSearchDescriptor() == null )
      throw new IllegalStateException( Messages.message( "dsml.searchDescriptorRequired" ) );

  attrs = getSearchDescriptor().getReturnAttrs();
  try {
      scope = getSearchDescriptor().getScope();
      switch ( scope ) {
      case SearchDescriptor.Scope.OneLevel:
    scope = LDAPv2.SCOPE_ONE;
    break;
      case SearchDescriptor.Scope.Base:
    scope = LDAPv2.SCOPE_BASE;
    break;
      case SearchDescriptor.Scope.SubTree:
    scope = LDAPv2.SCOPE_SUB;
    break;
      }
      enumeration = _conn.search( getSearchDescriptor().getBaseDN(), scope,
        getSearchDescriptor().getFilter(), attrs, false );
  } catch ( LDAPException except ) {
      // Object does not exist, was not removed, ignore.
      // Anything else, we must complain.
      if ( except.getLDAPResultCode() != LDAPException.NO_SUCH_OBJECT )
    throw new ImportExportException( except );
      enumeration = null;
  }

  try {
      producer = new MozillaProducer( docHandler, false );
      producer.startDocument();
      if ( serverSchema ) {
    schema = new LDAPSchema();
    schema.fetchSchema( _conn );
    producer.produce( schema );
      }
      if ( enumeration != null )
    producer.produce( enumeration );
      if ( importPolicy && getImportDescriptor() != null )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.