Class TargetPlatformServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.targetplatforms.core.service.TargetPlatformServiceImpl
-
- All Implemented Interfaces:
Adaptable,Component,Extensible,TimestampedService,TargetPlatformService
public class TargetPlatformServiceImpl extends DefaultComponent implements TargetPlatformService
TargetPlatformServiceimplementation relying on runtime extension points.- Since:
- 5.7.1
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceConfigurationRegistryconfstatic DateTimeFormatterdateParserprotected TargetPackageRegistrypackagesprotected TargetPlatformRegistryplatformsstatic StringXP_CONFstatic StringXP_PACKAGESstatic StringXP_PLATFORMS-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description TargetPlatformServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate(ComponentContext context)Activates the component.protected TargetPlatformInstanceImplcreateTargetPlatformInstanceFromId(String id)Create a TargetPlatformInstance given an id.voiddeactivate(ComponentContext context)Deactivates the component.voiddeprecateTargetPlatform(boolean deprecate, String id)Deprecates the target platform if given boolean is true (or un-deprecates it if boolean is false), overriding the default value from extension points and adding an entry in the override directory.voidenableTargetPlatform(boolean enable, String id)Enables the target platform if given boolean is true (or disables it boolean is false), overriding the default value from extension points and adding an entry in the override directory.List<TargetPlatform>getAvailableTargetPlatforms(TargetPlatformFilter filter)Returns all target platforms matching given criteria.List<TargetPlatformInfo>getAvailableTargetPlatformsInfo(TargetPlatformFilter filter)Returns all target platforms info matching given criteria.TargetPlatformgetDefaultTargetPlatform(TargetPlatformFilter filter)Returns the default target platform.TargetPlatformInstancegetDefaultTargetPlatformInstance(boolean restricted)protected DocumentModelgetDirectoryEntry(String id)StringgetOverrideDirectory()Returns the override directory name.TargetPackagegetTargetPackage(String id)Returns the target package with given id, or null if not found.protected TargetPackagegetTargetPackage(TargetPackageDescriptor desc)TargetPackageInfogetTargetPackageInfo(String id)Returns the target package info for given id, or null if not found.protected Map<String,TargetPackage>getTargetPackages(String targetPlatform)Lookup all packages referencing this target platform.protected Map<String,TargetPackageInfo>getTargetPackagesInfo(String targetPlatform)TargetPlatformgetTargetPlatform(String id)Returns the target platform with given id, or null if not found.protected TargetPlatformgetTargetPlatform(TargetPlatformDescriptor desc)TargetPlatformInfogetTargetPlatformInfo(String id)Returns the target platform info for given id, or null if not found.protected TargetPlatformInfogetTargetPlatformInfo(TargetPlatformDescriptor desc)TargetPlatformInstancegetTargetPlatformInstance(String id, List<String> packages)Returns a target platform instance with given id and given enabled packages, or null if not found.voidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)voidrestoreAllTargetPlatforms()Removes overrides for all target platform.voidrestoreTargetPlatform(String id)Removes overrides for this target platform.voidrestrictTargetPlatform(boolean restrict, String id)Restricts the target platform if given boolean is true (or un-restricts it if boolean is false), overriding the default value from extension points and adding an entry in the override directory.voidsetDefaultTargetPlatform(boolean isDefault, String id)Set the target platform as default if given boolean is true (or unset it as default if boolean is false), overriding the default value from extension points and adding an entry in the override directory.voidsetTrialTargetPlatform(boolean trial, String id)Set the target platform as trial if given boolean is true (or unset it as trial if boolean is false), overriding the default value from extension points and adding an entry in the override directory.protected DatetoDate(String date)voidunregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)protected voidupdateOrCreateEntry(String id, String prop, Integer value)-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
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
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
XP_CONF
public static final String XP_CONF
- See Also:
- Constant Field Values
-
XP_PLATFORMS
public static final String XP_PLATFORMS
- See Also:
- Constant Field Values
-
XP_PACKAGES
public static final String XP_PACKAGES
- See Also:
- Constant Field Values
-
dateParser
public static final DateTimeFormatter dateParser
-
conf
protected ServiceConfigurationRegistry conf
-
platforms
protected TargetPlatformRegistry platforms
-
packages
protected TargetPackageRegistry packages
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:ComponentActivates the component.This method is called by the runtime when a component is activated.
- Specified by:
activatein interfaceComponent- Overrides:
activatein classDefaultComponent- Parameters:
context- the runtime context
-
deactivate
public void deactivate(ComponentContext context)
Description copied from interface:ComponentDeactivates the component.This method is called by the runtime when a component is deactivated.
- Specified by:
deactivatein interfaceComponent- Overrides:
deactivatein classDefaultComponent- Parameters:
context- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContributionin classDefaultComponent
-
getDefaultTargetPlatform
public TargetPlatform getDefaultTargetPlatform(TargetPlatformFilter filter)
Description copied from interface:TargetPlatformServiceReturns the default target platform.If several target platforms are found for given filter, the first one is returned (ordered alphabetically on id).
- Specified by:
getDefaultTargetPlatformin interfaceTargetPlatformService
-
getOverrideDirectory
public String getOverrideDirectory()
Description copied from interface:TargetPlatformServiceReturns the override directory name.- Specified by:
getOverrideDirectoryin interfaceTargetPlatformService
-
getTargetPlatform
public TargetPlatform getTargetPlatform(String id)
Description copied from interface:TargetPlatformServiceReturns the target platform with given id, or null if not found.- Specified by:
getTargetPlatformin interfaceTargetPlatformService
-
getTargetPlatform
protected TargetPlatform getTargetPlatform(TargetPlatformDescriptor desc)
-
getTargetPackages
protected Map<String,TargetPackage> getTargetPackages(String targetPlatform)
Lookup all packages referencing this target platform.
-
getTargetPackagesInfo
protected Map<String,TargetPackageInfo> getTargetPackagesInfo(String targetPlatform)
-
getTargetPlatformInfo
public TargetPlatformInfo getTargetPlatformInfo(String id)
Description copied from interface:TargetPlatformServiceReturns the target platform info for given id, or null if not found.- Specified by:
getTargetPlatformInfoin interfaceTargetPlatformService
-
getTargetPlatformInfo
protected TargetPlatformInfo getTargetPlatformInfo(TargetPlatformDescriptor desc)
-
getTargetPackage
public TargetPackage getTargetPackage(String id)
Description copied from interface:TargetPlatformServiceReturns the target package with given id, or null if not found.- Specified by:
getTargetPackagein interfaceTargetPlatformService
-
getTargetPackageInfo
public TargetPackageInfo getTargetPackageInfo(String id)
Description copied from interface:TargetPlatformServiceReturns the target package info for given id, or null if not found.- Specified by:
getTargetPackageInfoin interfaceTargetPlatformService
-
getTargetPackage
protected TargetPackage getTargetPackage(TargetPackageDescriptor desc)
-
getTargetPlatformInstance
public TargetPlatformInstance getTargetPlatformInstance(String id, List<String> packages)
Description copied from interface:TargetPlatformServiceReturns a target platform instance with given id and given enabled packages, or null if not found.Ignore target packages that would not be found.
- Specified by:
getTargetPlatformInstancein interfaceTargetPlatformService
-
getAvailableTargetPlatforms
public List<TargetPlatform> getAvailableTargetPlatforms(TargetPlatformFilter filter)
Description copied from interface:TargetPlatformServiceReturns all target platforms matching given criteria.- Specified by:
getAvailableTargetPlatformsin interfaceTargetPlatformService- Parameters:
filter- the filter to apply, can be null if no filtering is needed.- See Also:
TargetPlatformFilter
-
getAvailableTargetPlatformsInfo
public List<TargetPlatformInfo> getAvailableTargetPlatformsInfo(TargetPlatformFilter filter)
Description copied from interface:TargetPlatformServiceReturns all target platforms info matching given criteria.- Specified by:
getAvailableTargetPlatformsInfoin interfaceTargetPlatformService- Parameters:
filter- the filter to apply, can be null if no filtering is needed.- See Also:
TargetPlatformFilter
-
deprecateTargetPlatform
public void deprecateTargetPlatform(boolean deprecate, String id)Description copied from interface:TargetPlatformServiceDeprecates the target platform if given boolean is true (or un-deprecates it if boolean is false), overriding the default value from extension points and adding an entry in the override directory.- Specified by:
deprecateTargetPlatformin interfaceTargetPlatformService
-
enableTargetPlatform
public void enableTargetPlatform(boolean enable, String id)Description copied from interface:TargetPlatformServiceEnables the target platform if given boolean is true (or disables it boolean is false), overriding the default value from extension points and adding an entry in the override directory.- Specified by:
enableTargetPlatformin interfaceTargetPlatformService
-
restrictTargetPlatform
public void restrictTargetPlatform(boolean restrict, String id)Description copied from interface:TargetPlatformServiceRestricts the target platform if given boolean is true (or un-restricts it if boolean is false), overriding the default value from extension points and adding an entry in the override directory.- Specified by:
restrictTargetPlatformin interfaceTargetPlatformService
-
setTrialTargetPlatform
public void setTrialTargetPlatform(boolean trial, String id)Description copied from interface:TargetPlatformServiceSet the target platform as trial if given boolean is true (or unset it as trial if boolean is false), overriding the default value from extension points and adding an entry in the override directory.- Specified by:
setTrialTargetPlatformin interfaceTargetPlatformService
-
setDefaultTargetPlatform
public void setDefaultTargetPlatform(boolean isDefault, String id)Description copied from interface:TargetPlatformServiceSet the target platform as default if given boolean is true (or unset it as default if boolean is false), overriding the default value from extension points and adding an entry in the override directory.- Specified by:
setDefaultTargetPlatformin interfaceTargetPlatformService
-
restoreTargetPlatform
public void restoreTargetPlatform(String id)
Description copied from interface:TargetPlatformServiceRemoves overrides for this target platform.- Specified by:
restoreTargetPlatformin interfaceTargetPlatformService
-
restoreAllTargetPlatforms
public void restoreAllTargetPlatforms()
Description copied from interface:TargetPlatformServiceRemoves overrides for all target platform.- Specified by:
restoreAllTargetPlatformsin interfaceTargetPlatformService
-
getDirectoryEntry
protected DocumentModel getDirectoryEntry(String id)
-
getDefaultTargetPlatformInstance
public TargetPlatformInstance getDefaultTargetPlatformInstance(boolean restricted)
- Specified by:
getDefaultTargetPlatformInstancein interfaceTargetPlatformService- Returns:
- the default target platform instance and enabled if not found.
-
createTargetPlatformInstanceFromId
protected TargetPlatformInstanceImpl createTargetPlatformInstanceFromId(String id)
Create a TargetPlatformInstance given an id.- Since:
- 5.9.3-NXP-15602
-
-