org.rhq.core.domain.content
Class PackageType

java.lang.Object
  extended by org.rhq.core.domain.content.PackageType
All Implemented Interfaces:
Serializable

public class PackageType
extends Object
implements Serializable

Defines a type of Package that can exist in the system. Package types are used to provide information about the content of a particular package. Plugins can then use this information to provide clues on how to deal with a package.

A package type is defined by a resource type and is only supported by its parent resource type. A resource type can support multiple package types.

See Also:
Serialized Form

Field Summary
static String QUERY_FIND_BY_RESOURCE_TYPE_ID
           
static String QUERY_FIND_BY_RESOURCE_TYPE_ID_AND_CREATION_FLAG
           
static String QUERY_FIND_BY_RESOURCE_TYPE_ID_AND_NAME
           
 
Constructor Summary
PackageType()
           
PackageType(String name, ResourceType resourceType)
           
 
Method Summary
 void addPackage(Package pkg)
           
 void afterUnmarshal(javax.xml.bind.Unmarshaller u, Object resourceType)
           
 boolean equals(Object obj)
           
 PackageCategory getCategory()
          Describes the type of content in this package.
 ConfigurationDefinition getDeploymentConfigurationDefinition()
          Defines the properties the user should be prompted to enter when deploying a package of this type.
 String getDescription()
          Free text description of this package type.
 long getDiscoveryInterval()
          Time, in milliseconds, between discovery scans for packages of this type.
 String getDisplayName()
          Name of this package type that is suitable for display to the user in the UI.
 int getId()
           
 String getName()
          Programmatic name of the package type.
 ConfigurationDefinition getPackageExtraPropertiesDefinition()
          A package type may have the need to indicate more data about a package than the package entity allows.
 Set<Package> getPackages()
          The packages of this type.
 ResourceType getResourceType()
          The resource type that defined this package type.
 int hashCode()
           
 boolean isCreationData()
          Indicates if this type of package must be specified when a new instance of the parent resource type is created.
 boolean isSupportsArchitecture()
          Indicates if this package type will be of any specific architecture.
 void setCategory(PackageCategory category)
           
 void setCreationData(boolean creationData)
           
 void setDeploymentConfigurationDefinition(ConfigurationDefinition deploymentConfigurationDefinition)
           
 void setDescription(String description)
           
 void setDiscoveryInterval(long discoveryInterval)
           
 void setDisplayName(String displayName)
           
 void setId(int id)
           
 void setName(String name)
           
 void setPackageExtraPropertiesDefinition(ConfigurationDefinition packageExtraPropertiesDefinition)
           
 void setPackages(Set<Package> packages)
           
 void setResourceType(ResourceType resourceType)
           
 void setSupportsArchitecture(boolean supportsArchitecture)
           
 String toString()
           
 void update(PackageType newType)
          Updates the contents of this definition with values from the specified new defintion.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_FIND_BY_RESOURCE_TYPE_ID

public static final String QUERY_FIND_BY_RESOURCE_TYPE_ID
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_TYPE_ID_AND_NAME

public static final String QUERY_FIND_BY_RESOURCE_TYPE_ID_AND_NAME
See Also:
Constant Field Values

QUERY_FIND_BY_RESOURCE_TYPE_ID_AND_CREATION_FLAG

public static final String QUERY_FIND_BY_RESOURCE_TYPE_ID_AND_CREATION_FLAG
See Also:
Constant Field Values
Constructor Detail

PackageType

public PackageType()

PackageType

public PackageType(String name,
                   ResourceType resourceType)
Method Detail

afterUnmarshal

public void afterUnmarshal(javax.xml.bind.Unmarshaller u,
                           Object resourceType)

getId

public int getId()

setId

public void setId(int id)

getName

public String getName()
Programmatic name of the package type.


setName

public void setName(String name)

getDisplayName

public String getDisplayName()
Name of this package type that is suitable for display to the user in the UI.


setDisplayName

public void setDisplayName(String displayName)

getDescription

public String getDescription()
Free text description of this package type.


setDescription

public void setDescription(String description)

getCategory

public PackageCategory getCategory()
Describes the type of content in this package.


setCategory

public void setCategory(PackageCategory category)

getDiscoveryInterval

public long getDiscoveryInterval()
Time, in milliseconds, between discovery scans for packages of this type.


setDiscoveryInterval

public void setDiscoveryInterval(long discoveryInterval)

isCreationData

public boolean isCreationData()
Indicates if this type of package must be specified when a new instance of the parent resource type is created.


setCreationData

public void setCreationData(boolean creationData)

isSupportsArchitecture

public boolean isSupportsArchitecture()
Indicates if this package type will be of any specific architecture. If this is true, each package may be of a different architecture. If this is false, all packages will be of architecture "noarch".


setSupportsArchitecture

public void setSupportsArchitecture(boolean supportsArchitecture)

getDeploymentConfigurationDefinition

public ConfigurationDefinition getDeploymentConfigurationDefinition()
Defines the properties the user should be prompted to enter when deploying a package of this type. These are settings that tell the plugin information that it will need in order to successfully install the package. For example, a typical deployment property would be a directory location to indicate where the package should be installed.


setDeploymentConfigurationDefinition

public void setDeploymentConfigurationDefinition(ConfigurationDefinition deploymentConfigurationDefinition)

getPackageExtraPropertiesDefinition

public ConfigurationDefinition getPackageExtraPropertiesDefinition()
A package type may have the need to indicate more data about a package than the package entity allows. Packages of this type can provide values for each property defined here to further describe the package. These extra properties are not for deployment-time configuration settings. They are merely used to further describe the package in a way custom to the package type. For example, a typical extra property would be the name of the vendor that created the package.


setPackageExtraPropertiesDefinition

public void setPackageExtraPropertiesDefinition(ConfigurationDefinition packageExtraPropertiesDefinition)

getPackages

public Set<Package> getPackages()
The packages of this type.


addPackage

public void addPackage(Package pkg)

setPackages

public void setPackages(Set<Package> packages)

getResourceType

public ResourceType getResourceType()
The resource type that defined this package type. Resources of this resource type can have packages of this package type installed on them.


setResourceType

public void setResourceType(ResourceType resourceType)

update

public void update(PackageType newType)
Updates the contents of this definition with values from the specified new defintion. The intention is for this to be used as a merge between this attached instance and a detached instance. The name and resourceTypes will NOT be updated as part of this call; they are used as identifiers and should already be the same if this merge is being performed.

Parameters:
newType - contains new data to merge into this definition; cannot be null

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.