com.basho.riak.client.api.commands.search.StoreSchema Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of riak-client Show documentation
Show all versions of riak-client Show documentation
HttpClient-based client for Riak
The newest version!
package com.basho.riak.client.api.commands.search;
import com.basho.riak.client.api.AsIsRiakCommand;
import com.basho.riak.client.core.operations.YzPutSchemaOperation;
import com.basho.riak.client.core.query.search.YokozunaSchema;
/**
* Command used to store a search schema in Riak.
*
* To store a schema for Solr/Yokozuna in Riak, you must supply a
* {@link com.basho.riak.client.core.query.search.YokozunaSchema} that defines the schema.
*
* @author Dave Rusek
* @since 2.0
*/
public final class StoreSchema extends AsIsRiakCommand
{
private final YokozunaSchema schema;
StoreSchema(Builder builder)
{
this.schema = builder.schema;
}
@Override
protected YzPutSchemaOperation buildCoreOperation()
{
return new YzPutSchemaOperation.Builder(schema).build();
}
/**
* Builder for a StoreSchema command.
*/
public static class Builder
{
private final YokozunaSchema schema;
/**
* Construct a Builder for a StoreSchema command.
*
* @param schema The schema to be stored to Riak.
*/
public Builder(YokozunaSchema schema)
{
this.schema = schema;
}
/**
* Construct the StoreSchema command.
* @return the new StoreSchema command.
*/
public StoreSchema build()
{
return new StoreSchema(this);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy