public final class DtoConverters
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
GENIE_ID_PREFIX
The Genie 3 prefix for resource ID added to the set of tags by the system.
|
static java.lang.String |
GENIE_NAME_PREFIX
The Genie 3 prefix for resource names added to the set of tags by the system.
|
Modifier and Type | Method and Description |
---|---|
static ClusterCriteria |
toClusterCriteria(Criterion criterion)
Convert the given
criterion to a V3 ClusterCriteria object. |
static Application |
toV3Application(Application v4Application)
Convert a V4 Application DTO to a V3 application DTO.
|
static Cluster |
toV3Cluster(Cluster v4Cluster)
Convert a V4 Cluster to a V3 Cluster.
|
static com.google.common.collect.ImmutableSet<java.lang.String> |
toV3CriterionTags(Criterion criterion)
Convert a given V4
criterion to the equivalent representation in V3 set of tags. |
static com.google.common.collect.ImmutableSet<java.lang.String> |
toV3Tags(java.lang.String id,
java.lang.String name,
java.util.Set<java.lang.String> tags)
Convert the V4 values supplied to how the tags would have looked in Genie V3.
|
static Application |
toV4Application(Application v3Application)
Convert a V3 Application DTO to a V4 Application DTO.
|
static Cluster |
toV4Cluster(Cluster v3Cluster)
Convert a V3 Cluster to a V4 cluster.
|
static Command |
toV4Command(Command v3Command)
Convert a V3 Command to a V4 Command.
|
static Criterion |
toV4Criterion(ClusterCriteria criteria)
Convert a V3 Cluster Criteria to a V4 Criterion.
|
static Criterion |
toV4Criterion(java.util.Set<java.lang.String> tags)
Convert a set of V3 criterion tags to a V4 criterion object.
|
static JobRequest |
toV4JobRequest(JobRequest v3JobRequest)
Convert a V3 Job Request to a V4 Job Request.
|
static JobRequest |
toV4JobRequest(JobRequest v3JobRequest,
boolean tokenizeArgumentsString)
Convert a V3 Job Request to a V4 Job Request.
|
public static final java.lang.String GENIE_ID_PREFIX
public static final java.lang.String GENIE_NAME_PREFIX
public static Application toV4Application(Application v3Application)
v3Application
- The V3 application to convertpublic static Application toV3Application(Application v4Application)
v4Application
- The V4 application to convertpublic static Cluster toV4Cluster(Cluster v3Cluster)
v3Cluster
- The cluster to convertpublic static Cluster toV3Cluster(Cluster v4Cluster)
v4Cluster
- The cluster to convertpublic static Command toV4Command(Command v3Command)
v3Command
- The V3 Command to convertpublic static JobRequest toV4JobRequest(JobRequest v3JobRequest) throws GeniePreconditionException
v3JobRequest
- The v3 request to convertGeniePreconditionException
- When the criteria is invalidpublic static JobRequest toV4JobRequest(JobRequest v3JobRequest, boolean tokenizeArgumentsString) throws GeniePreconditionException
v3JobRequest
- The v3 request to converttokenizeArgumentsString
- Whether to perform splitting of the command arguments string into separate
arguments. This is necessary to execute a request that came through the V3 API
using V4 execution code.GeniePreconditionException
- When the criteria is invalidpublic static com.google.common.collect.ImmutableSet<java.lang.String> toV3Tags(java.lang.String id, java.lang.String name, java.util.Set<java.lang.String> tags)
id
- The id of the resourcename
- The name of the resourcetags
- The tags on the resourcepublic static com.google.common.collect.ImmutableSet<java.lang.String> toV3CriterionTags(Criterion criterion)
criterion
to the equivalent representation in V3 set of tags.criterion
- The Criterion
to convertpublic static ClusterCriteria toClusterCriteria(Criterion criterion)
criterion
to a V3 ClusterCriteria
object.criterion
- The Criterion
to convertpublic static Criterion toV4Criterion(ClusterCriteria criteria) throws GeniePreconditionException
criteria
- The criteria to convertGeniePreconditionException
- If the criteria converts to an invalid criterionpublic static Criterion toV4Criterion(java.util.Set<java.lang.String> tags) throws GeniePreconditionException
tags
- The tags to convertGeniePreconditionException
- If the tags convert to an invalid criterion