[jboss-cvs] JBossAS SVN: r62522 - in projects/osgi/trunk: repository and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Apr 24 16:42:43 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-04-24 16:42:43 -0400 (Tue, 24 Apr 2007)
New Revision: 62522

Added:
   projects/osgi/trunk/repository/
   projects/osgi/trunk/repository/src/
   projects/osgi/trunk/repository/src/main/
   projects/osgi/trunk/repository/src/main/org/
   projects/osgi/trunk/repository/src/main/org/osgi/
   projects/osgi/trunk/repository/src/main/org/osgi/service/
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Capability.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/CapabilityProvider.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Repository.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryAdmin.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryPermission.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Requirement.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resolver.java
   projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resource.java
Log:
Create OBR codebase with current org.osgi.service.obr.* interfaces

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Capability.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Capability.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Capability.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.osgi.service.obr;
+
+import java.util.Map;
+
+/**
+ * A named set of properties representing some capability that is provided by
+ * its owner.
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+public interface Capability
+{
+    /**
+     * Return the name of the capability.
+     * 
+     */
+    String getName();
+
+    /**
+     * Return the set of properties.
+     * 
+     * Notice that the value of the properties is a list of values.
+     * 
+     * @return a Map<String,List>
+     */
+    Map getProperties();
+}
\ No newline at end of file


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Capability.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/CapabilityProvider.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/CapabilityProvider.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/CapabilityProvider.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+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>
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+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


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/CapabilityProvider.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Repository.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Repository.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Repository.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.osgi.service.obr;
+
+import java.net.URL;
+
+/**
+ * Represents a repository.
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+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


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Repository.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryAdmin.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryAdmin.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryAdmin.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+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>
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+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


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryAdmin.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryPermission.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryPermission.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryPermission.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.osgi.service.obr;
+
+import java.security.BasicPermission;
+
+/**
+ * TODO OBR - Implement repository permission.
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+public class RepositoryPermission extends BasicPermission
+{
+
+    public RepositoryPermission(String name)
+    {
+        super(name);
+
+    }
+
+}
\ No newline at end of file


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/RepositoryPermission.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Requirement.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Requirement.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Requirement.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.osgi.service.obr;
+
+/**
+ * A named requirement specifies the need for certain capabilities with the same
+ * name.
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+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


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Requirement.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resolver.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resolver.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resolver.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.osgi.service.obr;
+
+/**
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+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


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resolver.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native

Added: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resource.java
===================================================================
--- projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resource.java	                        (rev 0)
+++ projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resource.java	2007-04-24 20:42:43 UTC (rev 62522)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */  
+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.
+ * 
+ * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
+ * 
+ * @version $Revision$
+ */
+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


Property changes on: projects/osgi/trunk/repository/src/main/org/osgi/service/obr/Resource.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list