Package co.ecg.alpaca.toolkit.model
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
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:
-
Field Summary
Fields inherited from class co.ecg.alpaca.toolkit.model.BroadWorksObject
broadWorksServer, populated -
Constructor Summary
ConstructorsConstructorDescriptionThe Serializable ConstructorBroadWorksService(BroadWorksProcess broadWorksProcess) Creates a new BroadWorksService with the given BroadWorksProcess -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanReturns if this service is considered primary in that it should be handled before others when pushing the service.protected <R extends Response,O>
voidmapRequestAndFire(O object, Request<R> request, Object mappingObject) Convenience method to map a request to a response and add it to the request bundlermapRequestAndFire(O object, Q request, Object mappingObject, Consumer<R> responseConsumer) Convenience method to map a request to a response and add it to the request bundlermapRequestAndFire(O object, Q request, Object mappingObject, Consumer<R> responseConsumer, Consumer<Q> requestConsumer) mapRequestAndFire(O object, Q request, Object mappingObject, Consumer<R> responseConsumer, Consumer<Q> requestConsumer, String... expectedErrorCodes) Convenience method to map a request to a response and add it to the request bundlervoidsetBroadWorksProcess(BroadWorksProcess broadWorksProcess) voidsetPrimary(boolean primary) Sets the service as a primary service to be handled before non-primary services when inserting or modifying an object.voidMethods inherited from class co.ecg.alpaca.toolkit.model.BroadWorksObject
getBroadWorksServer, hasPopulated, populate, setBroadWorksServer, setPopulated
-
Constructor Details
-
BroadWorksService
Creates a new BroadWorksService with the given BroadWorksProcess- Parameters:
broadWorksProcess-
-
BroadWorksService
public BroadWorksService()The Serializable Constructor
-
-
Method Details
-
setBroadWorksProcess
-
getRequestContext
-
getProcess
-
isPopulated
public boolean isPopulated()- Overrides:
isPopulatedin classBroadWorksObject
-
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 requestmappingObject- 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>, void mapRequestAndFireO> (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 requestmappingObject- The input response or other mapped objectresponseConsumer- 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>, void mapRequestAndFireO> (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>, void mapRequestAndFireO> (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 requestmappingObject- The input response or other mapped objectresponseConsumer- A custom consumer for the responserequestConsumer- A custom consumer to modify the request before firing- Throws:
RequestException- Thrown if an error occurs while mapping the object and request.
-