本文整理汇总了Java中org.apache.directory.api.ldap.model.message.Response类的典型用法代码示例。如果您正苦于以下问题:Java Response类的具体用法?Java Response怎么用?Java Response使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Response类属于org.apache.directory.api.ldap.model.message包,在下文中一共展示了Response类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: action
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void action( Dsmlv2Container container ) throws XmlPullParserException
{
AbstractDsmlMessageDecorator<? extends Response> response
= ( AbstractDsmlMessageDecorator<? extends Response> )
container.getBatchResponse().getCurrentResponse();
if ( response instanceof SearchResponseDsml )
{
SearchResponse searchResponse = ( SearchResponse )
response.getDecorated();
createAndAddControlValue( container,
searchResponse.getSearchResultDone() );
}
else
{
createAndAddControlValue( container, response );
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:23,代码来源:Dsmlv2ResponseGrammar.java
示例2: addResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Adds a response.
*
* @param response
* the response to add
* @return
* true (as per the general contract of the Collection.add method).
*/
public boolean addResponse( DsmlDecorator<? extends Response> response )
{
if ( response instanceof SearchResultEntry )
{
( ( SearchResponse ) getDecorated() ).addSearchResultEntry(
( SearchResultEntryDsml ) response );
}
else if ( response instanceof SearchResultReference )
{
( ( SearchResponse ) getDecorated() ).addSearchResultReference(
( SearchResultReferenceDsml ) response );
}
else if ( response instanceof SearchResultDone )
{
( ( SearchResponse ) getDecorated() ).setSearchResultDone(
( SearchResultDoneDsml ) response );
}
else
{
throw new IllegalArgumentException( "Unidentified search resp type" );
}
return responses.add( response );
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:33,代码来源:SearchResponseDsml.java
示例3: toDsml
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Converts this Batch Response to its XML representation in the DSMLv2 format.
*
* @param prettyPrint if true, formats the document for pretty printing
* @return the XML representation in DSMLv2 format
*/
public String toDsml( boolean prettyPrint )
{
Document document = DocumentHelper.createDocument();
Element element = document.addElement( "batchResponse" );
element.add( ParserUtils.DSML_NAMESPACE );
element.add( ParserUtils.XSD_NAMESPACE );
element.add( ParserUtils.XSI_NAMESPACE );
// RequestID
if ( requestID != 0 )
{
element.addAttribute( "requestID", Integer.toString( requestID ) );
}
for ( DsmlDecorator<? extends Response> response : responses )
{
response.toDsml( element );
}
if ( prettyPrint )
{
document = ParserUtils.styleDocument( document );
}
return document.asXML();
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:34,代码来源:BatchResponseDsml.java
示例4: removeResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Removes a response.
*
* @param response
* the response to remove
* @return
* true if this list contained the specified element.
*/
public boolean removeResponse( DsmlDecorator<? extends Response> response )
{
if ( response instanceof SearchResultEntry )
{
( ( SearchResponse ) getDecorated() ).removeSearchResultEntry(
( SearchResultEntryDsml ) response );
}
else if ( response instanceof SearchResultReference )
{
( ( SearchResponse ) getDecorated() ).removeSearchResultReference(
( SearchResultReferenceDsml ) response );
}
else if ( response instanceof SearchResultDone )
{
if ( response.equals( ( ( SearchResponse ) getDecorated() ).getSearchResultDone() ) )
{
( ( SearchResponse ) getDecorated() ).setSearchResultDone( null );
}
}
else
{
throw new IllegalArgumentException( "Unidentified search resp type" );
}
return responses.remove( response );
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:35,代码来源:SearchResponseDsml.java
示例5: testResponseWith1AddResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 AddResponse
*/
@Test
public void testResponseWith1AddResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_AddResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof AddResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例6: testResponseWith1AuthResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 AuthResponse
*/
@Test
public void testResponseWith1AuthResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_AuthResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof BindResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例7: testResponseWith1CompareResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 CompareResponse
*/
@Test
public void testResponseWith1CompareResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_CompareResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof CompareResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例8: testResponseWith1DelResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 DelResponse
*/
@Test
public void testResponseWith1DelResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_DelResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof DeleteResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例9: testResponseWith1ErrorResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 ErrorResponse
*/
@Test
public void testResponseWith1ErrorResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ErrorResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ErrorResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例10: testResponseWith1ExtendedResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 ExtendedResponse
*/
@Test
public void testResponseWith1ExtendedResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput(
BatchResponseTest.class.getResource( "response_with_1_ExtendedResponse.xml" ).openStream(), "UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ExtendedResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例11: testResponseWith1ModDNResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 ModDNResponse
*/
@Test
public void testResponseWith1ModDNResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ModDNResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ModifyDnResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例12: testResponseWith1ModifyResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 ModifyResponse
*/
@Test
public void testResponseWith1ModifyResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_ModifyResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ModifyResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例13: testResponseWith1SearchResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 1 SearchResponse
*/
@Test
public void testResponseWith1SearchResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_1_SearchResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 1, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response.getDecorated() instanceof SearchResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例14: testResponseWith2AddResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 AddResponse
*/
@Test
public void testResponseWith2AddResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_2_AddResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof AddResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例15: testResponseWith2AuthResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 AuthResponse
*/
@Test
public void testResponseWith2AuthResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_2_AuthResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof BindResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例16: testResponseWith2CompareResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 CompareResponse
*/
@Test
public void testResponseWith2CompareResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_2_CompareResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof CompareResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例17: testResponseWith2DelResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 DelResponse
*/
@Test
public void testResponseWith2DelResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_2_DelResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof DeleteResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例18: testResponseWith2ErrorResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 ErrorResponse
*/
@Test
public void testResponseWith2ErrorResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_2_ErrorResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ErrorResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例19: testResponseWith2ExtendedResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 ExtendedResponse
*/
@Test
public void testResponseWith2ExtendedResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput(
BatchResponseTest.class.getResource( "response_with_2_ExtendedResponse.xml" ).openStream(), "UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ExtendedResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
示例20: testResponseWith2ModDNResponse
import org.apache.directory.api.ldap.model.message.Response; //导入依赖的package包/类
/**
* Test parsing of a Response with the 2 ModDNResponse
*/
@Test
public void testResponseWith2ModDNResponse()
{
Dsmlv2ResponseParser parser = null;
try
{
parser = new Dsmlv2ResponseParser( getCodec() );
parser.setInput( BatchResponseTest.class.getResource( "response_with_2_ModDNResponse.xml" ).openStream(),
"UTF-8" );
parser.parse();
}
catch ( Exception e )
{
fail( e.getMessage() );
}
BatchResponseDsml batchResponse = parser.getBatchResponse();
assertEquals( 2, batchResponse.getResponses().size() );
DsmlDecorator<? extends Response> response = batchResponse.getCurrentResponse();
if ( response instanceof ModifyDnResponse )
{
assertTrue( true );
}
else
{
fail();
}
}
开发者ID:apache,项目名称:directory-ldap-api,代码行数:37,代码来源:BatchResponseTest.java
注:本文中的org.apache.directory.api.ldap.model.message.Response类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论