public class OntrackDSLV4Facade extends Object implements OntrackDSLFacade
Constructor and Description |
---|
OntrackDSLV4Facade(OntrackConfiguration config,
OntrackDSLLogger logger) |
Modifier and Type | Method and Description |
---|---|
BranchFacade |
branch(String project,
String branch)
Gets a branch
|
BuildFacade |
build(String projectName,
String branchName,
String buildName)
Gets a build
|
String |
getAppVersion()
Gets the version of the remote app version
|
Object |
getDSLRoot()
Gets the root object to inject as
ontrack into the
DSL scripts. |
String |
getVersion()
Version of this facade
|
Object |
graphQLQuery(String query,
Map<String,?> vars)
Runs an arbitrary GraphQL query
|
void |
onClientException(Exception exception,
Consumer<String> handler)
Catching client exceptions
|
<T> T |
onNotFoundException(Exception exception,
Supplier<T> handler)
Catching not found exceptions
|
ProjectFacade |
project(String project)
Gets a project
|
public OntrackDSLV4Facade(OntrackConfiguration config, OntrackDSLLogger logger)
public String getVersion()
OntrackDSLFacade
getVersion
in interface OntrackDSLFacade
OntrackConfiguration.getOntrackVersion()
,
OntrackConfiguration.VERSION_3
,
OntrackConfiguration.VERSION_4
public String getAppVersion()
OntrackDSLFacade
getAppVersion
in interface OntrackDSLFacade
public Object getDSLRoot()
OntrackDSLFacade
ontrack
into the
DSL scripts.getDSLRoot
in interface OntrackDSLFacade
public void onClientException(Exception exception, Consumer<String> handler)
OntrackDSLFacade
onClientException
in interface OntrackDSLFacade
exception
- Exception to managehandler
- Handler called with the exception message if the exception is a client exceptionpublic <T> T onNotFoundException(Exception exception, Supplier<T> handler)
OntrackDSLFacade
onNotFoundException
in interface OntrackDSLFacade
T
- Type of object returned by the handlerexception
- Exception to managehandler
- Handler called if the exception is a "not found" exceptionpublic Object graphQLQuery(String query, Map<String,?> vars)
OntrackDSLFacade
graphQLQuery
in interface OntrackDSLFacade
query
- GraphQL queryvars
- Variables for the querypublic ProjectFacade project(String project)
OntrackDSLFacade
project
in interface OntrackDSLFacade
project
- Name of the projectpublic BranchFacade branch(String project, String branch)
OntrackDSLFacade
branch
in interface OntrackDSLFacade
project
- Name of the projectbranch
- Name of the branchpublic BuildFacade build(String projectName, String branchName, String buildName)
OntrackDSLFacade
build
in interface OntrackDSLFacade
projectName
- Name of the projectbranchName
- Name of the branchbuildName
- Name of the buildCopyright © 2016–2023. All rights reserved.