@Entity public class ViewEntity extends Object implements org.apache.ambari.view.ViewDefinition
Modifier and Type | Field and Description |
---|---|
static String |
AMBARI_ONLY |
Constructor and Description |
---|
ViewEntity()
Construct a view entity.
|
ViewEntity(ViewConfig configuration,
Configuration ambariConfiguration,
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.
|
Configuration |
getAmbariConfiguration()
Get the Ambari configuration.
|
String |
getAmbariProperty(String key)
Get a property for the given key from the ambari configuration.
|
String |
getArchive()
Get the path of the view archive.
|
String |
getBuild() |
ClassLoader |
getClassLoader()
Get the class loader used to load the view classes.
|
String |
getCommonName()
Get the common name of the view.
|
ViewConfig |
getConfiguration()
Get the associated view configuration.
|
String |
getDescription() |
Resource.Type |
getExternalResourceType()
Get the external resource type for the view.
|
String |
getIcon()
Get the icon path.
|
String |
getIcon64()
Get the big icon path.
|
ViewInstanceEntity |
getInstanceDefinition(String instanceName)
Get an instance definition for the given name.
|
Collection<ViewInstanceEntity> |
getInstances()
Get the view instances.
|
String |
getLabel() |
String |
getMask() |
String |
getName()
Get the view name.
|
Collection<ViewParameterEntity> |
getParameters()
Get the view parameters.
|
PermissionEntity |
getPermission(String permissionName)
Get the permission entity for the given permission name.
|
Collection<PermissionEntity> |
getPermissions()
Get the view custom permissions.
|
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.
|
ResourceTypeEntity |
getResourceType()
Get the admin resource type entity.
|
org.apache.ambari.view.ViewDefinition.ViewStatus |
getStatus() |
String |
getStatusDetail() |
org.apache.ambari.view.validation.Validator |
getValidator()
Get the associated view validator.
|
String |
getVersion() |
org.apache.ambari.view.View |
getView()
Get the associated view.
|
String |
getViewName() |
static String |
getViewName(String name,
String version)
Get the internal view name from the given common name and version.
|
Set<Resource.Type> |
getViewResourceTypes()
Get the set of resource types for this view.
|
boolean |
hasValidator()
Determine whether or not a validator has been specified for this view.
|
boolean |
isClusterConfigurable()
Determine whether or not this view is configurable through a cluster association.
|
boolean |
isDeployed()
Determine whether or not the entity is deployed.
|
boolean |
isSystem()
Determine whether or not the view is a system view.
|
void |
removeInstanceDefinition(String instanceName)
Remove an instance definition.
|
void |
setArchive(String archive)
Set the view archive path.
|
void |
setBuild(String build)
Set the view build number.
|
void |
setClassLoader(ClassLoader classLoader)
Set the class loader.
|
void |
setConfiguration(ViewConfig configuration)
Set the view configuration.
|
void |
setDescription(String description)
Set the view description.
|
void |
setIcon(String icon)
Set the icon path.
|
void |
setIcon64(String icon64)
Set the big icon path.
|
void |
setInstances(Collection<ViewInstanceEntity> instances)
Set the view instances.
|
void |
setLabel(String label)
Set the view label (display name).
|
void |
setMask(String mask)
Set the mask class name.
|
void |
setName(String name)
Set the view name.
|
void |
setParameters(Collection<ViewParameterEntity> parameters)
Set the view parameters.
|
void |
setPermissions(Collection<PermissionEntity> permissions)
Set the custom view permissions.
|
void |
setResources(Collection<ViewResourceEntity> resources)
Set the view resources.
|
void |
setResourceType(ResourceTypeEntity resourceType)
Set the admin resource type entity.
|
void |
setStatus(org.apache.ambari.view.ViewDefinition.ViewStatus status)
Set the status of the view.
|
void |
setStatusDetail(String statusDetail)
Set the status detail for the view.
|
void |
setSystem(boolean required)
Set the flag which indicates whether or not the view is a system view.
|
void |
setValidator(org.apache.ambari.view.validation.Validator validator)
Set the view validator.
|
void |
setVersion(String version)
Set the view version.
|
void |
setView(org.apache.ambari.view.View view)
Set the view.
|
String |
toString() |
public static final String AMBARI_ONLY
public ViewEntity()
public ViewEntity(ViewConfig configuration, Configuration ambariConfiguration, String archivePath)
configuration
- the view configurationambariConfiguration
- the Ambari configurationarchivePath
- the path of the view archivepublic String getViewName()
getViewName
in interface org.apache.ambari.view.ViewDefinition
public String getLabel()
getLabel
in interface org.apache.ambari.view.ViewDefinition
public String getDescription()
getDescription
in interface org.apache.ambari.view.ViewDefinition
public String getVersion()
getVersion
in interface org.apache.ambari.view.ViewDefinition
public String getBuild()
getBuild
in interface org.apache.ambari.view.ViewDefinition
public org.apache.ambari.view.ViewDefinition.ViewStatus getStatus()
getStatus
in interface org.apache.ambari.view.ViewDefinition
public String getStatusDetail()
getStatusDetail
in interface org.apache.ambari.view.ViewDefinition
public String getMask()
getMask
in interface org.apache.ambari.view.ViewDefinition
public String getName()
public void setName(String name)
name
- the view namepublic String getCommonName()
public void setLabel(String label)
label
- the view labelpublic void setDescription(String description)
description
- the view descriptionpublic void setVersion(String version)
version
- the versionpublic void setBuild(String build)
build
- the buildpublic String getIcon()
public void setIcon(String icon)
icon
- the icon pathpublic String getIcon64()
public void setIcon64(String icon64)
icon64
- the big icon pathpublic Collection<ViewParameterEntity> getParameters()
public void setParameters(Collection<ViewParameterEntity> parameters)
parameters
- the view parameterspublic Collection<PermissionEntity> getPermissions()
public void setPermissions(Collection<PermissionEntity> permissions)
permissions
- the permissionspublic PermissionEntity getPermission(String permissionName)
permissionName
- the permission namepublic 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 Configuration getAmbariConfiguration()
public String getQualifiedResourceTypeName(String resourceTypeName)
resourceTypeName
- the resource type namepublic Resource.Type getExternalResourceType()
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
classLoader
- the class loaderpublic 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 void setConfiguration(ViewConfig configuration)
configuration
- the view configurationpublic ViewConfig getConfiguration()
public void setView(org.apache.ambari.view.View view)
view
- the viewpublic org.apache.ambari.view.View getView()
public void setValidator(org.apache.ambari.view.validation.Validator validator)
validator
- the view validatorpublic org.apache.ambari.view.validation.Validator getValidator()
public boolean hasValidator()
public void setMask(String mask)
mask
- the mask class namepublic boolean isSystem()
public void setSystem(boolean required)
required
- the system flag; true if the view is a system viewpublic ResourceTypeEntity getResourceType()
public void setResourceType(ResourceTypeEntity resourceType)
resourceType
- the resource type entitypublic void setStatus(org.apache.ambari.view.ViewDefinition.ViewStatus status)
status
- the view statuspublic void setStatusDetail(String statusDetail)
statusDetail
- the status detailpublic boolean isClusterConfigurable()
public boolean isDeployed()
public static String getViewName(String name, String version)
name
- the view common nameversion
- the versionCopyright © 2022 Apache Software Foundation. All rights reserved.