當前位置: 首頁>>代碼示例>>Java>>正文


Java WebConnector類代碼示例

本文整理匯總了Java中i5.las2peer.connectors.webConnector.WebConnector的典型用法代碼示例。如果您正苦於以下問題:Java WebConnector類的具體用法?Java WebConnector怎麽用?Java WebConnector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WebConnector類屬於i5.las2peer.connectors.webConnector包,在下文中一共展示了WebConnector類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //導入依賴的package包/類
/**
 * Called before the tests start.
 * 
 * Sets up the node and initializes connector and users that can be used throughout the tests.
 * 
 * @throws Exception
 */
@Before
public void startServer() throws Exception {
	// start node
	node = new LocalNodeManager().newNode();
	testAgent = MockAgentFactory.getAdam();
	testAgent.unlock(testPass);
	node.storeAgent(testAgent);
	node.launch();

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");

	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();

	connector = new WebConnector(true, 0, false, 0);
	connector.setLogStream(new PrintStream(logStream));
	connector.start(node);

	client = new MiniClient();
	client.setConnectorEndpoint(connector.getHttpEndpoint());
	client.setLogin(testAgent.getIdentifier(), testPass);
}
 
開發者ID:rwth-acis,項目名稱:mobsos-query-visualization,代碼行數:33,代碼來源:ServiceTest.java

示例2: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //導入依賴的package包/類
@Before
public void startServer() throws Exception {
	// start Node
	node = TestSuite.launchNetwork(1).get(0);

	user1 = MockAgentFactory.getAdam();
	user1.unlock(adamsPass);
	node.storeAgent(user1);

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");

	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();
	connector = new WebConnector(true, HTTP_PORT, false, 1000);
	connector.setLogStream(new PrintStream(logStream));
	connector.start(node);
	Thread.sleep(1000); // wait a second for the connector to become ready

	c1 = new MiniClient();
	c1.setConnectorEndpoint(connector.getHttpEndpoint());
	c1.setLogin(user1.getIdentifier(), "adamspass");
}
 
開發者ID:rwth-acis,項目名稱:mobsos-success-modeling,代碼行數:26,代碼來源:MonitoringDataProvisionServiceTest.java

示例3: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //導入依賴的package包/類
/**
 * Called before the tests start.
 * 
 * Sets up the node and initializes connector and users that can be used throughout the tests.
 * 
 * @throws Exception
 */
@BeforeClass
public static void startServer() throws Exception {

	// start node
	node = new LocalNodeManager().newNode();

	user1 = MockAgentFactory.getAdam();
	user2 = MockAgentFactory.getAbel();
	user3 = MockAgentFactory.getEve();
	user1.unlock("adamspass");
	user2.unlock("abelspass");
	user3.unlock("evespass");

	Agent[] as;
	as = new Agent[] { user1, user2 };
	group1 = GroupAgentImpl.createGroupAgent(as);
	group1.unlock(user1);
	as = new Agent[] { user2, user3 };
	group2 = GroupAgentImpl.createGroupAgent(as);
	group2.unlock(user2);

	node.storeAgent(user1);
	node.storeAgent(user2);
	node.storeAgent(user3);

	node.storeAgent(group1);
	node.storeAgent(group2);

	node.launch();

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");
	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();

	connector = new WebConnector(true, 0, false, 0);
	connector.setLogStream(new PrintStream(logStream));
	connector.start(node);
	Thread.sleep(1000); // wait a second for the connector to become ready

	c1 = new MiniClient();
	c1.setConnectorEndpoint(connector.getHttpEndpoint());
	c1.setLogin(user1.getIdentifier(), "adamspass");

	c2 = new MiniClient();
	c2.setConnectorEndpoint(connector.getHttpEndpoint());
	c2.setLogin(user2.getIdentifier(), "abelspass");

	c3 = new MiniClient();
	c3.setConnectorEndpoint(connector.getHttpEndpoint());
	c3.setLogin(user3.getIdentifier(), "evespass");

}
 
開發者ID:rwth-acis,項目名稱:mobsos-surveys,代碼行數:63,代碼來源:SurveyServiceTest.java

示例4: startServer

import i5.las2peer.connectors.webConnector.WebConnector; //導入依賴的package包/類
/**
 * Called before the tests start.
 * 
 * Sets up the node and initializes connector and users that can be used throughout the tests.
 * 
 * @throws Exception
 */
@BeforeClass
public static void startServer() throws Exception {

	// start node
	node = new LocalNodeManager().newNode();

	user = MockAgentFactory.getAdam();

	node.storeAgent(user);

	node.launch();

	ServiceAgentImpl testService = ServiceAgentImpl.createServiceAgent(testServiceClass, "a pass");
	testService.unlock("a pass");

	node.registerReceiver(testService);

	// start connector
	logStream = new ByteArrayOutputStream();

	// connector = new WebConnector(true,HTTP_PORT,false,1000,"./etc/xmlc");
	connector = new WebConnector(true, 0, false, 0);

	connector.setLogStream(new PrintStream(logStream));

	connector.start(node);
	Thread.sleep(1000); // wait a second for the connector to become ready

	c1 = new MiniClient();
	c1.setConnectorEndpoint(connector.getHttpEndpoint());
	c1.setLogin(user.getIdentifier(), "adamspass");

	// String xml=RESTMapper.mergeXMLs(new String[]{RESTMapper.getMethodsAsXML(SurveyService.class)});
	// System.out.println(xml);

	// first delete all surveys & questionnaires
	c1.sendRequest("DELETE", "mobsos/surveys", "");
	c1.sendRequest("DELETE", "mobsos/questionnaires", "");
}
 
開發者ID:rwth-acis,項目名稱:mobsos-surveys,代碼行數:47,代碼來源:SurveyDataFill.java


注:本文中的i5.las2peer.connectors.webConnector.WebConnector類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。