org.ops4j.pax.scanner
Class ProvisionSpec

java.lang.Object
  extended by org.ops4j.pax.scanner.ProvisionSpec

public class ProvisionSpec
extends java.lang.Object

Provisioning specification.

Since:
0.18.0, March 08, 2009
Author:
Alin Dreghiciu (adreghiciu@gmail.com)

Constructor Summary
ProvisionSpec(java.lang.String spec)
          Constructor.
ProvisionSpec(java.lang.String scheme, java.lang.String path, java.lang.String filter, java.lang.Integer startLevel, java.lang.Boolean shouldStart, java.lang.Boolean shouldUpdate)
           
 
Method Summary
 java.lang.String getFilter()
          Getter.
 java.util.regex.Pattern getFilterPattern()
          Getter.
 java.lang.String getPath()
          Getter.
 java.net.URL getPathAsCachedUrl()
          Getter.
 java.net.URL getPathAsUrl()
          Getter.
 java.lang.String getScheme()
          Getter.
 java.lang.Integer getStartLevel()
          Getter.
 boolean isPathValidCacheUrl()
          Verify if the path is an valid cache url.
 boolean isPathValidUrl()
          Verify if the path is an valid url.
static java.util.regex.Pattern parseFilter(java.lang.String spec)
          Parses a usual filter into a regex pattern.
 java.lang.Boolean shouldStart()
          Getter.
 java.lang.Boolean shouldUpdate()
          Getter.
 java.lang.String toExternalForm()
          Constructs a string representation of this provision spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProvisionSpec

public ProvisionSpec(java.lang.String spec)
              throws MalformedSpecificationException
Constructor.

Parameters:
spec - provisioning spec
Throws:
MalformedSpecificationException - - If spec is null - If spec is empty - If provisioning scheme is not specified - Starts or ends with ServiceConstants.SEPARATOR_OPTION

ProvisionSpec

public ProvisionSpec(java.lang.String scheme,
                     java.lang.String path,
                     java.lang.String filter,
                     java.lang.Integer startLevel,
                     java.lang.Boolean shouldStart,
                     java.lang.Boolean shouldUpdate)
              throws MalformedSpecificationException
Throws:
MalformedSpecificationException
Method Detail

getScheme

public java.lang.String getScheme()
Getter.

Returns:
scheme

getPath

public java.lang.String getPath()
Getter.

Returns:
path

getPathAsUrl

public java.net.URL getPathAsUrl()
                          throws java.net.MalformedURLException
Getter.

Returns:
path as URL
Throws:
java.net.MalformedURLException - - If occured while creating the URL

getPathAsCachedUrl

public java.net.URL getPathAsCachedUrl()
                                throws java.net.MalformedURLException
Getter.

Returns:
path as URL
Throws:
java.net.MalformedURLException - - If occured while creating the URL

isPathValidUrl

public boolean isPathValidUrl()
Verify if the path is an valid url.

Returns:
true if path is a valid url, false otherwise

isPathValidCacheUrl

public boolean isPathValidCacheUrl()
Verify if the path is an valid cache url.

Returns:
true if path is a valid url, false otherwise

parseFilter

public static java.util.regex.Pattern parseFilter(java.lang.String spec)
                                           throws MalformedSpecificationException
Parses a usual filter into a regex pattern.

Parameters:
spec - the filter to be parsed
Returns:
a regexp pattern corresponding to the filter
Throws:
MalformedSpecificationException - - If the filter could not be compiled to a pattern

getStartLevel

public java.lang.Integer getStartLevel()
Getter.

Returns:
start level if option present, null otherwise

shouldStart

public java.lang.Boolean shouldStart()
Getter.

Returns:
true scanned bundles should be started, false otherwise if option is present, null otherwise

shouldUpdate

public java.lang.Boolean shouldUpdate()
Getter.

Returns:
true scanned bundles should be updated, false otherwise if option is present, null otherwise

getFilter

public java.lang.String getFilter()
Getter.

Returns:
filter

getFilterPattern

public java.util.regex.Pattern getFilterPattern()
Getter.

Returns:
filter

toExternalForm

public java.lang.String toExternalForm()
Constructs a string representation of this provision spec.

Returns:
a string representation of the object


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.