Examples of AuthResponse


Examples of com.alu.e3.prov.restapi.model.AuthResponse

        com.alu.e3.prov.restapi.model.Error error = validate(auth);

        if(LOG.isDebugEnabled())
          LOG.debug("Creating Auth ID: {}", auth.getId());

        AuthResponse response = new AuthResponse(AuthResponse.SUCCESS);
        if(error == null){
          com.alu.e3.data.model.Auth authDataModel = BeanConverterUtil.toDataModel(auth);
          dataManager.addAuth(authDataModel);
          response.setId(auth.getId());
        }
        else{
          error.setErrorCode("400");
          response.setStatus(AuthResponse.FAILURE);
          response.setError(error);
        }

        return response;
      }
    };
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.AuthResponse

        if(auth.getId() == null || auth.getId().equals(""))
          auth.setId(id);
        else if(auth.getId().equals(id) == false)
          throw new InvalidParameterException("Auth ID mismatch");

        AuthResponse response = new AuthResponse(AuthResponse.SUCCESS);

        if(error == null){
          com.alu.e3.data.model.Auth authDataModel = BeanConverterUtil.toDataModel(auth);
          dataManager.updateAuth(authDataModel);
          response.setId(auth.getId());
        }
        else{
          error.setErrorCode("400");
          response.setStatus(AuthResponse.FAILURE);
          response.setError(error);
        }
        return response;
      }
    };
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.AuthResponse

        if(LOG.isDebugEnabled())
          LOG.debug("Deleting Auth ID: {}", id);

        dataManager.removeAuth(id);

        AuthResponse response = new AuthResponse(AuthResponse.SUCCESS);
        return response;
      }
    };
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.AuthResponse

          LOG.debug("Getting Auth ID: {}", id);

        com.alu.e3.data.model.Auth authDataModel = dataManager.getAuthById(id, true);
        Auth auth = BeanConverterUtil.fromDataModel(authDataModel);

        AuthResponse response = new AuthResponse(AuthResponse.SUCCESS);
        response.setAuth(auth);
        return response;

      }
    };
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.model.AuthResponse

      @Override
      protected Object doAction(Object... params) {
        if(LOG.isDebugEnabled())
          LOG.debug("Getting All Auths");

        AuthResponse response = new AuthResponse(AuthResponse.SUCCESS);

        Set<String> auths = dataManager.getAllAuthIds();
        response.getIds().addAll(auths);

        return response;
      }
    };
  }
View Full Code Here

Examples of com.datastax.cassandra.transport.messages.AuthResponse

                    Authenticator authenticator = factory.authProvider.newAuthenticator(address);
                    byte[] initialResponse = authenticator.initialResponse();
                    if (null == initialResponse)
                        initialResponse = new byte[0];

                    com.datastax.cassandra.transport.Message.Response authResponse = write(new AuthResponse(initialResponse)).get();
                    waitForSaslCompletion(authResponse, authenticator);
                    break;
                default:
                    throw defunct(new TransportException(address, String.format("Unexpected %s response message from server to a STARTUP message", response.type)));
            }
View Full Code Here

Examples of com.datastax.cassandra.transport.messages.AuthResponse

                    logger.trace("Response to server is null: authentication should now be complete.");
                    return;
                } else {
                    // Otherwise, send the challenge response back to the server
                    logger.trace("Sending token response back to server");
                    waitForSaslCompletion(write(new AuthResponse(responseToServer)).get(), authenticator);
                }
                break;
            case ERROR:
                throw new AuthenticationException(address, (((ErrorMessage) authResponse).error).getMessage());
            default:
View Full Code Here

Examples of com.datastax.cassandra.transport.messages.AuthResponse

                    Authenticator authenticator = factory.authProvider.newAuthenticator(address);
                    byte[] initialResponse = authenticator.initialResponse();
                    if (null == initialResponse)
                        initialResponse = new byte[0];

                    com.datastax.cassandra.transport.Message.Response authResponse = write(new AuthResponse(initialResponse)).get();
                    waitForSaslCompletion(authResponse, authenticator);
                    break;
                default:
                    throw defunct(new TransportException(address, String.format("Unexpected %s response message from server to a STARTUP message", response.type)));
            }
View Full Code Here

Examples of com.datastax.cassandra.transport.messages.AuthResponse

                    logger.trace("Response to server is null: authentication should now be complete.");
                    return;
                } else {
                    // Otherwise, send the challenge response back to the server
                    logger.trace("Sending token response back to server");
                    waitForSaslCompletion(write(new AuthResponse(responseToServer)).get(), authenticator);
                }
                break;
            case ERROR:
                throw new AuthenticationException(address, (((ErrorMessage) authResponse).error).getMessage());
            default:
View Full Code Here

Examples of com.datastax.cassandra.transport.messages.AuthResponse

                    Authenticator authenticator = factory.authProvider.newAuthenticator(address);
                    byte[] initialResponse = authenticator.initialResponse();
                    if (null == initialResponse)
                        initialResponse = new byte[0];

                    com.datastax.cassandra.transport.Message.Response authResponse = write(new AuthResponse(initialResponse)).get();
                    waitForSaslCompletion(authResponse, authenticator);
                    break;
                default:
                    throw defunct(new TransportException(address, String.format("Unexpected %s response message from server to a STARTUP message", response.type)));
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.