felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r572697 [4/4] - in /felix/sandbox/clement/maven-obr-plugin: ./ src/ src/main/ src/main/java/ src/main/java/bundles/ src/main/java/bundles/obr/ src/main/java/bundles/obr/resource/ src/main/java/org/ src/main/java/org/apache/ src/main/java/or...
Date Tue, 04 Sep 2007 14:52:51 GMT
Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/CapabilityProvider.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/CapabilityProvider.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/CapabilityProvider.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/CapabilityProvider.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,49 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/CapabilityProvider.java,v
1.3 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+/**
+ * This service interface allows third parties to provide capabilities that are
+ * present on the system but not encoded in the bundle's manifests. For example,
+ * a capability provider could provide:
+ * <ol>
+ * <li>A Set of certificates</li>
+ * <li>Dimensions of the screen</li>
+ * <li>Amount of memory</li>
+ * <li>...</li>
+ * </ol>
+ * 
+ * @version $Revision: 1.3 $
+ */
+public interface CapabilityProvider
+{
+    /**
+     * Return a set of capabilities.
+     * 
+     * These capabilities are considered part of the platform. Bundles can
+     * require these capabilities during selection. All capabilities from
+     * different providers are considered part of the platform.
+     * 
+     * @return Set of capabilities
+     */
+    Capability[] getCapabilities();
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Repository.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Repository.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Repository.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Repository.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,53 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Repository.java,v
1.3 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+import java.net.URL;
+
+/**
+ * Represents a repository.
+ * 
+ * @version $Revision: 1.3 $
+ */
+public interface Repository
+{
+    /**
+     * Return the associated URL for the repository.
+     * 
+     */
+    URL getURL();
+
+    /**
+     * Return the resources for this repository.
+     */
+    Resource[] getResources();
+
+    /**
+     * Return the name of this reposotory.
+     * 
+     * @return a non-null name
+     */
+    String getName();
+
+    long getLastModified();
+
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryAdmin.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,104 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/RepositoryAdmin.java,v
1.3 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+import java.net.URL;
+
+/**
+ * Provides centralized access to the distributed repository.
+ * 
+ * A repository contains a set of <i>resources</i>. A resource contains a
+ * number of fixed attributes (name, version, etc) and sets of:
+ * <ol>
+ * <li>Capabilities - Capabilities provide a named aspect: a bundle, a display,
+ * memory, etc.</li>
+ * <li>Requirements - A named filter expression. The filter must be satisfied
+ * by one or more Capabilties with the given name. These capabilities can come
+ * from other resources or from the platform. If multiple resources provide the
+ * requested capability, one is selected. (### what algorithm? ###)</li>
+ * <li>Requests - Requests are like requirements, except that a request can be
+ * fullfilled by 0..n resources. This feature can be used to link to resources
+ * that are compatible with the given resource and provide extra functionality.
+ * For example, a bundle could request all its known fragments. The UI
+ * associated with the repository could list these as optional downloads.</li>
+ * 
+ * @version $Revision: 1.3 $
+ */
+public interface RepositoryAdmin
+{
+    /**
+     * Discover any resources that match the given filter.
+     * 
+     * This is not a detailed search, but a first scan of applicable resources.
+     * 
+     * ### Checking the capabilities of the filters is not possible because that
+     * requires a new construct in the filter.
+     * 
+     * The filter expression can assert any of the main headers of the resource.
+     * The attributes that can be checked are:
+     * 
+     * <ol>
+     * <li>name</li>
+     * <li>version (uses filter matching rules)</li>
+     * <li>description</li>
+     * <li>category</li>
+     * <li>copyright</li>
+     * <li>license</li>
+     * <li>source</li>
+     * </ol>
+     * 
+     * @param filterExpr
+     *            A standard OSGi filter
+     * @return List of resources matching the filters.
+     */
+    Resource[] discoverResources(String filterExpr);
+
+    /**
+     * Create a resolver.
+     * 
+     * @param resource
+     * @return
+     */
+    Resolver resolver();
+
+    /**
+     * Add a new repository to the federation.
+     * 
+     * The url must point to a repository XML file.
+     * 
+     * @param repository
+     * @return
+     * @throws Exception
+     */
+    Repository addRepository(URL repository) throws Exception;
+
+    boolean removeRepository(URL repository);
+
+    /**
+     * List all the repositories.
+     * 
+     * @return
+     */
+    Repository[] listRepositories();
+
+    Resource getResource(String respositoryId);
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryPermission.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryPermission.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryPermission.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/RepositoryPermission.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,40 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/RepositoryPermission.java,v
1.3 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+import java.security.BasicPermission;
+
+/**
+ * TODO OBR - Implement repository permission.
+ * 
+ * @version $Revision: 1.3 $
+ */
+public class RepositoryPermission extends BasicPermission
+{
+
+    public RepositoryPermission(String name)
+    {
+        super(name);
+
+    }
+
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Requirement.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Requirement.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Requirement.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Requirement.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,53 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Requirement.java,v
1.4 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+/**
+ * A named requirement specifies the need for certain capabilities with the same
+ * name.
+ * 
+ * @version $Revision: 1.4 $
+ */
+public interface Requirement
+{
+
+    /**
+     * Return the name of the requirement.
+     */
+    String getName();
+
+    /**
+     * Return the filter.
+     * 
+     */
+    String getFilter();
+
+    boolean isMultiple();
+
+    boolean isOptional();
+
+    boolean isExtend();
+
+    String getComment();
+
+    boolean isSatisfied(Capability capability);
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resolver.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resolver.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resolver.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resolver.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,44 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Resolver.java,v
1.3 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+public interface Resolver
+{
+
+    void add(Resource resource);
+
+    Requirement[] getUnsatisfiedRequirements();
+
+    Resource[] getOptionalResources();
+
+    Requirement[] getReason(Resource resource);
+
+    Resource[] getResources(Requirement requirement);
+
+    Resource[] getRequiredResources();
+
+    Resource[] getAddedResources();
+
+    boolean resolve();
+
+    void deploy(boolean start);
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resource.java
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resource.java?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resource.java
(added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/java/org/osgi/service/obr/Resource.java
Tue Sep  4 07:52:47 2007
@@ -0,0 +1,86 @@
+/*
+ * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Resource.java,v
1.5 2006/03/16 14:56:17 hargrave Exp $
+ *
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ *
+ * Licensed 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.
+ */
+
+// This document is an experimental draft to enable interoperability
+// between bundle repositories. There is currently no commitment to 
+// turn this draft into an official specification.  
+package org.osgi.service.obr;
+
+import java.net.URL;
+import java.util.Map;
+
+import org.osgi.framework.Version;
+
+/**
+ * A resource is an abstraction of a downloadable thing, like a bundle.
+ * 
+ * Resources have capabilities and requirements. All a resource's requirements
+ * must be satisfied before it can be installed.
+ * 
+ * @version $Revision: 1.5 $
+ */
+public interface Resource
+{
+    final String LICENSE_URL = "license";
+
+    final String DESCRIPTION = "description";
+
+    final String DOCUMENTATION_URL = "documentation";
+
+    final String COPYRIGHT = "copyright";
+
+    final String SOURCE_URL = "source";
+
+    final String SYMBOLIC_NAME = "symbolicname";
+
+    final String PRESENTATION_NAME = "presentationname";
+
+    final String ID = "id";
+
+    final String VERSION = "version";
+
+    final String URL = "url";
+
+    final String SIZE = "size";
+
+    final static String[] KEYS = { DESCRIPTION, SIZE, ID, LICENSE_URL,
+            DOCUMENTATION_URL, COPYRIGHT, SOURCE_URL, PRESENTATION_NAME,
+            SYMBOLIC_NAME, VERSION, URL };
+
+    // get readable name
+
+    Map getProperties();
+
+    String getSymbolicName();
+
+    String getPresentationName();
+
+    Version getVersion();
+
+    String getId();
+
+    URL getURL();
+
+    Requirement[] getRequirements();
+
+    Capability[] getCapabilities();
+
+    String[] getCategories();
+
+    Repository getRepository();
+}
\ No newline at end of file

Added: felix/sandbox/clement/maven-obr-plugin/src/main/resources/SchemaObr.xsd
URL: http://svn.apache.org/viewvc/felix/sandbox/clement/maven-obr-plugin/src/main/resources/SchemaObr.xsd?rev=572697&view=auto
==============================================================================
--- felix/sandbox/clement/maven-obr-plugin/src/main/resources/SchemaObr.xsd (added)
+++ felix/sandbox/clement/maven-obr-plugin/src/main/resources/SchemaObr.xsd Tue Sep  4 07:52:47
2007
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+<!-- definition of simple elements -->
+
+<!-- definition of attribute  -->
+<xs:attribute name="name"     type="xs:string"/>
+<xs:attribute name="filter"   type="xs:string"/>
+<xs:attribute name="extend"   type="xs:boolean"/>
+<xs:attribute name="multiple" type="xs:boolean"/>
+<xs:attribute name="optional" type="xs:boolean"/>
+<xs:attribute name="id" type="xs:string"/>
+<xs:attribute name="n" type="xs:string"/>
+<xs:attribute name="v" type="xs:string"/>
+<xs:attribute name="t" type="xs:string"/>
+
+<xs:element name="require">
+  <xs:complexType mixed="true">
+    <xs:attribute ref="name"     use="required"/>
+    <xs:attribute ref="filter"   use="required"/>
+    <xs:attribute ref="extend"   use="required"/>
+    <xs:attribute ref="multiple" use="required"/>
+    <xs:attribute ref="optional" use="required"/>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="category">
+  <xs:complexType>
+	<xs:attribute ref="id" use="required"/>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="p">
+  <xs:complexType>
+	<xs:attribute ref="n" use="required"/>
+    <xs:attribute ref="v" use="required"/>
+    <xs:attribute ref="t" />
+  </xs:complexType>
+</xs:element>
+
+
+<xs:element name="capability">
+  <xs:complexType>
+    <xs:sequence>
+  		<xs:element ref="p" minOccurs="0" maxOccurs="unbounded"/>
+	</xs:sequence>
+  </xs:complexType>
+</xs:element>
+
+<xs:element name="resource">
+  <xs:complexType>
+    <xs:sequence>
+		  <xs:element ref="capability" minOccurs="0" maxOccurs="unbounded"/> 
+		  <xs:element ref="require" minOccurs="0" maxOccurs="unbounded"/> 
+		  <xs:element ref="category" minOccurs="0" maxOccurs="unbounded"/> 
+	</xs:sequence>
+  </xs:complexType>
+</xs:element>
+</xs:schema>
\ No newline at end of file



Mime
View raw message