Package org.nuxeo.ecm.core.uidgen
Class UIDGeneratorComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.core.uidgen.UIDGeneratorComponent
- All Implemented Interfaces:
UIDGeneratorService
,Adaptable
,Component
,Extensible
,TimestampedService
Service that writes MetaData.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
static final String
Extension point is deprecated should be removed - preserved for now only for startup warnings.protected final Map<String,
UIDGenerator> static final String
protected final LinkedHashMap<String,
UIDSequencerProviderDescriptor> protected final Map<String,
UIDSequencer> static final String
static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
createUID
(DocumentModel doc) <T> T
getAdapter
(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Retrieves the defaultUIDSequencer
getSequencer
(String name) RetrievesUIDSequencer
by it's nameReturns 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) Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, setLastModified, setModifiedNow, setName, unregister, unregisterContribution
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
ID
- See Also:
-
UID_GENERATORS_EXTENSION_POINT
- See Also:
-
SEQUENCERS_EXTENSION_POINT
- See Also:
-
EXTENSION_POINT_SEQUENCER_FACTORY
Extension point is deprecated should be removed - preserved for now only for startup warnings.- See Also:
-
generators
-
sequencers
-
sequencerContribs
-
defaultSequencer
-
-
Constructor Details
-
UIDGeneratorComponent
public UIDGeneratorComponent()
-
-
Method Details
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
stop
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
-
registerExtension
Description copied from interface:Extensible
Registers the given extension.- Specified by:
registerExtension
in interfaceExtensible
- Overrides:
registerExtension
in classDefaultComponent
- Parameters:
extension
- the extension to register
-
unregisterExtension
Description copied from interface:Extensible
Unregisters the given extension.- Specified by:
unregisterExtension
in interfaceExtensible
- Overrides:
unregisterExtension
in classDefaultComponent
- Parameters:
extension
- the extension to unregister
-
computeDefault
protected void computeDefault() -
registerSequencers
-
unregisterSequencers
-
registerGenerators
-
getUIDGeneratorFor
Returns the uid generator to use for this document.Choice is made following the document type and the generator configuration.
- Specified by:
getUIDGeneratorFor
in interfaceUIDGeneratorService
-
setUID
Creates a new UID for the given doc and sets the field configured in the generator component with this value.- Specified by:
setUID
in interfaceUIDGeneratorService
- Throws:
PropertyNotFoundException
-
createUID
- Specified by:
createUID
in interfaceUIDGeneratorService
- Returns:
- a new UID for the given document
-
getAdapter
Description copied from interface:Adaptable
Returns an object which is an instance of the given class associated with this object. Returnsnull
if no such object can be found.- Specified by:
getAdapter
in interfaceAdaptable
- Overrides:
getAdapter
in classDefaultComponent
- Parameters:
adapter
- the adapter class to look up- Returns:
- a object castable to the given class, or
null
if this object does not have an adapter for the given class
-
getSequencer
Description copied from interface:UIDGeneratorService
Retrieves the defaultUIDSequencer
- Specified by:
getSequencer
in interfaceUIDGeneratorService
- Returns:
- the default
UIDSequencer
-
getSequencer
Description copied from interface:UIDGeneratorService
RetrievesUIDSequencer
by it's name- Specified by:
getSequencer
in interfaceUIDGeneratorService
- Parameters:
name
- the name of theUIDSequencer
- Returns:
- the
UIDSequencer
matching the name
-