public class

PartnerManagerConnector

extends Object
implements B2BProvider EventNotificationListener<T extends EventNotification>
java.lang.Object
   ↳ com.modus.mule.modules.apm.PartnerManagerConnector
Known Direct Subclasses
Known Indirect Subclasses

Summary

Constants
String MULE_EVENT_ID_SESSION_KEY
String MULE_TRANSACTION_ID_SESSION_KEY
String OBJECT_STORE
String ORIGINAL_TRANSACTION_ID_SESSION_KEY
String PARTNER_MANAGER_LAST_EVENT_ID_SESSION_KEY
String TPM_SERVICE_MIN_API_VERSION
String TRACKER_MIN_API_VERSION
String TRANSACTION_ID_SESSION_KEY
Fields
private BasicConfig connectorConfig
private ConnectorContext connectorContext
private EventWriter eventWriter
private ListableObjectStore<DefaultConfig> expirableObjectStore
private static final Logger logger
private MuleContext muleContext
private List<Scope> scopes
private Subscriber subscriber
private Cache<String, String> transactionIdMap
Public Constructors
PartnerManagerConnector()
Public Methods
void endTransactionsReplay(List<String> transactionIds)
Set given transactions as replayed.
Config getConfig(ConfigType configType, Direction direction, QueryObject queryObject)
BasicConfig getConnectorConfig()
FactoryResolver getFactoryResolver()
void onNotification(EventNotification notification)
void onPostConstruct()
void onStart()
void onStop()
Transmission readTransmission(Direction direction, TransmissionType transmissionType, QueryObject queryObject)
List<Map<String, Serializable>> resolveRoutes(String fromPartyIdentifier, String toPartyIdentifier, TpmClient.PartyIdentifierType partyIdentifierType, String transportType, TpmClient.Standard standard, String version, String messageType)
Resolve routes.
Map<String, Serializable> search(TpmClient.Resource resource, String query, Integer count, Integer offset, String orderBy, Boolean descending)
Search resource.
void setConnectorConfig(BasicConfig connectorConfig)
void setMuleContext(MuleContext muleContext)
List<Map<String, Serializable>> startTransactionsReplay(Integer replayingTimeout)
Fetch replayable transactions and set them as replaying.
MuleEvent trackDocument(String partnerIdentifier, Direction direction, String filename, Map<String, Object> metadata, TpmClient.Standard standard, String version, String messageType, Object file, Object document, Object transmissionSession, MuleEvent muleEvent)
Track document.
MuleEvent trackError(String partnerIdentifier, Direction direction, ErrorSource source, String sourceId, Integer code, String message, Object transmissionSession, MuleEvent muleEvent)
Track error.
MuleEvent trackTransmission(String partnerIdentifier, Direction direction, String filename, Map<String, Object> metadata, String transport, Object file, Object transmissionSession, MuleEvent muleEvent)
Track transmission.
TransmissionSession writeTransmission(Direction direction, Transmission transmission, TransmissionContext transmissionContext, TransmissionType transmissionType)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.mulesoft.api.b2b.B2BProvider
From interface org.mule.api.context.notification.ServerNotificationListener

Constants

public static final String MULE_EVENT_ID_SESSION_KEY

Constant Value: "muleEventId"

public static final String MULE_TRANSACTION_ID_SESSION_KEY

Constant Value: "muleTransactionId"

public static final String OBJECT_STORE

Constant Value: "_partnerManagerConnectorObjectStore"

public static final String ORIGINAL_TRANSACTION_ID_SESSION_KEY

Constant Value: "originalTransactionId"

public static final String PARTNER_MANAGER_LAST_EVENT_ID_SESSION_KEY

Constant Value: "lastEventId"

public static final String TPM_SERVICE_MIN_API_VERSION

Constant Value: "v2.0"

public static final String TRACKER_MIN_API_VERSION

Constant Value: "v2.0"

public static final String TRANSACTION_ID_SESSION_KEY

Constant Value: "transactionId"

Fields

private BasicConfig connectorConfig

private ConnectorContext connectorContext

private EventWriter eventWriter

private ListableObjectStore<DefaultConfig> expirableObjectStore

private static final Logger logger

private MuleContext muleContext

private List<Scope> scopes

private Subscriber subscriber

private Cache<String, String> transactionIdMap

Public Constructors

public PartnerManagerConnector ()

Public Methods

public void endTransactionsReplay (List<String> transactionIds)

Set given transactions as replayed.

Parameters
transactionIds List of transaction IDs to be marked as replayed
Throws
PartnerManagerConnectorException containing the actual error.

public Config getConfig (ConfigType configType, Direction direction, QueryObject queryObject)

Parameters
configType
direction
queryObject
Throws
B2BProviderException

public BasicConfig getConnectorConfig ()

public FactoryResolver getFactoryResolver ()

Throws
B2BProviderException

public void onNotification (EventNotification notification)

Parameters
notification

public void onPostConstruct ()

public void onStart ()

public void onStop ()

public Transmission readTransmission (Direction direction, TransmissionType transmissionType, QueryObject queryObject)

Parameters
direction
transmissionType
queryObject
Throws
B2BProviderException

public List<Map<String, Serializable>> resolveRoutes (String fromPartyIdentifier, String toPartyIdentifier, TpmClient.PartyIdentifierType partyIdentifierType, String transportType, TpmClient.Standard standard, String version, String messageType)

Resolve routes.

Parameters
fromPartyIdentifier Identifier of sending party.
toPartyIdentifier Identifier of receiving party.
partyIdentifierType Type of identifier.
transportType Type of transport carrying the document.
standard Document's standard.
version Document's version.
messageType Document's message type.
Returns
  • List of routes.
Throws
PartnerManagerConnectorException containing the actual error.

public Map<String, Serializable> search (TpmClient.Resource resource, String query, Integer count, Integer offset, String orderBy, Boolean descending)

Search resource.

Parameters
resource Resource type to search for.
query Query criteria expressed in PMQL.
count Maximum number of objects allowed in the result. No more than 500 objects can be returned at any given time.
offset Return results from a given offset. Default is 0.
orderBy Sort results by a given field name.
descending Sort results by descending or ascending order. Default is descending.
Returns
  • Query result.
Throws
PartnerManagerConnectorException containing the actual error.

public void setConnectorConfig (BasicConfig connectorConfig)

Parameters
connectorConfig

public void setMuleContext (MuleContext muleContext)

Parameters
muleContext

public List<Map<String, Serializable>> startTransactionsReplay (Integer replayingTimeout)

Fetch replayable transactions and set them as replaying.

Parameters
replayingTimeout Include replaying transactions in the result exceeding the replaying timeout in seconds.
Returns
  • Replayable transactions.
Throws
PartnerManagerConnectorException containing the actual error.

public MuleEvent trackDocument (String partnerIdentifier, Direction direction, String filename, Map<String, Object> metadata, TpmClient.Standard standard, String version, String messageType, Object file, Object document, Object transmissionSession, MuleEvent muleEvent)

Track document.

Parameters
partnerIdentifier Identifier of receiving/sending partner.
direction Whether the document is incoming or outgoing.
filename Filename for file-based content.
metadata
standard Document's standard.
version Document's version.
messageType Document's message type.
file File to pass to file storage provider. The file is required to be one of the following Java types: InputStream, Serializable, or ByteArrayOutputStream. A Partner Manager Connector file storage provider config (e.g., config-file-storage-amazon-s3) must be configured in order to save the file.
document Processable document.
transmissionSession Transaction session to use. By default, the Connector tries to read the transaction session from flow variable b2bTransmissionSession. If not found, a new transaction session is created.
muleEvent
Returns
  • Transaction session.
Throws
PartnerManagerConnectorException containing the actual error

public MuleEvent trackError (String partnerIdentifier, Direction direction, ErrorSource source, String sourceId, Integer code, String message, Object transmissionSession, MuleEvent muleEvent)

Track error.

Parameters
partnerIdentifier Identifier of receiving/sending partner.
direction Whether the error occurred while sending or receiving.
source Error's origin.
sourceId Source ID.
code Error code.
message Message describing the error.
transmissionSession Transaction session to use. By default, the Connector tries to read the transaction session from flow variable b2bTransmissionSession. If not found, a new transaction session is created.
muleEvent
Returns
  • Transaction session.
Throws
PartnerManagerConnectorException containing the actual error

public MuleEvent trackTransmission (String partnerIdentifier, Direction direction, String filename, Map<String, Object> metadata, String transport, Object file, Object transmissionSession, MuleEvent muleEvent)

Track transmission.

Parameters
partnerIdentifier Identifier of receiving/sending partner.
direction Whether the transmission is incoming or outgoing.
filename Filename for file-based content.
metadata Data about the content.
transport Transport carrying the transmission.
file File to pass to file storage provider. The file is required to be one of the following Java types: InputStream, Serializable, or ByteArrayOutputStream. A Partner Manager Connector file storage provider config (e.g., config-file-storage-amazon-s3) must be configured in order to save the file.
transmissionSession Transaction session to use. By default, the Connector tries to read the transaction session from the flow variable b2bTransmissionSession. If not found, a new transaction session is created.
muleEvent
Returns
  • Transaction session.
Throws
PartnerManagerConnectorException containing the actual error

public TransmissionSession writeTransmission (Direction direction, Transmission transmission, TransmissionContext transmissionContext, TransmissionType transmissionType)

Parameters
direction
transmission
transmissionContext
transmissionType
Throws
B2BProviderException