001    /*
002     * $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 $
003     *
004     * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
005     *
006     * Licensed under the Apache License, Version 2.0 (the "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *      http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     */
018    
019    // This document is an experimental draft to enable interoperability
020    // between bundle repositories. There is currently no commitment to 
021    // turn this draft into an official specification.  
022    package org.osgi.service.obr;
023    
024    import java.net.URL;
025    import java.util.Map;
026    
027    import org.osgi.framework.Version;
028    
029    /**
030     * A resource is an abstraction of a downloadable thing, like a bundle.
031     * 
032     * Resources have capabilities and requirements. All a resource's requirements
033     * must be satisfied before it can be installed.
034     * 
035     * @version $Revision: 1.5 $
036     */
037    public interface Resource
038    {
039        final String LICENSE_URL = "license";
040    
041        final String DESCRIPTION = "description";
042    
043        final String DOCUMENTATION_URL = "documentation";
044    
045        final String COPYRIGHT = "copyright";
046    
047        final String SOURCE_URL = "source";
048    
049        final String SYMBOLIC_NAME = "symbolicname";
050    
051        final String PRESENTATION_NAME = "presentationname";
052    
053        final String ID = "id";
054    
055        final String VERSION = "version";
056    
057        final String URL = "url";
058    
059        final String SIZE = "size";
060    
061        final static String[] KEYS = { DESCRIPTION, SIZE, ID, LICENSE_URL,
062                DOCUMENTATION_URL, COPYRIGHT, SOURCE_URL, PRESENTATION_NAME,
063                SYMBOLIC_NAME, VERSION, URL };
064    
065        // get readable name
066    
067        Map getProperties();
068    
069        String getSymbolicName();
070    
071        String getPresentationName();
072    
073        Version getVersion();
074    
075        String getId();
076    
077        URL getURL();
078    
079        Requirement[] getRequirements();
080    
081        Capability[] getCapabilities();
082    
083        String[] getCategories();
084    
085        Repository getRepository();
086    }