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


Java SPJSONMessageDecoder类代码示例

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


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

示例1: AbstractNetworkConflictResolver

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
public AbstractNetworkConflictResolver(
          ProjectLocation projectLocation, 
          SPJSONMessageDecoder jsonDecoder, 
          HttpClient inboundHttpClient, 
          HttpClient outboundHttpClient,
          RunnableDispatcher runnable) 
  {
      super("updater-" + projectLocation.getUUID());
      
      this.jsonDecoder = jsonDecoder;
      this.projectLocation = projectLocation;
      this.inboundHttpClient = inboundHttpClient;
      this.outboundHttpClient = outboundHttpClient;
this.runnable = runnable;
      
      contextRelativePath = "/" + ClientSideSessionUtils.REST_TAG + "/project/" + projectLocation.getUUID();
  }
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:18,代码来源:AbstractNetworkConflictResolver.java

示例2: persistRevisionFromServer

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
/**
 * Requests the server for persist calls from version 0 to the given revision
 * of the given project, and persists them to the given decoder.
 * 
 * @param projectLocation
 * @param revisionNo Must be greater than zero, and no greater than the current revision number
 * @param decoder
 * @throws IOException
 * @throws URISyntaxException
 * @throws SPPersistenceException
 * @throws IllegalArgumentException Thrown if the server rejects the given revisionNo
 */
public static void persistRevisionFromServer(ProjectLocation projectLocation, 
        int revisionNo, 
        SPJSONMessageDecoder decoder,
        CookieStore cookieStore)
