Graphene api find name avaible
This commit is contained in:
parent
06b02f76d6
commit
a94af316cc
1 changed files with 4 additions and 4 deletions
|
@ -166,12 +166,12 @@ public class GrapheneApiGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets if an Account Name is avaible to be used for a new account
|
* Retrieves the account id by the name of the account
|
||||||
*
|
*
|
||||||
* @param accountName The account Name to find
|
* @param accountName The account Name to find
|
||||||
* @param request The Api request object, to answer this petition
|
* @param request The Api request object, to answer this petition
|
||||||
*/
|
*/
|
||||||
public static void isAccountNameAvaible(String accountName, final ApiRequest request){
|
public static void getAccountIdByName(String accountName, final ApiRequest request){
|
||||||
WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(connectionTimeout);
|
WebSocketFactory factory = new WebSocketFactory().setConnectionTimeout(connectionTimeout);
|
||||||
try {
|
try {
|
||||||
final WebSocket webSocket = factory.createSocket(url);
|
final WebSocket webSocket = factory.createSocket(url);
|
||||||
|
@ -180,9 +180,9 @@ public class GrapheneApiGenerator {
|
||||||
public void onSuccess(WitnessResponse response) {
|
public void onSuccess(WitnessResponse response) {
|
||||||
AccountProperties accountProperties = ((WitnessResponse<AccountProperties>) response).result;
|
AccountProperties accountProperties = ((WitnessResponse<AccountProperties>) response).result;
|
||||||
if(accountProperties != null){
|
if(accountProperties != null){
|
||||||
request.getListener().success(true,request.getId());
|
request.getListener().success(null,request.getId());
|
||||||
}else{
|
}else{
|
||||||
request.getListener().success(false,request.getId());
|
request.getListener().success(accountProperties.id,request.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue