@Entity public class ViewEntity extends Object
Constructor and Description |
---|
ViewEntity()
Construct a view entity.
|
ViewEntity(ViewConfig configuration,
Configuration ambariConfiguration,
ClassLoader classLoader,
String archivePath)
Construct a view entity from the given configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addInstanceDefinition(ViewInstanceEntity viewInstanceDefinition)
Add an instance definition.
|
void |
addResourceConfiguration(Resource.Type type,
ResourceConfig config)
Add a resource configuration for the given type.
|
void |
addResourceDefinition(ViewSubResourceDefinition definition)
Add a resource definition.
|
void |
addResourceProvider(Resource.Type type,
ResourceProvider provider)
Add a resource provider for the given type.
|
String |
getAmbariProperty(String key)
Get a property for the given key from the ambari configuration.
|
String |
getArchive()
Get the path of the view archive.
|
ClassLoader |
getClassLoader()
Get the class loader used to load the view classes.
|
ViewConfig |
getConfiguration()
Get the associated view configuration.
|
Resource.Type |
getExternalResourceType()
Get the external resource type for the view.
|
ViewInstanceEntity |
getInstanceDefinition(String instanceName)
Get an instance definition for the given name.
|
Collection<ViewInstanceEntity> |
getInstances()
Get the view instances.
|
String |
getLabel()
Get the view label (display name).
|
String |
getName()
Get the view name.
|
Collection<ViewParameterEntity> |
getParameters()
Get the view parameters.
|
String |
getQualifiedResourceTypeName(String resourceTypeName)
Get a resource name qualified by the associated view name.
|
Map<Resource.Type,ResourceConfig> |
getResourceConfigurations()
Get the mapping of resource type to resource configurations.
|
ViewSubResourceDefinition |
getResourceDefinition(Resource.Type type)
Get the resource definition for the given type.
|
Map<Resource.Type,ViewSubResourceDefinition> |
getResourceDefinitions()
Get the mapping of resource type to resource definitions.
|
ResourceProvider |
getResourceProvider(Resource.Type type)
Get the resource provider for the given type.
|
Collection<ViewResourceEntity> |
getResources()
Get the view resources.
|
String |
getVersion()
Get the view version.
|
Set<Resource.Type> |
getViewResourceTypes()
Get the set of resource types for this view.
|
void |
removeInstanceDefinition(String instanceName)
Remove an instance definition.
|
void |
setArchive(String archive)
Set the view archive path.
|
void |
setInstances(Collection<ViewInstanceEntity> instances)
Set the view instances.
|
void |
setLabel(String label)
Set the view label (display name).
|
void |
setName(String name)
Set the view name.
|
void |
setParameters(Collection<ViewParameterEntity> parameters)
Set the view parameters.
|
void |
setResources(Collection<ViewResourceEntity> resources)
Set the view resources.
|
void |
setVersion(String version)
Set the view version.
|
public ViewEntity()
public ViewEntity(ViewConfig configuration, Configuration ambariConfiguration, ClassLoader classLoader, String archivePath)
configuration
- the view configurationambariConfiguration
- the Ambari configurationclassLoader
- the class loaderarchivePath
- the path of the view archivepublic String getName()
public void setName(String name)
name
- the view namepublic String getLabel()
public void setLabel(String label)
label
- the view labelpublic String getVersion()
public void setVersion(String version)
version
- the versionpublic Collection<ViewParameterEntity> getParameters()
public void setParameters(Collection<ViewParameterEntity> parameters)
parameters
- the view parameterspublic Collection<ViewResourceEntity> getResources()
public void setResources(Collection<ViewResourceEntity> resources)
resources
- the view resourcespublic Collection<ViewInstanceEntity> getInstances()
public void setInstances(Collection<ViewInstanceEntity> instances)
instances
- the instancespublic void addInstanceDefinition(ViewInstanceEntity viewInstanceDefinition)
viewInstanceDefinition
- the instance definitionpublic void removeInstanceDefinition(String instanceName)
instanceName
- the instance namepublic ViewInstanceEntity getInstanceDefinition(String instanceName)
instanceName
- the instance namepublic String getArchive()
public void setArchive(String archive)
archive
- the view archive pathpublic String getAmbariProperty(String key)
key
- the property keypublic String getQualifiedResourceTypeName(String resourceTypeName)
resourceTypeName
- the resource type namepublic Resource.Type getExternalResourceType()
public ClassLoader getClassLoader()
public void addResourceProvider(Resource.Type type, ResourceProvider provider)
type
- the resource typeprovider
- the resource providerpublic ResourceProvider getResourceProvider(Resource.Type type)
type
- the resource typepublic void addResourceDefinition(ViewSubResourceDefinition definition)
definition
- the resource definitionpublic ViewSubResourceDefinition getResourceDefinition(Resource.Type type)
type
- the resource typepublic Map<Resource.Type,ViewSubResourceDefinition> getResourceDefinitions()
public void addResourceConfiguration(Resource.Type type, ResourceConfig config)
type
- the resource typeconfig
- the configurationpublic Map<Resource.Type,ResourceConfig> getResourceConfigurations()
public Set<Resource.Type> getViewResourceTypes()
public ViewConfig getConfiguration()
Copyright © 2014. All rights reserved.