/*
 * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hazelcast.client.impl.protocol.template;

import com.hazelcast.annotation.GenerateCodec;
import com.hazelcast.annotation.Nullable;
import com.hazelcast.annotation.Response;
import com.hazelcast.client.impl.client.DistributedObjectInfo;
import com.hazelcast.client.impl.protocol.ResponseMessageConst;
import com.hazelcast.map.impl.SimpleEntryView;
import com.hazelcast.mapreduce.JobPartitionState;
import com.hazelcast.nio.Address;
import com.hazelcast.nio.serialization.Data;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Client Protocol Responses
 */
@GenerateCodec(id = 0, name = "response", ns = "")
public interface ResponseTemplate {

    @Response(ResponseMessageConst.VOID)
    void Void();

    /**
     *
     * @param response True if operation is successful, false otherwise.
     */
    @Response(ResponseMessageConst.BOOLEAN)
    void Boolean(boolean response);

    /**
     *
     * @param response The operation result as an integer.
     */
    @Response(ResponseMessageConst.INTEGER)
    void Integer(int response);

    /**
     *
     * @param response The operation result as a long.
     */
    @Response(ResponseMessageConst.LONG)
    void Long(long response);

    /**
     *
     * @param response The operation result as a string.
     */
    @Response(ResponseMessageConst.STRING)
    void String(String response);

    /**
     *
     * @param response The operation result as a serialized byte-array.
     */
    @Response(ResponseMessageConst.DATA)
    void Data(@Nullable Data response);

    /**
     *
     * @param list The operation result as an array of serialized byte-array.
     */
    @Response(ResponseMessageConst.LIST_DATA)
    void ListData(List<Data> list);

    /**
     *
     * @param set The operation result as an array of serialized byte-array.
     */
    @Response(ResponseMessageConst.SET_DATA)
    void SetData(Set<Data> set);

    /**
     *
     * @param entrySet The operation result as an array of serialized key-value byte-arrays.
     */
    @Response(ResponseMessageConst.SET_ENTRY)
    void SetEntry(Set<Map.Entry<Data, Data>> entrySet);

    @Response(ResponseMessageConst.LIST_ENTRY)
    void ListEntry(List<Map.Entry<Data, Data>> entries);

    /**
     *
     * @param entrySet The operation result as an array of serialized key-value byte-arrays.
     */
    @Response(ResponseMessageConst.LIST_ENTRY)
    void ListEntry(List<Map.Entry<Data, Data>> entrySet);

    /**
     *
     * @param address The address of the member server.
     * @param uuid Unique string identifying the connected client uniquely. This string is generated by the owner member server
     *             on initial connection. When the client connects to a non-owner member it sets this field on the request.
     * @param ownerUuid Unique string identifying the server member uniquely.
     * @return Returns the address, uuid and owner uuid.
     */

    @Response(ResponseMessageConst.AUTHENTICATION)
    Object Authentication(Address address, String uuid, String ownerUuid);

    /**
     *
     * @param partitions An array of member server address to partitions mapping.
     */
    @Response(ResponseMessageConst.PARTITIONS)
    void Partitions(Map<Address, Set<Integer>> partitions);

    /**
     *
     * @param infoCollection An array of DistributedObjectInfo (service name and object name).
     */
    @Response(ResponseMessageConst.SET_DISTRIBUTED_OBJECT)
    void SetDistributedObject(Set<DistributedObjectInfo> infoCollection);

    /**
     *
     * @param dataEntryView Response as an EntryView Data type.
     */
    @Response(ResponseMessageConst.ENTRY_VIEW)
    void EntryView(@Nullable SimpleEntryView<Data, Data> dataEntryView);

    /**
     *
     * @param jobPartitionStates The state of the job. See Job Partition State Data Type description for details.
     * @param processRecords Number of processed records.
     * @return The information about the job if exists
     */
    @Response(ResponseMessageConst.JOB_PROCESS_INFO)
    Object JobProcessInfo(List<JobPartitionState> jobPartitionStates, int processRecords);

    /***
     * @param tableIndex the last tableIndex processed
     * @param keys       list of keys
     */
    @Response(ResponseMessageConst.CACHE_KEY_ITERATOR_RESULT)
    void CacheKeyIteratorResult(int tableIndex, List<Data> keys);

    /**
     * @param errorCode      error code of this exception
     * @param className      java class name of exception
     * @param message        details of exception
     * @param stacktrace     array of stack trace
     * @param causeErrorCode error code of cause of this exception, if there is no cause -1
     * @param causeClassName java class name of the cause of this exception
     */
    @Response(ResponseMessageConst.EXCEPTION)
    void Exception(int errorCode, String className, @Nullable String message, StackTraceElement[] stacktrace
            , int causeErrorCode, @Nullable String causeClassName);

    /**
     *
     * @param readCount Number of items in the response.
     * @param items The array of serialized items.
     */
    @Response(ResponseMessageConst.READ_RESULT_SET)
    void ReadResultSet(int readCount, List<Data> items);

}

@@ -2768,113 +2768,8 @@
 );%0A%0A
-    @Response(ResponseMessageConst.LIST_ENTRY)%0A    void ListEntry(List%3CMap.Entry%3CData, Data%3E%3E entries);%0A%0A
     

fix compilation error caused by duplicate response template definition