Package com.betfair.cougar.transport.api.protocol.http.rescript

Examples of com.betfair.cougar.transport.api.protocol.http.rescript.RescriptIdentityTokenResolver


  protected int writeResponse(HttpCommand command, RescriptOperationBinding binding,
      Object result, ExecutionContextWithTokens context, MediaType requestMediaType, long bytesRead) {
    final HttpServletRequest request = command.getRequest();
    final HttpServletResponse response = command.getResponse();
        final RescriptIdentityTokenResolver tokenResolver = (RescriptIdentityTokenResolver)command.getIdentityTokenResolver();
    if (command.getStatus() == TransportCommand.CommandStatus.InProcess) {
      try {
        if (result instanceof ResponseCode) {
          ResponseCodeMapper.setResponseStatus(response, ((ResponseCode)result));
                  logAccess(command,
              context, bytesRead,
              0, requestMediaType,
              null, (ResponseCode)result);
        } else {
                    if (context != null && context.getIdentity() != null && tokenResolver != null) {
                        writeIdentity(context.getIdentityTokens(), new IdentityTokenIOAdapter() {

                            @Override
                            public void rewriteIdentityTokens(List<IdentityToken> identityTokens) {
                                tokenResolver.rewrite(identityTokens, response);
                            }

                            @Override
                            public boolean isRewriteSupported() {
                                return tokenResolver.isRewriteSupported();
                            }
                        });
                    }

                    //If the operation returns void, then return 200
View Full Code Here


  protected int writeResponse(HttpCommand command, RescriptOperationBinding binding,
      Object result, ExecutionContextWithTokens context, MediaType requestMediaType, long bytesRead) {
    final HttpServletRequest request = command.getRequest();
    final HttpServletResponse response = command.getResponse();
        final RescriptIdentityTokenResolver tokenResolver = (RescriptIdentityTokenResolver)command.getIdentityTokenResolver();
    if (command.getStatus() == TransportCommand.CommandStatus.InProcess) {     
      try {
        if (result instanceof ResponseCode) {
          ResponseCodeMapper.setResponseStatus(response, ((ResponseCode)result));
                  logAccess(command,
              context, bytesRead,
              0, requestMediaType,
              null, (ResponseCode)result);
        } else {
                    if (context != null && context.getIdentity() != null && tokenResolver != null) {
                        writeIdentity(context.getIdentityTokens(), new IdentityTokenIOAdapter() {

                            @Override
                            public void rewriteIdentityTokens(List<IdentityToken> identityTokens) {
                                tokenResolver.rewrite(identityTokens, response);
                            }

                            @Override
                            public boolean isRewriteSupported() {
                                return tokenResolver.isRewriteSupported();
                            }
                        });
                    }

                    //If the operation returns void, then return 200
View Full Code Here

TOP

Related Classes of com.betfair.cougar.transport.api.protocol.http.rescript.RescriptIdentityTokenResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.