ARoad0.gBaseInterface
Interface ACSManager

All Superinterfaces:
BaseBeanManager, BoundBean
All Known Implementing Classes:
BaseManagerImpl

public interface ACSManager
extends BaseBeanManager, BoundBean

This interface is responsible for managing the ACSs in the generic base through specific methods.

See Also:
BaseManagerImpl

Method Summary
 void closeDefaultBase()
          Closes the base without savings, with all the ACS and all the views.
 void closeOpenACS(ACSImpl _acs, boolean _withSaving)
          Closes an open ACS without saving it.
 java.util.Map getEorM_OpenACS()
           
 java.util.List getL_ACSNames()
          Returns the names of open or closed ACS.
 long getSerialVersionUID()
           
 boolean isOpenACS(ImmutableName _name)
           
 boolean knowsACS(ImmutableName _name)
           
 ACS openACS(ImmutableName _name)
          Opens a registered and closed ACS from a file in the current directory.
 void removeACS(ImmutableName _name)
          The ACS name is removed from the ACS list and from the IS nametree, like its children in the IS nametree if they exist.
 void saveAndCloseDefaultBase()
          Saves and closes the base with the ACS and the view lists, even if it is empty.
 void saveDefaultBase()
          Saves the base with the ACS and view lists, even if there are empty.
 void saveOpenACS(ACSImpl _acs)
          Saves an opens ACS with out close it.
 
Methods inherited from interface ARoad0.gBaseInterface.BaseBeanManager
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface ARoad0.gBaseInterface.BoundBean
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Method Detail

openACS

ACS openACS(ImmutableName _name)
            throws BaseError
Opens a registered and closed ACS from a file in the current directory. Analyze the need to open the closed aclEntries in every open ACS and in this ACS, with checkClosedAclEntries(). No need for closing open aclEntries, since all external AclEntries have been closed during the last save of this ACS.

Parameters:
_name - ImmutableName of the ACS to open. Its file name is built with the two last components of the name, or with the only component if it is alone.
Returns:
ACS: direct reference to the opened ACS after setting all the external references to open ACS, and deleting all the references to closed ACS.
Throws:
BaseError - if the ACS is not known, the ACS is open, the open ACS has not the same name, or ClassNotFoundException, IOException.

knowsACS

boolean knowsACS(ImmutableName _name)
Parameters:
_name - ImmutableName of an ACS
Returns:
boolean true if _name is known as an ACS name. The ACS may be open or closed.

isOpenACS

boolean isOpenACS(ImmutableName _name)
Parameters:
_name - ImmutableName of an ACS
Returns:
boolean true if _name is known as an ACS name and the ACS is open.

getL_ACSNames

java.util.List getL_ACSNames()
Returns the names of open or closed ACS.

Returns:
unmodifiable list of ACS names

getEorM_OpenACS

java.util.Map getEorM_OpenACS()
Returns:
unmodifiable map of non-null instances of ACS

saveDefaultBase

void saveDefaultBase()
                     throws BaseError
Saves the base with the ACS and view lists, even if there are empty. All the open ACS, but not the closed ones, are saved in some files (one per open ACS) in the default directory. All the open views, but not the closed ones, are saved in some files (one per open view) in the default directory. Fires a 'OpenACS' event before each ACS closing, to done it before the ACS proper events. Fires a 'OpenViews' event before each view closing, to done it before the view proper events.

Throws:
BaseError - if an acs or a view is not open, ACSname.lastComponent() is null, FileNotFoundException or IOException.

saveAndCloseDefaultBase

void saveAndCloseDefaultBase()
                             throws BaseError
Saves and closes the base with the ACS and the view lists, even if it is empty. All open ACS and views, but not the closed ones, are saved in some files (one per open ACS and view) in the default directory.

Throws:
BaseError - if an acs or a view is not open, ACSname.lastComponent() is null, FileNotFoundException or IOException.

saveOpenACS

void saveOpenACS(ACSImpl _acs)
                 throws BaseError
Saves an opens ACS with out close it. The ACS instance is not modified. - If one of its resources or one of its eligible party is controlled by the aclEntry of an another ACS, it is NOT unrecorded in this another ACS. - If _acs is a controller, its external aclEntries are unrecorded in the controlled resources and relevant eligible parties, and in their main ACS, with _acs.closeAclWithExternalReferences(), then _acs is saved and its external aclEntries are recorded again with _acs.checkClosedAclEntries(), but they are new instances THAT MUST BE TAKEN IN ACCOUNT BY THE APPLICATION. ACSManager then fires a swithExternalAclEntriesEvent to the registered listeners in the application ( TO DO ).

Parameters:
_acs - ACSImpl to be saved.
Throws:
BaseError - if _acs is not open, ACSname.lastComponent() is null, or FileNotFoundException and IOException.

closeOpenACS

void closeOpenACS(ACSImpl _acs,
                  boolean _withSaving)
                  throws BaseError
Closes an open ACS without saving it. Uses this method after a saving, or when an ACS instance is corrupted, before the opening of the old saving. The ACS is still known in ACSManager. Call closeACS() for each ACS under _acs in the IS nametree, and for _acs. After the call of this method, set the _acs to null, or restore it with _acs = openACS(cloned _acs name).

Parameters:
_acs - ACS to be closed and finalized.
_withSaving - true to save the ACS
Throws:
BaseError - if _acs is not open.

closeDefaultBase

void closeDefaultBase()
                      throws BaseError
Closes the base without savings, with all the ACS and all the views.

Throws:
BaseError - if an acs is not open.

removeACS

void removeACS(ImmutableName _name)
               throws BaseError
The ACS name is removed from the ACS list and from the IS nametree, like its children in the IS nametree if they exist. If it is open, the ACS is closed and saved before. So, it will be possible to restore the ACS in the futur. To handle a corrupted ACS instance and recover a correct ACS from file, you must rather use closeOpenACS(). The ACS saving file is not deleted, but it could be by the user, or be moved for a future use. ACSManager.openACS(_name) wont work..

Parameters:
_name - ImmutableName of the ACS to remove from the base.
Throws:
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.

getSerialVersionUID

long getSerialVersionUID()
Returns:
long static final