Interface IRelayService
- Namespace
- adas_core.Application.Services.Interfaces
- Assembly
- adas-core.Application.dll
public interface IRelayService
- Extension Methods
Methods
CheckRelayStatus(ObjectId)
Asynchronously checks the current status of the relay identified by the specified identifier.
Task<RelayEnum.Status> CheckRelayStatus(ObjectId relayId)
Parameters
relayIdObjectIdThe unique identifier of the relay whose status is being queried.
Returns
- Task<RelayEnum.Status>
A task that represents the asynchronous operation, containing the RelayEnum.Status of the requested relay.
CheckRelayStatus(Relay)
Asynchronously checks the current status of the specified relay.
Task<RelayEnum.Status> CheckRelayStatus(Relay relay)
Parameters
relayRelayThe relay whose status is being checked.
Returns
- Task<RelayEnum.Status>
A task that represents the asynchronous operation, containing the current RelayEnum.Status of the relay.
GetById(ObjectId)
Retrieves a relay by its unique identifier, returning null if no matching relay is found.
Task<Relay?> GetById(ObjectId relay)
Parameters
relayObjectIdThe unique identifier of the relay to look up.
Returns
- Task<Relay>
A Task<TResult> that resolves to the Relay if found, or
nullif no relay matches the provided identifier.
GetPaginatedRelays(PaginationFilter)
Retrieves a paginated list of relays based on the specified pagination filter.
Task<PaginationResponse<Relay>> GetPaginatedRelays(PaginationFilter request)
Parameters
requestPaginationFilterThe pagination filter containing the criteria used to retrieve the relays.
Returns
- Task<PaginationResponse<Relay>>
A task that represents the asynchronous operation, containing the paginated response with the requested relays.
GetRelayByTypeInList(List<ObjectId>?, Type)
Retrieves the relays of a specified type from the provided configuration relay list.
List<Relay> GetRelayByTypeInList(List<ObjectId>? configurationRelayList, RelayEnum.Type type)
Parameters
configurationRelayListList<ObjectId>The list of relay ObjectIds to filter, or null if no configuration relays are available.
typeRelayEnum.TypeThe relay type to match against the configuration relays.
Returns
GetRelayInList(List<ObjectId>?)
Retrieves the list of Relay objects corresponding to the specified collection of relay identifiers.
List<Relay> GetRelayInList(List<ObjectId>? relayList)
Parameters
relayListList<ObjectId>The list of MongoDB.Bson.ObjectId values identifying the relays to retrieve. May be
null.
Returns
InsertRelay(Relay)
Inserts a new relay record based on the provided request data.
Task<Relay?> InsertRelay(Relay request)
Parameters
requestRelayThe relay entity to be inserted.
Returns
- Task<Relay>
A task that resolves to the inserted Relay, or
nullif the insert did not return a value.
PowerOff(Relay)
Powers off the specified relay by sending a command to deactivate it.
Task PowerOff(Relay relay)
Parameters
relayRelayThe relay to power off.
Returns
PowerOn(Relay)
Powers on the specified relay.
Task PowerOn(Relay relay)
Parameters
relayRelayThe relay to power on.
Returns
SetManualRelay(Status, ObjectId, Type)
Sets a manual relay with the specified status for the given point of contact and relay type.
Task SetManualRelay(RelayEnum.Status status, ObjectId pocId, RelayEnum.Type type)
Parameters
statusRelayEnum.StatusThe status to apply to the manual relay.
pocIdObjectIdThe identifier of the point of contact associated with the relay.
typeRelayEnum.TypeThe type of relay to set manually.
Returns
UpdateRelayById(ObjectId, Relay)
Updates an existing relay identified by the specified objectId with the provided relay data.
Returns null when no relay is found with the given identifier.
Task<Relay?> UpdateRelayById(ObjectId objectId, Relay relay)
Parameters
objectIdObjectIdThe unique identifier of the relay to update.
relayRelayThe relay data containing the updated values.