<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you 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.
  -->

<plexus>
  <components>
    <!--
     | Logger manager
     -->
    <component>
      <role>org.codehaus.plexus.logging.LoggerManager</role>
      <implementation>org.codehaus.plexus.logging.slf4j.Slf4jLoggerManager</implementation>
      <lifecycle-handler>basic</lifecycle-handler>
    </component>

    <!--
     | Configuration
     -->
    <component>
      <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
      <implementation>org.apache.maven.archiva.configuration.DefaultArchivaConfiguration</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.registry.Registry</role>
          <role-hint>configured</role-hint>
        </requirement>
        <requirement>
          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
          <field-name>prePolicies</field-name>
        </requirement>
        <requirement>
          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
          <field-name>postPolicies</field-name>
        </requirement>
      </requirements>
    </component>
    <component>
      <role>org.codehaus.plexus.registry.Registry</role>
      <role-hint>configured</role-hint>
      <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
      <configuration>
        <properties>
          <system/>
          <xml fileName="${appserver.base}/conf/archiva.xml"
               config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
        </properties>
      </configuration>
    </component>
    
    <component>
      <role>org.codehaus.plexus.webdav.DavServerManager</role>
      <role-hint>default</role-hint>
      <implementation>org.codehaus.plexus.webdav.DefaultDavServerManager</implementation>
      <description>DefaultDavServerManager</description>
      <configuration>
        <provider-hint>proxied</provider-hint>
      </configuration>
    </component>
    
    <component>
      <role>org.codehaus.plexus.cache.Cache</role>
      <role-hint>url-failures-cache</role-hint>
      <implementation>org.codehaus.plexus.cache.ehcache.EhcacheCache</implementation>
      <description>URL Failure Cache</description>
      <configuration>
        <disk-expiry-thread-interval-seconds>600</disk-expiry-thread-interval-seconds>
        <disk-persistent>false</disk-persistent> <!--disabling disk persistence for unit testing. -->
        <disk-store-path>${java.io.tmpdir}/archiva/urlcache</disk-store-path>
        <eternal>false</eternal>
        <max-elements-in-memory>1000</max-elements-in-memory>
        <memory-eviction-policy>LRU</memory-eviction-policy>
        <name>url-failures-cache</name>
        <overflow-to-disk>false</overflow-to-disk>
        <!-- 45 minutes = 2700 seconds -->
        <time-to-idle-seconds>2700</time-to-idle-seconds>
        <!-- 30 minutes = 1800 seconds  -->
        <time-to-live-seconds>1800</time-to-live-seconds>
      </configuration>
    </component>    
    
    
    <!-- Don't drag in the world just to test this -->
    <component>
      <role>org.apache.maven.archiva.repository.scanner.RepositoryContentConsumers</role>
      <role-hint>default</role-hint>
      <implementation>org.apache.maven.archiva.web.repository.StubRepositoryContentConsumers</implementation>
    </component>

    <!-- TODO: shouldn't need so many components just to use in-memory - is flaky since these are auto-generated -->
    <component>
      <role>org.codehaus.plexus.redback.system.SecuritySystem</role>
      <role-hint>default</role-hint>
      <implementation>org.codehaus.plexus.redback.system.DefaultSecuritySystem</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.authentication.AuthenticationManager</role>
          <field-name>authnManager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.authorization.Authorizer</role>
          <role-hint>rbac</role-hint>
          <field-name>authorizer</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.users.UserManager</role>
          <role-hint>memory</role-hint>
          <field-name>userManager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.keys.KeyManager</role>
          <role-hint>memory</role-hint>
          <field-name>keyManager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
          <field-name>policy</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.authentication.Authenticator</role>
      <role-hint>user-manager</role-hint>
      <implementation>org.codehaus.plexus.redback.authentication.users.UserManagerAuthenticator</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.users.UserManager</role>
          <role-hint>memory</role-hint>
          <field-name>userManager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
          <field-name>securityPolicy</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.authentication.Authenticator</role>
      <role-hint>keystore</role-hint>
      <implementation>org.codehaus.plexus.redback.authentication.keystore.KeyStoreAuthenticator</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.keys.KeyManager</role>
          <role-hint>memory</role-hint>
          <field-name>keystore</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.users.UserManager</role>
          <role-hint>memory</role-hint>
          <field-name>userManager</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
      <role-hint>default</role-hint>
      <implementation>org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator
      </implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.users.UserManager</role>
          <role-hint>memory</role-hint>
          <field-name>userManager</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.authorization.Authorizer</role>
      <role-hint>rbac</role-hint>
      <implementation>org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
          <role-hint>memory</role-hint>
          <field-name>manager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.users.UserManager</role>
          <role-hint>memory</role-hint>
          <field-name>userManager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
          <role-hint>default</role-hint>
          <field-name>evaluator</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.role.RoleManager</role>
      <role-hint>default</role-hint>
      <implementation>org.codehaus.plexus.redback.role.DefaultRoleManager</implementation>
      <instantiation-strategy>singleton</instantiation-strategy>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.role.merger.RoleModelMerger</role>
          <role-hint>default</role-hint>
          <field-name>modelMerger</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.role.validator.RoleModelValidator</role>
          <role-hint>default</role-hint>
          <field-name>modelValidator</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
          <role-hint>default</role-hint>
          <field-name>modelProcessor</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
          <role-hint>default</role-hint>
          <field-name>templateProcessor</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
          <role-hint>memory</role-hint>
          <field-name>rbacManager</field-name>
        </requirement>
        <requirement>
          <role>org.codehaus.plexus.PlexusContainer</role>
          <field-name>container</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
      <role-hint>default</role-hint>
      <implementation>org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
          <role-hint>memory</role-hint>
          <field-name>rbacManager</field-name>
        </requirement>
      </requirements>
    </component>

    <component>
      <role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
      <role-hint>default</role-hint>
      <implementation>org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor</implementation>
      <requirements>
        <requirement>
          <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
          <role-hint>memory</role-hint>
          <field-name>rbacManager</field-name>
        </requirement>
      </requirements>
    </component>
  </components>
</plexus>
