public class LastFMRestRequester extends RestRequester
Modifier and Type | Field and Description |
---|---|
protected String |
apiKey_ |
protected static String |
CLASSNAME |
protected static boolean |
debugOut_ |
protected static String |
DEFAULT_API_KEY |
protected static String |
DEFAULT_IP
DEFAULT ISY994 IP address to use: 10.0.0.207 .
|
protected static String |
DEFAULT_PASSWORD
DEFAULT Last.FM password to use: admin .
|
protected static String |
DEFAULT_REST_RESULTS_FORMAT |
protected static String |
DEFAULT_REST_URL_PATHSTR
DEFAULT ISY994 rest URL to start the URL path: /rest .
|
protected static String |
DEFAULT_USERNAME
DEFAULT Last.FM username to use: admin .
|
protected static StringBuilder |
helpMsg_ |
static String |
LOG_TAG |
protected String |
restFormat_ |
protected String |
restUrlPath_
The start path to use in therest URL.
|
protected static String |
TOMS_IP |
protected static String |
TOMS_PASSWORD |
protected static String |
TOMS_USERNAME |
protected static boolean |
tomsID_
flag to indicate the use of TOMS_isy IP, userID, and password.
|
protected String |
userID_ |
acceptJSON_, authenticating_, baseUrl_, password_, SYSTEM_FILE_SEPERATOR, SYSTEM_LINE_SEPERATOR, USER_AGENT, username_
Constructor and Description |
---|
LastFMRestRequester()
Default constructor that authenticates the default ISY with the default user password (using the class vars)
UNLESS the tomsID_ class var is true to over-ride with TOMS _isy IP, userID, and password.
|
LastFMRestRequester(boolean useDefault)
Default constructor that authenticates and connects the ISY with a choice of either the default user password
(using the class vars) or with TOMS _isy IP, userID, and password..
|
LastFMRestRequester(String server,
String user,
String pass)
Constructor to customize all connection settings.
|
Modifier and Type | Method and Description |
---|---|
private void |
buildRestUrl() |
boolean |
canConnect()
Check connectivity to the ISY specified by the class parms.
|
int |
deviceAddressStatus(String addr)
returns the on/off/% fora specified node address.
|
protected static StringBuilder |
getHelpMsg()
initializes and gets the helpMsg_
class var.
|
protected static String |
getHelpMsgStr()
gets the help as a String.
|
protected void |
getPropertyCMD(String[] args)
commandLine command executor method for the getProperty Command.
|
String |
getRestUrlPath()
Get Method for class field 'restUrlPath_'.
|
static boolean |
getTomsID()
Get Method for class field 'tomsID_'.
|
static void |
main(String[] args)
Class main commandLine entry method that has a test command and some convienience commands, as well as a pure rest command.
|
StringBuilder |
requestToken()
Sends a REST call to get a request token to later be authorized by the user.
|
protected void |
restCMD(String[] args)
commandLine command executor method for the default rest Command.
|
StringBuilder |
sendApiCommand(String apiCommand) |
String |
sendAuthGetToken() |
void |
setRestUrlPath(String restUrlPath)
Set Method for class field 'restUrlPath_'.
|
static void |
setTomsID(boolean tomsId)
Set Method for class field
tomsID_ . |
protected void |
templateCMD(String[] args)
Template method for future commandLine command executor methods.
|
protected void |
testCMD(String[] args)
commandLine command executor method for the test Command.
|
callService, callService, getAcceptJSON, getBaseUrl, getPassword, getServiceUrl, getUsername, isInit, responseIndenter, serviceGet, servicePost, setAcceptJSON, setBaseUrl, setPassword, setUsername
protected static final String CLASSNAME
public static final String LOG_TAG
protected static final String DEFAULT_IP
protected static final String DEFAULT_USERNAME
protected static final String DEFAULT_PASSWORD
protected static final String DEFAULT_REST_URL_PATHSTR
protected static final String DEFAULT_API_KEY
protected static final String DEFAULT_REST_RESULTS_FORMAT
protected static final String TOMS_IP
protected static final String TOMS_USERNAME
protected static final String TOMS_PASSWORD
protected static StringBuilder helpMsg_
protected static boolean debugOut_
protected static boolean tomsID_
protected String restFormat_
protected String restUrlPath_
public LastFMRestRequester()
tomsID_
class var is false.DEFAULT_IP
,
DEFAULT_USERNAME
,
DEFAULT_PASSWORD
public LastFMRestRequester(boolean useDefault)
DEFAULT_IP
,
DEFAULT_USERNAME
,
DEFAULT_PASSWORD
public LastFMRestRequester(String server, String user, String pass)
public static void setTomsID(boolean tomsId)
tomsID_
.tomsId
- is the value to set this class field to.public static boolean getTomsID()
tomsID_
.public void setRestUrlPath(String restUrlPath)
restUrlPath_
- is the value to set this class field to.public String getRestUrlPath()
private void buildRestUrl()
public StringBuilder sendApiCommand(String apiCommand)
public String sendAuthGetToken()
public StringBuilder requestToken()
public boolean canConnect()
public int deviceAddressStatus(String addr)
public static void main(String[] args)
protected void testCMD(String[] args)
args
- the array of commandLine args that got passed inprotected void restCMD(String[] args)
args
- the array of commandLine args that got passed inprotected void getPropertyCMD(String[] args)
args
- the array of commandLine args that got passed inprotected void templateCMD(String[] args)
args
- the array of commandLine args that got passed inprotected static String getHelpMsgStr()
protected static StringBuilder getHelpMsg()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses