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


Java Form.getWebRepresentation方法代码示例

本文整理汇总了Java中org.restlet.data.Form.getWebRepresentation方法的典型用法代码示例。如果您正苦于以下问题:Java Form.getWebRepresentation方法的具体用法?Java Form.getWebRepresentation怎么用?Java Form.getWebRepresentation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.restlet.data.Form的用法示例。


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

示例1: createRWSRancidNode

import org.restlet.data.Form; //导入方法依赖的package包/类
public static void createRWSRancidNode(ConnectionProperties cp, RancidNode rnode) throws RancidApiException{
    
    if (!inited){
        throw(new RancidApiException("Error: Api not initialized"));
    }
    
    Form form = new Form();
    form.add("deviceType", rnode.getDeviceType());
    form.add("state", rnode.getState());
    form.add("comment", rnode.getComment());
            
    Representation rep = form.getWebRepresentation();

    String url = cp.getUrl()+cp.getDirectory()+"/rancid/groups/"+rnode.getGroup()+"/"+rnode.getDeviceName();
    putMethodRWS(cp, url,rep);
    
}
 
开发者ID:OpenNMS,项目名称:rancid-api,代码行数:18,代码来源:RWSClientApi.java

示例2: updateRWSRancidNode

import org.restlet.data.Form; //导入方法依赖的package包/类
public static void updateRWSRancidNode(ConnectionProperties cp, RancidNode rnode) throws RancidApiException{

        if (!inited){
            throw(new RancidApiException("Error: Api not initialized"));
        }
        Form form = new Form();
        form.add("deviceType", rnode.getDeviceType());
        form.add("state", rnode.getState());
        form.add("comment", rnode.getComment());
                
        Representation rep = form.getWebRepresentation();

        String url = cp.getUrl()+cp.getDirectory()+"/rancid/groups/"+rnode.getGroup()+"/"+rnode.getDeviceName();

        postMethodRWS(cp, url,rep);
        
    }
 
开发者ID:OpenNMS,项目名称:rancid-api,代码行数:18,代码来源:RWSClientApi.java

示例3: createRWSAuthNode

import org.restlet.data.Form; //导入方法依赖的package包/类
public static void createRWSAuthNode(ConnectionProperties cp, RancidNodeAuthentication rnodea) throws RancidApiException{
    if (!inited){
        throw(new RancidApiException("Error: Api not initialized"));
    }
    
    Form form = new Form();
    form.add("user", rnodea.getUser());
    form.add("password", rnodea.getPassword());
    form.add("enablepassword", rnodea.getEnablePass());
    String autoenable = "0";
    if (rnodea.isAutoEnable()){
        autoenable="1";
    }
    form.add("autoenable", autoenable);
    form.add("method", rnodea.getConnectionMethodString());
    
            
    Representation rep = form.getWebRepresentation();

    String url = cp.getUrl() + cp.getDirectory() + "/rancid/clogin/" +rnodea.getDeviceName();
    putMethodRWS(cp, url,rep);        
}
 
开发者ID:OpenNMS,项目名称:rancid-api,代码行数:23,代码来源:RWSClientApi.java

示例4: updateRWSAuthNode

import org.restlet.data.Form; //导入方法依赖的package包/类
public static void updateRWSAuthNode(ConnectionProperties cp, RancidNodeAuthentication rnodea) throws RancidApiException{
    if (!inited){
        throw(new RancidApiException("Error: Api not initialized"));
    }
    Form form = new Form();
    form.add("user", rnodea.getUser());
    form.add("password", rnodea.getPassword());
    form.add("enablepassword", rnodea.getEnablePass());
    String autoenable = "0";
    if (rnodea.isAutoEnable()){
        autoenable="1";
    }
    form.add("autoenable", autoenable);
    form.add("method", rnodea.getConnectionMethodString());
    
            
    Representation rep = form.getWebRepresentation();

    String url = cp.getUrl() + cp.getDirectory() + "/rancid/clogin/" +rnodea.getDeviceName();

    postMethodRWS(cp, url,rep);        
}
 
开发者ID:OpenNMS,项目名称:rancid-api,代码行数:23,代码来源:RWSClientApi.java

示例5: runtimeParameterResourcePutNotExisting

import org.restlet.data.Form; //导入方法依赖的package包/类
@Test
public void runtimeParameterResourcePutNotExisting() throws IOException, SlipStreamException {

	Run run = createAndStoreRunImage("runtimeParameterResourcePutNotExisting");

	String key = "node.1:key";
	Form form = new Form();
	String value = "value of key";
	form.add("value", value);

	Representation entity = form.getWebRepresentation();
	Request request = createPutRequest(run.getUuid(), key, entity);

	Response response = executeRequest(request);

	run.remove();

	assertThat(response.getStatus(), is(Status.CLIENT_ERROR_NOT_FOUND));
}
 
开发者ID:slipstream,项目名称:SlipStreamServer,代码行数:20,代码来源:RuntimeParameterResourceTest.java


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