|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.techventus.server.voice.Voice
public class Voice
The Class Voice. This class is the basis of the entire API and contains all the components necessary to connect and authenticate with Google Voice, place calls and SMS, and pull in the raw data from the account.
Field Summary | |
---|---|
(package private) static java.lang.String |
ACCOUNT_TYPE
Type of account to request authorization for. |
(package private) java.lang.String |
general
|
(package private) static java.lang.String |
generalSettingsURLString
|
(package private) static java.lang.String |
generalURLString
|
(package private) static java.lang.String |
groupsInfoURLString
|
(package private) static java.lang.String |
groupsSettingsURLString
|
(package private) static java.lang.String |
inboxURLString
|
(package private) static java.lang.String |
loginURLString
|
(package private) static java.lang.String |
missedURLString
|
(package private) static java.lang.String |
phoneEnableURLString
|
(package private) java.lang.String |
phonesInfo
|
(package private) static java.lang.String |
phonesInfoURLString
|
(package private) static java.lang.String |
placedURLString
|
boolean |
PRINT_TO_CONSOLE
|
(package private) static java.lang.String |
receivedURLString
|
(package private) static java.lang.String |
recentAllURLString
|
(package private) static java.lang.String |
recordedURLString
|
(package private) java.lang.String |
rnrSEE
|
(package private) static java.lang.String |
SERVICE
Name of the Google service you're requesting authorization for. |
(package private) static java.lang.String |
smsURLString
|
(package private) java.lang.String |
source
Short string identifying your application, for logging purposes. |
(package private) static java.lang.String |
spamURLString
|
(package private) static java.lang.String |
starredURLString
|
(package private) static java.lang.String |
trashURLString
|
(package private) static java.lang.String |
USER_AGENT
|
(package private) static java.lang.String |
voicemailInfoURLString
|
(package private) static java.lang.String |
voicemailURLString
|
Constructor Summary | |
---|---|
Voice(java.lang.String user,
java.lang.String pass)
Instantiates a new Voice Object. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source)
A constructor which which allows a custom source. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source,
boolean printDebugIntoToSystemOut)
Instantiates a new voice. |
|
Voice(java.lang.String user,
java.lang.String pass,
java.lang.String source,
java.lang.String rnrSee)
Deprecated. |
Method Summary | |
---|---|
java.lang.String |
call(java.lang.String originNumber,
java.lang.String destinationNumber,
java.lang.String phoneType)
Place a call. |
java.lang.String |
cancelCall(java.lang.String originNumber,
java.lang.String destinationNumber,
java.lang.String phoneType)
Cancel a call that was just placed. |
(package private) java.lang.String |
get(java.lang.String urlString)
HTML GET request for a given URL String. |
(package private) java.lang.String |
get(java.lang.String urlString,
int page)
HTML GET request for a given URL String and a given page number |
java.lang.String |
getGeneral()
Fetches the page Source Code for the Voice homepage. |
java.lang.String |
getGeneralPage(int page)
|
java.util.List<java.lang.String> |
getGroupSettingsList(boolean forceUpdate)
Returns the Group list - Lazy |
java.lang.String |
getInbox()
Fetches and returns the raw page source code for the Inbox. |
java.lang.String |
getInboxPage(int page)
|
java.lang.String |
getMissed()
Gets the missed calls source code. |
java.lang.String |
getMissedPage(int page)
|
java.lang.String |
getONLYFORTEST(java.lang.String urlString)
|
java.util.List<PhoneOld> |
getPhoneList(boolean forceUpdate)
Returns the phone list - Lazy TODO move this function in the Settings class |
java.lang.String |
getPlaced()
Gets the raw source code for the placed calls page. |
java.lang.String |
getPlacedPage(int page)
|
java.lang.String |
getRawPhonesInfo()
|
java.lang.String |
getReceived()
Gets the received calls source code. |
java.lang.String |
getReceivedPage(int page)
|
java.lang.String |
getRecent()
Gets the raw page source code for the recent items. |
java.lang.String |
getRecentPage(int page)
|
java.lang.String |
getRecorded()
Gets the page source for the recorded calls. |
java.lang.String |
getRecordedPage(int page)
|
AllSettings |
getSettings(boolean forceUpdate)
returns all users settings - lazy |
java.lang.String |
getSMS()
Gets the SMS page raw source code. |
java.lang.String |
getSMSPage(int page)
|
java.lang.String |
getSpam()
Gets the page source for the spam. |
java.lang.String |
getSpamPage(int page)
|
java.lang.String |
getStarred()
Gets the raw page source code for the starred items. |
java.lang.String |
getStarredPage(int page)
|
java.util.List<Greeting> |
getVoicemailList(boolean forceUpdate)
Returns the Greeting list - Lazy |
boolean |
isLoggedIn()
Fires a Get request for Recent Items. |
void |
login()
Login Method to refresh authentication with Google Voice. |
java.lang.String |
phoneDisable(int ID)
Disable one of the the phones attached to the account from ringing. |
java.lang.String |
phoneEnable(int ID)
Enables one of the the phones attached to the account from ringing. |
void |
phonesDisable(int[] IDs)
Disables multiple phones in one post TODO Test this with multiple phones in an account Make faster - spawn threads Best would be to be able to construct a url which can switch multiple phones at a time |
void |
phonesEnable(int[] IDs)
Enables multiple phones in one post TODO Test this with multiple phones in an account Best would be to be able to construct a url which can switch multiple phones at a time |
java.lang.String |
sendSMS(java.lang.String destinationNumber,
java.lang.String txt)
Send an SMS |
java.lang.String |
setCallPresentation(boolean announceCaller)
Enables/disables the call Announcement setting (general for all phones) |
java.lang.String |
setDoNotDisturb(boolean dndEnabled)
Activated or deactivated the Do Not disturb function. Enable this to send to voicemail all calls made to your Google number. |
java.lang.String |
setNewGroupSettings(Group group)
Applies the settings for this group |
java.lang.String |
setVoicemailGreetingId(java.lang.String greetingToSet)
This is the general voicemail greeting callers hear |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean PRINT_TO_CONSOLE
java.lang.String general
java.lang.String phonesInfo
java.lang.String rnrSEE
java.lang.String source
static final java.lang.String USER_AGENT
static final java.lang.String ACCOUNT_TYPE
static final java.lang.String SERVICE
static final java.lang.String generalURLString
static final java.lang.String loginURLString
static final java.lang.String inboxURLString
static final java.lang.String starredURLString
static final java.lang.String recentAllURLString
static final java.lang.String spamURLString
static final java.lang.String trashURLString
static final java.lang.String voicemailURLString
static final java.lang.String smsURLString
static final java.lang.String recordedURLString
static final java.lang.String placedURLString
static final java.lang.String receivedURLString
static final java.lang.String missedURLString
static final java.lang.String phoneEnableURLString
static final java.lang.String generalSettingsURLString
static final java.lang.String phonesInfoURLString
static final java.lang.String groupsInfoURLString
static final java.lang.String voicemailInfoURLString
static final java.lang.String groupsSettingsURLString
Constructor Detail |
---|
@Deprecated public Voice(java.lang.String user, java.lang.String pass, java.lang.String source, java.lang.String rnrSee) throws java.io.IOException
user
- the userpass
- the passsource
- the sourcernrSee
- the rnr see
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass, java.lang.String source) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the passwordsource
- Short string identifying your application, for logging purposes. This string should take the form:
"companyName-applicationName-versionID". See: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Request
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the pass
java.io.IOException
- Signals that an I/O exception has occurred.public Voice(java.lang.String user, java.lang.String pass, java.lang.String source, boolean printDebugIntoToSystemOut) throws java.io.IOException
user
- the username in the format of user@gmail.com or user@googlemail.compass
- the passwordsource
- the arbitrary source identifier. Can be anything.printDebugIntoToSystemOut
- the print debug into to system out
java.io.IOException
- Signals that an I/O exception has occurred.Method Detail |
---|
public java.util.List<PhoneOld> getPhoneList(boolean forceUpdate) throws java.io.IOException
refresh
- - set to true to force a List update from the server
java.io.IOException
public java.util.List<Greeting> getVoicemailList(boolean forceUpdate) throws java.io.IOException, gvjava.org.json.JSONException
refresh
- - set to true to force a List update from the server
java.io.IOException
gvjava.org.json.JSONException
public java.util.List<java.lang.String> getGroupSettingsList(boolean forceUpdate) throws java.io.IOException
refresh
- - set to true to force a List update from the server
java.io.IOException
public AllSettings getSettings(boolean forceUpdate) throws java.io.IOException, gvjava.org.json.JSONException
forceUpdate
-
java.io.IOException
gvjava.org.json.JSONException
public java.lang.String getInbox() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getInboxPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getGeneral() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getGeneralPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getStarred() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getStarredPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getRecent() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getRecentPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getSpam() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getSpamPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getRecorded() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getRecordedPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getPlaced() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getPlacedPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getReceived() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getReceivedPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getMissed() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getMissedPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getSMS() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getSMSPage(int page) throws java.io.IOException
java.io.IOException
public java.lang.String getRawPhonesInfo() throws java.io.IOException
java.io.IOException
public java.lang.String call(java.lang.String originNumber, java.lang.String destinationNumber, java.lang.String phoneType) throws java.io.IOException
originNumber
- the origin numberdestinationNumber
- the destination numberphoneType
- the phone type, this is a number such as 1,2,7 formatted as a String
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String cancelCall(java.lang.String originNumber, java.lang.String destinationNumber, java.lang.String phoneType) throws java.io.IOException
originNumber
- the origin numberdestinationNumber
- the destination numberphoneType
- the phone type
java.io.IOException
- Signals that an I/O exception has occurred.public void phonesEnable(int[] IDs) throws java.io.IOException
IDs
- Array of Phones to enable
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String phoneEnable(int ID) throws java.io.IOException
ID
- the iD
java.io.IOException
- Signals that an I/O exception has occurred.public void phonesDisable(int[] IDs) throws java.io.IOException
IDs
- Array of Phones to disable
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String phoneDisable(int ID) throws java.io.IOException
ID
- the iD
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setCallPresentation(boolean announceCaller) throws java.io.IOException
announceCaller
- java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setVoicemailGreetingId(java.lang.String greetingToSet) throws java.io.IOException
greetingToSet
- java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String setDoNotDisturb(boolean dndEnabled) throws java.io.IOException
dndEnabled
- true to enable dnd, false to disable it
java.io.IOException
public java.lang.String setNewGroupSettings(Group group) throws java.io.IOException
group
-
java.io.IOException
public java.lang.String sendSMS(java.lang.String destinationNumber, java.lang.String txt) throws java.io.IOException
destinationNumber
- the destination numbertxt
- the Text of the message. Messages longer than the allowed
character length will be split into multiple messages.
java.io.IOException
- Signals that an I/O exception has occurred.public java.lang.String getONLYFORTEST(java.lang.String urlString) throws java.io.IOException
java.io.IOException
java.lang.String get(java.lang.String urlString) throws java.io.IOException
urlString
- the url string
java.io.IOException
- Signals that an I/O exception has occurred.java.lang.String get(java.lang.String urlString, int page) throws java.io.IOException
urlString
- the url stringpage
- number must be a natural number
java.io.IOException
- Signals that an I/O exception has occurred.public void login() throws java.io.IOException
java.io.IOException
- Signals that an I/O exception has occurred.public boolean isLoggedIn()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |