28
28
import io .apicurio .registry .rest .v3 .beans .CreateArtifact ;
29
29
import io .apicurio .registry .rest .v3 .beans .CreateArtifactResponse ;
30
30
import io .apicurio .registry .rest .v3 .beans .CreateGroup ;
31
+ import io .apicurio .registry .rest .v3 .beans .CreateRule ;
31
32
import io .apicurio .registry .rest .v3 .beans .CreateVersion ;
32
33
import io .apicurio .registry .rest .v3 .beans .EditableArtifactMetaData ;
33
34
import io .apicurio .registry .rest .v3 .beans .EditableGroupMetaData ;
@@ -300,17 +301,16 @@ public List<RuleType> listArtifactRules(String groupId, String artifactId) {
300
301
}
301
302
302
303
/**
303
- * @see io.apicurio.registry.rest.v3.GroupsResource#createArtifactRule(java.lang. String, java.lang. String, io.apicurio.registry.rest.v3.beans.Rule )
304
+ * @see io.apicurio.registry.rest.v3.GroupsResource#createArtifactRule(String, String, CreateRule )
304
305
*/
305
306
@ Override
306
307
@ Audited (extractParameters = {"0" , KEY_GROUP_ID , "1" , KEY_ARTIFACT_ID , "2" , KEY_RULE })
307
308
@ Authorized (style = AuthorizedStyle .GroupAndArtifact , level = AuthorizedLevel .Write )
308
- public void createArtifactRule (String groupId , String artifactId , Rule data ) {
309
+ public void createArtifactRule (String groupId , String artifactId , CreateRule data ) {
309
310
requireParameter ("groupId" , groupId );
310
311
requireParameter ("artifactId" , artifactId );
311
-
312
- RuleType type = data .getType ();
313
- requireParameter ("type" , type );
312
+ requireParameter ("ruleType" , data .getRuleType ());
313
+ requireParameter ("config" , data .getConfig ());
314
314
315
315
if (data .getConfig () == null || data .getConfig ().isEmpty ()) {
316
316
throw new MissingRequiredParameterException ("Config" );
@@ -323,7 +323,7 @@ public void createArtifactRule(String groupId, String artifactId, Rule data) {
323
323
throw new ArtifactNotFoundException (groupId , artifactId );
324
324
}
325
325
326
- storage .createArtifactRule (new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , data .getType (), config );
326
+ storage .createArtifactRule (new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , data .getRuleType (), config );
327
327
}
328
328
329
329
/**
@@ -344,33 +344,34 @@ public void deleteArtifactRules(String groupId, String artifactId) {
344
344
*/
345
345
@ Override
346
346
@ Authorized (style = AuthorizedStyle .GroupAndArtifact , level = AuthorizedLevel .Read )
347
- public Rule getArtifactRuleConfig (String groupId , String artifactId , RuleType rule ) {
347
+ public Rule getArtifactRuleConfig (String groupId , String artifactId , RuleType ruleType ) {
348
348
requireParameter ("groupId" , groupId );
349
349
requireParameter ("artifactId" , artifactId );
350
- requireParameter ("rule " , rule );
350
+ requireParameter ("ruleType " , ruleType );
351
351
352
- RuleConfigurationDto dto = storage .getArtifactRule (new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , rule );
352
+ RuleConfigurationDto dto = storage .getArtifactRule (new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , ruleType );
353
353
Rule rval = new Rule ();
354
354
rval .setConfig (dto .getConfiguration ());
355
- rval .setType ( rule );
355
+ rval .setRuleType ( ruleType );
356
356
return rval ;
357
357
}
358
358
359
359
/**
360
- * @see io.apicurio.registry.rest.v3.GroupsResource#updateArtifactRuleConfig(java.lang. String, java.lang. String, io.apicurio.registry.types. RuleType, io.apicurio.registry.rest.v3.beans. Rule)
360
+ * @see io.apicurio.registry.rest.v3.GroupsResource#updateArtifactRuleConfig(String, String, RuleType, Rule)
361
361
*/
362
362
@ Override
363
363
@ Audited (extractParameters = {"0" , KEY_GROUP_ID , "1" , KEY_ARTIFACT_ID , "2" , KEY_RULE_TYPE , "3" , KEY_RULE })
364
364
@ Authorized (style = AuthorizedStyle .GroupAndArtifact , level = AuthorizedLevel .Write )
365
- public Rule updateArtifactRuleConfig (String groupId , String artifactId , RuleType rule , Rule data ) {
365
+ public Rule updateArtifactRuleConfig (String groupId , String artifactId , RuleType ruleType , Rule data ) {
366
366
requireParameter ("groupId" , groupId );
367
367
requireParameter ("artifactId" , artifactId );
368
- requireParameter ("rule" , rule );
368
+ requireParameter ("ruleType" , ruleType );
369
+ requireParameter ("config" , data .getConfig ());
369
370
370
371
RuleConfigurationDto dto = new RuleConfigurationDto (data .getConfig ());
371
- storage .updateArtifactRule (new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , rule , dto );
372
+ storage .updateArtifactRule (new GroupId (groupId ).getRawGroupIdWithNull (), artifactId , ruleType , dto );
372
373
Rule rval = new Rule ();
373
- rval .setType ( rule );
374
+ rval .setRuleType ( ruleType );
374
375
rval .setConfig (data .getConfig ());
375
376
return rval ;
376
377
}
0 commit comments