本文整理汇总了Java中org.wso2.carbon.databridge.commons.exception.TransportException类的典型用法代码示例。如果您正苦于以下问题:Java TransportException类的具体用法?Java TransportException怎么用?Java TransportException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransportException类属于org.wso2.carbon.databridge.commons.exception包,在下文中一共展示了TransportException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publish
import org.wso2.carbon.databridge.commons.exception.TransportException; //导入依赖的package包/类
public static void publish(String protocol, String host, String port, String username, String password,
String streamId,String dataFileName, String testCaseFolderName, StreamDefinition streamDefinition,
int events, int delay) throws MalformedStreamDefinitionException,
StreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException,
MalformedURLException, NoStreamDefinitionExistException, AuthenticationException,
TransportException, SocketException, DataEndpointAgentConfigurationException, DataEndpointException,
DataEndpointAuthenticationException, DataEndpointConfigurationException {
String relativeFilePath = getTestDataFileLocation(testCaseFolderName, dataFileName);
KeyStoreUtil.setTrustStoreParams();
//create data publisher
DataPublisher dataPublisher = new DataPublisher(protocol, "tcp://" + host + ":" + port, null, username,
password);
//Publish event for a valid stream
publishEvents(dataPublisher, streamDefinition, relativeFilePath, events, delay);
dataPublisher.shutdown();
}
示例2: configure
import org.wso2.carbon.databridge.commons.exception.TransportException; //导入依赖的package包/类
public void configure() throws IOException, XMLStreamException, DataEndpointAuthenticationException,
DataEndpointAgentConfigurationException, TransportException, DataEndpointException,
DataEndpointConfigurationException {
// Read bps analytics configuration
BPSAnalyticsConfiguration bpsAnalyticsConfiguration = BPMNAnalyticsHolder.getInstance().getBPSAnalyticsServer
().getBPSAnalyticsConfiguration();
if (bpsAnalyticsConfiguration.isBpmnDataPublishingEnabled() || bpsAnalyticsConfiguration
.isBpmnKPIDataPublishingEnabled()) {
configDataPublishing(bpsAnalyticsConfiguration.getAnalyticsReceiverURLSet(),
bpsAnalyticsConfiguration.getAnalyticsServerUsername(), bpsAnalyticsConfiguration
.getAnalyticsServerPassword(), bpsAnalyticsConfiguration.getAnalyticsAuthURLSet()
, bpsAnalyticsConfiguration.getBpmnAnalyticsPublisherType(), bpsAnalyticsConfiguration
.isBpmnAsyncDataPublishingEnabled(), bpsAnalyticsConfiguration
.isBpmnDataPublishingEnabled(), bpsAnalyticsConfiguration.isBpmnKPIDataPublishingEnabled());
}
}
示例3: DasReporter
import org.wso2.carbon.databridge.commons.exception.TransportException; //导入依赖的package包/类
private DasReporter(MetricRegistry registry, String source, String type, String receiverURL, String authURL,
String username, String password, String dataAgentConfigPath, TimeUnit rateUnit,
TimeUnit durationUnit, Clock clock, MetricFilter filter) {
super(registry, "das-reporter", filter, rateUnit, durationUnit);
this.source = source;
this.clock = clock;
if (source == null || source.trim().isEmpty()) {
throw new IllegalArgumentException("Source cannot be null or empty");
}
if (type == null || type.trim().isEmpty()) {
throw new IllegalArgumentException("Type cannot be null or empty");
}
if (receiverURL == null || receiverURL.trim().isEmpty()) {
throw new IllegalArgumentException("Data Receiver URL cannot be null or empty");
}
if (username == null || username.trim().isEmpty()) {
throw new IllegalArgumentException("Username cannot be null or empty");
}
if (password == null || password.trim().isEmpty()) {
throw new IllegalArgumentException("Password cannot be null or empty");
}
if (dataAgentConfigPath != null) {
AgentHolder.setConfigPath(dataAgentConfigPath);
}
try {
dataPublisher = new DataPublisher(type, receiverURL, authURL, username, password);
} catch (DataEndpointAgentConfigurationException | DataEndpointException | DataEndpointConfigurationException
| DataEndpointAuthenticationException | TransportException e) {
throw new IllegalStateException("Error when initializing the Data Publisher", e);
}
}
示例4: init
import org.wso2.carbon.databridge.commons.exception.TransportException; //导入依赖的package包/类
private void init(DasConfig dasConfig) {
if (logger.isInfoEnabled()) {
logger.info("Initializing HTTP Monitoring Data Publisher");
}
String type = dasConfig.getType();
String receiverURL = dasConfig.getReceiverURL();
String authURL = dasConfig.getAuthURL();
String username = dasConfig.getUsername();
String password = dasConfig.getPassword();
String dataAgentConfigPath = dasConfig.getDataAgentConfigPath();
if (type == null) {
throw new IllegalArgumentException("Type cannot be null");
}
if (receiverURL == null) {
throw new IllegalArgumentException("Data Receiver URL cannot be null");
}
if (username == null) {
throw new IllegalArgumentException("Username cannot be null");
}
if (password == null) {
throw new IllegalArgumentException("Password cannot be null");
}
if (dataAgentConfigPath == null) {
throw new IllegalArgumentException("Data Agent Configuration Path cannot be null");
}
AgentHolder.setConfigPath(dataAgentConfigPath);
arbitraryAttributes = SystemVariableUtil.getArbitraryAttributes();
try {
dataPublisher = new DataPublisher(type, receiverURL, authURL, username, password);
} catch (DataEndpointAgentConfigurationException | DataEndpointException | DataEndpointConfigurationException
| DataEndpointAuthenticationException | TransportException e) {
throw new IllegalStateException("Error when initializing the Data Publisher", e);
}
}
示例5: deleteColumnFamily
import org.wso2.carbon.databridge.commons.exception.TransportException; //导入依赖的package包/类
public void deleteColumnFamily(String columnFamily) throws SummarizerException, AgentException, MalformedURLException, AuthenticationException, TransportException, StreamDefinitionException, NoStreamDefinitionExistException {
log.info("Deleting CF " + columnFamily);
newConnection().dropColumnFamily(keyspaceName, columnFamily, true);
DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd");
Date date = new Date();
String prevDate = dateFormat.format(date.getTime() - 1000 * 60 * 60 * 24);
if (log.isDebugEnabled()) {
log.debug("The column family dated " + prevDate + " was deleted successfully.");
}
}