public class StorageUserResourceIdentifierMarshaller extends Object implements Marshaller<UserResourceIdentifier>, MigrationAware
UserResourceIdentifier
s to storage format.MigrationAware.MigrationPerformedPredicate
Constructor and Description |
---|
StorageUserResourceIdentifierMarshaller(XmlStreamWriterTemplate xmlStreamWriterTemplate) |
Modifier and Type | Method and Description |
---|---|
Streamable |
marshal(UserResourceIdentifier userResourceIdentifier,
ConversionContext conversionContext)
Marshal the supplied
UserResourceIdentifier to storage format. |
boolean |
wasMigrationPerformed(ConversionContext conversionContext)
Given a
ConversionContext that was previously used to perform a migration, determine if that context
contains information that indicates whether a "migration" was performed. |
public StorageUserResourceIdentifierMarshaller(XmlStreamWriterTemplate xmlStreamWriterTemplate)
public Streamable marshal(UserResourceIdentifier userResourceIdentifier, ConversionContext conversionContext) throws XhtmlException
UserResourceIdentifier
to storage format. Depending on the information contained in
the identifier, the output will contain either a UserKey
(preferred), or a
username (if no UserKey available).
If the marshaller detects that the UserResourceIdentifier
was originally initialised from a username
rather than a UserKey (i.e. pre-user-rename storage format), then it will set a flag in the
ConversionContext
to record the fact that the identifier was migrated from one format to another. This
flag can then be interrogated by calling the
wasMigrationPerformed(com.atlassian.confluence.content.render.xhtml.ConversionContext)
method.
marshal
in interface Marshaller<UserResourceIdentifier>
userResourceIdentifier
- The identifier to be marshalled.conversionContext
- the conversion context in which to record the migration flagStreamable
containing the marshalled identifier.XhtmlException
- if an error occurs during marshallingMigrationAware}
public boolean wasMigrationPerformed(ConversionContext conversionContext)
MigrationAware
ConversionContext
that was previously used to perform a migration, determine if that context
contains information that indicates whether a "migration" was performed. What constitutes a migration is
implementation-dependent.wasMigrationPerformed
in interface MigrationAware
conversionContext
- the context used for the migrationConversionContext
contains a flag indicating that a UserResourceIdentifier
was migrated from "old" to "new" storage format in this context, false othewrwise.MigrationAware}
Copyright © 2003–2017 Atlassian. All rights reserved.