public final class ConfigContextImpl extends java.lang.Object implements ConfigContext
Constructor and Description |
---|
ConfigContextImpl(ConfigServiceImpl configService, java.lang.String session, boolean isTransient, boolean isLoad)
Creates config context but does not initialize it yet.
|
Modifier and Type | Method and Description |
---|---|
void |
create(Ref ref, java.lang.Object data)
Creates a new simple type instance with the given id and value.
|
void |
delete(Ref ref)
Deletes the simple type instance with the given reference.
|
void |
delete(java.util.Set<Ref> refs)
Deletes the simple type instances with the given references.
|
void |
destroy()
Nukes all the persisted data associated with a session, essentially erasing the session
|
<T> T |
execute(java.util.concurrent.Callable<T> callable, java.lang.String description, boolean readOnly)
executes the given callable in this context
|
<T> T |
executeTask(SessionedTask<T> task)
Executes the given task in this context.
|
boolean |
exists(Ref ref)
Check if the given reference exists.
|
boolean |
exists(ResourceAccess.VersionedRef vref) |
BaseType |
getBaseTypeHere(java.lang.String typeId) |
ReferenceMap |
getCombinedDependencyGraph() |
ComponentTypeImpl |
getComponentTypeHere(java.lang.String typeId) |
ConfigMBean |
getConfigMBean()
Returns the ConfigMBean
|
ConfigService |
getConfigService()
Returns the ConfigService that owns this context
|
ConfigServiceImpl |
getConfigServiceImpl() |
<T> T |
getData(Ref ref)
Returns the data value for the given reference (applies to simple and resource types).
|
Diagnostics |
getDiagnostics(Ref ref)
Returns the Diagnostics object for the given resource.
|
SimpleType |
getExecHistory() |
ProjectHierarchy |
getHierarchy() |
ComponentType |
getLocationDataType() |
LocationType |
getLocationType() |
Metadata |
getMetadata(Ref ref)
Returns the internal Metadata object for the given reference (applies to simple and resource types).
|
ReferenceMap |
getParentChildMap() |
PersistenceHandler |
getPersistenceHandler(java.lang.String typeId) |
ProjectView |
getProjectView()
returns a view into the project hierarchy
|
ReferenceMap |
getReferenceMap() |
ReferenceView |
getReferenceView()
returns a view into the reference graphs
|
java.util.Set<Ref> |
getRefs(ResourceQuery query)
Returns the set of references for resource instances that satisfy the given filter criteria.
|
java.util.Set<Ref> |
getRefs(java.lang.String typeId)
Returns references to all instances of the given (simple or resource) type
|
java.util.Set<Ref> |
getRefs(java.lang.String typeId, java.lang.String keyName, java.lang.Object keyValue)
returns a set of references for instances that have the given keyValue for the given key (applies to simple and resource types).
|
<T> T |
getResourceData(Ref ref, boolean returnCopy)
Returns the resource data for the given reference.
|
java.lang.String |
getSession()
Returns the name of the session this context is associated with
|
InternalSessionData |
getSessionData() |
java.util.List<SessionedData> |
getSessionedData() |
SimpleTypeImpl |
getSimpleTypeHere(java.lang.String typeId) |
SimpleType |
getSystemData() |
SimpleType |
getUndoInfo() |
SimpleType |
getUploadStore() |
<T> T |
getUserProperty(java.lang.String name)
Returns the user property associated with the session.
|
java.util.Set<ResourceAccess.VersionedRef> |
getVersionedRefs() |
void |
init(boolean isLoad)
This one really initializes the things transactionally
|
boolean |
isCommitting() |
boolean |
isTransient()
returns whether this context is transient
|
void |
setCommitting(boolean b) |
void |
setUserProperty(java.lang.String name, java.lang.Object value)
Sets a property associated with the session.
|
void |
shutdown()
Shutdown the context
|
void |
update(Ref ref, java.lang.Object newData)
Updates an existing simple type instance with a new value.
|
void |
updateSessionData(InternalSessionData newdata) |
public ConfigContextImpl(ConfigServiceImpl configService, java.lang.String session, boolean isTransient, boolean isLoad) throws java.lang.Exception
java.lang.Exception
public void init(boolean isLoad) throws java.lang.Exception
java.lang.Exception
public void shutdown()
public void destroy()
public java.lang.String getSession()
ConfigContext
getSession
in interface ConfigContext
public boolean isTransient()
ConfigContext
isTransient
in interface ConfigContext
public ConfigService getConfigService()
ConfigContext
getConfigService
in interface ConfigContext
public void setUserProperty(java.lang.String name, java.lang.Object value)
ConfigContext
setUserProperty
in interface ConfigContext
public <T> T getUserProperty(java.lang.String name)
ConfigContext
getUserProperty
in interface ConfigContext
public ConfigMBean getConfigMBean()
ConfigContext
getConfigMBean
in interface ConfigContext
public boolean exists(Ref ref)
ConfigContext
exists
in interface ConfigContext
public java.util.Set<Ref> getRefs(java.lang.String typeId)
ConfigContext
getRefs
in interface ConfigContext
public java.util.Set<Ref> getRefs(java.lang.String typeId, java.lang.String keyName, java.lang.Object keyValue)
ConfigContext
getRefs
in interface ConfigContext
typeId
- the simple or resource typekeyName
- the name of the key defined on this typekeyValue
- the key value to be searchedpublic java.util.Set<Ref> getRefs(ResourceQuery query)
ConfigContext
getRefs
in interface ConfigContext
query
- the resource querypublic <T> T getData(Ref ref) throws NotFoundException
ConfigContext
getData
in interface ConfigContext
NotFoundException
public <T> T getResourceData(Ref ref, boolean returnCopy) throws NotFoundException
ConfigContext
getResourceData
in interface ConfigContext
ref
- reference to the resourcereturnCopy
- whether to return a copy of the dataNotFoundException
public Metadata getMetadata(Ref ref) throws NotFoundException
ConfigContext
getMetadata
in interface ConfigContext
ref
- reference to the instanceNotFoundException
public Diagnostics getDiagnostics(Ref ref) throws NotFoundException
ConfigContext
getDiagnostics
in interface ConfigContext
NotFoundException
public void create(Ref ref, java.lang.Object data) throws ValidationException, CreateException
ConfigContext
create
in interface ConfigContext
ref
- reference of the new instance.data
- the data used to initialize the instance.ValidationException
- if the validation of the data, or reference fails, or if the instance already existsCreateException
- if there are any other errors during the operation (serialization, etc)public void delete(Ref ref) throws DeleteException, NotFoundException
ConfigContext
delete
in interface ConfigContext
ref
- reference of the instance to be deleted.DeleteException
- if there are any other errors during the operationNotFoundException
- if the instance does not exist.public void delete(java.util.Set<Ref> refs) throws DeleteException, NotFoundException
ConfigContext
delete
in interface ConfigContext
refs
- references of the instances to be deleted.DeleteException
- if there are any other errors during the operationNotFoundException
- if the instance does not exist.public void update(Ref ref, java.lang.Object newData) throws ValidationException, UpdateException
ConfigContext
update
in interface ConfigContext
ref
- reference of the instance to be updated.newData
- the new valueValidationException
- if the validation of the data, or reference fails, or if the instance does not existUpdateException
- if there are any other errors during the operation (serialization, etc)public <T> T executeTask(SessionedTask<T> task) throws java.lang.Exception
ConfigContext
executeTask
in interface ConfigContext
java.lang.Exception
public <T> T execute(java.util.concurrent.Callable<T> callable, java.lang.String description, boolean readOnly) throws java.lang.Exception
ConfigContext
execute
in interface ConfigContext
java.lang.Exception
public ProjectView getProjectView()
ConfigContext
getProjectView
in interface ConfigContext
public ReferenceView getReferenceView()
ConfigContext
getReferenceView
in interface ConfigContext
public ConfigServiceImpl getConfigServiceImpl()
public ReferenceMap getReferenceMap()
public ReferenceMap getParentChildMap()
public ReferenceMap getCombinedDependencyGraph()
public ProjectHierarchy getHierarchy()
public SimpleType getSystemData()
public SimpleType getExecHistory()
public SimpleType getUndoInfo()
public SimpleType getUploadStore()
public ComponentType getLocationDataType()
public LocationType getLocationType()
public BaseType getBaseTypeHere(java.lang.String typeId)
public ComponentTypeImpl getComponentTypeHere(java.lang.String typeId)
public SimpleTypeImpl getSimpleTypeHere(java.lang.String typeId)
public InternalSessionData getSessionData()
public void updateSessionData(InternalSessionData newdata) throws java.lang.Exception
java.lang.Exception
public java.util.List<SessionedData> getSessionedData()
public PersistenceHandler getPersistenceHandler(java.lang.String typeId) throws java.lang.Exception
java.lang.Exception
public boolean exists(ResourceAccess.VersionedRef vref)
public java.util.Set<ResourceAccess.VersionedRef> getVersionedRefs()
public boolean isCommitting()
public void setCommitting(boolean b)