public class ContentVersionManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_VERSION
Default Service version.
|
| Constructor and Description |
|---|
ContentVersionManager(String serviceUrl,
Map<String,String> properties)
Read Service version by handshake request to Service.
|
ContentVersionManager(String serviceUrl,
Properties properties)
Read Service version by handshake request to Service.
|
| Modifier and Type | Method and Description |
|---|---|
protected List<Class<?>> |
getClasses()
Get list of loaded classes.
|
Version |
getServiceVersion() |
boolean |
isCompatible()
Checks if all methods from current stacktrace are compatible with CIS version.
|
boolean |
isHigherCISVersion(Version currentVersion)
Checks if CIS version is equal to or above specified version.
|
protected String |
loadServiceVersion(String cisUrl,
Map<String,String> requestProperties)
Read CIS version by $metadata call to CIS.
|
protected <T extends Annotation> |
methodsWithAnnotation(List<Class<?>> classes,
Class<T> annotation)
Find all annotated methods in classes loaded by class loader.
|
protected <T extends Annotation> |
methodsWithoutAnnotation(List<Class<?>> classes,
Class<T> annotation)
Find all methods in classes without annotation.
|
public static final String DEFAULT_VERSION
public ContentVersionManager(String serviceUrl, Map<String,String> properties)
serviceUrl - url to service.properties - include oauth credentials.public ContentVersionManager(String serviceUrl, Properties properties)
serviceUrl - url to service.properties - include oauth credentials.protected String loadServiceVersion(String cisUrl, Map<String,String> requestProperties)
public boolean isCompatible()
SupportedCisVersion methods are stored in Map.
If there is at least one out of range version in current stacktrace return false.protected List<Class<?>> getClasses()
protected <T extends Annotation> Map<String,T> methodsWithAnnotation(List<Class<?>> classes, Class<T> annotation)
T - should be implementation of Annotationannotation - to find.protected <T extends Annotation> Set<String> methodsWithoutAnnotation(List<Class<?>> classes, Class<T> annotation)
T - should be implementation of Annotationclasses - classes to scan.annotation - this annotation should not be presentpublic Version getServiceVersion()
public boolean isHigherCISVersion(Version currentVersion)
currentVersion - version to compare with CIS versionCopyright © 2017 SDL Group. All rights reserved.