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
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, getLastModified, registerContribution, setLastModified, setModifiedNow, unregisterContribution
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public 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)
Component
start
in interface Component
start
in class DefaultComponent
public void stop(ComponentContext context)
Component
stop
in interface Component
stop
in class DefaultComponent
public void registerExtension(Extension extension)
Extensible
registerExtension
in interface Extensible
registerExtension
in class DefaultComponent
extension
- the extension to registerpublic void unregisterExtension(Extension extension)
Extensible
unregisterExtension
in interface Extensible
unregisterExtension
in class DefaultComponent
extension
- 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 UIDGeneratorService
public void setUID(DocumentModel doc) throws PropertyNotFoundException
setUID
in interface UIDGeneratorService
PropertyNotFoundException
public String createUID(DocumentModel doc)
createUID
in interface UIDGeneratorService
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not have an adapter for
the given classpublic UIDSequencer getSequencer()
UIDGeneratorService
UIDSequencer
getSequencer
in interface UIDGeneratorService
UIDSequencer
public UIDSequencer getSequencer(String name)
UIDGeneratorService
UIDSequencer
by it's namegetSequencer
in interface UIDGeneratorService
name
- the name of the UIDSequencer
UIDSequencer
matching the nameCopyright © 2017 Nuxeo. All rights reserved.