Examples of ConfigEntry


Examples of com.carrotgarden.nexus.aws.s3.publish.config.ConfigEntry

    if (shouldYield()) {
      log.info("yielding to priority tasks");
      return;
    }

    final ConfigEntry entry = configEntry();

    final String comboId = entry.comboId();

    final AmazonService service = entry.amazonService();

    final List<String> repoList = RepoHelp.repoList(repoRegistry, comboId);

    final Pattern defaultExclude = ConfigHelp.defaultExclude();

    for (final String repoId : repoList) {

      checkInterruption();

      doSleep(scannerRepositorySleepTime());

      final Repository repo = repoRegistry.getRepository(repoId);

      final File root = RepoHelp.repoRoot(repo);

      final CarrotListener listener = new CarrotListenerSupport() {

        @Override
        public void onBegin() {

          log.info("##########################################");
          log.info("repo scan init : {} {}", configId(), repoId);

        }

        @Override
        public void onEnd() {

          log.info("repo stats : processed={} published={}",
              reporter.scanCount.count(),
              reporter.amazonPublishedFileCount.count());
          log.info("repo scan done : {} {}", configId(), repoId);
          log.info("##########################################");
        }

        @Override
        public boolean skipDirectory(final File directory) {

          final String path = //
          rootFullPath(relativePath(root, directory));

          final boolean isExcluded = defaultExclude.matcher(path)
              .matches();

          return isExcluded;

        }

        @Override
        public boolean skipFile(final File file) {

          return false;

        }

        @Override
        public void onFile(final File file) {
          try {

            checkInterruption();

            reporter.scanCount.inc();
            reporter.scanRate.mark();

            reporter.repoFilePeek.add(file);

            final String path = //
            rootFullPath(relativePath(root, file));

            if (entry.isExcluded(path)) {
              reporter.amazonIgnoredFileCount.inc();
              return;
            }

            final ResourceStoreRequest request = //
View Full Code Here

Examples of com.carrotgarden.nexus.aws.s3.publish.config.ConfigEntry

    final CapabilityIdentity capaId = new CapabilityIdentity(configId());

    final CapabilityReference reference = capaRegistry.get(capaId);

    final ConfigEntry entry = reference
        .capabilityAs(ConfigCapability.class);

    final String comboId = entry.comboId();

    final AmazonService amazonService = entry.amazonService();

    final List<String> repoList = RepoHelp.repoList(repoRegistry, comboId);

    for (final String repoId : repoList) {

      checkInterruption();

      doSleep(scannerRepositorySleepTime());

      final Repository repo = repoRegistry.getRepository(repoId);

      final File root = RepoHelp.repoRoot(repo);

      final Listener listener = new ListenerSupport() {

        @Override
        public void onBegin() {

          log.info("##########################################");
          log.info("repo scan init : {} {}", configId(), repoId);

        }

        @Override
        public void onEnd() {

          log.info("repo stats : total={} success={}",
              reporter.amazonPublishedFileSize.count(),
              reporter.amazonPublishedFileCount.count());
          log.info("repo scan done : {} {}", configId(), repoId);
          log.info("##########################################");
        }

        @Override
        public void onFile(final File file) {
          try {

            reporter.repoFilePeek.add(file);

            reporter.fileRate.mark();
            reporter.fileCount.inc();

            checkInterruption();

            final String path = //
            PathHelp.rootFullPath(PathHelp.relativePath(root, file));

            if (entry.isExcluded(path)) {
              reporter.amazonIgnoredFileCount.inc();
              return;
            }

            reporter.repoFileSize.inc(file.length());
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

    TaskBackendCfg cfg = (TaskBackendCfg)config;

    DN[] baseDNs = new DN[cfg.getBaseDN().size()];
    cfg.getBaseDN().toArray(baseDNs);

    ConfigEntry configEntry = DirectoryServer.getConfigEntry(cfg.dn());

    configEntryDN = configEntry.getDN();


    // Make sure that the provided set of base DNs contains exactly one value.
    // We will only allow one base for task entries.
    if ((baseDNs == null) || (baseDNs.length == 0))
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

      throw new ConfigException(message);
    }

    Validator.ensureTrue(config instanceof SchemaBackendCfg);
    SchemaBackendCfg cfg = (SchemaBackendCfg)config;
    ConfigEntry configEntry = DirectoryServer.getConfigEntry(cfg.dn());

    configEntryDN = configEntry.getDN();

    // Get all of the attribute types that we will use for schema elements.
    attributeTypesType =
         DirectoryServer.getAttributeType(ATTR_ATTRIBUTE_TYPES_LC, true);
    objectClassesType =
         DirectoryServer.getAttributeType(ATTR_OBJECTCLASSES_LC, true);
    matchingRulesType =
         DirectoryServer.getAttributeType(ATTR_MATCHING_RULES_LC, true);
    ldapSyntaxesType =
         DirectoryServer.getAttributeType(ATTR_LDAP_SYNTAXES_LC, true);
    ditContentRulesType =
         DirectoryServer.getAttributeType(ATTR_DIT_CONTENT_RULES_LC, true);
    ditStructureRulesType =
         DirectoryServer.getAttributeType(ATTR_DIT_STRUCTURE_RULES_LC, true);
    matchingRuleUsesType =
         DirectoryServer.getAttributeType(ATTR_MATCHING_RULE_USE_LC, true);
    nameFormsType = DirectoryServer.getAttributeType(ATTR_NAME_FORMS_LC, true);

    // Initialize the lastmod attributes.
    creatorsNameType =
         DirectoryServer.getAttributeType(OP_ATTR_CREATORS_NAME_LC, true);
    createTimestampType =
         DirectoryServer.getAttributeType(OP_ATTR_CREATE_TIMESTAMP_LC, true);
    modifiersNameType =
         DirectoryServer.getAttributeType(OP_ATTR_MODIFIERS_NAME_LC, true);
    modifyTimestampType =
         DirectoryServer.getAttributeType(OP_ATTR_MODIFY_TIMESTAMP_LC, true);

    // Construct the set of objectclasses to include in the schema entry.
    schemaObjectClasses = new LinkedHashMap<ObjectClass,String>(3);
    schemaObjectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP);

    ObjectClass subentryOC = DirectoryServer.getObjectClass(OC_LDAP_SUBENTRY_LC,
                                                            true);
    schemaObjectClasses.put(subentryOC, OC_LDAP_SUBENTRY);

    ObjectClass subschemaOC = DirectoryServer.getObjectClass(OC_SUBSCHEMA,
                                                             true);
    schemaObjectClasses.put(subschemaOC, OC_SUBSCHEMA);


    // Define empty sets for the supported controls and features.
    supportedControls = new HashSet<String>(0);
    supportedFeatures = new HashSet<String>(0);


    configEntryDN = configEntry.getDN();

    DN[] baseDNs = new DN[cfg.getBaseDN().size()];
    cfg.getBaseDN().toArray(baseDNs);
    this.baseDNs = baseDNs;

    creatorsName  = AttributeValues.create(
        creatorsNameType, baseDNs[0].toString());
    modifiersName =
        AttributeValues.create(
            modifiersNameType, baseDNs[0].toString());

    long createTime = DirectoryServer.getSchema().getOldestModificationTime();
    createTimestamp =
         GeneralizedTimeSyntax.createGeneralizedTimeValue(createTime);

    long modifyTime = DirectoryServer.getSchema().getYoungestModificationTime();
    modifyTimestamp =
         GeneralizedTimeSyntax.createGeneralizedTimeValue(modifyTime);


    // Get the set of user-defined attributes for the configuration entry.  Any
    // attributes that we don't recognize will be included directly in the
    // schema entry.
    userDefinedAttributes = new ArrayList<Attribute>();
    for (List<Attribute> attrs :
         configEntry.getEntry().getUserAttributes().values())
    {
      for (Attribute a : attrs)
      {
        if (! isSchemaConfigAttribute(a))
        {
          userDefinedAttributes.add(a);
        }
      }
    }
    for (List<Attribute> attrs :
         configEntry.getEntry().getOperationalAttributes().values())
    {
      for (Attribute a : attrs)
      {
        if (! isSchemaConfigAttribute(a))
        {
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

    // Check to see if there is a new set of user-defined attributes.
    ArrayList<Attribute> newUserAttrs = new ArrayList<Attribute>();
    try
    {
      ConfigEntry configEntry = DirectoryServer.getConfigEntry(configEntryDN);
      for (List<Attribute> attrs :
           configEntry.getEntry().getUserAttributes().values())
      {
        for (Attribute a : attrs)
        {
          if (! isSchemaConfigAttribute(a))
          {
            newUserAttrs.add(a);
          }
        }
      }
      for (List<Attribute> attrs :
           configEntry.getEntry().getOperationalAttributes().values())
      {
        for (Attribute a : attrs)
        {
          if (! isSchemaConfigAttribute(a))
          {
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

      Message message = ERR_CANNOT_DECODE_BACKEND_BASE_DN.get(
          DN_BACKEND_BASE, getExceptionMessage(e));
      throw new ConfigException(message, e);
    }

    ConfigEntry baseEntry = null;
    try
    {
      baseEntry = DirectoryServer.getConfigEntry(backendBaseDN);
    }
    catch (ConfigException ce)
    {
      Message message = ERR_CANNOT_RETRIEVE_BACKEND_BASE_ENTRY.get(
          DN_BACKEND_BASE, ce.getMessage());
      throw new ConfigException(message, ce);
    }
    catch (Exception e)
    {
      Message message = ERR_CANNOT_RETRIEVE_BACKEND_BASE_ENTRY.get(
          DN_BACKEND_BASE, getExceptionMessage(e));
      throw new ConfigException(message, e);
    }


    // Iterate through the immediate children, attempting to parse them as
    // backends.
    TreeMap<String,TreeSet<DN>> backendMap = new TreeMap<String,TreeSet<DN>>();
    for (ConfigEntry configEntry : baseEntry.getChildren().values())
    {
      // Get the backend ID attribute from the entry.  If there isn't one, then
      // skip the entry.
      String backendID = null;
      try
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

   */
  @Override()
  public void initializeBackend()
         throws ConfigException, InitializationException
  {
    ConfigEntry configEntry =
         DirectoryServer.getConfigEntry(configEntryDN);

    // Make sure that a configuration entry was provided.  If not, then we will
    // not be able to complete initialization.
    if (configEntry == null)
    {
      Message message = ERR_ROOTDSE_CONFIG_ENTRY_NULL.get();
      throw new ConfigException(message);
    }

    // Get the set of user-defined attributes for the configuration entry.  Any
    // attributes that we don't recognize will be included directly in the root
    // DSE.
    userDefinedAttributes = new ArrayList<Attribute>();
    for (List<Attribute> attrs :
         configEntry.getEntry().getUserAttributes().values())
    {
      for (Attribute a : attrs)
      {
        if (! isDSEConfigAttribute(a))
        {
          userDefinedAttributes.add(a);
        }
      }
    }
    for (List<Attribute> attrs :
         configEntry.getEntry().getOperationalAttributes().values())
    {
      for (Attribute a : attrs)
      {
        if (! isDSEConfigAttribute(a))
        {
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

    // Check to see if there is a new set of user-defined attributes.
    ArrayList<Attribute> userAttrs = new ArrayList<Attribute>();
    try
    {
      ConfigEntry configEntry = DirectoryServer.getConfigEntry(configEntryDN);

      for (List<Attribute> attrs :
           configEntry.getEntry().getUserAttributes().values())
      {
        for (Attribute a : attrs)
        {
          if (! isDSEConfigAttribute(a))
          {
            userAttrs.add(a);
          }
        }
      }
      for (List<Attribute> attrs :
           configEntry.getEntry().getOperationalAttributes().values())
      {
        for (Attribute a : attrs)
        {
          if (! isDSEConfigAttribute(a))
          {
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

          DN_BACKEND_BASE, getExceptionMessage(e));
      logError(message);
      return configEntries;
    }

    ConfigEntry baseEntry;
    try
    {
      baseEntry = DirectoryServer.getConfigEntry(backendBaseDN);
    }
    catch (ConfigException ce)
    {
      Message message = ERR_CANNOT_RETRIEVE_BACKEND_BASE_ENTRY.get(
          DN_BACKEND_BASE, ce.getMessage());
      logError(message);
      return configEntries;
    }
    catch (Exception e)
    {
      Message message = ERR_CANNOT_RETRIEVE_BACKEND_BASE_ENTRY.get(
          DN_BACKEND_BASE, getExceptionMessage(e));
      logError(message);
      return configEntries;
    }


    // Iterate through the immediate children, attempting to parse them as
    // backends.
    for (ConfigEntry configEntry : baseEntry.getChildren().values())
    {
      // Get the backend ID attribute from the entry.  If there isn't one, then
      // skip the entry.
      String backendID;
      try
View Full Code Here

Examples of org.nasutekds.server.config.ConfigEntry

    }

    // Get the DN of the backend configuration entry from the backup.
    DN configEntryDN = backupDir.getConfigEntryDN();

    ConfigEntry configEntry;
    try
    {
      // Get the backend configuration entry.
      configEntry = DirectoryServer.getConfigEntry(configEntryDN);
    }
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.