﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Data.Common;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Runtime.Serialization;
using System.Configuration;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Linq;

using Hydra.Framework;
using Hydra.Framework.Java;
using Hydra.Framework.Helpers;
using Hydra.Framework.Cryptographics;
using Hydra.Framework.Mapping.CoordinateSystems;
using Hydra.Framework.Collections;
using Hydra.Framework.Conversions;
using DomainModel = Hydra.DomainModel;
using Hydra.DomainStatus;
using Hydra.Data.Model;
using Hydra.Data.RepositoryInterfaces;
using Hydra.Domain.Mapping;

namespace Hydra.ServiceContracts
{
    /// <summary>
    /// Chokepoint Service Interface
    /// </summary>
    public interface IChokepointService
    {
        /// <summary>
        /// Gets or sets the repository.
        /// </summary>
        /// <value>The repository.</value>
        IRepository<Hydra.Data.Model.Chokepoint> Repository { get; }

        /// <summary>
        /// Updates the chokepoint.
        /// </summary>
        /// <param name="chokepoint">The chokepoint.</param>
        void Update(DomainModel.InternalChokepoint chokepoint);

        /// <summary>
        /// Adds the chokepoint.
        /// </summary>
        /// <param name="chokepoint">The chokepoint.</param>
        void Add(ref DomainModel.InternalChokepoint chokepoint);

        /// <summary>
        /// Deletes the chokepoint.
        /// </summary>
        /// <param name="chokepoint">The chokepoint.</param>
        void Delete(DomainModel.InternalChokepoint chokepoint);

        /// <summary>
        /// Gets the specified chokepoint
        /// </summary>
        /// <param name="id">The chokepoint id.</param>
        /// <returns></returns>
        DomainModel.InternalChokepoint Get(int id);

        /// <summary>
        /// Does the item Exist in the repository
        /// </summary>
        /// <param name="id">The item id.</param>
        /// <returns>Boolean, true if exists</returns>
        bool Exists(int id);

        /// <summary>
        /// Find the Maximum Number of objects currently in persisted cache.
        /// </summary>
        /// <returns>Max Number of items</returns>
        int MaxID();

        /// <summary>
        /// AccountList of AccessPoints
        /// </summary>
        /// <returns></returns>
        List<DomainModel.InternalChokepoint> List();

        /// <summary>
        /// AccountList of AccessPoints
        /// </summary>
        /// <param name="locationId">The location id.</param>
        /// <returns></returns>
        List<DomainModel.InternalChokepoint> List(int locationId);

        /// <summary>
        /// Builds the cache list from database.
        /// </summary>
        /// <returns>A new Dictionary</returns>
        Dictionary<int, DomainModel.InternalChokepoint> BuildCacheListFromDatabase();

        /// <summary>
        /// Serializes the specified chokepoint.
        /// </summary>
        /// <param name="chokepoint">The chokepoint to serialize.</param>
        /// <returns></returns>
        string Serialize(DomainModel.InternalChokepoint chokepoint);

        /// <summary>
        /// Serialize a list of AccessPoints.
        /// </summary>
        /// <param name="list">The list of AccessPoints.</param>
        /// <returns></returns>
        string Serialize(List<DomainModel.InternalChokepoint> list);
    }
}