org.rhq.enterprise.server.plugin.pc.content
Interface PackageTypeBehavior

All Known Implementing Classes:
AbstractPackageTypeBehavior

public interface PackageTypeBehavior

The package types are either defined in the agent plugin descriptors or by the server-side package type plugins. The server-side plugins define a "behaviorClass" that implements this interface to provide additional runtime "hooks" controlling the package type behavior.

Author:
Lukas Krejci

Method Summary
 Comparator<PackageVersion> getPackageVersionComparator(String packageTypeName)
          This comparator will be used to determine the latest version of a package.
 PackageVersionFormatDescription getPackageVersionFormat(String packageTypeName)
          Description of the package version format mandated by the package type.
 void validateDetails(ValidatablePackageDetailsKey key, Subject origin)
          Validate the package before it gets stored.
 

Method Detail

validateDetails

void validateDetails(ValidatablePackageDetailsKey key,
                     Subject origin)
                     throws PackageDetailsValidationException
Validate the package before it gets stored.

Parameters:
key - the package details key
origin - who is uploading the package
Throws:
PackageDetailsValidationException

getPackageVersionComparator

Comparator<PackageVersion> getPackageVersionComparator(String packageTypeName)
This comparator will be used to determine the latest version of a package. It should sort the package versions from the "oldest" to the "youngest", i.e. when comparing
comparator.compare(older, younger)
the comparator should return a value < 0.

Parameters:
packageTypeName - the name of the package type
Returns:
a comparator to use when sorting the package versions or null if PackageVersion.DEFAULT_COMPARATOR should be used.

getPackageVersionFormat

PackageVersionFormatDescription getPackageVersionFormat(String packageTypeName)
Description of the package version format mandated by the package type.

Returns:
the package version format description


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.