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
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final StringExtension point is deprecated should be removed - preserved for now only for startup warnings.protected final Map<String,UIDGenerator> static final Stringprotected final LinkedHashMap<String,UIDSequencerProviderDescriptor> protected final Map<String,UIDSequencer> static final Stringstatic final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateUID(DocumentModel doc) <T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.Retrieves the defaultUIDSequencergetSequencer(String name) RetrievesUIDSequencerby it's nameRetrieves allUIDSequencer.Returns the uid generator to use for this document.voidregisterExtension(Extension extension) Registers the given extension.protected voidregisterGenerators(Extension extension, Object[] contribs) protected voidregisterSequencers(Extension extension, Object[] contribs) voidsetUID(DocumentModel doc) Creates a new UID for the given doc and sets the field configured in the generator component with this value.voidstart(ComponentContext context) Start the component.voidstop(ComponentContext context) Stop the component.voidunregisterExtension(Extension extension) Unregisters the given extension.protected voidunregisterSequencers(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, unregisterContributionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
registerExtension
Description copied from interface:ExtensibleRegisters the given extension.- Specified by:
registerExtensionin interfaceExtensible- Overrides:
registerExtensionin classDefaultComponent- Parameters:
extension- the extension to register
-
unregisterExtension
Description copied from interface:ExtensibleUnregisters the given extension.- Specified by:
unregisterExtensionin interfaceExtensible- Overrides:
unregisterExtensionin 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:
getUIDGeneratorForin interfaceUIDGeneratorService
-
setUID
Creates a new UID for the given doc and sets the field configured in the generator component with this value.- Specified by:
setUIDin interfaceUIDGeneratorService- Throws:
PropertyNotFoundException
-
createUID
- Specified by:
createUIDin interfaceUIDGeneratorService- Returns:
- a new UID for the given document
-
getAdapter
Description copied from interface:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Overrides:
getAdapterin classDefaultComponent- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
getSequencers
Description copied from interface:UIDGeneratorServiceRetrieves allUIDSequencer.- Specified by:
getSequencersin interfaceUIDGeneratorService- Returns:
- all
UIDSequencer.
-
getSequencer
Description copied from interface:UIDGeneratorServiceRetrieves the defaultUIDSequencer- Specified by:
getSequencerin interfaceUIDGeneratorService- Returns:
- the default
UIDSequencer
-
getSequencer
Description copied from interface:UIDGeneratorServiceRetrievesUIDSequencerby it's name- Specified by:
getSequencerin interfaceUIDGeneratorService- Parameters:
name- the name of theUIDSequencer- Returns:
- the
UIDSequencermatching the name
-