Search in sources :

Example 1 with ExtendedResponseImpl

use of org.apache.directory.api.ldap.model.message.ExtendedResponseImpl in project directory-ldap-api by apache.

the class InitExtendedResponse method action.

/**
 * {@inheritDoc}
 */
public void action(LdapMessageContainer<ExtendedResponseDecorator<?>> container) throws DecoderException {
    // Now, we can allocate the ExtendedResponse Object
    ExtendedResponseDecorator<?> extendedResponse = new ExtendedResponseDecorator<>(container.getLdapCodecService(), new ExtendedResponseImpl(container.getMessageId()));
    container.setMessage(extendedResponse);
    LOG.debug("Extended Response");
}
Also used : ExtendedResponseImpl(org.apache.directory.api.ldap.model.message.ExtendedResponseImpl) ExtendedResponseDecorator(org.apache.directory.api.ldap.codec.decorators.ExtendedResponseDecorator)

Example 2 with ExtendedResponseImpl

use of org.apache.directory.api.ldap.model.message.ExtendedResponseImpl in project directory-ldap-api by apache.

the class DefaultLdapCodecService method newExtendedResponse.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("unchecked")
@Override
public <E extends ExtendedResponse> E newExtendedResponse(String responseName, int messageId, byte[] serializedResponse) throws DecoderException {
    ExtendedResponseDecorator<ExtendedResponse> resp;
    ExtendedOperationFactory extendedRequestFactory = extendedOperationFactories.get(responseName);
    if (extendedRequestFactory != null) {
        resp = (ExtendedResponseDecorator<ExtendedResponse>) extendedRequestFactory.newResponse(serializedResponse);
    } else {
        resp = new ExtendedResponseDecorator(this, new ExtendedResponseImpl(responseName));
        resp.setResponseValue(serializedResponse);
        resp.setResponseName(responseName);
    }
    resp.setMessageId(messageId);
    return (E) resp;
}
Also used : ExtendedResponse(org.apache.directory.api.ldap.model.message.ExtendedResponse) ExtendedOperationFactory(org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory) ExtendedResponseImpl(org.apache.directory.api.ldap.model.message.ExtendedResponseImpl) ExtendedResponseDecorator(org.apache.directory.api.ldap.codec.decorators.ExtendedResponseDecorator)

Aggregations

ExtendedResponseDecorator (org.apache.directory.api.ldap.codec.decorators.ExtendedResponseDecorator)2 ExtendedResponseImpl (org.apache.directory.api.ldap.model.message.ExtendedResponseImpl)2 ExtendedOperationFactory (org.apache.directory.api.ldap.codec.api.ExtendedOperationFactory)1 ExtendedResponse (org.apache.directory.api.ldap.model.message.ExtendedResponse)1