-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from conglisc/master
Bring in changes on data governance for messaging toolkit
- Loading branch information
Showing
9 changed files
with
198 additions
and
12 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
...treamsx.messaging/impl/java/src/com/ibm/streamsx/messaging/common/DataGovernanceUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.ibm.streamsx.messaging.common; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import com.ibm.streams.operator.AbstractOperator; | ||
|
||
public class DataGovernanceUtil { | ||
|
||
public static void registerForDataGovernance(AbstractOperator operator, String assetName, String assetType, String parentAssetName, String parentAssetType, boolean isInput, String operatorType) { | ||
Map<String, String> properties = new HashMap<String, String>(); | ||
if(isInput) { | ||
properties.put(IGovernanceConstants.TAG_REGISTER_TYPE, IGovernanceConstants.TAG_REGISTER_TYPE_INPUT); | ||
properties.put(IGovernanceConstants.PROPERTY_INPUT_OPERATOR_TYPE, operatorType); | ||
} else { | ||
properties.put(IGovernanceConstants.TAG_REGISTER_TYPE, IGovernanceConstants.TAG_REGISTER_TYPE_OUTPUT); | ||
properties.put(IGovernanceConstants.PROPERTY_OUTPUT_OPERATOR_TYPE, operatorType); | ||
} | ||
properties.put(IGovernanceConstants.PROPERTY_SRC_NAME, assetName); | ||
properties.put(IGovernanceConstants.PROPERTY_SRC_TYPE, IGovernanceConstants.ASSET_STREAMS_PREFIX + assetType); | ||
if(parentAssetName != null) { | ||
properties.put(IGovernanceConstants.PROPERTY_SRC_PARENT_PREFIX, IGovernanceConstants.PROPERTY_PARENT_PREFIX); | ||
properties.put(IGovernanceConstants.PROPERTY_PARENT_PREFIX + IGovernanceConstants.PROPERTY_SRC_NAME, parentAssetName); | ||
properties.put(IGovernanceConstants.PROPERTY_PARENT_PREFIX + IGovernanceConstants.PROPERTY_SRC_TYPE, IGovernanceConstants.ASSET_STREAMS_PREFIX + parentAssetType); | ||
properties.put(IGovernanceConstants.PROPERTY_PARENT_PREFIX + IGovernanceConstants.PROPERTY_PARENT_TYPE, "$" + parentAssetType); | ||
} | ||
|
||
operator.setTagData(IGovernanceConstants.TAG_OPERATOR_IGC, properties); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...eamsx.messaging/impl/java/src/com/ibm/streamsx/messaging/common/IGovernanceConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.ibm.streamsx.messaging.common; | ||
|
||
public interface IGovernanceConstants { | ||
public static final String TAG_OPERATOR_IGC = "OperatorIGC"; | ||
public static final String TAG_REGISTER_TYPE = "registerType"; | ||
public static final String TAG_REGISTER_TYPE_INPUT = "input"; | ||
public static final String TAG_REGISTER_TYPE_OUTPUT = "output"; | ||
|
||
public static final String ASSET_STREAMS_PREFIX = "$Streams-"; | ||
|
||
public static final String ASSET_JMS_SERVER_TYPE = "JMSServer"; | ||
|
||
public static final String ASSET_JMS_MESSAGE_TYPE = "JMS"; | ||
|
||
public static final String ASSET_KAFKA_TOPIC_TYPE = "KafkaTopic"; | ||
|
||
public static final String ASSET_MQTT_TOPIC_TYPE = "MQTT"; | ||
public static final String ASSET_MQTT_SERVER_TYPE = "MQServer"; | ||
|
||
public static final String PROPERTY_SRC_NAME = "srcName"; | ||
public static final String PROPERTY_SRC_TYPE = "srcType"; | ||
|
||
public static final String PROPERTY_SRC_PARENT_PREFIX = "srcParent"; | ||
public static final String PROPERTY_PARENT_TYPE = "parentType"; | ||
|
||
public static final String PROPERTY_PARENT_PREFIX = "p1"; | ||
|
||
public static final String PROPERTY_INPUT_OPERATOR_TYPE = "inputOperatorType"; | ||
public static final String PROPERTY_OUTPUT_OPERATOR_TYPE = "outputOperatorType"; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters