public class UIDGeneratorComponent extends DefaultComponent implements UIDGeneratorService
| Modifier and Type | Field and Description |
|---|---|
protected String |
defaultSequencer |
static String |
EXTENSION_POINT_SEQUENCER_FACTORY
Extension point is deprecated should be removed - preserved for now only for startup warnings.
|
protected Map<String,UIDGenerator> |
generators |
static String |
ID |
protected LinkedHashMap<String,UIDSequencerProviderDescriptor> |
sequencerContribs |
protected Map<String,UIDSequencer> |
sequencers |
static String |
SEQUENCERS_EXTENSION_POINT |
static String |
UID_GENERATORS_EXTENSION_POINT |
lastModified, name| Constructor and Description |
|---|
UIDGeneratorComponent() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeDefault() |
String |
createUID(DocumentModel doc) |
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object.
|
UIDSequencer |
getSequencer()
Retrieves the default
UIDSequencer |
UIDSequencer |
getSequencer(String name)
Retrieves
UIDSequencer by it's name |
UIDGenerator |
getUIDGeneratorFor(DocumentModel doc)
Returns the uid generator to use for this document.
|
void |
registerExtension(Extension extension)
Registers the given extension.
|
protected void |
registerGenerators(Extension extension,
Object[] contribs) |
protected void |
registerSequencers(Extension extension,
Object[] contribs) |
void |
setUID(DocumentModel doc)
Creates a new UID for the given doc and sets the field configured in the generator component with this value.
|
void |
start(ComponentContext context)
Start the component.
|
void |
stop(ComponentContext context)
Stop the component.
|
void |
unregisterExtension(Extension extension)
Unregisters the given extension.
|
protected void |
unregisterSequencers(Extension extension,
Object[] contribs) |
activate, deactivate, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, setLastModified, setModifiedNow, setName, unregister, unregisterContributionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderpublic static final String ID
public static final String UID_GENERATORS_EXTENSION_POINT
public static final String SEQUENCERS_EXTENSION_POINT
public static final String EXTENSION_POINT_SEQUENCER_FACTORY
protected final Map<String,UIDGenerator> generators
protected final Map<String,UIDSequencer> sequencers
protected final LinkedHashMap<String,UIDSequencerProviderDescriptor> sequencerContribs
protected String defaultSequencer
public UIDGeneratorComponent()
public void start(ComponentContext context)
Componentstart in interface Componentstart in class DefaultComponentpublic void stop(ComponentContext context)
Componentstop in interface Componentstop in class DefaultComponentpublic void registerExtension(Extension extension)
ExtensibleregisterExtension in interface ExtensibleregisterExtension in class DefaultComponentextension - the extension to registerpublic void unregisterExtension(Extension extension)
ExtensibleunregisterExtension in interface ExtensibleunregisterExtension in class DefaultComponentextension - the extension to unregisterprotected void computeDefault()
protected void registerSequencers(Extension extension, Object[] contribs)
protected void unregisterSequencers(Extension extension, Object[] contribs)
protected void registerGenerators(Extension extension, Object[] contribs)
public UIDGenerator getUIDGeneratorFor(DocumentModel doc)
Choice is made following the document type and the generator configuration.
getUIDGeneratorFor in interface UIDGeneratorServicepublic void setUID(DocumentModel doc) throws PropertyNotFoundException
setUID in interface UIDGeneratorServicePropertyNotFoundExceptionpublic String createUID(DocumentModel doc)
createUID in interface UIDGeneratorServicepublic <T> T getAdapter(Class<T> adapter)
Adaptablenull
if no such object can be found.getAdapter in interface AdaptablegetAdapter in class DefaultComponentadapter - the adapter class to look upnull if this object does not have an adapter for
the given classpublic UIDSequencer getSequencer()
UIDGeneratorServiceUIDSequencergetSequencer in interface UIDGeneratorServiceUIDSequencerpublic UIDSequencer getSequencer(String name)
UIDGeneratorServiceUIDSequencer by it's namegetSequencer in interface UIDGeneratorServicename - the name of the UIDSequencerUIDSequencer matching the nameCopyright © 2019 Nuxeo. All rights reserved.