public class TargetPlatformServiceImpl extends DefaultComponent implements TargetPlatformService
TargetPlatformService implementation relying on runtime extension points.| Modifier and Type | Field and Description | 
|---|---|
protected ServiceConfigurationRegistry | 
conf  | 
protected static org.joda.time.format.DateTimeFormatter | 
dateParser  | 
protected TargetPackageRegistry | 
packages  | 
protected TargetPlatformRegistry | 
platforms  | 
static String | 
XP_CONF  | 
static String | 
XP_PACKAGES  | 
static String | 
XP_PLATFORMS  | 
lastModified, name| Constructor and Description | 
|---|
TargetPlatformServiceImpl()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
activate(ComponentContext context)
Activates the component. 
 | 
protected TargetPlatformInstanceImpl | 
createTargetPlatformInstanceFromId(String id)
Create a TargetPlatformInstance given an id. 
 | 
void | 
deactivate(ComponentContext context)
Deactivates the component. 
 | 
void | 
deprecateTargetPlatform(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. 
 | 
void | 
enableTargetPlatform(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. 
 | 
TargetPlatform | 
getDefaultTargetPlatform(TargetPlatformFilter filter)
Returns the default target platform. 
 | 
TargetPlatformInstance | 
getDefaultTargetPlatformInstance(boolean restricted)  | 
protected DocumentModel | 
getDirectoryEntry(String id)  | 
String | 
getOverrideDirectory()
Returns the override directory name. 
 | 
TargetPackage | 
getTargetPackage(String id)
Returns the target package with given id, or null if not found. 
 | 
protected TargetPackage | 
getTargetPackage(TargetPackageDescriptor desc)  | 
TargetPackageInfo | 
getTargetPackageInfo(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)  | 
TargetPlatform | 
getTargetPlatform(String id)
Returns the target platform with given id, or null if not found. 
 | 
protected TargetPlatform | 
getTargetPlatform(TargetPlatformDescriptor desc)  | 
TargetPlatformInfo | 
getTargetPlatformInfo(String id)
Returns the target platform info for given id, or null if not found. 
 | 
protected TargetPlatformInfo | 
getTargetPlatformInfo(TargetPlatformDescriptor desc)  | 
TargetPlatformInstance | 
getTargetPlatformInstance(String id,
                         List<String> packages)
Returns a target platform instance with given id and given enabled packages, or null if not found. 
 | 
void | 
registerContribution(Object contribution,
                    String extensionPoint,
                    ComponentInstance contributor)  | 
void | 
restoreAllTargetPlatforms()
Removes overrides for all target platform. 
 | 
void | 
restoreTargetPlatform(String id)
Removes overrides for this target platform. 
 | 
void | 
restrictTargetPlatform(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. 
 | 
void | 
setDefaultTargetPlatform(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. 
 | 
void | 
setTrialTargetPlatform(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 Date | 
toDate(String date)  | 
void | 
unregisterContribution(Object contribution,
                      String extensionPoint,
                      ComponentInstance contributor)  | 
protected void | 
updateOrCreateEntry(String id,
                   String prop,
                   Integer value)  | 
getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderpublic static final String XP_CONF
public static final String XP_PLATFORMS
public static final String XP_PACKAGES
protected static final org.joda.time.format.DateTimeFormatter dateParser
protected ServiceConfigurationRegistry conf
protected TargetPlatformRegistry platforms
protected TargetPackageRegistry packages
public TargetPlatformServiceImpl()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void deactivate(ComponentContext context)
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentpublic TargetPlatform getDefaultTargetPlatform(TargetPlatformFilter filter)
TargetPlatformServiceIf several target platforms are found for given filter, the first one is returned (ordered alphabetically on id).
getDefaultTargetPlatform in interface TargetPlatformServicepublic String getOverrideDirectory()
TargetPlatformServicegetOverrideDirectory in interface TargetPlatformServicepublic TargetPlatform getTargetPlatform(String id)
TargetPlatformServicegetTargetPlatform in interface TargetPlatformServiceprotected TargetPlatform getTargetPlatform(TargetPlatformDescriptor desc)
protected Map<String,TargetPackage> getTargetPackages(String targetPlatform)
protected Map<String,TargetPackageInfo> getTargetPackagesInfo(String targetPlatform)
public TargetPlatformInfo getTargetPlatformInfo(String id)
TargetPlatformServicegetTargetPlatformInfo in interface TargetPlatformServiceprotected TargetPlatformInfo getTargetPlatformInfo(TargetPlatformDescriptor desc)
public TargetPackage getTargetPackage(String id)
TargetPlatformServicegetTargetPackage in interface TargetPlatformServicepublic TargetPackageInfo getTargetPackageInfo(String id)
TargetPlatformServicegetTargetPackageInfo in interface TargetPlatformServiceprotected TargetPackage getTargetPackage(TargetPackageDescriptor desc)
public TargetPlatformInstance getTargetPlatformInstance(String id, List<String> packages)
TargetPlatformServiceIgnore target packages that would not be found.
getTargetPlatformInstance in interface TargetPlatformServicepublic List<TargetPlatform> getAvailableTargetPlatforms(TargetPlatformFilter filter)
TargetPlatformServicegetAvailableTargetPlatforms in interface TargetPlatformServicefilter - the filter to apply, can be null if no filtering is needed.TargetPlatformFilterpublic List<TargetPlatformInfo> getAvailableTargetPlatformsInfo(TargetPlatformFilter filter)
TargetPlatformServicegetAvailableTargetPlatformsInfo in interface TargetPlatformServicefilter - the filter to apply, can be null if no filtering is needed.TargetPlatformFilterpublic void deprecateTargetPlatform(boolean deprecate, String id)
TargetPlatformServicedeprecateTargetPlatform in interface TargetPlatformServicepublic void enableTargetPlatform(boolean enable, String id)
TargetPlatformServiceenableTargetPlatform in interface TargetPlatformServicepublic void restrictTargetPlatform(boolean restrict, String id)
TargetPlatformServicerestrictTargetPlatform in interface TargetPlatformServicepublic void setTrialTargetPlatform(boolean trial, String id)
TargetPlatformServicesetTrialTargetPlatform in interface TargetPlatformServicepublic void setDefaultTargetPlatform(boolean isDefault, String id)
TargetPlatformServicesetDefaultTargetPlatform in interface TargetPlatformServicepublic void restoreTargetPlatform(String id)
TargetPlatformServicerestoreTargetPlatform in interface TargetPlatformServicepublic void restoreAllTargetPlatforms()
TargetPlatformServicerestoreAllTargetPlatforms in interface TargetPlatformServiceprotected void updateOrCreateEntry(String id, String prop, Integer value)
protected DocumentModel getDirectoryEntry(String id)
public TargetPlatformInstance getDefaultTargetPlatformInstance(boolean restricted)
getDefaultTargetPlatformInstance in interface TargetPlatformServiceprotected TargetPlatformInstanceImpl createTargetPlatformInstanceFromId(String id)
Copyright © 2019 Nuxeo. All rights reserved.