/*
 * Copyright (c) 2002-2009 "Neo Technology,"
 *     Network Engine for Objects in Lund AB [http://neotechnology.com]
 *
 * This file is part of Neo4j.
 * 
 * Neo4j is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.neo4j.kernel.impl.core;

import javax.transaction.TransactionManager;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.kernel.impl.cache.AdaptiveCacheManager;
import org.neo4j.kernel.impl.nioneo.store.PropertyData;
import org.neo4j.kernel.impl.persistence.IdGenerator;
import org.neo4j.kernel.impl.persistence.PersistenceManager;
import org.neo4j.kernel.impl.transaction.LockManager;
import org.neo4j.kernel.impl.util.ArrayMap;

class ReadOnlyNodeManager extends NodeManager
{
    ReadOnlyNodeManager( GraphDatabaseService graphDbService,
            AdaptiveCacheManager cacheManager, LockManager lockManager,
            LockReleaser lockReleaser, TransactionManager transactionManager,
            PersistenceManager persistenceManager, IdGenerator idGenerator,
            boolean useNewCaches )
    {
        super( graphDbService, cacheManager, lockManager, lockReleaser,
                transactionManager, persistenceManager, idGenerator,
                useNewCaches );
    }

    @Override
    public Node createNode()
    {
        throw new ReadOnlyDbException();
    }

    @Override
    public Relationship createRelationship( Node startNode, Node endNode,
        RelationshipType type )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    PropertyIndex createPropertyIndex( String key )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    ArrayMap<Integer,PropertyData> deleteNode( NodeImpl node )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    int nodeAddProperty( NodeImpl node, PropertyIndex index, Object value )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    void nodeChangeProperty( NodeImpl node, int propertyId, Object value )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    void nodeRemoveProperty( NodeImpl node, int propertyId )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    ArrayMap<Integer,PropertyData> deleteRelationship( RelationshipImpl rel )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    int relAddProperty( RelationshipImpl rel, PropertyIndex index, Object value )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    void relChangeProperty( RelationshipImpl rel, int propertyId, Object value )
    {
        throw new ReadOnlyDbException();
    }

    @Override
    void relRemoveProperty( RelationshipImpl rel, int propertyId )
    {
        throw new ReadOnlyDbException();
    }
}