Class AssociationCreateOrUpdateOp
java.lang.Object
io.confluent.kafka.schemaregistry.client.rest.entities.requests.AssociationOp
io.confluent.kafka.schemaregistry.client.rest.entities.requests.AssociationCreateOrUpdateOp
- Direct Known Subclasses:
AssociationCreateOp,AssociationUpsertOp
-
Field Summary
Fields inherited from class io.confluent.kafka.schemaregistry.client.rest.entities.requests.AssociationOp
KEY_ASSOCIATION_TYPE, opType, VALUE_ASSOCIATION_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionAssociationCreateOrUpdateOp(OpType opType, String subject, String associationType, LifecyclePolicy lifecycle, Boolean frozen, RegisterSchemaRequest schema, Boolean normalize) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDefaults(boolean isCreate) Applies defaults for an association that does not yet exist.booleaninthashCode()voidsetAssociationType(String associationType) voidvoidsetLifecycle(LifecyclePolicy lifecycle) voidsetNormalize(Boolean normalize) voidsetSchema(RegisterSchemaRequest schema) voidsetSubject(String subject) voidvalidate(boolean dryRun) Methods inherited from class io.confluent.kafka.schemaregistry.client.rest.entities.requests.AssociationOp
getType, toJson
-
Constructor Details
-
AssociationCreateOrUpdateOp
public AssociationCreateOrUpdateOp(OpType opType, String subject, String associationType, LifecyclePolicy lifecycle, Boolean frozen, RegisterSchemaRequest schema, Boolean normalize)
-
-
Method Details
-
getSubject
-
setSubject
-
getAssociationType
-
setAssociationType
-
getLifecycle
-
setLifecycle
-
getFrozen
-
setFrozen
-
getSchema
-
setSchema
-
getNormalize
-
setNormalize
-
equals
- Overrides:
equalsin classAssociationOp
-
hashCode
public int hashCode()- Overrides:
hashCodein classAssociationOp
-
applyDefaults
public void applyDefaults(boolean isCreate) Applies defaults for an association that does not yet exist. Only call this while creating the association: an upsert that updates an existing one keeps that association's stored lifecycle and would be wrongly rejected here for carrying a schema.For a create op a schema implies frozen STRONG, and frozen=false or WEAK alongside a schema are rejected. For an upsert op no schema is accepted at all, since a schema implies a topic-owned STRONG association and those can only be created together with the topic. Either way frozen and lifecycle are defaulted when null.
The matching check on an explicit STRONG lifecycle lives in the registry, which can exempt subjects in IMPORT mode.
- Parameters:
isCreate- whether this is a create op rather than an upsert op
-
validate
public void validate(boolean dryRun) - Specified by:
validatein classAssociationOp
-