All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.client.internal.command.GetServerMappingCommand Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package com.alachisoft.ncache.client.internal.command;

import com.alachisoft.ncache.client.internal.communication.Connection;
import com.alachisoft.ncache.common.protobuf.CommandProtocol;
import com.alachisoft.ncache.common.protobuf.GetServerMappingCommandProtocol;
import com.alachisoft.ncache.runtime.exceptions.CommandException;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;

public class GetServerMappingCommand extends InitialCommandBase {

    private GetServerMappingCommandProtocol.GetServerMappingCommand.Builder serverMappingBuilder;

    public GetServerMappingCommand() {
        serverMappingBuilder = GetServerMappingCommandProtocol.GetServerMappingCommand.newBuilder();
        serverMappingBuilder.setRequestId(super.getRequestId());
    }

    @Override
    public CommandType getCommandType() {
        return CommandType.GET_SERVER_MAPPING;
    }

    @Override
    public RequestType getCommandRequestType() {
        return RequestType.InternalCommand;
    }

    @Override
    protected void createCommand() throws CommandException {

        CommandProtocol.Command.Builder commandBuilder =
                    CommandProtocol.Command.newBuilder();

            commandBuilder = commandBuilder.setGetServerMappingCommand(serverMappingBuilder)
                    .setRequestID(this.getRequestId())
                    .setType(CommandProtocol.Command.Type.GET_SERVER_MAPPING);
            super._command = commandBuilder.build();

    }

    @Override
    protected boolean getIsKeyBased() {
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy