| Modifier and Type | Field and Description |
|---|---|
private TransportConnector |
connector |
private Queue<de.iip_ecosphere.platform.support.function.IOConsumer<TransportConnector>> |
queue |
private boolean |
stayOffline |
private Supplier<TransportSetup> |
transportSupplier |
| Constructor and Description |
|---|
TransportInstance()
Creates a transport instance without transport setup information (for deferred setup).
|
TransportInstance(Supplier<TransportSetup> supplier)
Creates a transport information instance and sets the transport information.
|
| Modifier and Type | Method and Description |
|---|---|
TransportConnector |
createConnector()
Tries creating a connector.
|
TransportConnector |
getConnector()
Returns the transport connector.
|
void |
releaseConnector()
Releases an existing connector and stays offline.
|
void |
releaseConnector(boolean stayOff)
Releases an existing connector.
|
void |
send(de.iip_ecosphere.platform.support.function.IOConsumer<TransportConnector> sender,
String kind)
Sends a message of a certain
kind and cares for queuing. |
void |
sendAlert(Alert alert)
Sends an alert message.
|
void |
sendContainerStatus(ActionType action,
String containerId,
String... aliasIds)
Sends a container status message.
|
void |
sendProcessStatus(String componentId,
int step,
int max,
String description)
Sends information about a processing status.
|
void |
sendProcessStatus(String componentId,
int step,
int max,
String description,
String subDescription)
Sends information about a processing status.
|
void |
sendResourceStatus(ActionType action,
String... aliasIds)
Sends a resource status message for this resource.
|
void |
sendResourceStatus(ActionType action,
String deviceId,
String... aliasIds)
Sends a resource status message.
|
void |
sendServiceArtifactStatus(ActionType action,
String artifactId,
String... aliasIds)
Sends a service artifact status message.
|
void |
sendServiceStatus(ActionType action,
String serviceId,
String... aliasIds)
Sends a service status message.
|
void |
sendStatus(StatusMessage msg)
Sends a status message.
|
void |
sendTraceRecord(TraceRecord record)
Sends a trace record.
|
void |
setTraceFilter(Predicate<TraceRecord> filter)
Defines a trace filter.
|
void |
setTransportSetup(Supplier<TransportSetup> supplier)
Sets up the transport information.
|
private TransportConnector connector
private boolean stayOffline
private Queue<de.iip_ecosphere.platform.support.function.IOConsumer<TransportConnector>> queue
private Supplier<TransportSetup> transportSupplier
public TransportInstance()
setTransportSetup(Supplier) afterwards.public TransportInstance(Supplier<TransportSetup> supplier)
supplier - the transport suppliersetTransportSetup(Supplier)public void setTransportSetup(Supplier<TransportSetup> supplier)
supplier - the transport supplierpublic void sendServiceStatus(ActionType action, String serviceId, String... aliasIds)
Id.getDeviceId(). Calls createConnector() to obtain
a connector instance on demand.action - the action on the serviceserviceId - the service IdaliasIds - optional alias ids for the servicepublic void sendServiceArtifactStatus(ActionType action, String artifactId, String... aliasIds)
Id.getDeviceId(). Calls createConnector() to
obtain a connector instance on demand.action - the action on the artifactartifactId - the artifact IdaliasIds - optional alias ids for the artifactpublic void sendContainerStatus(ActionType action, String containerId, String... aliasIds)
Id.getDeviceId(). Calls createConnector() to obtain
a connector instance on demand.action - the action on the containercontainerId - the container IdaliasIds - optional alias ids for the containerpublic void sendResourceStatus(ActionType action, String... aliasIds)
createConnector() to obtain
a connector instance on demand.action - the action on the containeraliasIds - optional alias ids for the resourcepublic void sendResourceStatus(ActionType action, String deviceId, String... aliasIds)
createConnector() to obtain
a connector instance on demand.action - the action on the containerdeviceId - the device id, may be null then Id.getDeviceId() is usedaliasIds - optional alias ids for the resourcepublic void send(de.iip_ecosphere.platform.support.function.IOConsumer<TransportConnector> sender, String kind)
kind and cares for queuing.sender - the sender including the messagekind - the kind of the message for loggingpublic void setTraceFilter(Predicate<TraceRecord> filter)
filter - the filter, null for no filterpublic void sendTraceRecord(TraceRecord record)
createConnector() to obtain
a connector instance on demand. Caches messages if no connector is available.record - the record to be sentpublic void sendProcessStatus(String componentId, int step, int max, String description)
componentId - the component idstep - the step [0; max]max - the maximum stepdescription - the description of the taskpublic void sendProcessStatus(String componentId, int step, int max, String description, String subDescription)
componentId - the component idstep - the step [0; max]max - the maximum stepdescription - the description of the tasksubDescription - the description of an optional sub-task within the actual task, may be
null or emptypublic void sendStatus(StatusMessage msg)
createConnector() to obtain
a connector instance on demand. Caches messages if no connector is available.msg - the message to be sentpublic void sendAlert(Alert alert)
createConnector() to obtain
a connector instance on demand. Caches messages if no connector is available.alert - the alert to be sentpublic TransportConnector createConnector()
connector will be initialized for caching. The instance
is cached. The transport information must be set up before setTransportSetup(Supplier). After
successfully creating a connector, queued messages are sent and removed from the queue. However, there is no
guarantee that a connector can be created.setTransportSetup(Supplier),
releaseConnector(),
releaseConnector(boolean)public void releaseConnector()
public void releaseConnector(boolean stayOff)
stayOff - whether a call to createConnector() shall create a new connector or prevent sending
further messages.public TransportConnector getConnector()
createConnector()Copyright © 2022. All rights reserved.