@Entity public class ViewInstanceEntity extends Object implements org.apache.ambari.view.ViewInstanceDefinition
| Modifier and Type | Class and Description |
|---|---|
static class |
ViewInstanceEntity.ViewInstanceVersionDTO
Keeps information about view name, version and instance name.
|
| Constructor and Description |
|---|
ViewInstanceEntity() |
ViewInstanceEntity(ViewEntity view,
InstanceConfig instanceConfig)
Construct a view instance definition.
|
ViewInstanceEntity(ViewEntity view,
String name)
Construct a view instance definition.
|
ViewInstanceEntity(ViewEntity view,
String name,
String label)
Construct a view instance definition.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addResourceProvider(Resource.Type type,
org.apache.ambari.view.ResourceProvider provider)
Add a resource provider for the given resource type.
|
void |
addService(String pluralName,
Object service)
Add a service for the given plural resource name.
|
boolean |
alterNames()
Determine whether or not to alter the names of the
data store entities to avoid db reserved word conflicts.
|
void |
clearUrl()
Remove the URL associated with this entity
|
boolean |
equals(Object o) |
Long |
getClusterHandle() |
org.apache.ambari.view.ClusterType |
getClusterType()
Get the type of cluster the view instance is attached to
|
InstanceConfig |
getConfiguration()
Get the associated configuration.
|
String |
getContextPath()
Get the context path for the UI for this view.
|
static String |
getContextPath(String viewName,
String version,
String viewInstanceName)
Get the context path for a view instance with the given names.
|
String |
getCurrentUserName() |
Collection<ViewInstanceDataEntity> |
getData()
Get the instance data.
|
org.apache.ambari.view.migration.ViewDataMigrator |
getDataMigrator(org.apache.ambari.view.migration.ViewDataMigrationContext dataMigrationContext)
Get the data migrator instance for view instance.
|
String |
getDescription() |
Collection<ViewEntityEntity> |
getEntities()
Get the view entities.
|
String |
getIcon()
Get the icon path.
|
String |
getIcon64()
Get the big icon path.
|
ViewInstanceDataEntity |
getInstanceData(String key)
Get the instance data entity for the given key.
|
Map<String,String> |
getInstanceDataMap() |
String |
getInstanceName() |
String |
getLabel() |
String |
getName()
Get the name of this instance.
|
Collection<ViewInstancePropertyEntity> |
getProperties()
Get the instance properties.
|
ViewInstancePropertyEntity |
getProperty(String key)
Get the instance property entity for the given key.
|
Map<String,String> |
getPropertyMap() |
ResourceEntity |
getResource()
Get the admin resource entity.
|
org.apache.ambari.view.ResourceProvider |
getResourceProvider(Resource.Type type)
Get the resource provider for the given resource type.
|
org.apache.ambari.view.ResourceProvider |
getResourceProvider(String type)
Get the resource provider for the given resource type name (scoped to this view).
|
Object |
getService(String pluralName)
Get the service associated with the given plural resource name.
|
String |
getUsername()
Get the current user name.
|
InstanceValidationResultImpl |
getValidationResult(ViewEntity viewEntity,
org.apache.ambari.view.validation.Validator.ValidationContext context)
Get the validation the state of the instance.
|
org.apache.ambari.view.ViewDefinition |
getViewDefinition() |
ViewEntity |
getViewEntity()
Get the parent view entity.
|
Long |
getViewInstanceId()
Get the view instance id.
|
String |
getViewName() |
ViewURLEntity |
getViewUrl()
Get the view URL associated with the instance
|
int |
hashCode() |
boolean |
isVisible() |
boolean |
isXmlDriven()
Get the xml driven flag.
|
void |
putInstanceData(String key,
String value)
Associate the given instance data value with the given key.
|
void |
putProperty(String key,
String value)
Add a property value to this instance.
|
void |
removeInstanceData(String key)
Remove the instance data entity associated with the given key.
|
void |
removeProperty(String key)
Remove the property identified by the given key from this instance.
|
void |
setAlterNames(boolean alterNames)
Set the flag which indicates whether or not to alter the names of the
data store entities to avoid db reserved word conflicts.
|
void |
setClusterHandle(Long clusterHandle)
Set a cluster association for this view instance with the Ambari cluster
identified by the given cluster handle.
|
void |
setClusterType(org.apache.ambari.view.ClusterType clusterType)
Set the type of cluster for cluster handle
|
void |
setData(Collection<ViewInstanceDataEntity> data)
Set the collection of instance data entities.
|
void |
setDescription(String description)
Set the description.
|
void |
setEntities(Collection<ViewEntityEntity> entities)
Set the view entities.
|
void |
setIcon(String icon)
Set the icon path.
|
void |
setIcon64(String icon64)
Set the big icon path.
|
void |
setLabel(String label)
Set the label.
|
void |
setName(String name)
Set the name of this instance.
|
void |
setProperties(Collection<ViewInstancePropertyEntity> properties)
Set the collection of instance property entities.
|
void |
setResource(ResourceEntity resource)
Set the admin resource entity.
|
protected void |
setSecurityHelper(SecurityHelper securityHelper)
Set the security helper.
|
void |
setViewEntity(ViewEntity view)
Set the parent view entity.
|
void |
setViewInstanceId(Long viewInstanceId)
Set the given view instance id.
|
void |
setViewName(String viewName)
Set the view name.
|
void |
setViewUrl(ViewURLEntity viewUrl)
Set the view URL associated with the instance
|
void |
setVisible(boolean visible)
Set the visible flag.
|
void |
setXmlDriven(boolean xmlDriven)
Set the xml driven flag.
|
String |
toString() |
void |
validate(ViewEntity viewEntity,
org.apache.ambari.view.validation.Validator.ValidationContext context)
Validate the state of the instance.
|
public ViewInstanceEntity()
public ViewInstanceEntity(ViewEntity view, InstanceConfig instanceConfig)
view - the parent view definitioninstanceConfig - the associated configurationpublic ViewInstanceEntity(ViewEntity view, String name)
view - the parent view definitionname - the instance namepublic ViewInstanceEntity(ViewEntity view, String name, String label)
view - the parent view definitionname - the instance namelabel - the instance labelpublic String getInstanceName()
getInstanceName in interface org.apache.ambari.view.ViewInstanceDefinitionpublic String getViewName()
getViewName in interface org.apache.ambari.view.ViewInstanceDefinitionpublic Map<String,String> getPropertyMap()
getPropertyMap in interface org.apache.ambari.view.ViewInstanceDefinitionpublic Map<String,String> getInstanceDataMap()
getInstanceDataMap in interface org.apache.ambari.view.ViewInstanceDefinitionpublic org.apache.ambari.view.ViewDefinition getViewDefinition()
getViewDefinition in interface org.apache.ambari.view.ViewInstanceDefinitionpublic String getLabel()
getLabel in interface org.apache.ambari.view.ViewInstanceDefinitionpublic String getDescription()
getDescription in interface org.apache.ambari.view.ViewInstanceDefinitionpublic Long getClusterHandle()
getClusterHandle in interface org.apache.ambari.view.ViewInstanceDefinitionpublic boolean isVisible()
isVisible in interface org.apache.ambari.view.ViewInstanceDefinitionpublic Long getViewInstanceId()
public void setViewInstanceId(Long viewInstanceId)
viewInstanceId - the instance idpublic void setViewName(String viewName)
viewName - the view namepublic String getName()
public void setName(String name)
name - the instance namepublic void setLabel(String label)
label - the labelpublic void setDescription(String description)
description - the descriptionpublic void setClusterHandle(Long clusterHandle)
clusterHandle - the cluster identifierpublic org.apache.ambari.view.ClusterType getClusterType()
getClusterType in interface org.apache.ambari.view.ViewInstanceDefinitionpublic void setClusterType(org.apache.ambari.view.ClusterType clusterType)
clusterType - public void setVisible(boolean visible)
visible - visible flagpublic String getIcon()
public void setIcon(String icon)
icon - the icon pathpublic String getIcon64()
public void setIcon64(String icon64)
icon64 - the big icon pathpublic boolean isXmlDriven()
public void setXmlDriven(boolean xmlDriven)
xmlDriven - the xml driven flagpublic boolean alterNames()
public void setAlterNames(boolean alterNames)
alterNames - the alterNames flag; true if the data store names should be alteredpublic Collection<ViewInstancePropertyEntity> getProperties()
public void putProperty(String key, String value)
key - the property keyvalue - the property valuepublic void removeProperty(String key)
key - the keypublic ViewInstancePropertyEntity getProperty(String key)
key - the keypublic void setProperties(Collection<ViewInstancePropertyEntity> properties)
properties - the collection of instance property entitiespublic Collection<ViewInstanceDataEntity> getData()
public void setData(Collection<ViewInstanceDataEntity> data)
data - the collection of instance data entitiespublic Collection<ViewEntityEntity> getEntities()
public void setEntities(Collection<ViewEntityEntity> entities)
entities - the view entitiespublic void putInstanceData(String key, String value)
key - the keyvalue - the valuepublic void removeInstanceData(String key)
key - the keypublic ViewInstanceDataEntity getInstanceData(String key)
key - the keypublic ViewEntity getViewEntity()
public void setViewEntity(ViewEntity view)
view - the parent view entitypublic InstanceConfig getConfiguration()
public void addResourceProvider(Resource.Type type, org.apache.ambari.view.ResourceProvider provider)
type - the resource typeprovider - the resource providerpublic org.apache.ambari.view.ResourceProvider getResourceProvider(Resource.Type type)
type - the resource typepublic org.apache.ambari.view.ResourceProvider getResourceProvider(String type)
type - the resource type namepublic void addService(String pluralName, Object service)
pluralName - the plural resource nameservice - the servicepublic Object getService(String pluralName)
pluralName - the plural resource namepublic String getContextPath()
public static String getContextPath(String viewName, String version, String viewInstanceName)
viewName - the view nameviewInstanceName - the instance namepublic String getUsername()
public ResourceEntity getResource()
public void setResource(ResourceEntity resource)
resource - the resource entitypublic org.apache.ambari.view.migration.ViewDataMigrator getDataMigrator(org.apache.ambari.view.migration.ViewDataMigrationContext dataMigrationContext)
throws ClassNotFoundException
dataMigrationContext - the data migration context to inject into migrator instance.ClassNotFoundException - if class defined in the archive could not be loadedpublic void validate(ViewEntity viewEntity, org.apache.ambari.view.validation.Validator.ValidationContext context) throws ValidationException
viewEntity - the view entity to which this instance will be boundcontext - the validation contextValidationException - if the instance can not be validatedpublic InstanceValidationResultImpl getValidationResult(ViewEntity viewEntity, org.apache.ambari.view.validation.Validator.ValidationContext context) throws IllegalStateException
viewEntity - the view entity to which this instance will be boundcontext - the validation contextIllegalStateExceptionpublic String getCurrentUserName()
protected void setSecurityHelper(SecurityHelper securityHelper)
securityHelper - the helperpublic ViewURLEntity getViewUrl()
public void setViewUrl(ViewURLEntity viewUrl)
viewUrl - public void clearUrl()
Copyright © 2022 Apache Software Foundation. All rights reserved.