|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BaseManagerImpl
public class BaseManagerImpl
This large class is the single manager for the Access Road object-oriented database. It allows to register, save, close, open and remove the ACS and the views. It allows to create, update, save and remove the information systems, their nodes and components. It allows to register and unregister an AcsAddon. After ACSFactoryImpl and ACSImpl, this is the most complex class of the gBase package.
This class manages a map of nametrees which describes the tree structures of IS, components and ACS. The key is the IS name, and the value is a NameISTree which describes the structure. An information system may contain some ACS, subACS, composite ACS, composite subACS, physical components and logical components. A physical component is a hardware in the information system. A logical component is simply a software which have no ACS functions. An information system cannot contain another one.
The IS structure is a tree of named nodes, each having a type and some associated properties. The ACS nodes are opened and closed in the program, and all the other nodes are created/opened/closed at the ACS creation/opening/closing. This is true for the subACS of the ACS, but also for any composite ACS which is opened only when all the ACS of its elements are opened, and for any physical or logicial component, since it is opened in the IS at the opening of one ACS which is its child.
This structure has a specific format which is defined in the class ISNodeImpl. There is a default IS for all the ACS without an explicit IS, and all these ACS are in a flat list under the default IS root. Deleting is done into the Access Road base, not the files into the Access Road operating system work directory.
A view is a user selection of several ACS objects.
This class offers lists of the current open or closed ACS and views. It does not create the ACS and the views directly, but registers and saves them when there are created through ACSFactory or their view constructors. On the other hand, the information system nametrees are created directly by this class.
Caution: a new ACS may have the name of an ACSObject in a closed ACS, and this is not checked. The ACSObjects in the open ACS are all checked. When the relevant closed ACS is opened, there is no more checking of the name doublons. During the search of objects from their names, the ACS is selected first.
There is only one instance of this class. It is a javabean with the following bound properties:
'OpenACS', 'OpenViews', 'OneInformationSystem', 'OneInformationSystemNode', 'OneInformationSystemNodeOpening'. Since the AcsAddons are (un)registered at the starting of the program, there is no bound property for them.
Other changes in nametree nodes are managed by ACSFactory. The listeners are proper to this instance, outside gBase, transient. They are called in any order.
Nevertheless, an order exists between these events and the events fired by the ACS and the views, when there are some operations on them:
- any change on 'OpenACS' and 'OpenViews' is fired - after - the creation or opening, but, it is fired - before - the closing or removing, and the events from the ACS or the view.
The listeners receive only a copy of the new value, to protect the property. All the exceptions from the listeners are catched, and a dialog box is displayed to inform the user.
All the Access Road data is saved as serialized Java objects under the Access Road working directory, with the file extension 'acr'. This includes the AcsAddon files. There are 3 main types of objects to serialize independently:
- ACS: for each one, the file name starts with 'ACS0_'; its serialization maintains references among the objects of almost all classes in gBase, excepted for ViewInBase classes for which there are no references,
- ViewInBase: for each one, the file name starts with 'VIEW0_'; its serialization does not maintain references among the objects in all the relevant ACS, since only names are saved. There are no references to other ViewInBases into it.
- Information System NameTree: the single file name is 'm_nametrees_v0.acr'; it is serialized without external references into it.
The other small objects to save are the general descriptors of the Access Road context. That includes:
- 'l_acs_v0.acr' for the ACS names,
- 'l_views_v0.acr' for the view names,
- 'l_metarights_v0.acr' for the metarights,
- 'l_acsaddon_v0.acr' for the ACS addon names,
- 'GUI_config.acr' for the locations of the objects in the GUI.
Field Summary | |
---|---|
private java.beans.PropertyChangeSupport |
changeSupport_
manage all the property change listeners |
private static int |
INITIAL_CAPACITY
|
protected static BaseManagerImpl |
INSTANCE
|
private static java.util.List<ImmutableName> |
l_Acs__
ACS names |
private static java.util.List<java.lang.String> |
l_AcsAddonDescriptors__
The form of a value is 'Editor: full_editor_name - AcsAddon: addon_name', like in ACSImpl.getEditorAndAddonNames(). |
protected static java.util.List<StringMetaRight> |
l_MetaRights__
List of metarights. |
private static java.util.List<ImmutableName> |
l_Views__
View names |
protected static java.util.Map<java.lang.Integer,StringMetaRight[]> |
m_MetaRightsArrayFromPower__
Map of metarights where the getPower() value is the key; the value in the map is an array of all the metarights having the same power. |
protected static java.util.Map<java.lang.String,StringMetaRight> |
m_MetaRightsFromRight__
Map of metarights where the getRight() value is the key; the value in the map is the metaright. |
private static java.util.Map<ImmutableName,ImmutableNameISTree> |
m_NameTrees__
m_NameTrees__ is a map of NameISTrees which describes the structure of each IS. |
protected static java.util.Map<ImmutableName,ImmutableACS> |
m_OpenAcs__
ACS map; ACS name is the key |
protected static java.util.Map<ImmutableName,ViewInBase> |
m_OpenViews__
View map; view name is the key |
static java.io.ObjectStreamField[] |
serialPersistentFields
variable for the JDK 2 serialization. |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
private |
BaseManagerImpl()
Reads the files "l_metarights_v0.acr", "l_is_v0.acr", "m_nametrees_v0.acr", l_acs_v0.acr" and "l_views_v0.acr" to initialize the rights, IS, components, ACS and view maps. |
Method Summary | |
---|---|
protected void |
addAcsOrSubAcsNodeToIS(ImmutableName _ISname,
Name _parent,
ImmutableName _name,
java.lang.String _node_type,
boolean _is_hub,
java.lang.String _visible_space,
boolean _server,
boolean _fireChange)
Called by ACSFactory to add an ACS or subACS to the IS nametrees, after the call to newEorACS(), and by importACS(). |
void |
addComponentNodeToIS(ImmutableName _ISname,
ImmutableName _name,
java.lang.String _node_type)
Called by ACSFactoryImpl and importACS() to add a physical or logical component to the IS nametrees, and by ActionNewACSyst.handleSelectionDialog(). |
protected void |
addCompositeNodeToIS(ImmutableName _ISname,
java.lang.String _name,
java.lang.String _node_type,
boolean _is_authorization_server)
Called by ACSFactory to add a Composite ACS or a Composite subACS to the IS nametrees. |
void |
addIS(ImmutableName _name,
boolean _is_hub)
Called by newEorACS() and ActionNewACSsyst to add an information system, to save it in the NameTrees map through a new NameISTree with a passive root which is the IS name. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener _l)
Add a listener to the bean. |
void |
addPropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
Add a listener to the bean. |
protected void |
addSecondaryPropertiesToAcsOrSubNode(ImmutableName _ISname,
ImmutableName _name,
boolean _is_tied_child,
ImmutableName _composite,
ImmutableName[] _l_alternates,
java.util.Map<ImmutableName,java.lang.String[]> _m_alternateProperties,
boolean _fireChange)
Called by ACSFactory to add some Tied-Child, Composite, Alternate relations to an ACS or subACS in the IS nametree, after the call to addAcsOrSubAcsNodeToIS(). |
private void |
closeACS(ACSImpl _acs,
boolean _withSaving)
Closes an open ACS with or without saving it. |
void |
closeDefaultBase()
Closes the base without savings, with all the open ACS and all the open views first. |
void |
closeOpenACS(ACSImpl _acs,
boolean _withSaving)
Closes an open ACS with saving or not, and closes all its children ACS. |
void |
closeOpenView(ViewInBase _view)
Closes an open view without saving it. |
void |
closeSketchView(EPRViewInBaseImpl _view)
Close the sketch view without saving it. |
private static void |
createMetaRightMaps()
Create the generic metaright maps which are internal to this instance. |
private void |
cutACSExternalLinks(ACSImpl _acs)
Cuts all the external links to another open ACS and to the metarights. |
private void |
cutACSInternalLinks(ACSImpl _acs)
Cuts all the internal links. |
protected void |
firePropertyChange(java.lang.String _propertyName,
java.lang.Object _oldValue,
java.lang.Object _newValue)
Fire an event to every registered listener, in any order. |
java.util.Set<ImmutableName> |
getElementsOfOneView(ImmutableName _name,
boolean _acsNames)
Gets the elements of a closed or opened ViewInBase. |
java.util.Map<ImmutableName,ImmutableACS> |
getEorM_OpenACS()
Called in the generic access paths searching, then may be called from a view worker thread. |
java.util.Map<ImmutableName,ViewInBase> |
getEorM_OpenViews()
|
java.util.Map |
getGUI()
Gets the GUI configuration from the 'GUI_config.acr' file. |
static BaseManagerImpl |
getInstance()
Only method to obtain the unique instance of BaseManagerImpl. |
ImmutableName |
getISofName(ImmutableName _name)
Gets the IS name if the name is known as a node name or an area name. |
ImmutableNameISTree |
getISTree(ImmutableName _name)
Returns an IS nametree. |
java.util.List<java.lang.String> |
getL_AcsAddonDescriptors()
Gets all the descriptors of the ACS addons that are loaded in the current working directory of Access Road. |
java.util.List<ImmutableName> |
getL_ACSNames()
Return the names of the registered ACS, open ones and closed ones. |
java.util.Set<ImmutableName> |
getL_CompositeNodesOfIS(ImmutableName _ISname)
Get the Composite ACS and a Composite subACS of an IS nametrees. |
java.util.Set<ImmutableName> |
getL_IS()
Returns the names of the registered IS, which are also the IS nametree names. |
java.util.List<StringMetaRight> |
getL_MetaRights()
Gets all the metarights in an sorted set. |
StringMetaRight[] |
getL_MetaRightsFromPower(int _power)
Gets all the metarights with the same power. |
java.util.List<StringMetaRight> |
getL_NonAdministrativeMetaRights()
Gets all the non-administrative metarights in an ordered list, which is a subset of the metarights for GUI displaying and user selecting. |
java.util.List<ImmutableName> |
getL_ViewNames()
Gets the names of the open or closed views. |
java.util.Map<ImmutableName,ImmutableNameISTree> |
getM_ISTrees()
Returns the map of all the registered IS nametrees. |
StringMetaRight |
getMetaRight(java.lang.String _right)
Gets the metaright with the correct right, following the creations in BaseUtilityImpl.initializeBasicMetaRights(). |
StringMetaRight |
getMetaRightFromName(ImmutableName _name)
Gets the metaright with the correct name through getName(). |
long |
getSerialVersionUID()
|
boolean |
getSupportsXML()
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
importACS(ImmutableName _name)
Imports an unknown ACS from a file in the current directory, creates it as a node in the right IS, opens and saves it. |
boolean |
isOpenACS(ImmutableName _name)
|
boolean |
isOpenView(ImmutableName _name)
|
boolean |
knowsACS(ImmutableName _name)
|
boolean |
knowsIS(ImmutableName _name)
|
boolean |
knowsView(ImmutableName _name)
|
protected void |
newEorACS(ACS _acs,
boolean _ISroot_is_hub)
Called by the ACSFactoryImpl.createACS(). |
protected void |
newEorCopiedViewToSave(ViewInBase _view)
Called by the ViewInBaseImpl copyAndFinalize() method for registering the instance and to save it, while it is not open. |
protected void |
newEorView(ViewInBase _view)
Called by the ViewInBaseImpl constructor for registering the instance. |
static void |
newMetaRight(StringMetaRight _right,
boolean _toSave)
Register a new metaright. |
ACSImpl |
openACS(ImmutableName _name)
Opens a registered and closed ACS from a file in the current directory. |
void |
openAllViews()
Open all known views, when there are all closed. |
ViewInBase |
openView(ImmutableName _name)
Opens a registered and closed view from a file in the current data directory. |
void |
removeACS(ImmutableName _name)
The ACS name is removed from the ACS list and from the IS nametree, like all its children in the IS nametree if they exist. |
private void |
removeAcsNodeToIS(ImmutableName _ISname,
ImmutableName _name)
Called to remove an ACS to the IS nametrees and save it, and to remove also all its direct and indirect children, including its subACS and all the ACS and subACS which are its children. |
void |
removeComponentNodeToIS(ImmutableName _ISname,
ImmutableName _name)
Called to remove a physical or logical component to the IS nametrees, and all its direct and indirect children, including its subACS and all the ACS and subACS which are its children. |
void |
removeCompositeNodeToIS(ImmutableName _ISname,
ImmutableName _name)
Called to remove a Composite ACS or a Composite subACS to the IS nametrees. |
void |
removeIS(ImmutableName _name)
Called by removeACS() to remove an information system, and to save the new NameTrees map. |
protected void |
removeMetaRight(StringMetaRight _right)
UNUSED METHOD. |
private void |
removeOneACS(ImmutableName _name)
The ACS name is removed from the ACS list and from the IS nametree, like all its children in the IS nametree if they exist. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener _l)
remove a listener to the bean. |
void |
removePropertyChangeListener(java.lang.String _propertyName,
java.beans.PropertyChangeListener _l)
remove a listener to the bean. |
void |
removeView(ImmutableName _name)
The view name is removed from the view list in ViewManager. |
private void |
restoreACSExternalLinks(ACSImpl _acs)
Restores all the external links to another open ACS and in the metarights. |
void |
restoreACSInternalLinks(ACSImpl _acs)
Restores all the internal properties of an ACS. |
private void |
saveACS(ACSImpl _acs)
Saves an open ACS without closing for it. |
void |
saveAllViews()
Save all the open views in some files (one per view) in the default data directory. |
void |
saveAndCloseDefaultBase()
Save and close the base with the ACS and the view lists, even if it is empty. |
void |
saveAndCloseOpenView(ViewInBase _view)
Close an open view and save it before. |
void |
saveDefaultBase()
Saves the base with the ACS and view lists, even if there are empty. |
void |
saveGUI(java.util.Map _config)
Saves the GUI configuration in the file 'GUI_config.acr'. |
private static void |
saveMetaRights()
Save the metarights list. |
private void |
saveNameTrees()
Save the NameTrees map in the file 'l_metarights_v0.acr'. |
void |
saveOpenACS(ACSImpl _acs)
Saves an open ACS without closing it, with a synchronization on it. |
void |
saveOpenView(ViewInBase _view)
Saves an open view without closing it. |
private void |
saveView(ViewInBase _view)
Saves a view without closing it. |
private void |
updateAndSaveAcsAddonDescriptors()
Fills up the list l_AcsAddonDescriptors__ with the ACS addon editors and names. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int INITIAL_CAPACITY
private static java.util.List<ImmutableName> l_Acs__
private static java.util.Map<ImmutableName,ImmutableNameISTree> m_NameTrees__
private static java.util.List<java.lang.String> l_AcsAddonDescriptors__
private static java.util.List<ImmutableName> l_Views__
protected static java.util.Map<ImmutableName,ImmutableACS> m_OpenAcs__
protected static java.util.Map<ImmutableName,ViewInBase> m_OpenViews__
protected static java.util.List<StringMetaRight> l_MetaRights__
protected static java.util.Map<java.lang.String,StringMetaRight> m_MetaRightsFromRight__
protected static java.util.Map<java.lang.Integer,StringMetaRight[]> m_MetaRightsArrayFromPower__
private static final long serialVersionUID
private transient java.beans.PropertyChangeSupport changeSupport_
protected static final BaseManagerImpl INSTANCE
public static final java.io.ObjectStreamField[] serialPersistentFields
Constructor Detail |
---|
private BaseManagerImpl()
Method Detail |
---|
public static final BaseManagerImpl getInstance()
private static final void createMetaRightMaps()
public boolean knowsIS(ImmutableName _name)
_name
- ImmutableName of an IS
public ImmutableName getISofName(ImmutableName _name)
_name
- of the node or area. Never null.
public java.util.Set<ImmutableName> getL_IS()
public java.util.Map<ImmutableName,ImmutableNameISTree> getM_ISTrees()
public ImmutableNameISTree getISTree(ImmutableName _name)
_name
- name of the IS; not null
public final void addIS(ImmutableName _name, boolean _is_hub) throws BaseError
_name
- name of a new IS. Not null._is_hub
- is true if the IS is a node hub, which means that for this node,
any direct child may have exchanges with any other direct child, if the rights allow them.
BaseError
- if the IS name is already known as ACS, IS or component,
or FileNotFoundException and IOException.public final void removeIS(ImmutableName _name) throws BaseError
_name
- of an IS. Never null.
BaseError
- if the IS name is not known, or
FileNotFoundException and IOException.protected final void addAcsOrSubAcsNodeToIS(ImmutableName _ISname, Name _parent, ImmutableName _name, java.lang.String _node_type, boolean _is_hub, java.lang.String _visible_space, boolean _server, boolean _fireChange) throws BaseError
_ISname
- the IS name_parent
- is a node in the nametree. May be null._name
- is the new ACS or subACS name, which is put at the end
of the children array of _parent_node_type
- is the _name type; it is an allowed type for the _parent
children, following the NameTreeImpl policy._is_hub
- is true if the child is a node hub, which means that for this node,
any direct child may have exchanges with any another direct child._visible_space
- is the visible space for the ACS. Never null._server
- true if the new ACS is an authorization server.
Not used for a subACS, for which this method sets it to false._fireChange
- true to fire a property change 'OneInformationSystemNode'.
To set to false if Tied-Child, Composite or Alternate relations have still to be set.
BaseError
- if _parent is not a node of this nametree,
if _child is null, is already a nametree node, if
the parent does not allow this type for its children,
wrong node type, wrong visible space,
or if its length is greater than 12,
or FileNotFoundException and IOException.protected final void addSecondaryPropertiesToAcsOrSubNode(ImmutableName _ISname, ImmutableName _name, boolean _is_tied_child, ImmutableName _composite, ImmutableName[] _l_alternates, java.util.Map<ImmutableName,java.lang.String[]> _m_alternateProperties, boolean _fireChange) throws BaseError
The Composite relation is defined in the mandatory paths of _name, and _name is added as subcomposite to the ImmutableNameISTree.Area which defines the Composite.
The Alternate relation is defined through the two last method arguments, which must be coherent. The items in _l_alternates are ACS/SubACS/Composite ACS/Composite SubACS nodes in the IS nametree. Almost all the couples are allowed in the Alternate relation, excepted when a ground ACS has an alternate SubACS or Composite SubACS.
The _m_alternateProperties keys must be strictly the _l_alternates items. The _m_alternateProperties value for a key is a String array with the ISFactoryUtilityImpl constants: ALTERNATE_TYPE at the index 0 (mandatory), then, without any specific order in the array, some right types (mandatory), OPTIONAL_ALTERNATE (optional), OPTIONAL_GROUND (optional). The argument _m_alternateProperties is stored in specific links in the IS nametree. A double name derived from _name and the alternate name is used as key for the link. These specific keys are not handled by NameISTreeImpl, so they are managed by this method and the class ISNodeImpl.
It is possible to change, through this method, some of the 3 relations for a given ACS or subACS. There are some dependencies among the relations, and there are checked by this method which throws an exception if a constraint is not fulfilled. The dependencies between relations are listed hereafter:
- a subcomposite cannot be a ground for alternates.
- a subcomposite ACS may be a Tied-Child of its parent, but it is not workable until all the subcomposites of the Composite are opened.
The ACS node is always opened by this method.
May fire a property change 'OneInformationSystemNode' with the new node name.
_ISname
- the IS name_name
- is the ACS or subACS node name in the current IS nametree_is_tied_child
- true if the new ACS is a tied child to its parent.
Not used for a subACS, for which this method sets it to false._composite
- name of the Composite ACS or Composite SubACS for which
this ACS or subACS is a subcomposite. This subcomposite is added
to the Composite list. May be null._l_alternates
- are the alternate names in the same IS for this ACS or subACS
as a ground. No more than 4 items. May be null or empty. Each argument is updated._m_alternateProperties
- where each name in _l_alternates is a map key,
and the map value is an array of the properties for the alternate. Must be
not null if _l_alternates is not null nor empty, with the good format._fireChange
- true to fire a property change 'OneInformationSystemNode'.
To set to false if it is not the last call to this method in the same sequence.
BaseError
- if a constraint is not fulfilled,
or FileNotFoundException and IOException.protected final void addCompositeNodeToIS(ImmutableName _ISname, java.lang.String _name, java.lang.String _node_type, boolean _is_authorization_server) throws BaseError
It implements a Composite through the ImmutableNameISTree.Area property. The property is_hub_for_children is always true for a composite. The extended visible space of a composite is always NameISTreeImpl.ALL_THE_IS_SPACE. A composite is never a tied child of its parent. Its working depends on the opening of all its subcomposites, and this is managed by this class at each opening and closing of an ACS. The standard information systems IPV4/6_ADDRESSES_SPACE do not allow a composite node. The Composite node is not opened by this method.
Firing of a property change 'OneInformationSystemNode' with the new node name.
_ISname
- the IS name_name
- the last component of the new Composite ACS or subACS name_node_type
- is the _name type; it is an allowed type for the _parent
children, following the ISImpl policy._is_authorization_server
- true if the new Composite ACS is an authorization server.
Not used for a Composite subACS, for which this method sets it to false.
BaseError
- if _parent is not a node of this nametree,
if _child is null, is already a nametree node, if
the parent does not allow this type for its children, wrong node type,
or FileNotFoundException and IOException.public final void addComponentNodeToIS(ImmutableName _ISname, ImmutableName _name, java.lang.String _node_type) throws BaseError
_ISname
- the IS name_name
- is the new component name, which is put at the end
of the children array of its parent_node_type
- is the _name type; it is an allowed type for the _parent
children, following the ISImpl policy.
BaseError
- if the parent is not a node of this nametree,
if _child is null, is already a nametree node, if
the parent does not allow this type for its children,
wrong node type, or FileNotFoundException and IOException.private final void removeAcsNodeToIS(ImmutableName _ISname, ImmutableName _name) throws BaseError
This method is called only by removeACS(). Handles the Tied-Child, Composite, Alternate relations of the ACS and its subACS.
Some of the Alternate properties are stored in specific links in the IS nametree. A double name derived from _name and the alternate name is used as key for the link. These specific keys are not handled by NameISTreeImpl, so they are managed by this method.
Firing of a property change 'OneInformationSystemNode' with the old node name.
_ISname
- the IS name_name
- is the ACS name
BaseError
- if a name is null or unknown, if it is not an ACS node,
or FileNotFoundException and IOException.public final void removeCompositeNodeToIS(ImmutableName _ISname, ImmutableName _name) throws BaseError
_ISname
- the IS name_name
- is the Composite ACS or Composite subACS name
BaseError
- if _parent is not a node of this nametree,
if _name is null, or FileNotFoundException and IOException.public final void removeComponentNodeToIS(ImmutableName _ISname, ImmutableName _name) throws BaseError
Firing of a property change 'OneInformationSystemNode' with the old node name.
_ISname
- the IS name_name
- is the new ACS or subACS name
BaseError
- if a name is null or unknown, if it is not an ACS node,
or FileNotFoundException and IOException.public final java.util.Set<ImmutableName> getL_CompositeNodesOfIS(ImmutableName _ISname)
_ISname
- the IS name
private final void saveNameTrees() throws BaseError
BaseError
- if FileNotFoundException and IOException.private final void updateAndSaveAcsAddonDescriptors() throws BaseError
BaseError
- if FileNotFoundException and IOException, or if an AcsAddon
have not the 4 standard directories (gBase, gBaseBeanInfo, gBaseInterface, gWork).public ACSImpl openACS(ImmutableName _name) throws BaseError
openACS
in interface ACSManager
_name
- ImmutableName of the ACS to open. Its file name is built
with the two last components of the name, or with the single component
BaseError
- if the ACS is not known, the ACS is open, the open
ACS has not the same name, or ClassNotFoundException, IOException with
invalidClassException if ACSImpl has changed.public java.util.Map<java.lang.String,java.util.List<java.lang.String>> importACS(ImmutableName _name) throws BaseError, DialogError
This method restores all the inner properties of the imported ACS, including its structure, behavior and ACSobjects. This includes the ACS roots, but they are applied only if the parent is an ACS. Otherwise, the roots are deleted during the import. If the parent is an ACS, it has to comply to the structure and behavior of the parent ACS source, so that the roots action may be applied without error. However, errors in the creation of roots do not stop the import operation.
This method never opens the external ACSObjects of the imported ACS, and its closed Bridges, AclEntries and linked Privileges. It rather returns a map containing the description of these closed objects. The user may choose, in the class ActionImportACS, to create some of these closed objects. The returned map described each Bridge, AclEntry or Privilege, including the rights. Even if they are ACS rights from the imported ACS, they are always fully defined. The import operation resets the links between the ACS rights and the current metarights of the running Access Road instance. Called by ACS_Facade.getImportedACS(). Fires an event 'OpenACS' after the ACS opening.
_name
- ImmutableName of the ACS to import. Its file name is built
with the two last components of the name, or with the single component
BaseError
- if the ACS name is known or null argument,
or SecurityException, or the IS name of the imported acs or
its parent in the IS ImmutableNameTree are unknown, or wrong saving
DialogError
- if the open ACS has not the same name,
or ClassNotFoundException, IOException with
invalidClassException if ACSImpl has changed.ActionImportACS
public void saveDefaultBase() throws BaseError
saveDefaultBase
in interface ACSManager
BaseError
- if an acs or a view is not open, ACSname.lastComponent() is null,
FileNotFoundException or IOException.public void closeDefaultBase() throws BaseError
closeDefaultBase
in interface ACSManager
BaseError
- if an acs is not open.public void saveAndCloseDefaultBase() throws BaseError
saveAndCloseDefaultBase
in interface ACSManager
BaseError
- if an acs or a view is not open, ACSname.lastComponent() is null,
FileNotFoundException or IOException.public void saveOpenACS(ACSImpl _acs) throws BaseError
- If one of its Resources or one of its EligibleParty is controlled by the AclEntry or the linked Privilege of an another ACS, it is NOT unrecorded in this another ACS.
- If _acs is a controller, its external AclEntries and linked Privileges are unrecorded in the controlled Resources and relevant EligibleParties, and in their main ACS, then _acs is saved and its external AclEntries and linked Privileges are recorded again with _acs.checkClosedAclEntries(), but they are new instances THAT MUST BE TAKEN IN ACCOUNT BY THE APPLICATION.
- If _acs has bridge links, they are also cuts then restored.
Called by saveDefaultBase(). Calls saveACS(), and the code is synchronized on the argument.
saveOpenACS
in interface ACSManager
_acs
- to be saved
BaseError
- if _acs is not open, ACSname.lastComponent() is null,
or FileNotFoundException and IOException.public void closeOpenACS(ACSImpl _acs, boolean _withSaving) throws BaseError
closeOpenACS
in interface ACSManager
_acs
- ACS to be closed and finalized._withSaving
- true to save the ACS
BaseError
- if _acs is not open.public void removeACS(ImmutableName _name) throws BaseError
removeACS
in interface ACSManager
_name
- ACS to remove from the base.
BaseError
- if the ACS is unknown, or it is not a leaf in the IS nametree,
or if ACSname.lastComponent() is null, FileNotFoundException and IOException.public java.util.List<ImmutableName> getL_ACSNames()
getL_ACSNames
in interface ACSManager
public java.util.Map<ImmutableName,ImmutableACS> getEorM_OpenACS()
getEorM_OpenACS
in interface ACSManager
public boolean knowsACS(ImmutableName _name)
knowsACS
in interface ACSManager
_name
- ImmutableName of an ACS
public boolean isOpenACS(ImmutableName _name)
isOpenACS
in interface ACSManager
_name
- ImmutableName of an ACS
public final void restoreACSInternalLinks(ACSImpl _acs)
_acs
- to be restored.public long getSerialVersionUID()
getSerialVersionUID
in interface ACSManager
getSerialVersionUID
in interface ViewManager
public boolean getSupportsXML()
public void addPropertyChangeListener(java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
_l
- PropertyChangeListener to add. Caution: the listener must NOT
have specific hashCode() and equals() methods, to work with HashSet
in the removing operations.public void addPropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
addPropertyChangeListener
in interface BaseBeanManager
addPropertyChangeListener
in interface BoundBean
_propertyName
- String is the name of the property_l
- PropertyChangeListener to add. Caution: the listener must NOT
have specific hashCode() and equals() methods, to work with HashSet
in the removing operations.public void removePropertyChangeListener(java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BaseBeanManager
removePropertyChangeListener
in interface BoundBean
_l
- PropertyChangeListener to removepublic void removePropertyChangeListener(java.lang.String _propertyName, java.beans.PropertyChangeListener _l)
removePropertyChangeListener
in interface BaseBeanManager
removePropertyChangeListener
in interface BoundBean
_propertyName
- String is the name of the property_l
- PropertyChangeListener to removeprotected final void newEorACS(ACS _acs, boolean _ISroot_is_hub) throws BaseError
- The ACS name is already known as an ACS name.
- The ACS name is already known as the name of an object into another open ACS.
The caller may invoke later the methods addAcsOrSubAcsNodeToIS() and addSecondaryPropertiesToAcsOrSubNode().
Caution: the new ACS may have the name of an ACSObject in a closed ACS, and this is not checked. When the closed ACS is opened, there is no more checking of the name doublons. In the search of objects from their names, the ACS is selected first.
_acs
- is the new ACS to be recorded in the base manager.
_acs must not be null (throws an InternalError)_ISroot_is_hub
- is true for a new IS for which the root in the nametree
is a hub. There is a new IS if _acs.getISName() returns an unknown IS name, and
otherwise this argument is not used.
BaseError
- if the ACS name is already known as ACS, IS or component,
if the IS name is not known, if _parentName is not a node of the IS nametreeaddAcsOrSubAcsNodeToIS(ARoad0.gBaseInterface.ImmutableName, ARoad0.gBaseInterface.Name, ARoad0.gBaseInterface.ImmutableName, java.lang.String, boolean, java.lang.String, boolean, boolean)
private final void saveACS(ACSImpl _acs) throws BaseError
_acs
- ACS to be saved.
BaseError
- if ACSname.lastComponent() is null,
or FileNotFoundException and IOException.private void removeOneACS(ImmutableName _name) throws BaseError
_name
- of the ACS to remove from the base.
BaseError
- if the ACS is unknown, or it is not a leaf in the IS nametree,
or if ACSname.lastComponent() is null, FileNotFoundException and IOException.private final void cutACSExternalLinks(ACSImpl _acs)
If one of the ACS resource or eligible party is controlled by the AclEntry of an another ACS, to avoid failed external references, it is unregistered in this another ACS with ACS.ExternalAclEntries(_acs).
If _acs is a controller, its external AclEntries are unregistered in the controlled resources and relevant eligible parties, and in their main ACS, with _acs.ExternalAclEntries(all ACS).
If one of the ACS resource or eligible party is controlled through the linked privilege of another ACS, or controls through a linked privilege of another ACS, its external privileges are unregistered with ACS.closeExternalLinkedPrivileges(). If _acs has bridge links, their are closed with closeBridges() in the two sens.
The code is synchronized on the argument and also on each other open ACS to process. Called by saveOpenACS(), closeACS().
_acs
- to isolate from the other open ACSprivate final void cutACSInternalLinks(ACSImpl _acs)
_acs
- to be saved.private final void restoreACSExternalLinks(ACSImpl _acs)
_acs
- to restoreprivate void closeACS(ACSImpl _acs, boolean _withSaving) throws BaseError
- If one of its resources or one of its eligible party is controlled by the aclEntry of an another ACS, to avoid failed external references, it is unrecorded in this another ACS with ACS.closeAclEntriesTo(_acs).
- If _acs is a controller, its aclEntries are unrecorded in the controlled resources and relevant eligible parties, and in their main ACS, with closeAclEntriesTo(_acs).
- If there are bridge links, closes them.
- cuts the links with metarights.
- then finalizes the ACS.
After the call of this method, set the _acs to null, or restore it with _acs = openACS(cloned _acs name). Fires an 'OpenACS' event to the ACSTreeBaseListenerImpls and ViewInBases before the the finalization of the ACS and its true removing in m_OpenAcs__. Then, the open views that contains some objects from this ACS are closed without user message. Fires an 'OneInformationSystemNodeOpening' event to the BaseListeners after the finalization of the ACS and its removing. Called by closeOpenACS(). Calls saveACS(), and the code is synchronized on the argument.
_acs
- to be closed and finalized_withSaving
- true to save the ACS
BaseError
- if _acs is not open.public void openAllViews() throws BaseError, DialogError
openAllViews
in interface ViewManager
BaseError
- if a view is not known or ClassNotFoundException,
a view object belongs to a closed ACS (with the relevant closed
ACS names that may be get through BaseError.getL_Exception()),
or IOException, or if a view is open at the start of the method (if so,
close it before a new call to this method).
DialogError
- if a view contains closed-ACS objects.public void saveAllViews() throws BaseError
saveAllViews
in interface ViewManager
BaseError
- if viewName.lastComponent() is null,
FileNotFoundException or IOException.public void saveAndCloseOpenView(ViewInBase _view) throws BaseError
saveAndCloseOpenView
in interface ViewManager
_view
- ViewInBase to be saved, closed and finalized.
BaseError
- if ViewName.lastComponent() is null,
or FileNotFoundException and IOException.public void saveOpenView(ViewInBase _view) throws BaseError
saveOpenView
in interface ViewManager
_view
- ViewInBase to be saved.
BaseError
- if _view is not open, ViewName.lastComponent() is null,
or FileNotFoundException and IOException.public java.util.List<ImmutableName> getL_ViewNames()
getL_ViewNames
in interface ViewManager
public java.util.Map<ImmutableName,ViewInBase> getEorM_OpenViews()
getEorM_OpenViews
in interface ViewManager
public boolean knowsView(ImmutableName _name)
knowsView
in interface ViewManager
_name
- ImmutableName of a view
public boolean isOpenView(ImmutableName _name)
isOpenView
in interface ViewManager
_name
- ImmutableName of a view
public ViewInBase openView(ImmutableName _name) throws BaseError, DialogError
openView
in interface ViewManager
_name
- ImmutableName of an EPRViewInBaseImpl to open. Its file name is built
with the three last components of the name, at most.
BaseError
- if the view is not known, the view is open,
the open view has not the same name,
or ClassNotFoundException, IOException.
DialogError
- if the view contains an object from a closed ACS,
and the exception message should be shown to the userpublic java.util.Set<ImmutableName> getElementsOfOneView(ImmutableName _name, boolean _acsNames) throws BaseError
_name
- of an opened or closed ViewInBase._acsNames
- false to get the view elements names, true to get the names of
the ACS which own the view elements
BaseError
- if the view is not known,
the open view has not the same name,
or ClassNotFoundException, IOException.public void closeOpenView(ViewInBase _view)
closeOpenView
in interface ViewManager
_view
- to be closed and finalized. Is null when a view
is closed after the closing of one of its ACS, because gDMak.ActionClose
cannot get the view then.public void closeSketchView(EPRViewInBaseImpl _view)
_view
- to be closed and finalized.public void removeView(ImmutableName _name) throws BaseError
removeView
in interface ViewManager
_name
- ImmutableName of the view to remove.
BaseError
- if the view is unknown,
viewName.lastComponent() is null,
or FileNotFoundException and IOException.public final void saveGUI(java.util.Map _config) throws BaseError
_config
- is the map of the configuration objects, where the object
name is the key
BaseError
- if FileNotFoundException and IOException.public final java.util.Map getGUI() throws BaseError
BaseError
- if ClassNotFoundException and IOException.public java.util.List<StringMetaRight> getL_MetaRights()
public java.util.List<java.lang.String> getL_AcsAddonDescriptors()
public java.util.List<StringMetaRight> getL_NonAdministrativeMetaRights()
public StringMetaRight getMetaRight(java.lang.String _right)
_right
- is from StringRight.getRight()
public StringMetaRight getMetaRightFromName(ImmutableName _name)
_name
-
public StringMetaRight[] getL_MetaRightsFromPower(int _power)
_power
- is the power of the searched metarights
public static void newMetaRight(StringMetaRight _right, boolean _toSave) throws CreateError
_right
- the new metaright_toSave
- true if the saving must be provided
CreateError
- if the metaright is already knownprotected void removeMetaRight(StringMetaRight _right) throws CreateError
CreateError
- if the metaright is not knownprivate static final void saveMetaRights() throws BaseError
BaseError
- if FileNotFoundException or IOExceptionprotected void firePropertyChange(java.lang.String _propertyName, java.lang.Object _oldValue, java.lang.Object _newValue)
_propertyName
- name of the changing property_oldValue
- of the property_newValue
- of the property. No operation if equal to _oldValue
and if the two values are not null.protected final void newEorView(ViewInBase _view) throws CreateError
_view
- is the new view to be recorded.
_view must not be null (throws InternalError).
CreateError
- if the view name is already knownprotected final void newEorCopiedViewToSave(ViewInBase _view) throws BaseError
_view
- is the new view to be recorded.
_view must not be null (throws InternalError).
BaseError
- if the view name is already knownprivate final void saveView(ViewInBase _view) throws BaseError
_view
- to be saved.
BaseError
- if ViewName.lastComponent() is null,
or FileNotFoundException and IOException.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |