|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.services.StandardManager
wt.vc.views.StandardViewService
This implementation of ViewService
caches the View
s and
ViewAssociation
s, so ViewService
calls do not hit
the database.
Use the newStandardViewService
static factory method(s),
not the StandardViewService
constructor, to construct instances
of this class. Instances must be constructed using the static factory(s),
in order to ensure proper initialization of the instance.
Supported API: true
Extendable: true
Nested Class Summary | |
(package private) static class |
StandardViewService.ViewCacheUpdater
|
Field Summary | |
private static boolean |
CLASSIC_MODE
|
private static String |
CLASSNAME
|
private static String |
RESOURCE
|
private static StatementParameterFactory |
statementFactory
|
private static ViewCache |
viewCache
|
Fields inherited from class wt.services.StandardManager |
|
Fields inherited from interface wt.services.Manager |
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE |
Constructor Summary | |
StandardViewService()
|
Method Summary | |
private static void |
createViewCache()
|
View[] |
getAllChildren(View view)
Returns all the children of this view. |
View[] |
getAllParents(View view)
Returns all the parents of the view, if any. |
View[] |
getAllRootViews()
Return all root views, that is all views with no parent views. |
View[] |
getAllViews()
Return all defined views. |
View[] |
getChildren(View view)
Returns the immediate children of this view. |
String |
getConceptualClassname()
Deprecated. |
View[] |
getEligibleViews(ViewManageable viewManageable)
For a particular version, returns all the valid views the version may be branched into. |
View |
getParent(View view)
Gets the immediate parent of this view, if one exists. |
View |
getView(ObjectIdentifier objId)
Returns the view object for this view identifier, if one exists. |
View |
getView(String viewName)
Returns the view object for this view name, if it exists. |
private static ViewCache |
getViewCache()
|
void |
insert(View parent,
View child,
View viewToInsert)
Inserts a view between other associated views. |
boolean |
isChildOf(View view,
View viewToCheck)
Returns true if the viewToCheck is a child of the view, false otherwise. |
boolean |
isMemberOf(View view,
View viewToCheck)
Returns true if the viewToCheck is contained in the same view association as the view, false otherwise. |
boolean |
isParentOf(View view,
View viewToCheck)
Returns true if the viewToCheck is a parent of the view, false otherwise. |
ViewManageable |
newBranchForView(ViewManageable version,
ObjectIdentifier viewId)
Creates a new version from the original version and assigns it to the specified view. |
ViewManageable |
newBranchForView(ViewManageable version,
String viewName)
Creates a new version from the original version and assigns it to the specified view. |
ViewManageable |
newBranchForView(ViewManageable version,
View view)
Creates a new version from the original version and assigns it to the specified view. |
static StandardViewService |
newStandardViewService()
Default factory for the class. |
protected void |
performStartupProcess()
The cache is affected by any change to views/view associations. |
protected void |
processViewDeletion(View view)
Handles validation and cleanup associated with deleting a view. |
protected void |
validateNewViewAssociation(ViewAssociation vA)
Validates that the new association does not cause recursion or a view to have more than one parent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static final boolean CLASSIC_MODE
private static StatementParameterFactory statementFactory
private static ViewCache viewCache
Constructor Detail |
public StandardViewService()
Method Detail |
public String getConceptualClassname()
getConceptualClassname
in interface NetFactor
getConceptualClassname
in class StandardManager
public static StandardViewService newStandardViewService() throws WTException
WTException
public ViewManageable newBranchForView(ViewManageable version, String viewName) throws WTPropertyVetoException, WTException, ViewException
wt.properties
entry wt.vc.views.newViewVersionClassicBehavior
to false
, you can change this behavior: rather than
creating B.A (Mfg) from B (Eng), the new version will be created from
A.A (Mfg). The result will still be B.A (Mfg), but the Mfg changes
will be preserved.
newBranchForView
in interface ViewService
version
- The version the new version is to be derived from.viewName
- The view name of the view to assign the new version to.
WTPropertyVetoException
WTException
ViewException
public ViewManageable newBranchForView(ViewManageable version, View view) throws WTPropertyVetoException, WTException, ViewException
wt.properties
entry wt.vc.views.newViewVersionClassicBehavior
to false
, you can change this behavior: rather than
creating B.A (Mfg) from B (Eng), the new version will be created from
A.A (Mfg). The result will still be B.A (Mfg), but the Mfg changes
will be preserved.
newBranchForView
in interface ViewService
version
- The version the new version is to be derived from.view
- The view to assign the new version to.
WTPropertyVetoException
WTException
ViewException
public ViewManageable newBranchForView(ViewManageable version, ObjectIdentifier viewId) throws WTPropertyVetoException, WTException, ViewException
wt.properties
entry wt.vc.views.newViewVersionClassicBehavior
to false
, you can change this behavior: rather than
creating B.A (Mfg) from B (Eng), the new version will be created from
A.A (Mfg). The result will still be B.A (Mfg), but the Mfg changes
will be preserved.
newBranchForView
in interface ViewService
version
- The version the new version will be derived from.viewId
- The Id of the view to assign the version from.
WTPropertyVetoException
WTException
ViewException
public View getView(String viewName) throws WTException, ViewException
getView
in interface ViewService
viewName
-
WTException
ViewException
public View getView(ObjectIdentifier objId) throws WTException, ViewException
getView
in interface ViewService
objId
-
WTException
ViewException
public View getParent(View view) throws WTException, ViewException
getParent
in interface ViewService
view
- The view to get the parent of; it must exist
WTException
ViewException
public View[] getAllParents(View view) throws WTException, ViewException
getAllParents
in interface ViewService
view
- The view to get the parents of; it must exist
WTException
ViewException
public boolean isParentOf(View view, View viewToCheck) throws WTException, ViewException
isParentOf
in interface ViewService
view
- viewToCheck
-
WTException
ViewException
public View[] getChildren(View view) throws WTException, ViewException
getChildren
in interface ViewService
view
- View to get children of; it must exist.
WTException
ViewException
public View[] getAllChildren(View view) throws WTException, ViewException
getAllChildren
in interface ViewService
view
- View to get all children of; it must exist.
WTException
ViewException
public boolean isChildOf(View view, View viewToCheck) throws WTException, ViewException
isChildOf
in interface ViewService
view
- viewToCheck
-
WTException
ViewException
public boolean isMemberOf(View view, View viewToCheck) throws WTException, ViewException
isMemberOf
in interface ViewService
view
- viewToCheck
-
WTException
ViewException
public View[] getAllViews() throws WTException, ViewException
getAllViews
in interface ViewService
WTException
ViewException
public View[] getAllRootViews() throws WTException, ViewException
getAllRootViews
in interface ViewService
WTException
ViewException
public void insert(View parent, View child, View viewToInsert) throws WTException, ViewException
insert
in interface ViewService
parent
- The parent view in a ViewAssociation.child
- A child of the parent. May be null, in which case the viewToInsert is inserted above all the parent's children.viewToInsert
- The view to insert.
WTException
ViewException
public View[] getEligibleViews(ViewManageable viewManageable) throws WTException, ViewException
getEligibleViews
in interface ViewService
viewManageable
-
WTException
ViewException
private static ViewCache getViewCache()
private static void createViewCache()
protected void validateNewViewAssociation(ViewAssociation vA) throws WTException, ViewException
WTException
ViewException
protected void processViewDeletion(View view) throws WTException
WTException
protected void performStartupProcess() throws ManagerException
performStartupProcess
in class StandardManager
ManagerException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |