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.Exceptionpublic void init(boolean isLoad)
throws java.lang.Exception
java.lang.Exceptionpublic void shutdown()
public void destroy()
public java.lang.String getSession()
ConfigContextgetSession in interface ConfigContextpublic boolean isTransient()
ConfigContextisTransient in interface ConfigContextpublic ConfigService getConfigService()
ConfigContextgetConfigService in interface ConfigContextpublic void setUserProperty(java.lang.String name,
java.lang.Object value)
ConfigContextsetUserProperty in interface ConfigContextpublic <T> T getUserProperty(java.lang.String name)
ConfigContextgetUserProperty in interface ConfigContextpublic ConfigMBean getConfigMBean()
ConfigContextgetConfigMBean in interface ConfigContextpublic boolean exists(Ref ref)
ConfigContextexists in interface ConfigContextpublic java.util.Set<Ref> getRefs(java.lang.String typeId)
ConfigContextgetRefs in interface ConfigContextpublic java.util.Set<Ref> getRefs(java.lang.String typeId, java.lang.String keyName, java.lang.Object keyValue)
ConfigContextgetRefs in interface ConfigContexttypeId - 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)
ConfigContextgetRefs in interface ConfigContextquery - the resource querypublic <T> T getData(Ref ref) throws NotFoundException
ConfigContextgetData in interface ConfigContextNotFoundExceptionpublic <T> T getResourceData(Ref ref, boolean returnCopy) throws NotFoundException
ConfigContextgetResourceData in interface ConfigContextref - reference to the resourcereturnCopy - whether to return a copy of the dataNotFoundExceptionpublic Metadata getMetadata(Ref ref) throws NotFoundException
ConfigContextgetMetadata in interface ConfigContextref - reference to the instanceNotFoundExceptionpublic Diagnostics getDiagnostics(Ref ref) throws NotFoundException
ConfigContextgetDiagnostics in interface ConfigContextNotFoundExceptionpublic void create(Ref ref, java.lang.Object data) throws ValidationException, CreateException
ConfigContextcreate in interface ConfigContextref - 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
ConfigContextdelete in interface ConfigContextref - 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
ConfigContextdelete in interface ConfigContextrefs - 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
ConfigContextupdate in interface ConfigContextref - 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
ConfigContextexecuteTask in interface ConfigContextjava.lang.Exceptionpublic <T> T execute(java.util.concurrent.Callable<T> callable,
java.lang.String description,
boolean readOnly)
throws java.lang.Exception
ConfigContextexecute in interface ConfigContextjava.lang.Exceptionpublic ProjectView getProjectView()
ConfigContextgetProjectView in interface ConfigContextpublic ReferenceView getReferenceView()
ConfigContextgetReferenceView in interface ConfigContextpublic 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.Exceptionpublic java.util.List<SessionedData> getSessionedData()
public PersistenceHandler getPersistenceHandler(java.lang.String typeId) throws java.lang.Exception
java.lang.Exceptionpublic boolean exists(ResourceAccess.VersionedRef vref)
public java.util.Set<ResourceAccess.VersionedRef> getVersionedRefs()
public boolean isCommitting()
public void setCommitting(boolean b)