当前位置: 首页>>代码示例>>Java>>正文


Java ClientHTTPRequestSchema类代码示例

本文整理汇总了Java中com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema的典型用法代码示例。如果您正苦于以下问题:Java ClientHTTPRequestSchema类的具体用法?Java ClientHTTPRequestSchema怎么用?Java ClientHTTPRequestSchema使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClientHTTPRequestSchema类属于com.ociweb.pronghorn.network.schema包,在下文中一共展示了ClientHTTPRequestSchema类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: HTTPClientRequestTrafficStage

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
/**
 * Parse HTTP data on feed and sends back an ack to the  SSLEngine as each message is decrypted.
 * 
 * @param graphManager
 * @param hardware
 * @param input
 * @param goPipe
 * @param ackPipe
 * @param output
 */

public HTTPClientRequestTrafficStage(
		GraphManager graphManager, 
		MsgRuntime<?,?> runtime,
		BuilderImpl hardware,
		ClientCoordinator ccm,
		
           Pipe<ClientHTTPRequestSchema>[] input,
           Pipe<TrafficReleaseSchema>[] goPipe,
           Pipe<TrafficAckSchema>[] ackPipe,
           
           Pipe<NetPayloadSchema>[] output
           ) {
	
	super(graphManager, runtime, hardware, input, goPipe, ackPipe, output);
	this.input = input;
	this.output = output;
	this.ccm = ccm;
	
	assert(ccm.isTLS == hardware.getHTTPClientConfig().isTLS());
	
	GraphManager.addNota(graphManager, GraphManager.DOT_BACKGROUND, "lavenderblush", this);
	GraphManager.addNota(graphManager, GraphManager.LOAD_MERGE, GraphManager.LOAD_MERGE, this);
	
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:36,代码来源:HTTPClientRequestTrafficStage.java

示例2: newInstance

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public static RequestTwitterQueryStreamStage newInstance(GraphManager gm,
									String consumerKey, String consumerSecret,
									int maxCount,
									int[] queryResponseIds, 
									String[] queryStrings,
									int bearerRequestResponseId, 			
									Pipe<TwitterStreamControlSchema>[] streamControlPipe, //Bad bearer detected or bad data
									Pipe<NetResponseSchema> newBearerPipe, //new Bearer arrives here
									Pipe<ClientHTTPRequestSchema> httpRequest //send out request for Bearer or Query request
		) {
	
	return new RequestTwitterQueryStreamStage(gm, consumerKey, consumerSecret,
											  maxCount, queryResponseIds, queryStrings,
			                                  bearerRequestResponseId,
											  streamControlPipe, newBearerPipe, httpRequest);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:17,代码来源:RequestTwitterQueryStreamStage.java

示例3: RequestTwitterUserStreamStage

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public RequestTwitterUserStreamStage(GraphManager graphManager, 
										String ck, String cs, 
										String token, String secret, 
										int httpRequestResponseId,
										Pipe<TwitterStreamControlSchema> control,
		                                Pipe<ClientHTTPRequestSchema> output) {
	
	super(graphManager, control, output);
	this.control = control;
	this.output = output;
	
	this.ck = ck;
	this.cs = cs;
	this.token = token;
	this.secret = secret;
	this.httpRequestResponseId = httpRequestResponseId;		
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:18,代码来源:RequestTwitterUserStreamStage.java

示例4: streamingRequest

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
private void streamingRequest(Pipe<ClientHTTPRequestSchema> pipe, int httpRequestResponseId) {
		
	PipeWriter.presumeWriteFragment(pipe, ClientHTTPRequestSchema.MSG_HTTPGET_100);
	assert(httpRequestResponseId>=0);
	PipeWriter.writeInt(pipe, ClientHTTPRequestSchema.MSG_HTTPGET_100_FIELD_DESTINATION_11, httpRequestResponseId);
	PipeWriter.writeInt(pipe, ClientHTTPRequestSchema.MSG_HTTPGET_100_FIELD_SESSION_10, httpRequestResponseId);
	PipeWriter.writeInt(pipe, ClientHTTPRequestSchema.MSG_HTTPGET_100_FIELD_PORT_1, port);
	PipeWriter.writeUTF8(pipe, ClientHTTPRequestSchema.MSG_HTTPGET_100_FIELD_HOST_2, host);
	PipeWriter.writeUTF8(pipe, ClientHTTPRequestSchema.MSG_HTTPGET_100_FIELD_PATH_3, path);
			
	DataOutputBlobWriter<ClientHTTPRequestSchema> stream = PipeWriter.outputStream(pipe);
	DataOutputBlobWriter.openField(stream);
	myAuth.addHeaders(stream, "GET").append("\r\n");
	
	//myAuth.addHeaders(System.out, "GET");
	
	DataOutputBlobWriter.closeHighLevelField(stream, ClientHTTPRequestSchema.MSG_HTTPGET_100_FIELD_HEADERS_7);

	PipeWriter.publishWrites(pipe);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:21,代码来源:RequestTwitterUserStreamStage.java

示例5: processShutdownLogic

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
private void processShutdownLogic(Pipe<ClientHTTPRequestSchema> requestPipe) {
	ClientConnection connectionToKill = ccm.nextValidConnection();
	final ClientConnection firstToKill = connectionToKill;					
	while (null!=connectionToKill) {								
		connectionToKill = ccm.nextValidConnection();
		
		//must send handshake request down this pipe
		int pipeId = connectionToKill.requestPipeLineIdx();
		
		HTTPClientUtil.cleanCloseConnection(connectionToKill, output[pipeId]);
											
		if (firstToKill == connectionToKill) {
			break;//done
		}
	}
	
	shutdownInProgress = true;
	Pipe.confirmLowLevelRead(requestPipe, Pipe.EOF_SIZE);
	Pipe.releaseReadLock(requestPipe);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:21,代码来源:HTTPClientRequestStage.java

示例6: testStageGen

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
@Test
public void testStageGen() {
	
	int testDuration = 100;
	int generatorSeed = 51;
	assertTrue(StageTester.runFuzzTest(FuzzGeneratorStage.class, testDuration, generatorSeed, 
			                new MessageSchema[]{RawDataSchema.instance},
			                new Object[]{new Random(42),10L}));
	
	assertTrue(StageTester.runFuzzTest(FuzzGeneratorStage.class, testDuration, generatorSeed, 
							new MessageSchema[]{ClientHTTPRequestSchema.instance},
							new Object[]{new Random(42),10L}));
	
	assertTrue(StageTester.runFuzzTest(FuzzGeneratorStage.class, testDuration, generatorSeed, 
							new MessageSchema[]{PipeMonitorSchema.instance},
							new Object[]{new Random(42),10L}));
		
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:19,代码来源:StageTesterTester.java

示例7: testStageJSONDump

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
@Test
	public void testStageJSONDump() {
		
		int testDuration = 100;
		int generatorSeed = 13;
		
		assertTrue(StageTester.runFuzzTest(ConsoleJSONDumpStage.class, testDuration, generatorSeed++, 
							RawDataSchema.instance, false));
					       //never true above since RawDataSchema is NOT defined as UTF8
					
		assertTrue(StageTester.runFuzzTest(ConsoleJSONDumpStage.class, testDuration, generatorSeed++, 
							ClientHTTPRequestSchema.instance, false));
							//never true above since payload is NOT defined as UTF8
					
		assertTrue(StageTester.runFuzzTest(ConsoleJSONDumpStage.class, testDuration, generatorSeed++, 
							PipeMonitorSchema.instance, false));

		assertTrue(StageTester.runFuzzTest(ConsoleJSONDumpStage.class, testDuration, generatorSeed++, 
							PipeMonitorSchema.instance, true));

;
			
	}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:24,代码来源:StageTesterTester.java

示例8: ensureHTTPClientRequesting

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public void ensureHTTPClientRequesting(int queueLength, int maxMessageSize) {
	if (isInit) {
		throw new UnsupportedOperationException("Too late, ensureHTTPClientRequesting method must be called in define behavior.");
	}
	growCommandCountRoom(queueLength);
	this.initFeatures |= NET_REQUESTER;
	
	pcm.ensureSize(ClientHTTPRequestSchema.class, queueLength, maxMessageSize);

}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:11,代码来源:MsgCommandChannel.java

示例9: newNetRequestPipe

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
private static <B extends BuilderImpl> Pipe<ClientHTTPRequestSchema> newNetRequestPipe(PipeConfig<ClientHTTPRequestSchema> config, B builder) {

    	return new Pipe<ClientHTTPRequestSchema>(config) {
			@Override
			protected DataOutputBlobWriter<ClientHTTPRequestSchema> createNewBlobWriter() {
				return new PayloadWriter<ClientHTTPRequestSchema>(this);
			}    		
    	};
    }
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:10,代码来源:MsgCommandChannel.java

示例10: newCommandChannel

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public GreenCommandChannel newCommandChannel(int features) { 
    
	PipeConfigManager pcm = new PipeConfigManager(4, defaultCommandChannelLength, 
			                                         defaultCommandChannelMaxPayload);

	pcm.addConfig(defaultCommandChannelLength, defaultCommandChannelHTTPMaxPayload, ClientHTTPRequestSchema.class);
	pcm.addConfig(defaultCommandChannelLength,0,TrafficOrderSchema.class);
	
	return this.builder.newCommandChannel(
features,
parallelInstanceUnderActiveConstruction,
pcm
);    	
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:15,代码来源:GreenRuntime.java

示例11: OAuth1RequestTokenStage

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public OAuth1RequestTokenStage(GraphManager graphManager, 
		                       Pipe<HTTPRequestSchema>[] inputs, 
		                       Pipe<ClientHTTPRequestSchema> clientRequestsPipe,
		                       int responseId,
		                       HTTPSpecification<?, ?, ?, ?> httpSpec) {
	
	super(graphManager, inputs, clientRequestsPipe);
	this.inputs = inputs;
	this.clientRequestsPipe = clientRequestsPipe;
	this.httpSpec = httpSpec;
	this.responseId = responseId;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:13,代码来源:OAuth1RequestTokenStage.java

示例12: writeHeaders

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
private static void writeHeaders(String ck, String cs, DataOutputBlobWriter<ClientHTTPRequestSchema> stream) {
//	byte[] btc = encodeKeys(ck,cs).getBytes();//
	byte[] btc = (ck+':'+cs).getBytes();  //TODO: not GC free...
	//Authorization: Basic UW5KTlFsWnlkemRXVDNSV2RrWTVaSFo2TWs1Tk5EbEZZanBvTW5VNU5UQlpOVUZFZVdOa1JqSlNXV1p1V0daNE5sUkJaRVpaTlZZeE4xZDVSazFsTVVSS2JrSlBSMVZqZVVNM1lRPT0=

	stream.append("Authorization: Basic ");
	Appendables.appendBase64Encoded(stream, btc, 0, btc.length, Integer.MAX_VALUE);
	stream.append("\r\nContent-Type: application/x-www-form-urlencoded;charset=UTF-8\r\n");
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:OAuth2BearerUtil.java

示例13: newFollowInstance

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public static RequestTwitterFriendshipStage newFollowInstance(GraphManager graphManager,
		String ck, String cs, 
		String token, String secret, 
		Pipe<HTTPRequestSchema> inputs, Pipe<ServerResponseSchema> outputs,
		int httpRequestResponseId,
		Pipe<ClientHTTPRequestSchema> toTwitter, Pipe<NetResponseSchema> fromTwitter) {
	return new RequestTwitterFriendshipStage(graphManager, ck, cs, token, secret, 
			inputs, outputs, httpRequestResponseId, toTwitter, fromTwitter, followPath, "follow=true".getBytes());			 
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:RequestTwitterFriendshipStage.java

示例14: newUnFollowInstance

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
public static RequestTwitterFriendshipStage newUnFollowInstance(GraphManager graphManager,
		String ck, String cs, 
		String token, String secret, 
		Pipe<HTTPRequestSchema> inputs, Pipe<ServerResponseSchema> outputs,
		int httpRequestResponseId,
		Pipe<ClientHTTPRequestSchema> toTwitter, Pipe<NetResponseSchema> fromTwitter) {
	return new RequestTwitterFriendshipStage(graphManager, ck, cs, token, secret, 
			inputs, outputs, httpRequestResponseId, toTwitter, fromTwitter, unfollowPath);			 
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:RequestTwitterFriendshipStage.java

示例15: RequestTwitterFriendshipStage

import com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema; //导入依赖的package包/类
private RequestTwitterFriendshipStage(
		GraphManager graphManager,
		String ck, String cs, 
		String token, String secret, 
		Pipe<HTTPRequestSchema> inputs, 
		Pipe<ServerResponseSchema> outputs,
		int httpRequestResponseId,
		Pipe<ClientHTTPRequestSchema> toTwitter, 
		Pipe<NetResponseSchema> fromTwitter,
		String path,
		byte[] ... postItems
		) {
	
	super(graphManager, join(inputs, fromTwitter), join(outputs, toTwitter));
	
	this.inputs = inputs;
	this.outputs = outputs;
	this.toTwitter = toTwitter;
	this.fromTwitter = fromTwitter;
	
	this.ck = ck;
    this.cs = cs;
	this.token = token;
	this.secret = secret;
		
	this.path = path;
	this.pathBytes = path.getBytes();
	this.postItems = postItems;	
	this.httpRequestResponseId = httpRequestResponseId;
	
	this.msBetweenCalls = (24*60*60*1000)/1000;  //(15*60*1000)/15; 15 min limit
	assert(86_400 == msBetweenCalls);  //24 hour limit of 1000
	this.dynamicLength = new StringBuilder();
	
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:36,代码来源:RequestTwitterFriendshipStage.java


注:本文中的com.ociweb.pronghorn.network.schema.ClientHTTPRequestSchema类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。