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


Java NetResponseSchema类代码示例

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


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

示例1: NetResponseJSONStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public NetResponseJSONStage(GraphManager graphManager, Class<T> keys,  MapJSONToPipeBuilder<M,T> mapper, Pipe<NetResponseSchema> input, int bottom, Pipe<M> output, Pipe ... otherOutputs) {
	super(graphManager, input, join(otherOutputs, output));
	this.input = input;
	this.output = output;
	this.bottomOfJSON = bottom;
	
	boolean debug = false;
	
	this.keys = debug ? null : keys;	
	this.mapper = debug ? null : mapper;
	
	if (debug) {
		this.visitor = new JSONStreamVisitorCapture(System.out);
	}
	
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:17,代码来源:NetResponseJSONStage.java

示例2: newInstance

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的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: endOfHeaderProcessing

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
private int endOfHeaderProcessing(int i, final int stateIdx, DataOutputBlobWriter<NetResponseSchema> writer) {
	int state;
	//all done with header move on to body
	writer.writeShort((short)-1); //END OF HEADER FIELDS 		
	
	//Now write header message, we know there is room because we checked before starting.
					    
	if (payloadLengthData[i] == -1) {
		positionMemoData[stateIdx]= state= 3;	
		payloadLengthData[i] = 0;//starting chunk size.			

	} else {
		positionMemoData[stateIdx]= state= 2;
	}
	return state;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:17,代码来源:HTTP1xResponseParserStage.java

示例4: buildNetResponsePipe

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
private Pipe<NetResponseSchema> buildNetResponsePipe() {
	Pipe<NetResponseSchema> netResponsePipe = new Pipe<NetResponseSchema>(builder.pcm.getConfig(NetResponseSchema.class)) {
		@SuppressWarnings("unchecked")
		@Override
		protected DataInputBlobReader<NetResponseSchema> createNewBlobReader() {
			return new HTTPResponseReader(this);
		}
	};
	return netResponsePipe;
}
 
开发者ID:oci-pronghorn,项目名称:GreenLightning,代码行数:11,代码来源:MsgRuntime.java

示例5: OAuth1RequestTokenResponseStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public OAuth1RequestTokenResponseStage(GraphManager graphManager, 
		Pipe<NetResponseSchema> input,
		Pipe<ServerResponseSchema>[] output,
		HTTPSpecification<?, ?, ?, ?> httpSpec) {
	super(graphManager, input, output);
	this.httpSpec = httpSpec;
	this.output = output;
	this.input = input;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:OAuth1RequestTokenResponseStage.java

示例6: NetResponseDumpStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public NetResponseDumpStage(GraphManager graphManager, 
		                    Pipe<NetResponseSchema> input, 
		                    A target, 
		                    HTTPSpecification<?, ?, ?, ?> httpSpec) {
	super(graphManager, input, NONE);
	this.input = input;
	this.target = target;
	this.httpSpec = httpSpec;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:NetResponseDumpStage.java

示例7: newFollowInstance

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的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

示例8: newUnFollowInstance

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的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

示例9: RequestTwitterFriendshipStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的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

示例10: TwitterJSONToTwitterEventsStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public TwitterJSONToTwitterEventsStage(GraphManager graphManager,
									   int bottom,
									   boolean sendPostIds,
		                               Pipe<NetResponseSchema> input, 
		                               Pipe<TwitterStreamControlSchema> control,
		                               Pipe<TwitterEventSchema> output) {
			
	super(graphManager, TwitterKey.class, customJSONMapper(), input, bottom, output, control);
	this.control = control;
	this.sendPostIds = sendPostIds;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:12,代码来源:TwitterJSONToTwitterEventsStage.java

示例11: buildStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public static Pipe<TwitterEventSchema> buildStage(GraphManager gm, boolean sendPostIds, int bottom, Pipe<NetResponseSchema> clientResponsesPipe ,
		Pipe<TwitterStreamControlSchema> control,
		int tweetsCount) {
	
	Pipe<TwitterEventSchema> hosePipe = TwitterEventSchema.instance.newPipe(tweetsCount, MAX_TWEET_TEXT_SIZE);
	new TwitterJSONToTwitterEventsStage(gm, bottom, sendPostIds, clientResponsesPipe, control, hosePipe);
	return hosePipe;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:9,代码来源:TwitterJSONToTwitterEventsStage.java

示例12: HTTP1xResponseParserStage

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public HTTP1xResponseParserStage(GraphManager graphManager, 
		                       Pipe<NetPayloadSchema>[] input, 
		                       Pipe<NetResponseSchema>[] output, 
		                       Pipe<ReleaseSchema> ackStop,
		                       ClientCoordinator ccm,
		                       HTTPSpecification<?,?,?,?> httpSpec) {
	
	super(graphManager, input, join(output,ackStop));
	this.input = input;
	this.output = output;//must be 1 for each listener
	this.ccm = ccm;
	this.releasePipe = ackStop;
	this.httpSpec = httpSpec;		
	
	int i = input.length;
	while (--i>=0) {
		assert(	input[i].sizeOfBlobRing >=  MAX_VALID_HEADER*2 ); //size of blob ring is the largest a header can ever be.			
	}
	
	assert(this.httpSpec.headerMatches(H_TRANSFER_ENCODING, HTTPHeaderDefaults.TRANSFER_ENCODING.writingRoot()));
	assert(this.httpSpec.headerMatches(H_CONTENT_LENGTH, HTTPHeaderDefaults.CONTENT_LENGTH.writingRoot()));		
	assert(this.httpSpec.headerMatches(H_CONTENT_TYPE, HTTPHeaderDefaults.CONTENT_TYPE.writingRoot()));
	
	this.UNSUPPORTED_HEADER_ID  = httpSpec.headerCount+2;
	this.END_OF_HEADER_ID       = httpSpec.headerCount+3;//for the empty header found at the bottom of the header
	
	GraphManager.addNota(graphManager, GraphManager.DOT_BACKGROUND, "lavenderblush", this);
	
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:30,代码来源:HTTP1xResponseParserStage.java

示例13: outputsHaveRoom

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
private boolean outputsHaveRoom(Pipe<NetResponseSchema>[] output) {
	
	int i = output.length;
	while (--i>=0) {
		if (!Pipe.hasRoomForWrite(output[i])) {
			return false;
		}
	}
	
	return true;
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:12,代码来源:HTTP1xResponseParserStage.java

示例14: buildHTTP1xResponseParser

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
public static void buildHTTP1xResponseParser(GraphManager gm, ClientCoordinator ccm, 
		Pipe<NetResponseSchema>[] responses, Pipe<NetPayloadSchema>[] clearResponse,
		Pipe<ReleaseSchema> ackRelease) {
	
	HTTP1xResponseParserStage parser = new HTTP1xResponseParserStage(gm, clearResponse, responses, ackRelease, ccm, HTTPSpecification.defaultSpec());
	GraphManager.addNota(gm, GraphManager.DOT_RANK_NAME, "HTTPParser", parser);
	ccm.processNota(gm, parser);
	
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:10,代码来源:NetGraphBuilder.java

示例15: buildParser

import com.ociweb.pronghorn.network.schema.NetResponseSchema; //导入依赖的package包/类
private static void buildParser(GraphManager gm, ClientCoordinator ccm, 
		Pipe<NetResponseSchema>[] responses, Pipe<NetPayloadSchema>[] clearResponse, Pipe<ReleaseSchema>[] acks) {
	
	HTTP1xResponseParserStage parser = new HTTP1xResponseParserStage(gm, clearResponse, responses, acks[acks.length-1], ccm, HTTPSpecification.defaultSpec());
	GraphManager.addNota(gm, GraphManager.DOT_RANK_NAME, "HTTPParser", parser);
	ccm.processNota(gm, parser);
}
 
开发者ID:oci-pronghorn,项目名称:Pronghorn,代码行数:8,代码来源:NetGraphBuilder.java


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