public class MoxtraClient extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
MoxtraClient.AuthProblemException |
protected class |
MoxtraClient.HeaderValue |
class |
MoxtraClient.OAuth2Authorizer
Builder-style helper for Moxtra authorization via OAuth2.
|
protected class |
MoxtraClient.RESTClient
Oltu HTTP client implementation using Apache HTTP Client.
|
protected class |
MoxtraClient.RESTError |
protected class |
MoxtraClient.RESTResponse |
| Constructor and Description |
|---|
MoxtraClient(String oauthClientId,
String oauthClientSecret,
String oauthClientSchema,
String oauthClientHost)
Moxtra client using OAuth2 authentication.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
accessToken() |
MoxtraClient.OAuth2Authorizer |
authorizer()
Authorize via OAuth2 flow.
|
protected void |
checkError(MoxtraClient.RESTResponse resp) |
void |
createMeet(MoxtraMeet meet)
Create new Moxtra meet and join its users as participants.
|
void |
deleteBinder(MoxtraBinder binder)
Delete Moxtra binder.
|
void |
deleteMeet(MoxtraMeet meet)
Delete Moxtra meet by its session key (meet id).
|
MoxtraMeet |
findMeet(String binderId,
Date date)
Deprecated.
|
MoxtraBinder |
getBinder(String binderId) |
List<MoxtraUser> |
getContacts(MoxtraUser user) |
protected List<MoxtraUser> |
getContacts(String userId) |
MoxtraUser |
getCurrentUser() |
MoxtraMeet |
getMeet(String sessionKey)
Get meet info from Moxtra.
Don't use this remote for getting meet's all metadata as Moxtra doesn't return such fields as agenda, auto_recording, startmeet_url. |
MoxtraMeet |
getMeetBinder(String binderId)
Deprecated.
|
List<MoxtraMeetRecording> |
getMeetRecordings(MoxtraMeet meet) |
List<MoxtraMeet> |
getMeets(Date from,
Integer toDays)
Find current user meets in given time period.
|
List<MoxtraMeet> |
getMeets(String moxtraUserId,
Date startsFrom,
Integer days)
Get meets for given user (by id) and time period.
|
protected String |
getMeetStatus(String sessionKey) |
protected AccessToken |
getOAuthToken() |
MoxtraMeet |
getUpdateMeet(String sessionKey)
Deprecated.
|
MoxtraUser |
getUser(String userId) |
protected void |
initOAuthToken(AccessToken newToken) |
boolean |
inviteMeetUsers(MoxtraMeet meet)
Invite users from given
MoxtraMeet to the remote meet. |
boolean |
inviteUsers(MoxtraBinder binder)
Invite users from
MoxtraBinder to the remote binder. |
boolean |
isAuthorized()
Checks if this client is already authorized to access Moxtra services.
|
protected boolean |
isNull(org.exoplatform.ws.frameworks.json.value.JsonValue json) |
protected MoxtraClient.RESTError |
readError(MoxtraClient.RESTResponse resp) |
protected MoxtraMeet |
readMeet(org.exoplatform.ws.frameworks.json.value.JsonValue vmeet) |
void |
refreshMeet(MoxtraMeet meet)
Refresh given (local) meet with recent information from Moxtra.
|
void |
removeUsers(MoxtraBinder binder)
Remove given users from the binder.
|
void |
renameBinder(MoxtraBinder binder)
Rename Moxtra binder.
|
void |
renameMeet(MoxtraMeet meet)
Deprecated.
|
InputStream |
requestGet(String url,
String contentType)
Raw GET request to given URL with OAuth2 access token.
|
protected MoxtraClient.RESTResponse |
restRequest(String url,
String method) |
protected MoxtraClient.RESTResponse |
restRequest(String url,
String method,
String body) |
protected MoxtraClient.RESTResponse |
restRequest(String url,
String method,
String contentType,
String body) |
void |
updateMeet(MoxtraMeet meet)
Update Moxtra meet and join/remove its users as participants.
|
public static final String MOXTRA_USER_ME
public static final String MOXTRA_URL
public static final String API_V1
public static final String API_OAUTH_AUTHORIZE
public static final String API_USER
public static final String API_USER_CONTACTS
public static final String API_USER_MEETS
public static final String API_MEETS_SCHEDULE
public static final String API_MEETS_SESSION
public static final String API_MEETS_INVITEUSER
public static final String API_MEETS_RECORDINGS
public static final String API_MEETS_STATUS
public static final String API_BINDER
public static final String API_BINDER_INVITEUSER
public static final String API_BINDER_REMOVEUSER
public static final String RESPONSE_SUCCESS
public static final String REQUEST_CONTENT_TYPE_JSON
public static final String REQUEST_CONTENT_TYPE_BINARY
public static final String REQUEST_ACCEPT
public static final String RESPONSE_ALLOW
public static final int GET_MEETS_LIST_MAX_DAYS
public static final int DAY_MILLISECONDS
public static final String RESPONSE_ERROR_NOT_FOUND
protected static final Pattern HTML_ERROR_EXTRACT
protected static final String EMPTY
protected static final org.exoplatform.services.log.Log LOG
protected final org.apache.http.client.HttpClient httpClient
protected final org.apache.oltu.oauth2.client.OAuthClient oAuthClient
protected final org.apache.http.protocol.HttpContext context
protected final String oAuthClientId
protected final String oAuthClientSecret
protected final String oAuthClientSchema
protected final String oAuthClientHost
protected final Lock authLock
protected final ReadWriteLock accessLock
protected AccessToken oAuthToken
protected MoxtraClient.OAuth2Authorizer authorizer
public MoxtraClient(String oauthClientId, String oauthClientSecret, String oauthClientSchema, String oauthClientHost)
MoxtraConfigurationExceptionpublic MoxtraClient.OAuth2Authorizer authorizer()
MoxtraClient.OAuth2Authorizerpublic boolean isAuthorized()
true if client is authorized to access Moxtra services, false otherwisepublic MoxtraUser getCurrentUser() throws MoxtraAuthenticationException, MoxtraException
public MoxtraUser getUser(String userId) throws MoxtraAuthenticationException, MoxtraException
public List<MoxtraUser> getContacts(MoxtraUser user) throws MoxtraAuthenticationException, MoxtraException
protected List<MoxtraUser> getContacts(String userId) throws MoxtraAuthenticationException, MoxtraException
@Deprecated public MoxtraMeet getMeetBinder(String binderId) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientException@Deprecated public MoxtraMeet getUpdateMeet(String sessionKey) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
sessionKey - org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic MoxtraMeet getMeet(String sessionKey) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
refreshMeet(MoxtraMeet) instead to refresh available
fields of existing meet. In other cases this method can work only to get actual state of some field or
users (w/ hoster) of the meet, e.g. on meet creation when finally updating local nodes.sessionKey - org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic void refreshMeet(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
meet - MoxtraMeet meet object to refreshorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic List<MoxtraMeet> getMeets(String moxtraUserId, Date startsFrom, Integer days) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
moxtraUserId - StringstartsFrom - Date from this datedays - Integer for number of days, but not more that 30 (will be cut if more)MoxtraMeetorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic List<MoxtraMeet> getMeets(Date from, Integer toDays) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
from - Date from datetoDays - Integer days since the from date, max 30 or it will be cut to the maximumMoxtraMeet, if nothing found it will be emptyorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientException@Deprecated public MoxtraMeet findMeet(String binderId, Date date) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
getMeet(String)
instead.binderId - String scheduled binder iddate - Date date where the meet should have a placeMoxtraMeet of null if nothing foundorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic MoxtraBinder getBinder(String binderId) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic void createMeet(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
null or empty
then no users will be added explicitly. If start time is null then it will be set to a next
minute. If end time is null or before the start time, then it will be adjusted for 30 min
since the start.meet - MoxtraMeetorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic List<MoxtraMeetRecording> getMeetRecordings(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionprotected String getMeetStatus(String sessionKey) throws MoxtraException, MoxtraClientException, MoxtraAuthenticationException
public InputStream requestGet(String url, String contentType) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
url - contentType - org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientException@Deprecated public void renameMeet(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
updateMeet(MoxtraMeet) instead.meet - MoxtraMeetorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionupdateMeet(MoxtraMeet)public void updateMeet(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
null or empty
then no users will be added explicitly. If start time is null then it will be set to a next
minute. If end time is null or before the start time, then it will be adjusted for 30 min
since the start.meet - MoxtraMeetorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic void deleteMeet(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
meet - MoxtraMeetorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic void deleteBinder(MoxtraBinder binder) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
binder - MoxtraBinderorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic void renameBinder(MoxtraBinder binder) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
binder - MoxtraBinderorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic boolean inviteMeetUsers(MoxtraMeet meet) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
MoxtraMeet to the remote meet.meet - MoxtraMeetinviteList - org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic boolean inviteUsers(MoxtraBinder binder) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
MoxtraBinder to the remote binder.binder - MoxtraBinderorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionpublic void removeUsers(MoxtraBinder binder) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
binder - MoxtraBinderorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionprotected MoxtraClient.RESTError readError(MoxtraClient.RESTResponse resp)
protected void initOAuthToken(AccessToken newToken)
protected AccessToken getOAuthToken()
protected String accessToken()
protected void checkError(MoxtraClient.RESTResponse resp) throws MoxtraException
MoxtraExceptionprotected MoxtraClient.RESTResponse restRequest(String url, String method) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionprotected MoxtraClient.RESTResponse restRequest(String url, String method, String body) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionprotected MoxtraClient.RESTResponse restRequest(String url, String method, String contentType, String body) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, MoxtraException, MoxtraClientException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionMoxtraExceptionMoxtraClientExceptionprotected boolean isNull(org.exoplatform.ws.frameworks.json.value.JsonValue json)
protected MoxtraMeet readMeet(org.exoplatform.ws.frameworks.json.value.JsonValue vmeet) throws MoxtraException, org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException, ParseException
MoxtraExceptionorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionParseExceptionCopyright © 2003–2015 eXo Platform SAS. All rights reserved.