lumis.util.security.acl.serialization
Class AclSerializationManager

Package class diagram package AclSerializationManager
java.lang.Object
  extended by lumis.util.security.acl.serialization.AclSerializationManager
All Implemented Interfaces:
IConfigPersister, IAclSerializationManager
Direct Known Subclasses:
ChannelAclSerializationManager, GroupAclSerializationManager, PageAclSerializationManager, ServiceInstanceAclSerializationManager

public abstract class AclSerializationManager
extends Object
implements IAclSerializationManager

Manager for Acl serialization

Since:
4.0.7

Nested Class Summary
 class AclSerializationManager.AclGlobalPrincipalEntriesRemovalResult
           
 
Field Summary
protected  String configAlias
           
protected  List<ConfigForeignKey> entryForeignKeys
           
protected  List<ConfigForeignKey> foreignKeys
           
protected  String[] primaryKeyFieldNames
           
 
Constructor Summary
AclSerializationManager()
           
 
Method Summary
protected  void analyzeExternalDependencies(SerializationContext serializationContext, ISerializationMessageConfigNodeBuilder serializationMessageConfigNodeBuilder, AccessControlList dependentAccessControlList)
           
protected  AccessControlListSerializableConfig createSerializableConfig(AccessControlList accessControlList, List<String> globalPrincipalIds)
           
 void deserialize(DeserializationContext deserializationContext, AccessControlListSerializableConfig accessControlListSerializableConfig)
          Deserialize an access control list.
 AccessControlList deserializeConfig(DeserializationContext deserializationContext, String accessControlListId)
          Deserialize a AccessControlList object.
protected abstract  IAclManager getAclManager()
           
protected  String getConfigPath(BaseSerializationContext deserializationContext, String configId)
          Get the full path for the serialization file.
 boolean persistConfig(DeserializationContext deserializationContext, Object config, boolean firstPersistence)
          Performs a config persistance (add or update) operation
protected  AclSerializationManager.AclGlobalPrincipalEntriesRemovalResult removeGlobalPrincipalEntries(BaseSerializationContext baseSerializationContext, AccessControlList originalAcl)
          Create a new AccessControlList, removing from a given AccessControlList all entries that references nonstandard global principals.
protected  AccessControlList removeGlobalPrincipalEntries(BaseSerializationContext baseSerializationContext, AccessControlList originalAcl, List<String> globalPrincipalIds)
          Create a new AccessControlList, removing from a given AccessControlList all entries that references any principal present in the given global principals list.
abstract  AccessControlListSerializableConfig serialize(SerializationContext serializationContext, String securableId)
          Serialize an access control list.
 void setupSerializationContext(BaseSerializationContext serializationContext)
          Set up a serialization context, defining settings such as class aliases, field aliases, transient fields, omitted collections etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primaryKeyFieldNames

protected final String[] primaryKeyFieldNames

foreignKeys

protected final List<ConfigForeignKey> foreignKeys

entryForeignKeys

protected final List<ConfigForeignKey> entryForeignKeys

configAlias

protected final String configAlias
See Also:
Constant Field Values
Constructor Detail

AclSerializationManager

public AclSerializationManager()
Method Detail

deserialize

public void deserialize(DeserializationContext deserializationContext,
                        AccessControlListSerializableConfig accessControlListSerializableConfig)
                 throws PortalException
Description copied from interface: IAclSerializationManager
Deserialize an access control list.

Specified by:
deserialize in interface IAclSerializationManager
Throws:
PortalException

deserializeConfig

public AccessControlList deserializeConfig(DeserializationContext deserializationContext,
                                           String accessControlListId)
                                    throws SerializationException
Description copied from interface: IAclSerializationManager
Deserialize a AccessControlList object.

Specified by:
deserializeConfig in interface IAclSerializationManager
Returns:
Throws:
SerializationException

persistConfig

public boolean persistConfig(DeserializationContext deserializationContext,
                             Object config,
                             boolean firstPersistence)
                      throws PortalException
Description copied from interface: IConfigPersister
Performs a config persistance (add or update) operation

Specified by:
persistConfig in interface IConfigPersister
Returns:
Throws:
PortalException

getAclManager

protected abstract IAclManager getAclManager()

serialize

public abstract AccessControlListSerializableConfig serialize(SerializationContext serializationContext,
                                                              String securableId)
                                                       throws PortalException
Description copied from interface: IAclSerializationManager
Serialize an access control list.

Specified by:
serialize in interface IAclSerializationManager
Returns:
Throws:
PortalException

createSerializableConfig

protected AccessControlListSerializableConfig createSerializableConfig(AccessControlList accessControlList,
                                                                       List<String> globalPrincipalIds)

analyzeExternalDependencies

protected void analyzeExternalDependencies(SerializationContext serializationContext,
                                           ISerializationMessageConfigNodeBuilder serializationMessageConfigNodeBuilder,
                                           AccessControlList dependentAccessControlList)
                                    throws PortalException
Throws:
PortalException

setupSerializationContext

public void setupSerializationContext(BaseSerializationContext serializationContext)
Description copied from interface: IAclSerializationManager
Set up a serialization context, defining settings such as class aliases, field aliases, transient fields, omitted collections etc.

Specified by:
setupSerializationContext in interface IAclSerializationManager

getConfigPath

protected String getConfigPath(BaseSerializationContext deserializationContext,
                               String configId)
Get the full path for the serialization file.

Parameters:
deserializationContext -
configId -
Returns:

removeGlobalPrincipalEntries

protected AclSerializationManager.AclGlobalPrincipalEntriesRemovalResult removeGlobalPrincipalEntries(BaseSerializationContext baseSerializationContext,
                                                                                                      AccessControlList originalAcl)
                                                                                               throws PortalException
Create a new AccessControlList, removing from a given AccessControlList all entries that references nonstandard global principals. The list of global principals found is also returned. Both ACL and ids list are returned inside a AclSerializationManager.AclGlobalPrincipalEntriesRemovalResult object.

If the 'import global principals' option of the serialization context is set to false, the reference removal is unnecessary. In this case, the given AccessControlList is returned itself in the result object.

Parameters:
baseSerializationContext - serialization context
originalAcl - original AccessControlList
Returns:
AclSerializationManager.AclGlobalPrincipalEntriesRemovalResult object, containing the new AccessControlList without references to global principals, and the list of global principals found.
Throws:
PortalException

removeGlobalPrincipalEntries

protected AccessControlList removeGlobalPrincipalEntries(BaseSerializationContext baseSerializationContext,
                                                         AccessControlList originalAcl,
                                                         List<String> globalPrincipalIds)
                                                  throws PortalException
Create a new AccessControlList, removing from a given AccessControlList all entries that references any principal present in the given global principals list. If the 'import global principals' option of the serialization context is set to false, the reference removal is unnecessary. In this case, the given AccessControlList is returned itself in the result object.

Parameters:
baseSerializationContext - serialization context
originalAcl - original AccessControlList
globalPrincipalIds - List of referenced global principals to remove from the given AccessControlList
Returns:
new AccessControlList without reference to the given global principals.
Throws:
PortalException


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.