/*
 * 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.
 */
package org.apache.sling.installer.api;

/**
 * OSGi Service that installs/updates/removes installable data
 * {@link InstallableResource} in the OSGi framework.
 *
 * The client can register a number of such resources, and the
 * installer decides based on the resource weights, bundle version
 * numbers, etc. which ones are actually installed.
 *
 * An InstallableResource can be a bundle, a configuration, and later
 * we might support deployment packages as well.
 */
public interface OsgiInstaller {

	/**
	 * Provide the installer with the complete list of installable
	 * resources for a given client.
	 *
	 * Client must call this at startup and/or when the installer
	 * service becomes available. The installer stores the list of
	 * previously registered/added resources, compares with the new
	 * list and removes resources that have disappeared.
	 *
     * Invalid resources are ignored.
	 *
     * @param urlScheme identifies the client.
	 * @param resources the list of available resources
	 */
	void registerResources(String urlScheme, InstallableResource[] resources);

    /**
	 * Inform the installer that resources are available for installation
	 * and/or other resources are no longer available.
	 * This method is called if
	 * - installed resources have been modified
	 * - new resources are available
	 * - installed resources should be uninstalled
	 * Invalid resources are ignored.
     * @param urlScheme identifies the client.
     * @param resource An array of updated/new resources - might be null
     * @param ids An array of identifiers for removed resources - might be null
	 */
	void updateResources(String urlScheme, InstallableResource[] resources,
	        String[] ids);
}
@@ -848,21 +848,16 @@
 %0A%0A/**%0A *
- OSGi
  Service
@@ -861,20 +861,19 @@
 ice 
-that
+for
  install
 s/up
@@ -872,25 +872,29 @@
 tall
-s
+ing
 /updat
-es
+ing
 /remov
-es
+ing
  ins
@@ -906,12 +906,17 @@
 ble 
-data
+resources
 %0A * 
@@ -946,19 +946,18 @@
 rce%7D in 
-the
+an
  OSGi fr
@@ -979,303 +979,1408 @@
 The 
-client can register a number of such resources, and the%0A * installer decides based o
+resources are provided by provider components which are%0A * clients of this API. For example a file directory provider might%0A * scan a directory in the file system and provide the artifacts%0A * contained in the configured directory.%0A *%0A * When such a client starts it should first call%0A * %7B@link #registerResources(String, InstallableResource%5B%5D)%7D and%0A * inform this service about all available resources. In the case%0A * of a file directory provider, this list would contain all%0A * files found i
 n the 
-resource weights, bundle version%0A * numbers, etc. which ones are actually installed.%0A *%0A * An InstallableResource
+directory (and sub directories). This is%0A * the rendezvous point. The OSGi installer service compares this%0A * complete list with previous lists it might have and triggers%0A * corresponding tasks like installing new artifacts and%0A * uninstalling removed artifacts.%0A *%0A * Once this rendezvous has been done between a client and the%0A * OSGi installe, the client calls%0A * %7B@link #updateResources(String, InstallableResource%5B%5D, String%5B%5D)%7D%0A * to inform about
  c
+h
 an
- be a bundle, a configuration, and later%0A * we might support deployment packages as well
+ges like new resources or removed resources.%0A *%0A * A single provider should never call these methods in parallel,%0A * before calling any method a previous call must have finished!%0A *%0A * The OSGi installer detects the resources and based on their type%0A * and metadata, the installer decides whether to install them,%0A * update an already installed artifact or simply ignore them.%0A * For example, for bundles the symbolic name and the version is used
 .%0A *

Update javadocs