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

com.alachisoft.ncache.client.internal.command.GetCacheHostPortCommand 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.common.protobuf.CommandProtocol;
import com.alachisoft.ncache.common.protobuf.GetCacheManagementPortCommandProtocol;
import com.alachisoft.ncache.runtime.exceptions.CommandException;
import com.google.protobuf.ByteString;

import java.io.IOException;

public class GetCacheHostPortCommand extends InitialCommandBase {

    private final String cacheid;

    public GetCacheHostPortCommand(String id, byte[] userName, byte[] password) {
        name = "GetCacheManagementPort";
        this.cacheid = id;
    }

    @Override
    protected void createCommand() throws CommandException {

        GetCacheManagementPortCommandProtocol.GetCacheManagementPortCommand.Builder builder =
                GetCacheManagementPortCommandProtocol.GetCacheManagementPortCommand.newBuilder()
                        .setCacheId(this.cacheid);

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

            commandBuilder = commandBuilder.setGetCacheManagementPortCommand(builder)
                    .setRequestID(this.getRequestId())
                    .setType(CommandProtocol.Command.Type.GET_CACHE_MANAGEMENT_PORT);
            super._command = commandBuilder.build();

    }


    /**
     * @return
     */
    @Override
    public CommandType getCommandType() {
        return CommandType.GET_CACHE_MANAGEMENT_PORT;
    }

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

    @Override
    public boolean getSupportsAacknowledgement() {
        return false;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy