@Connector(name="partner-manager", schemaVersion="1.0", friendlyName="Partner Manager", minMuleVersion="3.5") @RequiresEnterpriseLicense(allowEval=true) public class PartnerManagerConnector extends Object implements com.mulesoft.api.b2b.B2BProvider, com.mulesoft.mule.tracking.event.EventNotificationListener<com.mulesoft.mule.tracking.event.EventNotification>
Modifier and Type | Field and Description |
---|---|
static String |
MULE_EVENT_ID_SESSION_KEY |
static String |
MULE_TRANSACTION_ID_SESSION_KEY |
static String |
OBJECT_STORE |
static String |
ORIGINAL_TRANSACTION_ID_SESSION_KEY |
static String |
PARTNER_MANAGER_LAST_EVENT_ID_SESSION_KEY |
static String |
PROPERTIES_SESSION_KEY |
static String |
TPM_SERVICE_MIN_API_VERSION |
static String |
TRACKER_MIN_API_VERSION |
static String |
TRANSACTION_ID_SESSION_KEY |
Constructor and Description |
---|
PartnerManagerConnector() |
Modifier and Type | Method and Description |
---|---|
void |
endTransactionsReplay(List<String> transactionIds)
Set given transactions as replayed.
|
com.mulesoft.api.b2b.config.Config |
getConfig(com.mulesoft.api.b2b.config.ConfigType configType,
com.mulesoft.api.b2b.Direction direction,
com.mulesoft.api.b2b.config.QueryObject queryObject) |
BasicConfig |
getConnectorConfig() |
com.mulesoft.api.b2b.factory.FactoryResolver |
getFactoryResolver() |
org.mule.api.MuleEvent |
harvestEndpointProperties(String endpointName,
Object transmissionSession,
org.mule.api.MuleEvent muleEvent)
Harvest endpoint properties.
|
List<Map<String,Serializable>> |
lookup(String lookupTable,
String key,
Map<String,Serializable> fields)
Lookup entries.
|
void |
onNotification(com.mulesoft.mule.tracking.event.EventNotification notification) |
void |
onPostConstruct() |
void |
onStart() |
void |
onStop() |
org.mule.api.MuleEvent |
propagateEndpointProperties(String endpointName,
Object transmissionSession,
org.mule.api.MuleEvent muleEvent)
Copy endpoint properties found in the transmission session to outbound properties.
|
com.mulesoft.api.b2b.transmission.Transmission |
readTransmission(com.mulesoft.api.b2b.Direction direction,
com.mulesoft.api.b2b.transmission.TransmissionType transmissionType,
com.mulesoft.api.b2b.config.QueryObject queryObject) |
List<Map<String,Serializable>> |
resolveRoutes(String fromPartyIdentifier,
String toPartyIdentifier,
com.modus.tpm.client.TpmClient.PartyIdentifierType partyIdentifierType,
com.modus.tpm.client.TpmClient.Standard standard,
String version,
String messageType)
Resolve routes.
|
Map<String,Serializable> |
search(com.modus.tpm.client.TpmClient.Resource resource,
String query,
Integer count,
Integer offset,
String orderBy,
Boolean descending)
Search resource.
|
void |
setConnectorConfig(BasicConfig connectorConfig) |
void |
setMuleContext(org.mule.api.MuleContext muleContext) |
List<Map<String,Serializable>> |
startTransactionsReplay(Integer replayingTimeout)
Fetch replayable transactions and set them as replaying.
|
org.mule.api.MuleEvent |
trackDocument(String partnerIdentifier,
com.mulesoft.api.b2b.Direction direction,
String filename,
Map<String,Object> metadata,
com.modus.tpm.client.TpmClient.Standard standard,
String version,
String messageType,
Object file,
Object document,
Object transmissionSession,
org.mule.api.MuleEvent muleEvent)
Track document.
|
org.mule.api.MuleEvent |
trackError(String partnerIdentifier,
com.mulesoft.api.b2b.Direction direction,
ErrorSource source,
String sourceId,
Integer code,
String message,
Object transmissionSession,
org.mule.api.MuleEvent muleEvent)
Track error.
|
org.mule.api.MuleEvent |
trackTransmission(String partnerIdentifier,
com.mulesoft.api.b2b.Direction direction,
String filename,
Map<String,Object> metadata,
String transport,
Object file,
Object transmissionSession,
org.mule.api.MuleEvent muleEvent)
Track transmission.
|
void |
updateTransactionStatus(String transactionId,
com.modus.tracker.client.TrackerClient.Status status,
Object transmissionSession)
Updates the status of a transaction.
|
com.mulesoft.api.b2b.transmission.TransmissionSession |
writeTransmission(com.mulesoft.api.b2b.Direction direction,
com.mulesoft.api.b2b.transmission.Transmission transmission,
com.mulesoft.api.b2b.transmission.TransmissionContext transmissionContext,
com.mulesoft.api.b2b.transmission.TransmissionType transmissionType) |
public static final String TRACKER_MIN_API_VERSION
public static final String TPM_SERVICE_MIN_API_VERSION
public static final String MULE_TRANSACTION_ID_SESSION_KEY
public static final String TRANSACTION_ID_SESSION_KEY
public static final String PROPERTIES_SESSION_KEY
public static final String ORIGINAL_TRANSACTION_ID_SESSION_KEY
public static final String PARTNER_MANAGER_LAST_EVENT_ID_SESSION_KEY
public static final String MULE_EVENT_ID_SESSION_KEY
public static final String OBJECT_STORE
@PostConstruct public void onPostConstruct() throws PartnerManagerConnectorException
PartnerManagerConnectorException
@Stop public void onStop() throws PartnerManagerConnectorException
PartnerManagerConnectorException
@Start public void onStart() throws PartnerManagerConnectorException
PartnerManagerConnectorException
public com.mulesoft.api.b2b.config.Config getConfig(com.mulesoft.api.b2b.config.ConfigType configType, com.mulesoft.api.b2b.Direction direction, com.mulesoft.api.b2b.config.QueryObject queryObject) throws com.mulesoft.api.b2b.B2BProviderException
getConfig
in interface com.mulesoft.api.b2b.B2BProvider
com.mulesoft.api.b2b.B2BProviderException
@Processor public org.mule.api.MuleEvent trackTransmission(@Placement(group="Transmission",order=1) String partnerIdentifier, @Placement(group="Transmission",order=2) com.mulesoft.api.b2b.Direction direction, @Placement(group="Transmission",order=3)@Optional String filename, @Placement(group="Transmission",order=4)@Optional Map<String,Object> metadata, @Placement(group="Transport Type") String transport, @Placement(group="Content")@FriendlyName(value="File (requires PMC file storage provider config)")@Optional Object file, @RefOnly@Placement(group="Advanced")@Default(value="#[flowVars.b2bTransmissionSession]") Object transmissionSession, org.mule.api.MuleEvent muleEvent) throws PartnerManagerConnectorException
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.PartnerManagerConnectorException
- describing the run-time error@Processor public org.mule.api.MuleEvent propagateEndpointProperties(String endpointName, @RefOnly@Placement(group="Advanced")@Default(value="#[flowVars.b2bTransmissionSession]") Object transmissionSession, org.mule.api.MuleEvent muleEvent) throws PartnerManagerConnectorException
endpointName
- Name identifying the send endpoint where the property definitions are defined.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.PartnerManagerConnectorException
- describing the run-time error@Processor public org.mule.api.MuleEvent harvestEndpointProperties(String endpointName, @RefOnly@Placement(group="Advanced")@Default(value="#[flowVars.b2bTransmissionSession]") Object transmissionSession, org.mule.api.MuleEvent muleEvent) throws PartnerManagerConnectorException
endpointName
- Name identifying the receive endpoint where the property definitions are defined.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.PartnerManagerConnectorException
- describing the run-time error@Processor public org.mule.api.MuleEvent trackDocument(@Placement(group="Document",order=1)@Optional String partnerIdentifier, @Placement(group="Document",order=2) com.mulesoft.api.b2b.Direction direction, @Placement(group="Document",order=3)@Optional String filename, @Placement(group="Document",order=4)@Optional Map<String,Object> metadata, @Placement(group="Document Type",order=1)@Default(value="OTHER") com.modus.tpm.client.TpmClient.Standard standard, @Placement(group="Document Type",order=2)@Optional String version, @Placement(group="Document Type",order=3)@Optional String messageType, @Placement(group="Content")@FriendlyName(value="File (requires PMC file storage provider config)")@Optional Object file, @Placement(group="Content")@FriendlyName(value="Document (requires to be in a supported standard)")@Optional Object document, @RefOnly@Placement(group="Advanced")@Default(value="#[flowVars.b2bTransmissionSession]") Object transmissionSession, org.mule.api.MuleEvent muleEvent) throws PartnerManagerConnectorException
partnerIdentifier
- Identifier of receiving/sending partner.direction
- Whether the document is incoming or outgoing.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.standard
- Document's standard.version
- Document's version.messageType
- Document's message type.filename
- Filename for file-based content.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.PartnerManagerConnectorException
- describing the run-time error@Processor public org.mule.api.MuleEvent trackError(String partnerIdentifier, com.mulesoft.api.b2b.Direction direction, @Placement(group="Error",order=1) ErrorSource source, @FriendlyName(value="Source ID")@Placement(group="Error",order=2) String sourceId, @Placement(group="Error",order=3)@Optional Integer code, @Placement(group="Error",order=4)@Optional String message, @RefOnly@Placement(group="Advanced")@Default(value="#[flowVars.b2bTransmissionSession]") Object transmissionSession, org.mule.api.MuleEvent muleEvent) throws PartnerManagerConnectorException
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.PartnerManagerConnectorException
- describing the run-time error@Processor public Map<String,Serializable> search(@Placement(order=1) com.modus.tpm.client.TpmClient.Resource resource, @Placement(order=2) String query, @Placement(order=3)@Default(value="500") Integer count, @Placement(order=4)@Default(value="0") Integer offset, @Placement(order=5)@Optional String orderBy, @Placement(order=6)@Default(value="true") Boolean descending) throws PartnerManagerConnectorException
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.PartnerManagerConnectorException
- describing the run-time error.@Processor public List<Map<String,Serializable>> lookup(@Placement(order=1) String lookupTable, @Placement(order=2)@Optional String key, @Placement(order=3) Map<String,Serializable> fields) throws PartnerManagerConnectorException
lookupTable
- Name identifying the lookup table where the search for entries is performed.key
- Name identifying the lookup key which may be specified in order to enforce field validation and ensure only a single entry is returned.fields
- Field name-value pairs specifying the entries to search for in the lookup table.PartnerManagerConnectorException
- describing the run-time error.@Processor public List<Map<String,Serializable>> startTransactionsReplay(@FriendlyName(value="Replaying Timeout (in seconds)")@Optional Integer replayingTimeout) throws PartnerManagerConnectorException
replayingTimeout
- Include replaying transactions in the result exceeding the replaying timeout in seconds.PartnerManagerConnectorException
- describing the run-time error.@Processor public void endTransactionsReplay(@FriendlyName(value="Transaction IDs") List<String> transactionIds) throws PartnerManagerConnectorException
transactionIds
- List of transaction IDs to be marked as replayedPartnerManagerConnectorException
- describing the run-time error.@Processor public List<Map<String,Serializable>> resolveRoutes(@Placement(order=1) String fromPartyIdentifier, @Placement(order=2) String toPartyIdentifier, @Placement(order=3)@Optional com.modus.tpm.client.TpmClient.PartyIdentifierType partyIdentifierType, @Placement(group="Document Type",order=1) com.modus.tpm.client.TpmClient.Standard standard, @Placement(group="Document Type",order=2)@Optional String version, @Placement(group="Document Type",order=3)@Optional String messageType) throws PartnerManagerConnectorException
fromPartyIdentifier
- Identifier of sending party.toPartyIdentifier
- Identifier of receiving party.partyIdentifierType
- Type of identifier.standard
- Document's standard.version
- Document's version.messageType
- Document's message type.PartnerManagerConnectorException
- describing the run-time error.@Processor public void updateTransactionStatus(@Optional@FriendlyName(value="Transaction ID") String transactionId, com.modus.tracker.client.TrackerClient.Status status, @RefOnly@Placement(group="Advanced")@Default(value="#[flowVars.b2bTransmissionSession]") Object transmissionSession) throws PartnerManagerConnectorException
transactionId
- ID identifying the transaction to be updated. transactionId overrides the transaction ID read from b2bTransmissionSession.status
- Transaction status to update to.transmissionSession
- Transaction session to read transaction ID from. By default, the connector tries to read the transaction session from the flow variable b2bTransmissionSession.PartnerManagerConnectorException
- describing the run-time error.public com.mulesoft.api.b2b.transmission.TransmissionSession writeTransmission(com.mulesoft.api.b2b.Direction direction, com.mulesoft.api.b2b.transmission.Transmission transmission, com.mulesoft.api.b2b.transmission.TransmissionContext transmissionContext, com.mulesoft.api.b2b.transmission.TransmissionType transmissionType) throws com.mulesoft.api.b2b.B2BProviderException
writeTransmission
in interface com.mulesoft.api.b2b.B2BProvider
com.mulesoft.api.b2b.B2BProviderException
public com.mulesoft.api.b2b.transmission.Transmission readTransmission(com.mulesoft.api.b2b.Direction direction, com.mulesoft.api.b2b.transmission.TransmissionType transmissionType, com.mulesoft.api.b2b.config.QueryObject queryObject) throws com.mulesoft.api.b2b.B2BProviderException
readTransmission
in interface com.mulesoft.api.b2b.B2BProvider
com.mulesoft.api.b2b.B2BProviderException
public com.mulesoft.api.b2b.factory.FactoryResolver getFactoryResolver() throws com.mulesoft.api.b2b.B2BProviderException
getFactoryResolver
in interface com.mulesoft.api.b2b.B2BProvider
com.mulesoft.api.b2b.B2BProviderException
public void onNotification(com.mulesoft.mule.tracking.event.EventNotification notification)
onNotification
in interface org.mule.api.context.notification.ServerNotificationListener<com.mulesoft.mule.tracking.event.EventNotification>
public BasicConfig getConnectorConfig()
public void setConnectorConfig(BasicConfig connectorConfig)
public void setMuleContext(org.mule.api.MuleContext muleContext)
Copyright © 2010–2016. All rights reserved.