public String createToken(int ttl) {
        checkArgument(ttl > 0);

        CreateTokenRequest request = new CreateTokenRequest();
        request.setTtl(ttl);
        InternalRequest internalRequest = createRequest(request, HttpMethodName.POST, null, TOKEN);
        CreateTokenResponse response = this.invokeHttpClient(internalRequest, CreateTokenResponse.class);
        return response.getToken();
    }
public String createToken ( int ttl ) { checkArgument ( ttl > 0 ) ; CreateTokenRequest request = new CreateTokenRequest ( ) ; request . setTtl ( ttl ) ; InternalRequest internalRequest = createRequest ( request , HttpMethodName . POST , null , TOKEN ) ; CreateTokenResponse response = this . invokeHttpClient ( internalRequest , CreateTokenResponse . class ) ; return response . getToken ( ) ; }
Create a token
@param ttl - token's time to live, in seconds
@return a string token