本文整理汇总了Java中org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException类的典型用法代码示例。如果您正苦于以下问题:Java DataEndpointAuthenticationException类的具体用法?Java DataEndpointAuthenticationException怎么用?Java DataEndpointAuthenticationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataEndpointAuthenticationException类属于org.wso2.carbon.databridge.agent.exception包,在下文中一共展示了DataEndpointAuthenticationException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publish
import org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException; //导入依赖的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.agent.exception.DataEndpointAuthenticationException; //导入依赖的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.agent.exception.DataEndpointAuthenticationException; //导入依赖的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.agent.exception.DataEndpointAuthenticationException; //导入依赖的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: publish
import org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException; //导入依赖的package包/类
public static void publish(String host, String port, String username, String password, int events)
throws MalformedStreamDefinitionException,
StreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException,
MalformedURLException,
AuthenticationException, NoStreamDefinitionExistException,
org.wso2.carbon.databridge.commons.exception.AuthenticationException,
TransportException, SocketException, DataEndpointAgentConfigurationException, DataEndpointException, DataEndpointAuthenticationException, DataEndpointConfigurationException {
System.out.println("Starting Stock quote Agent");
KeyStoreUtil.setTrustStoreParams();
//create data publisher
DataPublisher dataPublisher = new DataPublisher("tcp://" + host + ":" + port, username, password);
String streamId = DataBridgeCommonsUtils.generateStreamId(STREAM_NAME1, VERSION1);
//Publish event for a valid stream
if (!streamId.isEmpty()) {
System.out.println("Stream ID: " + streamId);
while (sentEventCount < events) {
dataPublisher.publish(streamId, null, null, getPayload());
sentEventCount++;
System.out.println("Events published : " + sentEventCount);
}
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
//ignore
}
dataPublisher.shutdown();
}
}
示例6: publish
import org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException; //导入依赖的package包/类
public static void publish(String host, String port, String username, String password, int events)
throws MalformedStreamDefinitionException,
StreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException,
MalformedURLException,
AuthenticationException, NoStreamDefinitionExistException,
org.wso2.carbon.databridge.commons.exception.AuthenticationException,
TransportException, SocketException, DataEndpointAgentConfigurationException, DataEndpointException,
DataEndpointAuthenticationException, DataEndpointConfigurationException {
System.out.println("Starting Statistics Agent");
KeyStoreUtil.setTrustStoreParams();
//create data publisher
DataPublisher dataPublisher = new DataPublisher("tcp://" + host + ":" + port, username, password);
// StreamDefinition streamDefinition = new StreamDefinition(STREAM_NAME1, VERSION1);
// streamDefinition.addMetaData("ipAdd", AttributeType.STRING);
// streamDefinition.addMetaData("index", AttributeType.LONG);
// streamDefinition.addMetaData("timestamp", AttributeType.LONG);
// streamDefinition.addMetaData("nanoTime", AttributeType.LONG);
// streamDefinition.addPayloadData("userID", AttributeType.STRING);
// streamDefinition.addPayloadData("searchTerms", AttributeType.STRING);
// String streamId = dataPublisher.defineStream(streamDefinition);
String streamId = DataBridgeCommonsUtils.generateStreamId(STREAM_NAME1, VERSION1);
//Publish event for a valid stream
if (!streamId.isEmpty()) {
System.out.println("Stream ID: " + streamId);
while (sentEventCount < events) {
dataPublisher.publish(streamId, getMeta(), null, getPayload());
sentEventCount++;
System.out.println("Events published : " + sentEventCount);
}
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
//ignore
}
dataPublisher.shutdown();
}
}
示例7: main
import org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException; //导入依赖的package包/类
public static void main(String[] args)
throws SocketException, MalformedURLException, AuthenticationException, TransportException, StreamDefinitionException, MalformedStreamDefinitionException, DifferentStreamDefinitionAlreadyDefinedException,
FileNotFoundException, UnknownHostException, DataEndpointAuthenticationException, DataEndpointAgentConfigurationException, DataEndpointException, DataEndpointConfigurationException {
System.out.println("Starting HttpLog Agent");
DataPublisherUtil.setTrustStoreParams();
AgentHolder.setConfigPath(DataPublisherUtil.getAgentConfigPath());
String host = args[0];
String port = args[1];
String username = args[2];
String password = args[3];
//create data publisher
DataPublisher dataPublisher = new DataPublisher("tcp://" + host + ":" + port, username, password);
String streamId = DataBridgeCommonsUtils.generateStreamId(HTTPD_LOG_STREAM,VERSION);
// try {
// streamId = dataPublisher.findStream(HTTPD_LOG_STREAM, VERSION);
// System.out.println("Stream already defined");
//
// } catch (NoStreamDefinitionExistException e) {
// //Define event stream
// streamId = dataPublisher.defineStream("{" +
// " 'name':'" + HTTPD_LOG_STREAM + "'," +
// " 'version':'" + VERSION + "'," +
// " 'nickName': 'Httpd_Log_Stream'," +
// " 'description': 'Sample of Httpd logs'," +
// " 'metaData':[" +
// " {'name':'clientType','type':'STRING'}" +
// " ]," +
// " 'payloadData':[" +
// " {'name':'log','type':'STRING'}" +
// " ]" +
// "}");
//
// }
if (null != streamId && !streamId.isEmpty()) {
publishLogEvents(dataPublisher, streamId);
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
dataPublisher.shutdownWithAgent();
}