|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.gBase.BaseUtilityImpl
public class BaseUtilityImpl
This class is an utility class for all the ACS, with only static methods. It provides synchronized methods to copy, get a BaseObject or a BeanInfo. This class is not used by the view core algorithms, since its methods are dedicated to the updating and the displaying of the gBase class properties. A lot of methods are final, to provide generic operations. The subclasses of this class are in the AcsAddon packages. Caution: this class is not defined in ACSFactoryUtilityImpl.M_GENERIC_ACS_VOCABULARY, then it is not possible to get its subclasses in the AcsAddons, through ARoad0.gBaseInterface.ACSRun.getM_AcsVocabulary(). Then, a BaseUtilityImpl subclass is always reserved to its AcsAddon packages and its own subclasses.
Field Summary | |
---|---|
protected static int |
INITIAL_CAPACITY
|
protected static BaseUtilityImpl |
instance__
|
Constructor Summary | |
---|---|
protected |
BaseUtilityImpl()
Protected constructor for the subclasses. |
Method Summary | |
---|---|
static java.util.List |
addObjectInDecreasingSort(java.util.List _l_current,
java.lang.Comparable _newObject)
Adds a comparable object, and sort the resulting set with compareTo() to put the object in a decreasing order. |
static StringRight[] |
addRightInDecreasingSort(StringRight[] _l_currentRights,
StringRight _newRight)
Adds a right, and sort the resulting set with StringRightImpl.compareTo() to put the right in a decreasing order. |
static Directory |
copyDirectoriesAndActorsWithoutInternalAcl(Directory _dirToCopy,
Directory _dir)
Copies all the actors and all the subdirectories without internal acl copy. |
static Directory |
copyDirectoriesAndResources(Directory _dirToCopy,
Directory _dir)
Applies ((ResourceImpl)child).copyOwnAcl() to each element under _dir. |
static Directory |
copyDirectoryChildren(Directory _dirToCopy,
Directory _dir)
Copies a DirectoryImpl, and copies all the children and children of children without any specific order. |
static ACS |
copyDirectoryChildrenForACS(ACS _acsToCopy,
ACS _acs)
Copies all the ACS directories, and copies all the children and children of children with the standard copy() method of the Copyable interface. |
static GroupID[] |
copyGroupsTree(GroupID _groupToCopy,
GroupID _grp)
UNUSED - copies a GroupID tree with all members, to register in _grp (not copied) all the _groupToCopy members |
static GroupID[] |
copyOrAddGroupMembers(GroupID _groupToCopy,
GroupID _grp)
Copies or adds members to a GroupID from another one members |
static ImmutableName |
getAcsNameFromName(ImmutableName _rightName)
Get the ACS name from the acsright name. |
static java.util.Set<ImmutableGroupIDMember> |
getAllIndirectGroupMembers(GroupID _grp)
Gets all the direct and all the indirect members of a group. |
static java.util.Set<ImmutableEligibleParty> |
getAllIndirectGroupMembersAndRunningUnderActors(GroupID _grp)
Gets all the direct and indirect members of a group, and all the running-under actors for which this group is a primary or a secondary group. |
static ImmutableName |
getBaseObjectTrueName(ImmutableName _initialName,
java.lang.Class _class)
For UserIDs and GroupIDs, adds '<U>' or '<G>' before the name last component. |
static java.lang.String |
getBeanInfoNameForISnode(java.lang.String _text)
Gets the name of the BeanInfo class from the ISNodeImpl type. |
protected static StringRight[] |
getChildRightsFromParentAGRights(StringRight[] _l_parentRights,
ImmutableACS _acs)
Gets the child inherited rights from the AG directory rights, for the children. |
protected static java.util.Set<StringRight> |
getChildRightsSetFromParentAGRights(StringRight[] _l_parentRights,
ImmutableACS _acs)
Gets the child inherited rights from the AG directory rights, for the children. |
static java.util.List<java.lang.String> |
getClassicSuperInterfacesFromBeanInfo(BeanInfoPattern _baseObjectBeanInfo)
Gets the set of all the classical interfaces and super-interfaces of the BaseObject from its BeanInfo.getBeanDescriptor().getBeanClass(). |
static BaseObject |
getEorBaseObject(ImmutableName _name)
Gets the BaseObject from the open entities only. |
static ImmutableName |
getFromKownACS(ImmutableName _name)
A Basic name starts with its ACS name, and this is used to detect if a name is from a known ACS in the full structure. |
static BaseUtilityImpl |
getInstance()
Method to obtain the unique instance of BaseUtilityImpl. |
static StringRight[] |
getL_AcsRestrictedRights(BeanInfoPattern _baseObjectBeanInfo,
BaseObject _source,
java.lang.String _propertyName,
ImmutableACS _acs,
java.lang.String _type)
Gets the restricted rights from the ACS for the property of an ACSObject. |
static java.lang.String[] |
getL_AcsRestrictedTypes(BeanInfoPattern _baseObjectBeanInfo,
java.lang.String _propertyName,
ImmutableACS _acs)
Gets the restricted ACSObject types for the property of an ACSObject to set in the GUI. |
static StringRight[] |
getL_AcsSpecializedRights(java.lang.String _propertyName,
ImmutableACS _acs,
java.lang.String _resourceType,
java.lang.String _EPType,
java.util.Collection _l_interfaces)
Gets the allowed specialized rights from the ACS for the property of an ACSObject. |
static boolean |
getNoDisplayThisRightProperty(ACSObject _object,
java.beans.PropertyDescriptor _propertyDescriptor,
ACS _acs)
Detects the need to display a right property in the beamer, following the ACS policy about its standard and specialized rights. |
static java.lang.Object[] |
getRestrictedValues(BeanInfoPattern _baseObjectBeanInfo,
java.lang.String _propertyName,
ACSRun _acs,
BaseObject _source,
java.lang.String _type)
Gets the restricted String or StringRight values for the argument of a new ACSObject. |
static StringRight |
getRightFromNameAsString(java.lang.String _text,
ACSRun _acs)
Get the right from the string returned by getName().toString(), both for StringRightImpl and StringMetaRightImpl instances. |
static boolean |
isAcsRightName(ImmutableName _rightName)
Called by BeamerManager. |
static boolean |
isExternalACSobject(ACSImpl _acs,
ImmutableName _objName,
boolean _forSource)
Called by ACSImpl and PrivilegeForLinksImpl.finalizeForBase(), to check the presence of the ACSObject named _objName as a source of an external AclEntry or an external Linked Privilege, if _forSource is true, or as a target, also for an external AclEntry or an external linked Privilege. |
static java.lang.String |
removeSpacesInString(java.lang.String _propertyName)
Removes the whitespaces. |
static boolean |
withAcrossToDirectoryAGRights(StringRight[] _l_rights)
Analyzes the directory rights to say if the AG inherited rights which are derived from the directory rights allow some access to the child. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static BaseUtilityImpl instance__
protected static final int INITIAL_CAPACITY
Constructor Detail |
---|
protected BaseUtilityImpl()
Method Detail |
---|
public static BaseUtilityImpl getInstance()
public static final BaseObject getEorBaseObject(ImmutableName _name) throws BaseError
_name
- name of the object
BaseError
- if there is no open object with this namepublic static final ImmutableName getBaseObjectTrueName(ImmutableName _initialName, java.lang.Class _class)
_initialName
- to analyze. Not null._class
- of the BaseObject. Never null.
public static final ImmutableName getFromKownACS(ImmutableName _name)
_name
- the name of the ACSObject, which may be unknown by the ACS
public static final java.lang.Object[] getRestrictedValues(BeanInfoPattern _baseObjectBeanInfo, java.lang.String _propertyName, ACSRun _acs, BaseObject _source, java.lang.String _type)
- first, if _propertyName contains 'Rights', from the ACS.getM_SpecializedRights() map if there is a matched key, and then, the values are in a StringRight array,
- second, if _propertyName contains 'Rights', from the ACS.getM_StandardRights() map if there is a matched key, and then, the values are in a StringRight array,
- third, from the ACS.getM_SpecializedTypesAndExplorer() map if there is a matched key, and then, the values are in a String array,
- fourth, from the property descriptor in the BeanInfo if 'limitedSetForValues' is not null, and then, the values are in a String array.
For the privilege 'MainType' property in the constructor, returns only the simple typed and the simple linked privilege types. Called:
- by BaseObjectHandler.getArgumentEditor() with a null or non-null ACSRun argument,
- by CollectioPropertyEditor.actionPerformed() for the Select button.
Calls getL_AcsRestrictedRights() and getL_AcsRestrictedStrings().
_baseObjectBeanInfo
- is the BeanInfo instance where the properties are described_propertyName
- is the name of the restricted property in the BeanInfo,
with spaces between words or not._acs
- is the new object ACS or ACSFactory. May be null._source
- is generally the object having _propertyName as property. May be null
only if _propertyName does not contain 'Rights', since it is used for
searching specialized rights. If _source is instance of AclEntry, the
caller has to replace it by the AclEntry Resource to test the type.
If it is for Privilege rights, _source has to be a Privilege._type
- not null only when _propertyName is 'AclRights' or 'PrivilegeRights',
to give the type of the AclEntry EligibleParty or the Privilege type. May be null.
public static final StringRight[] getL_AcsRestrictedRights(BeanInfoPattern _baseObjectBeanInfo, BaseObject _source, java.lang.String _propertyName, ImmutableACS _acs, java.lang.String _type)
- first, search of the specialized right constraints,
- second, search of the general right constraints.
The class in the ACS must be one of the interfaces of the ACSObject class. Returns the first matching result which is found. In each of the two searches, the search order is the order of interfaces get from getClassicSuperInterfacesFromBeanInfo(). When _propertyName is 'AclRights', it is recommanded to have a non-null _type only when the eligible party belongs to _acs, like in AclEntryImpl.setRights(). When _propertyName is 'PrivilegeRights', there is no search of the specialized right constraints. Called by getRestrictedValues(), getNoDisplayThisRightProperty(), ResourceImpl, AclEntryImpl, PrivilegeAbst. Calls getClassicSuperInterfacesFromBeanInfo(), removeSpacesInString(), getL_AcsSpecializedRights(), getClassNameFromArrayOrInterface() and getACSVocabularyFromArrayOrInterface(). BaseUtilityImpl.getClassNameFromArrayOrInterface() and getBeanInfoNameFromClass().
_baseObjectBeanInfo
- is the BeanInfo instance where the properties are described.
Used only when _source is a Privilege._source
- is the object for which there is the property and a BeanInfo.
For AclEntry, it is the AclEntry Resource or EligibleParty.
For Privilege, it is an empty PrivilegeForTypeImpl, even for a linked privilege.
For other objects, it is the source of the property._propertyName
- is the property name, with spaces in the name or not_acs
- is the ACSObject ACS_type
- to use only when _propertyName is 'AclRights' for an ACL source,
to give the type of the eligible party or the privilege type. May be null,
even with the property 'AclRights'.
public static final java.lang.String[] getL_AcsRestrictedTypes(BeanInfoPattern _baseObjectBeanInfo, java.lang.String _propertyName, ImmutableACS _acs)
The search order of the possible values in getM_TypesAndGUIPolicy() is the order of interfaces get from the method getClassicSuperInterfacesFromBeanInfo(), where the searched keys have the format 'interface name.property name'. The possible values are get from the first key to match.
The user can create some ACSObjects having only the types the ACS authorizes. Typically, the types 'ResourceType.<byAcsCreator>' and 'EPType.<byAcsCreator>' are not allowed. After the first selection of allowed types, it may have a removing of some values from the getM_TypesAndGUIPolicy() key 'CreationByBeamer.NoType'. The forbidden types in the array have one of the following forms : 'ResourceType.forbidden type', 'EPType.forbidden type', 'DirectoryType.forbidden type', 'ActorType.forbidden type', 'UserIDType.forbidden type', 'GroupIDType.forbidden type', 'VirtualFolderType.forbidden type', 'PrivilegeSecondType.forbidden type'. A forbidden type for EligibleParty is not forbidden to all the EligibleParty subclasses. This is also true for a forbidden type for Resource. Like the order of interfaces, the 'ActorType.forbidden type' list is the single list to applied to an Actor, just like 'DirectoryType.forbidden type' for the Directories, and 'UserIDType.forbidden type' for the UserID.
Caution: this method does provide all the types of the objects the program has created at the ACS construction, although these types may be useful in varied operations like the construction of a new typed privilege.
'VirtualFolderType' is converted to ResourceVFType or to EPVFType. ResourceVFType is the first choice, if _acs manages the VirtualFolders of Targets. Then if the 2 VirtualFolder types are used by the ACS, the key 'VirtualFolder.EPVFType' is unused, and the selection of a type for a VirtualFolder of EP Targets is let to the user among the extended list. If its type choice is wrong, the VirtualFolder constructor fires an exception.
Called by getRestrictedValues() and SimplePropertyEditor.getRestrictedValues().
_baseObjectBeanInfo
- is the BeanInfo of a BaseObject class_propertyName
- is the property name, with spaces in the name or not_acs
- is the ACSObject ACS
ACSCatalog.getM_TypesAndGUIPolicy()
public static final StringRight[] getL_AcsSpecializedRights(java.lang.String _propertyName, ImmutableACS _acs, java.lang.String _resourceType, java.lang.String _EPType, java.util.Collection _l_interfaces)
_propertyName
- is the property name, with spaces in the name or not.
Has to contain 'Rights' since it is a right property._acs
- is the base object ACS_resourceType
- is the type of the new object as Resource. May be null._EPType
- is the type of the new object as EligibleParty. May be null._l_interfaces
- interfaces to consider
public static final java.util.List<java.lang.String> getClassicSuperInterfacesFromBeanInfo(BeanInfoPattern _baseObjectBeanInfo)
_baseObjectBeanInfo
- is the bean info of a BaseObject class. Never null.
public static final boolean getNoDisplayThisRightProperty(ACSObject _object, java.beans.PropertyDescriptor _propertyDescriptor, ACS _acs)
_object
- to display. May be null._propertyDescriptor
- is a property descriptor from a BeanInfo_acs
- contains _object
public static final java.lang.String removeSpacesInString(java.lang.String _propertyName)
_propertyName
- is a set of words separated or not by one or several spaces,
may be with whitespaces at the end and the beginning
public static Directory copyDirectoryChildren(Directory _dirToCopy, Directory _dir)
_dirToCopy
- is the ResourceImpl to copy_dir
- is the instance which has been just created,
and is updated with _dirToCopy variables copies
public static ACS copyDirectoryChildrenForACS(ACS _acsToCopy, ACS _acs)
_acsToCopy
- is the source_acs
- is the copied instance
public static Directory copyDirectoriesAndActorsWithoutInternalAcl(Directory _dirToCopy, Directory _dir)
_dirToCopy
- is the source_dir
- is the copied instance
public static Directory copyDirectoriesAndResources(Directory _dirToCopy, Directory _dir)
_dirToCopy
- is the source_dir
- is the copied instance
public static GroupID[] copyOrAddGroupMembers(GroupID _groupToCopy, GroupID _grp)
_groupToCopy
- is the GroupID to copy, which has non-null members._grp
- is the instance which has been created
public static GroupID[] copyGroupsTree(GroupID _groupToCopy, GroupID _grp)
_groupToCopy
- is the GroupID to copy, which has non-null members._grp
- is the instance which has been created
public static final java.lang.String getBeanInfoNameForISnode(java.lang.String _text)
_text
- a node type in ISFactoryUtilityImpl
public static final StringRight[] addRightInDecreasingSort(StringRight[] _l_currentRights, StringRight _newRight)
_l_currentRights
- sorted set. May be null or empty._newRight
- to add. May be null.
public static java.util.List addObjectInDecreasingSort(java.util.List _l_current, java.lang.Comparable _newObject)
_l_current
- sorted list of java.lang.Comparable to update. Never null._newObject
- to add. Never null.
public static boolean withAcrossToDirectoryAGRights(StringRight[] _l_rights)
_l_rights
- rights of a Directory
public static java.util.Set<ImmutableGroupIDMember> getAllIndirectGroupMembers(GroupID _grp)
_grp
- group to analyse
getAllIndirectGroupMembersAndRunningUnderActors
public static java.util.Set<ImmutableEligibleParty> getAllIndirectGroupMembersAndRunningUnderActors(GroupID _grp)
_grp
- is the group to analyze
getAllIndirectGroupMembers(ARoad0.gBaseInterface.GroupID)
protected static StringRight[] getChildRightsFromParentAGRights(StringRight[] _l_parentRights, ImmutableACS _acs)
_l_parentRights
- acsrights or metarights of a directory. Never null._acs
- of the Resource calling this method. Never null.
protected static java.util.Set<StringRight> getChildRightsSetFromParentAGRights(StringRight[] _l_parentRights, ImmutableACS _acs)
_l_parentRights
- acsrights or metarights of a directory. Never null._acs
- of the Resource calling this method. Never null.
public static final StringRight getRightFromNameAsString(java.lang.String _text, ACSRun _acs) throws BaseError
_text
- is the name, as get through getName().toString()_acs
- is the ACSFactory or the ACS which may own the right if it is
an ascright. May be null.
BaseError
- if the string argument is not from a name, or
if it is not a known right in an open ACS, or from NameImpl.getNameFromString(_text).public static final ImmutableName getAcsNameFromName(ImmutableName _rightName) throws BaseError
_rightName
- name of an acsright
BaseError
- if it is not an acsright name.public static final boolean isAcsRightName(ImmutableName _rightName)
_rightName
- name
public static final boolean isExternalACSobject(ACSImpl _acs, ImmutableName _objName, boolean _forSource)
_acs
- ACS to analyze_objName
- name of the ACSObject to search_forSource
- true to search an EligibleParty, and false to search an ImmutableTarget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |