public class ViewContextImpl extends Object implements ViewContext
Modifier and Type | Class and Description |
---|---|
protected static class |
ViewContextImpl.ViewURLStreamProvider
Wrapper around internal URL stream provider.
|
CONTEXT_ATTRIBUTE
Constructor and Description |
---|
ViewContextImpl(ViewInstanceEntity viewInstanceEntity,
ViewRegistry viewRegistry)
Construct a view context from the given view entity.
|
Modifier and Type | Method and Description |
---|---|
String |
getAmbariProperty(String key)
Get a property for the given key from the ambari configuration.
|
Map<String,String> |
getInstanceData()
Get the instance data values.
|
String |
getInstanceData(String key)
Get the instance data value for the given key.
|
String |
getInstanceName()
Get the view instance name.
|
Map<String,String> |
getProperties()
Get the property values specified to create the view instance.
|
ResourceProvider<?> |
getResourceProvider(String type)
Get the view resource provider for the given resource type.
|
URLStreamProvider |
getURLStreamProvider()
Get a URL stream provider.
|
String |
getUsername()
Get the current user name.
|
String |
getViewName()
Get the view name.
|
void |
putInstanceData(String key,
String value)
Save an instance data value for the given key.
|
void |
removeInstanceData(String key)
Remove the instance data value for the given key.
|
public ViewContextImpl(ViewInstanceEntity viewInstanceEntity, ViewRegistry viewRegistry)
viewInstanceEntity
- the view entityviewRegistry
- the view registrypublic String getViewName()
ViewContext
getViewName
in interface ViewContext
public String getInstanceName()
ViewContext
getInstanceName
in interface ViewContext
public Map<String,String> getProperties()
ViewContext
getProperties
in interface ViewContext
public void putInstanceData(String key, String value)
ViewContext
putInstanceData
in interface ViewContext
key
- the keyvalue
- the valuepublic String getInstanceData(String key)
ViewContext
getInstanceData
in interface ViewContext
key
- the keypublic Map<String,String> getInstanceData()
ViewContext
getInstanceData
in interface ViewContext
public void removeInstanceData(String key)
ViewContext
removeInstanceData
in interface ViewContext
key
- the keypublic String getAmbariProperty(String key)
ViewContext
getAmbariProperty
in interface ViewContext
key
- the property keypublic ResourceProvider<?> getResourceProvider(String type)
ViewContext
getResourceProvider
in interface ViewContext
type
- the resource typepublic String getUsername()
ViewContext
getUsername
in interface ViewContext
public URLStreamProvider getURLStreamProvider()
ViewContext
getURLStreamProvider
in interface ViewContext
Copyright © 2017. All rights reserved.