org.apache.sling.commons.osgi.bundleversion
Class BundleVersionInfo<T>

java.lang.Object
  extended by org.apache.sling.commons.osgi.bundleversion.BundleVersionInfo<T>
All Implemented Interfaces:
Comparable<BundleVersionInfo<?>>
Direct Known Subclasses:
BundleBundleVersionInfo, FileBundleVersionInfo

public abstract class BundleVersionInfo<T>
extends Object
implements Comparable<BundleVersionInfo<?>>

Provides bundle version information, which can be extracted from bundle files or Bundle objects.


Field Summary
static String BND_LAST_MODIFIED
          Name of the BND attribute that provides the bundle's last modified timestamp
static long BND_LAST_MODIFIED_MISSING
          Value for getBundleLastModified() if corresponding header is not present
static String SNAPSHOT_MARKER
          Marker used by Maven to identify snapshots
 
Constructor Summary
BundleVersionInfo()
           
 
Method Summary
 int compareTo(BundleVersionInfo<?> other)
          Compare based on bundle version info, and for snapshots based on getBundleLastModified()
abstract  long getBundleLastModified()
          Return the bundle last modification time, based on the BND_LAST_MODIFIED manifest header, if available.
abstract  String getBundleSymbolicName()
          Return the bundle symbolic name, null if not available
abstract  T getSource()
          Return the source of information: underlying File or Bundle
abstract  org.osgi.framework.Version getVersion()
          Return the bundle version, null if not available
abstract  boolean isBundle()
          True if the provided data is a valid bundle
abstract  boolean isSnapshot()
          True if the bundle version indicates a snapshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SNAPSHOT_MARKER

public static final String SNAPSHOT_MARKER
Marker used by Maven to identify snapshots

See Also:
Constant Field Values

BND_LAST_MODIFIED

public static final String BND_LAST_MODIFIED
Name of the BND attribute that provides the bundle's last modified timestamp

See Also:
Constant Field Values

BND_LAST_MODIFIED_MISSING

public static final long BND_LAST_MODIFIED_MISSING
Value for getBundleLastModified() if corresponding header is not present

See Also:
Constant Field Values
Constructor Detail

BundleVersionInfo

public BundleVersionInfo()
Method Detail

getSource

public abstract T getSource()
Return the source of information: underlying File or Bundle


isBundle

public abstract boolean isBundle()
True if the provided data is a valid bundle


getBundleSymbolicName

public abstract String getBundleSymbolicName()
Return the bundle symbolic name, null if not available


getVersion

public abstract org.osgi.framework.Version getVersion()
Return the bundle version, null if not available


isSnapshot

public abstract boolean isSnapshot()
True if the bundle version indicates a snapshot


getBundleLastModified

public abstract long getBundleLastModified()
Return the bundle last modification time, based on the BND_LAST_MODIFIED manifest header, if available. This is *not* the Bundle.getLastModified() value, which refers to actions in the OSGi framework.

Returns:
BND_LAST_MODIFIED_MISSING if header not supplied

compareTo

public int compareTo(BundleVersionInfo<?> other)
Compare based on bundle version info, and for snapshots based on getBundleLastModified()

Specified by:
compareTo in interface Comparable<BundleVersionInfo<?>>


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.