Package ru.bitel.bgbilling.server.util

# Class ClosedDateChecker

java.lang.Object
ru.bitel.bgbilling.server.util.ClosedDateChecker

public class ClosedDateChecker extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ClosedDateChecker()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `checkDatesForDelete(Calendar closedDate, LocalDate date)`
  `static void`
  `checkDatesForDelete(Calendar closedDate, Calendar dateFrom)`
  Для любых сущностей.
  `static void`
  `checkDatesForDelete(Calendar closedDate, Date date)`
  `static void`
  `checkDatesForUpdate(Calendar closedDate, LocalDate date, LocalDate newDate)`
  `static void`
  `checkDatesForUpdate(Calendar closedDate, Calendar date, Calendar newDate)`
  Для сущностей с одной датой формирования
  `static void`
  `checkDatesForUpdate(Calendar closedDate, Calendar dateFrom, Calendar dateTo, Calendar newDateFrom, Calendar newDateTo)`
  Для сущностей с периодом
  `static void`
  `checkDatesForUpdate(Calendar closedDate, Date date, Date newDate)`
  `static void`
  `checkDatesForUpdate(Calendar closedDate, Date dateFrom, Date dateTo, Date newDateFrom, Date newDateTo)`
  `Calendar`
  `getClosePeriodDate(int typeId)`
  `static Calendar`
  `getClosePeriodDateIfChecking(String key, int mid, int userId)`
  `static ClosedDateChecker`
  `getInstance()`
  `void`
  `setClosePeriodDate(int typeId, Date dt)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ClosedDateChecker

    public ClosedDateChecker()

- ## Method Details

  - ### getInstance

    public static ClosedDateChecker getInstance()

  - ### getClosePeriodDate

    public Calendar getClosePeriodDate(int typeId)

  - ### setClosePeriodDate

    public void setClosePeriodDate(int typeId, Date dt)

  - ### getClosePeriodDateIfChecking

    public static Calendar getClosePeriodDateIfChecking(String key, int mid, int userId)

  - ### checkDatesForDelete

    public static void checkDatesForDelete(Calendar closedDate, Date date) throws ru.bitel.bgbilling.common.BGMessageException
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException`

  - ### checkDatesForDelete

    public static void checkDatesForDelete(Calendar closedDate, LocalDate date) throws ru.bitel.bgbilling.common.BGMessageException
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException`

  - ### checkDatesForDelete

    public static void checkDatesForDelete(Calendar closedDate, Calendar dateFrom) throws ru.bitel.bgbilling.common.BGMessageException
    Для любых сущностей. Для сущностей с периодом достаточна проверка лишь левой границы.
    Parameters:
      `dateFrom` - левая граница
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException` - если изменение нельзя производить

  - ### checkDatesForUpdate

    public static void checkDatesForUpdate(Calendar closedDate, Date dateFrom, Date dateTo, Date newDateFrom, Date newDateTo) throws ru.bitel.bgbilling.common.BGMessageException
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException`

  - ### checkDatesForUpdate

    public static void checkDatesForUpdate(Calendar closedDate, Date date, Date newDate) throws ru.bitel.bgbilling.common.BGMessageException
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException`

  - ### checkDatesForUpdate

    public static void checkDatesForUpdate(Calendar closedDate, LocalDate date, LocalDate newDate) throws ru.bitel.bgbilling.common.BGMessageException
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException`

  - ### checkDatesForUpdate

    public static void checkDatesForUpdate(Calendar closedDate, Calendar dateFrom, Calendar dateTo, Calendar newDateFrom, Calendar newDateTo) throws ru.bitel.bgbilling.common.BGMessageException
    Для сущностей с периодом
    Parameters:
      `dateFrom` - старая левая дата
      `dateTo` - старая права дата
      `newDateFrom` - новая левая дата
      `newDateTo` - новая права дата
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException` - если изменение нельзя производить

  - ### checkDatesForUpdate

    public static void checkDatesForUpdate(Calendar closedDate, Calendar date, Calendar newDate) throws ru.bitel.bgbilling.common.BGMessageException
    Для сущностей с одной датой формирования
    Parameters:
      `date` -
      `newDate` -
    Throws:
      `ru.bitel.bgbilling.common.BGMessageException`