Class BroadWorksService

java.lang.Object
co.ecg.alpaca.toolkit.model.BroadWorksObject
co.ecg.alpaca.toolkit.model.BroadWorksService
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BroadWorksGroupService, BroadWorksServiceProviderService, BroadWorksUserService

public abstract class BroadWorksService extends BroadWorksObject
Defines the model for BroadWorksServices. These service objects are loaded asynchronously with service information and use an outstanding counter to block on read when the requests are still outstanding.
Author:
Matthew Keathley on 3/13/16
See Also:
  • Constructor Details

    • BroadWorksService

      public BroadWorksService(BroadWorksProcess broadWorksProcess)
      Creates a new BroadWorksService with the given BroadWorksProcess
      Parameters:
      broadWorksProcess -
    • BroadWorksService

      public BroadWorksService()
      The Serializable Constructor
  • Method Details

    • setBroadWorksProcess

      public void setBroadWorksProcess(BroadWorksProcess broadWorksProcess)
    • getRequestContext

      public RequestContext getRequestContext()
    • getProcess

      public BroadWorksProcess getProcess()
    • isPopulated

      public boolean isPopulated()
      Overrides:
      isPopulated in class BroadWorksObject
    • waitForLoad

      public void waitForLoad()
    • isPrimary

      public boolean isPrimary()
      Returns if this service is considered primary in that it should be handled before others when pushing the service.
      Returns:
      Returns true if the service is primary.
    • setPrimary

      public void setPrimary(boolean primary)
      Sets the service as a primary service to be handled before non-primary services when inserting or modifying an object.
      Parameters:
      primary - The boolean primary value.
    • mapRequestAndFire

      protected <R extends Response, O> void mapRequestAndFire(O object, Request<R> request, Object mappingObject) throws RequestException
      Convenience method to map a request to a response and add it to the request bundler
      Parameters:
      request - The output request
      mappingObject - The input response or other mapped object
      Throws:
      RequestException - Thrown if an error occurs while mapping the object and request.
    • mapRequestAndFire

      protected <R extends Response, Q extends Request<R>, O> void mapRequestAndFire(O object, Q request, Object mappingObject, Consumer<R> responseConsumer) throws RequestException
      Convenience method to map a request to a response and add it to the request bundler
      Parameters:
      request - The output request
      mappingObject - The input response or other mapped object
      responseConsumer - A custom consumer for the response
      Throws:
      RequestException - Thrown if an error occurs while mapping the object and request.
    • mapRequestAndFire

      protected <R extends Response, Q extends Request<R>, O> void mapRequestAndFire(O object, Q request, Object mappingObject, Consumer<R> responseConsumer, Consumer<Q> requestConsumer) throws RequestException
      Throws:
      RequestException
    • mapRequestAndFire

      protected <R extends Response, Q extends Request<R>, O> void mapRequestAndFire(O object, Q request, Object mappingObject, Consumer<R> responseConsumer, Consumer<Q> requestConsumer, String... expectedErrorCodes) throws RequestException
      Convenience method to map a request to a response and add it to the request bundler
      Parameters:
      request - The output request
      mappingObject - The input response or other mapped object
      responseConsumer - A custom consumer for the response
      requestConsumer - A custom consumer to modify the request before firing
      Throws:
      RequestException - Thrown if an error occurs while mapping the object and request.