public abstract class AbstractImport<O extends BroadWorksObject,T extends BroadWorksObjectInformation<O>,R extends Request<DefaultResponse>,S extends Enum<S>,E extends AbstractImport<O,T,R,S,E>> extends IterableProcess<E,S> implements Executable<O>
BroadWorksObject
given a BroadWorksObjectInformation
Modifier and Type | Field and Description |
---|---|
R |
addRequest |
stepList
errors, log, warnings
Constructor and Description |
---|
AbstractImport(BroadWorksServer bws,
T information,
Class<S> buildStepClass)
Creates a new Object Import with the provided information
|
Modifier and Type | Method and Description |
---|---|
void |
concurrencyCheck() |
abstract R |
getAddRequest() |
BroadWorksServer |
getBroadWorksServer() |
T |
getInformation() |
O |
getOutput() |
protected <R extends Response,Q extends Request<R>> |
mapRequestAndFire(Q request,
Response response,
Consumer<R> responseConsumer,
Consumer<Q> afterMappingConsumer)
Convenience method to map a request to a response and add it to the request bundler
|
protected <R extends Response> |
mapRequestAndFire(Request<R> request,
Response response)
Convenience method to map a request to a response and add it to the request bundler
|
protected <R extends Response> |
mapRequestAndFire(Request<R> request,
Response response,
Consumer<R> responseConsumer)
Convenience method to map a request to a response and add it to the request bundler
|
E |
registerForEvents()
Registers the import to receive events
|
void |
serviceModifyEvent(ServiceModifyEvent event)
Method to handle the subscription to the
EventBus for
ServiceModifyEvent . |
void |
setAddRequest(R request) |
void |
setOutput(O output) |
void |
unregister()
Removes this object from the EventBus
|
addStep, addStep, all, allBut, getStepCount, isConcurrent, only, removeStep, setConcurrent, step, step
checkValidity, exception, getErrors, getReport, getWarnings, hasErrors, isError, isError, isError, printReport, setExceptionOnErrors
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
getSessionLogger, logger
public R extends Request<DefaultResponse> addRequest
public AbstractImport(BroadWorksServer bws, T information, Class<S> buildStepClass) throws HelperException
bws
- The BroadWorks server to create the User oninformation
- The information to base the new object onbuildStepClass
- The class of the import build stepsHelperException
- Thrown if unable to create the Import.public void concurrencyCheck()
public E registerForEvents()
public void unregister()
public BroadWorksServer getBroadWorksServer()
public O getOutput()
public void setOutput(O output)
public T getInformation()
public abstract R getAddRequest() throws RequestException
RequestException
public void setAddRequest(R request)
protected <R extends Response> void mapRequestAndFire(Request<R> request, Response response) throws RequestException
request
- The output requestresponse
- The input responseRequestException
- Thrown if unable to map or fire the request.protected <R extends Response> void mapRequestAndFire(Request<R> request, Response response, Consumer<R> responseConsumer) throws RequestException
request
- The output requestresponse
- The input responseresponseConsumer
- Action to perform on the responseRequestException
- Thrown if unable to map or fire the request.protected <R extends Response,Q extends Request<R>> void mapRequestAndFire(Q request, Response response, Consumer<R> responseConsumer, Consumer<Q> afterMappingConsumer) throws RequestException
request
- The output requestresponse
- The input responseresponseConsumer
- A custom consumer for the responseRequestException
- Thrown if unable to map or fire the request.public void serviceModifyEvent(ServiceModifyEvent event)
EventBus
for
ServiceModifyEvent
. These incoming events allow for the import to be queried to see
if there was any errors.event
- The ServiceModifyEvent to be handledCopyright © 2017 ECG. All rights reserved.