/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.
 */

#ifndef _IGNITE_IMPL_BINARY_BINARY_TYPE_UPDATER_IMPL
#define _IGNITE_IMPL_BINARY_BINARY_TYPE_UPDATER_IMPL

#include "ignite/impl/ignite_environment.h"
#include "ignite/impl/binary/binary_type_updater.h"

namespace ignite
{
    namespace impl
    {
        namespace binary
        {
            /**
             * Type updater implementation.
             */
            class IGNITE_IMPORT_EXPORT BinaryTypeUpdaterImpl : public BinaryTypeUpdater
            {
            public:
                /**
                 * Constructor.
                 *
                 * @param env Environment.
                 * @param javaRef Reference to Java object which is able to process type request.
                 */
                BinaryTypeUpdaterImpl(IgniteEnvironment& env, jobject javaRef);

                /**
                 * Destructor.
                 */
                ~BinaryTypeUpdaterImpl();

                virtual bool Update(const Snap& snap, IgniteError& err);

                virtual SPSnap GetMeta(int32_t typeId, IgniteError& err);
            private:
                /** Environment. */
                IgniteEnvironment& env;

                /** Handle to Java object. */
                jobject javaRef;

                IGNITE_NO_COPY_ASSIGNMENT(BinaryTypeUpdaterImpl)
            };
        }
    }
}

#endif //_IGNITE_IMPL_BINARY_BINARY_TYPE_UPDATER_IMPL