uk.gov.hmrc.mongo.workitem

Members list

Type members

Classlikes

object Operations

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Operations.type
sealed trait ProcessingStatus

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object InProgress
object ToDo
trait ResultStatus
object Cancelled
object Deferred
object Duplicate
object Failed
object Ignored
object Succeeded
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ResultStatus extends ProcessingStatus

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Cancelled
object Deferred
object Duplicate
object Failed
object Ignored
object Succeeded
Show all
sealed trait StatusUpdateResult

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object NotFound
class NotUpdated
class Updated

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class WorkItem[T](id: ObjectId, receivedAt: Instant, updatedAt: Instant, availableAt: Instant, status: ProcessingStatus, failureCount: Int, item: T)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object WorkItem

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
WorkItem.type
case class WorkItemFields(id: String, receivedAt: String, updatedAt: String, availableAt: String, status: String, failureCount: String, item: String)

Defines the internal fields for WorkItem, allowing customisation.

Defines the internal fields for WorkItem, allowing customisation.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
abstract class WorkItemModuleRepository[T](collectionName: String, moduleName: String, mongoComponent: MongoComponent, replaceIndexes: Boolean, extraIndexes: Seq[IndexModel], extraCodecs: Seq[Codec[_]])(implicit trd: Reads[T], ec: ExecutionContext) extends WorkItemRepository[T]

If you have multiple lifecycles on a WorkItem, you can use the WorkItemModuleRepository to interact with those lifecycles. It will namespace the lifecycle fields with the provided moduleName. It assumes creation of WorkItems are made through another view (e.g. a standard WorkItemRepository), it will only allow interacting with the WorkItem lifecycle, and will throw runtime exceptions if pushNew or pushNewBatch are called.

If you have multiple lifecycles on a WorkItem, you can use the WorkItemModuleRepository to interact with those lifecycles. It will namespace the lifecycle fields with the provided moduleName. It assumes creation of WorkItems are made through another view (e.g. a standard WorkItemRepository), it will only allow interacting with the WorkItem lifecycle, and will throw runtime exceptions if pushNew or pushNewBatch are called.

Attributes

Companion
object
Supertypes
trait MetricSource
trait FindById[T]
trait Cancel
class PlayMongoRepository[WorkItem[T]]
trait MongoDatabaseCollection
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class WorkItemRepository[T](collectionName: String, mongoComponent: MongoComponent, itemFormat: Format[T], val workItemFields: WorkItemFields, replaceIndexes: Boolean, extraIndexes: Seq[IndexModel], extraCodecs: Seq[Codec[_]])(implicit ec: ExecutionContext) extends PlayMongoRepository[WorkItem[T]], Cancel, FindById[T], MetricSource

The repository to set and get the work item's for processing. See pushNew for creating work items, and pullOutstanding for retrieving them.

The repository to set and get the work item's for processing. See pushNew for creating work items, and pullOutstanding for retrieving them.

Value parameters

collectionName

the name of the mongo collection.

extraCodecs

optional - to support more types

extraIndexes

optional - to add additional indexes

itemFormat

a play Json format to map the item to mongo entities

replaceIndexes

optional - default is true If true, existing indices should be removed/updated to match the provided indices. If false, any old indices are left behind, and indices with changed definitions will throw IndexConflict exceptions.

workItemFields

the internal fields for WorkItem, allowing customisation

Attributes

Supertypes
trait MetricSource
trait FindById[T]
trait Cancel
class PlayMongoRepository[WorkItem[T]]
trait MongoDatabaseCollection
class Object
trait Matchable
class Any
Show all
Known subtypes