org.apache.jetspeed.serializer
Class JetspeedSerializerImpl
java.lang.Object
org.apache.jetspeed.serializer.JetspeedSerializerBase
org.apache.jetspeed.serializer.JetspeedSerializerImpl
- All Implemented Interfaces:
- JetspeedSerializer
public class JetspeedSerializerImpl
- extends JetspeedSerializerBase
- implements JetspeedSerializer
Jetspeed Serializer
The Serializer is capable of reading and writing the current content of the
Jetspeed environment to and from XML files. The component can be used from a
standalone java application for seeding a new database or from a running
portal as an administrative backup/restore function.
The XML file needs to indicate whether passwords used in credentials
are plain text or whether they are encoded. The import algoritm can determine -
prior to reading users - which encode/decode scheme was used and if or
then we store plain passwords (Note that
that alone requires the resulting XML to be encoded!!!!!)
- Version:
- $Id: $
- Author:
- Hajo Birthelmer
Fields inherited from interface org.apache.jetspeed.serializer.JetspeedSerializer |
DECODING_SUPPORTED, ERROR_DECODING, INVALID_PASSWORDS, KEY_BACKUP_BEFORE_PROCESS, KEY_OVERWRITE_EXISTING, KEY_PROCESS_CAPABILITIES, KEY_PROCESS_ENTITIES, KEY_PROCESS_PERMISSIONS, KEY_PROCESS_PORTAL_PREFERENCES, KEY_PROCESS_PREFERENCES, KEY_PROCESS_PROFILER, KEY_PROCESS_USER_PREFERENCES, KEY_PROCESS_USERS, NO_DECODING, PASSTHRU_REQUIRED, TAG_SECONDARYSNAPSHOT, TAG_SNAPSHOT |
Constructor Summary |
JetspeedSerializerImpl()
|
JetspeedSerializerImpl(ComponentManager cm)
hand over existing component manager |
JetspeedSerializerImpl(java.lang.String appRoot,
java.lang.String[] bootConfig,
java.lang.String[] appConfig)
This constructor takes the application root, the search path for the boot
component configuration files and the search path for the application
component configuration files. |
Methods inherited from class org.apache.jetspeed.serializer.JetspeedSerializerBase |
checkSettings, closeUp, createUniqueBackupFilename, doBackupOfCurrent, exportData, getCM, getDefaultIndent, getObjectBehindPath, getSetting, getSnapshot, getTokens, importData, initializeComponentManager, logMe, openWriter, readFile, recreatePassword, removeFromString, setComponentManager, setDefaultIndent, setSetting, setSnapshot, setSnapshotData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JetspeedSerializerImpl
public JetspeedSerializerImpl()
JetspeedSerializerImpl
public JetspeedSerializerImpl(ComponentManager cm)
- hand over existing component manager
- Parameters:
cm
-
JetspeedSerializerImpl
public JetspeedSerializerImpl(java.lang.String appRoot,
java.lang.String[] bootConfig,
java.lang.String[] appConfig)
throws SerializerException
- This constructor takes the application root, the search path for the boot
component configuration files and the search path for the application
component configuration files.
For example: new JetspeedSerializerImpl("./", "assembly/boot/*.xml",
"assembly/*.xml") will establish the current directory as the root,
process all xml files in the assembly/boot directory before processing
all xml files in the assembly directory itself.
- Parameters:
appRoot
- working directorybootConfig
- boot (primary) file or files (wildcards are allowed)appConfig
- application (secondary) file or files (wildcards are allowed)
- Throws:
SerializerException
getSerializerDataClass
protected java.lang.Class getSerializerDataClass()
- Description copied from class:
JetspeedSerializerBase
- return the class for the serializer data , for example JSSeedData.class)
- Specified by:
getSerializerDataClass
in class JetspeedSerializerBase
- Returns:
getSerializerDataTag
protected java.lang.String getSerializerDataTag()
- Description copied from class:
JetspeedSerializerBase
- return the XML tag for the serializer data , for example "JSSnapShot")
- Specified by:
getSerializerDataTag
in class JetspeedSerializerBase
- Returns:
resetSettings
protected void resetSettings()
- reset instruction flags to default settings (all true)
- Specified by:
resetSettings
in class JetspeedSerializerBase
getSnapshotData
protected void getSnapshotData()
- On import, get the basic SnapShot data
- Overrides:
getSnapshotData
in class JetspeedSerializerBase
processImport
protected void processImport()
throws SerializerException
- The workhorse for importing data
- Specified by:
processImport
in class JetspeedSerializerBase
- Parameters:
binding
- established XML binding
- Throws:
SerializerException
processExport
protected void processExport(java.lang.String name,
javolution.xml.XMLBinding binding)
throws SerializerException
- The workhorse for exporting data
- Specified by:
processExport
in class JetspeedSerializerBase
- Parameters:
binding
- established XML binding
- Throws:
SerializerException
setupAliases
protected void setupAliases(javolution.xml.XMLBinding binding)
- Setup the binding for the different classes, mapping each extracted class
to a unique tag name in the XML
- Specified by:
setupAliases
in class JetspeedSerializerBase
- Parameters:
binding
-
compareCurrentSecurityProvider
protected int compareCurrentSecurityProvider(JSSeedData file)
- Establish whether incoming passwords are "clear" text or whether they are
to be decoded. That however depends on whether the passwords were encoded
with the current active provider or not.
- Returns:
recreateRuleCriterion
protected RuleCriterion recreateRuleCriterion(Profiler profiler,
JSRuleCriterion jsr,
ProfilingRule rule)
throws SerializerException,
java.lang.ClassNotFoundException
- recreate a rule criterion object from the deserialized wrapper
- Parameters:
profiler
- established profile managerjsr
- deserialized object
- Returns:
- new RuleCriterion with content set to deserialized wrapepr
- Throws:
SerializerException
java.lang.ClassNotFoundException
recreateRule
protected ProfilingRule recreateRule(Profiler profiler,
ProfilingRule existingRule,
JSProfilingRule jsp)
throws SerializerException,
java.lang.ClassNotFoundException,
ProfilerException
- recreate a profiling rule object from the deserialized wrapper and store it
- Parameters:
profiler
- established profile managerjsp
- deserialized object
- Throws:
SerializerException,
- ClassNotFoundException, ProfilerException
SerializerException
java.lang.ClassNotFoundException
ProfilerException
Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.