throws IOException, URISyntaxException, SPPersistenceException, IllegalArgumentException {
    
    SPServerInfo serviceInfo = projectLocation.getServiceInfo();
    HttpClient httpClient = ClientSideSessionUtils.createHttpClient(serviceInfo, cookieStore);
       
       try {
           JSONMessage response = ClientSideSessionUtils.executeServerRequest(httpClient, serviceInfo,
                   "/" + ClientSideSessionUtils.REST_TAG + "/project/" + projectLocation.getUUID() + "/" + revisionNo,
                   new JSONResponseHandler());            
           
           if (response.isSuccessful()) {
               decoder.decode(response.getBody());                
           } else {
               throw new IllegalArgumentException("The server rejected the revision number " +
               		"(it must be greater than 0, and no greater than the current revision number)");
           }
           
       } finally {
           httpClient.getConnectionManager().shutdown();
       }   
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:38,代码来源:ClientSideSessionUtils.java

示例3: persistRevisionFromServer

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
public static void persistRevisionFromServer(ProjectLocation projectLocation, 
        int revisionNo, 
        SPJSONMessageDecoder decoder)
throws IOException, URISyntaxException, SPPersistenceException, IllegalArgumentException {
    
    ClientSideSessionUtils.persistRevisionFromServer(projectLocation, revisionNo, decoder, cookieStore);
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:8,代码来源:MatchMakerClientSideSession.java

示例4: MatchMakerNetworkConflictResolver

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
public MatchMakerNetworkConflictResolver(ProjectLocation projectLocation,
		SPJSONMessageDecoder jsonDecoder,
		HttpClient inboundHttpClient,
		HttpClient outboundHttpClient,
           MatchMakerClientSideSession session) {
	super(projectLocation, jsonDecoder, inboundHttpClient, outboundHttpClient,
			session);
	// TODO Auto-generated constructor stub
	this.session = session;
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:11,代码来源:MatchMakerNetworkConflictResolver.java

示例5: WabitClientSession

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
public WabitClientSession(
  		@Nonnull WorkspaceLocation workspaceLocation,
  		@Nonnull WabitSessionContext context) 
  {
      super(context);
this.workspaceLocation = workspaceLocation;
      if (workspaceLocation == null) {
      	throw new NullPointerException("workspaceLocation must not be null");
      }

      super.fontLoader = new RemoteFontLoader(workspaceLocation.getServiceInfo());
      outboundHttpClient = createHttpClient(workspaceLocation.getServiceInfo());
      
      getWorkspace().setUUID(workspaceLocation.getUuid());
      getWorkspace().setName("Loading Workspace...");
      getWorkspace().setSession(this); // XXX leaking a reference to partially-constructed session!
      
      sessionPersister = new WabitSessionPersister(
      		"inbound-" + workspaceLocation.getUuid(),
      		WabitClientSession.this, true);
      // Whatever updates come from the server, it can override the user's stuff.
      sessionPersister.setGodMode(true);
      updater = new Updater(workspaceLocation.getUuid(), new SPJSONMessageDecoder(sessionPersister));
      
      MessageSender<JSONObject> httpSender = new JSONHttpMessageSender(outboundHttpClient, workspaceLocation.getServiceInfo(),
      		workspaceLocation.getUuid());
jsonPersister = new WabitJSONPersister(httpSender);

try {
	ServerInfoProvider.getServerVersion(
			this.workspaceLocation.getServiceInfo().getServerAddress(), 
			String.valueOf(this.workspaceLocation.getServiceInfo().getPort()), 
			this.workspaceLocation.getServiceInfo().getPath(), 
			this.workspaceLocation.getServiceInfo().getUsername(), 
			this.workspaceLocation.getServiceInfo().getPassword());
} catch (Exception e) {
	throw new AssertionError("Exception encountered while verifying the server license:" + e.getMessage());
}
  }
 
开发者ID:SQLPower,项目名称:wabit,代码行数:40,代码来源:WabitClientSession.java

示例6: MatchMakerClientSideSession

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
public MatchMakerClientSideSession(String name,
		ProjectLocation projectLocation,
   		MatchMakerSession delegateSession) throws SQLObjectException {
	
	this.projectLocation = projectLocation;
	this.delegateSession = delegateSession;
	dataSourceCollectionUpdater = new MatchMakerDataSourceCollectionUpdater(projectLocation);
	
	String ddlgClass = prefs.get(this.projectLocation.getUUID() + ".ddlg", null);
	if (ddlgClass != null) {
	    try {
               DDLGenerator ddlg = (DDLGenerator) Class.forName(ddlgClass, true, MatchMakerClientSideSession.class.getClassLoader()).newInstance();
               setDDLGenerator(ddlg);
               ddlg.setTargetCatalog(prefs.get(this.projectLocation.getUUID() + ".targetCatalog", null));
               ddlg.setTargetSchema(prefs.get(this.projectLocation.getUUID() + ".targetSchema", null));
           } catch (Exception e) {
               delegateSession.createUserPrompterFactory().createUserPrompter("Cannot load DDL settings due to missing class " + ddlgClass, 
                       UserPromptType.MESSAGE, UserPromptOptions.OK, UserPromptResponse.OK, null, "OK").promptUser("");
               logger.error("Cannot find DDL Generator for class " + ddlgClass + 
                       ", ddl generator properties are not loaded.");
           }
	}
	
	outboundHttpClient = ClientSideSessionUtils.createHttpClient(projectLocation.getServiceInfo(), cookieStore);
	dataSourceCollection = getDataSources();
	
	sessionPersister = new MatchMakerSessionPersister("inbound-" + projectLocation.getUUID(), getWorkspace(), 
	        new MatchMakerPersisterSuperConverter(dataSourceCollection, getWorkspace()));
	sessionPersister.setWorkspaceContainer(this);
	
	jsonMessageDecoder = new SPJSONMessageDecoder(sessionPersister);
	
	updater = new MatchMakerNetworkConflictResolver(
	        projectLocation, 
	        jsonMessageDecoder, 
	        ClientSideSessionUtils.createHttpClient(projectLocation.getServiceInfo(), cookieStore), 
	        outboundHttpClient, this);
	
	jsonPersister = new SPJSONPersister(updater);
	
	verifyServerLicense(projectLocation);
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:43,代码来源:MatchMakerClientSideSession.java

示例7: Updater

import ca.sqlpower.dao.json.SPJSONMessageDecoder; //导入依赖的package包/类
/**
 * Creates, but does not start, the updater thread.
 * 
 * @param workspaceUUID
 *            the ID of the workspace this updater is responsible for. This is
 *            used in creating the thread's name.
 */
Updater(String workspaceUUID, SPJSONMessageDecoder jsonDecoder) {
	super("updater-" + workspaceUUID);
	this.jsonDecoder = jsonDecoder;
	inboundHttpClient = createHttpClient(workspaceLocation.getServiceInfo());
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:13,代码来源:WabitClientSession.java


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