public class AppsGroupsService extends AppsPropertyService
GoogleService.AccountDeletedException, GoogleService.AccountDisabledException, GoogleService.CaptchaRequiredException, GoogleService.InvalidCredentialsException, GoogleService.NotVerifiedException, GoogleService.ServiceUnavailableException, GoogleService.SessionExpiredException, GoogleService.TermsNotAgreedException
Service.ClientInputProperties, Service.ClientOutputProperties, Service.ClientStreamProperties, Service.GDataRequest, Service.GDataRequestFactory, Service.Versions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPS_PROP_GROUP_DESC |
static java.lang.String |
APPS_PROP_GROUP_EMAIL |
static java.lang.String |
APPS_PROP_GROUP_ID |
static java.lang.String |
APPS_PROP_GROUP_MEMBER_ID |
static java.lang.String |
APPS_PROP_GROUP_NAME |
static java.lang.String |
APPS_PROP_GROUP_PERMISSION |
static java.lang.String |
APPS_PROP_GROUP_ROLE |
static java.lang.String |
BASE_URL |
java.lang.String |
baseDomainUrl |
APPS_SERVICE, DOMAIN_NAME, HTTPS_PROTOCOL
connectTimeout, extProfile, metadataRegistry, requestFactory
Constructor and Description |
---|
AppsGroupsService(java.lang.String domain,
java.lang.String applicationName)
Parameterized constructor to setup a Service object which can be used to
initialize the service without obtaining a token.
|
AppsGroupsService(java.lang.String adminUser,
java.lang.String adminPassword,
java.lang.String domain,
java.lang.String applicationName)
Parameterized constructor to setup a Service object with user credentials.
|
Modifier and Type | Method and Description |
---|---|
GenericEntry |
addMemberToGroup(java.lang.String groupId,
java.lang.String memberName)
Adds a new member to the group.
|
GenericEntry |
addOwnerToGroup(java.lang.String groupId,
java.lang.String ownerName)
Adds a new member as owner to the group.
|
GenericEntry |
createGroup(java.lang.String groupId,
java.lang.String groupName,
java.lang.String groupDescription,
java.lang.String emailPermission)
Creates a new group in the domain.
|
void |
deleteGroup(java.lang.String groupId)
Deletes a group from the domain.
|
void |
deleteMemberFromGroup(java.lang.String groupId,
java.lang.String memberName)
Removes member subscription to the group.
|
boolean |
doesEntityExist(java.lang.String feedUrlSuffix)
Checks for an available feed from a given Url.
|
GenericFeed |
getNextPage(Link atomLink)
Get the next page from the atom:next link
|
boolean |
isMember(java.lang.String groupId,
java.lang.String memberId)
Checks if an user/group is a member of the group specified.
|
boolean |
isOwner(java.lang.String groupId,
java.lang.String email)
Checks if an user is a owner of the group specified.
|
void |
removeOwnerFromGroup(java.lang.String email,
java.lang.String groupId)
Removes an owner from the group.
|
GenericFeed |
retreiveGroupOwners(java.lang.String groupId)
Retrieves all the owners of a given Group.
|
GenericFeed |
retrieveAllGroups()
Retrieves all groups in a domain as a GenericFeed.
|
GenericFeed |
retrieveAllMembers(java.lang.String groupId)
Retrieves all the members of a group as a GenericFeed.
|
java.util.List<GenericEntry> |
retrieveAllPagesOfGroups()
Retrieves all the pages of the groups feed.
|
GenericEntry |
retrieveGroup(java.lang.String groupId)
Retrieves the group details.
|
GenericFeed |
retrieveGroups(java.lang.String memberName,
boolean directOnly)
Retrieves all groups of the given member.
|
GenericFeed |
retrievePageOfGroups(Link next)
Retrieves next page of groups in a domain as a GenericFeed.
|
GenericFeed |
retrievePageOfMembers(Link next)
Retrieves next page of members of a group as a GenericFeed.
|
GenericEntry |
updateGroup(java.lang.String groupId,
java.lang.String groupName,
java.lang.String groupDescription,
java.lang.String emailPermission)
Updates the group properties.
|
delete, getAllPages, getEntry, getEntry, getFeed, getFeed, insert, query, update
addCookie, batch, createRequest, createRequest, delete, getAuthToken, getAuthTokenFactory, getCookieManager, getCookies, getEntry, getFeed, getFeed, getFeed, handleRedirectException, handlesCookies, handleSessionExpiredException, makePostRequest, setAuthSubToken, setAuthSubToken, setAuthTokenFactory, setCookieManager, setHandlesCookies, setOAuthCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserToken, tokenChanged
classOf, createBatchRequest, createDeleteRequest, createEntryRequest, createFeedRequest, createFeedRequest, createInsertRequest, createLinkQueryRequest, createPatchRequest, createUpdateRequest, delete, delete, endVersionScope, getAltRegistry, getContentType, getDefaultAltRegistry, getExtensionProfile, getFeed, getMetadataRegistry, getProtocolVersion, getRequestFactory, getSchema, getServiceVersion, getStreamFromLink, getStrictValidation, getVersion, initServiceVersion, introspect, parseResponseData, parseResponseData, patch, patch, query, query, setAcceptLanguage, setAltRegistry, setConnectTimeout, setContentType, setExtensionProfile, setHeader, setOAuthProxyHeaders, setPrivateHeader, setProtocolVersion, setReadTimeout, setRequestFactory, setStrictValidation, setTimeouts, startVersionScope, update, useSsl, writeRequestData, writeRequestData
public static final java.lang.String BASE_URL
public final java.lang.String baseDomainUrl
public static final java.lang.String APPS_PROP_GROUP_ID
public static final java.lang.String APPS_PROP_GROUP_NAME
public static final java.lang.String APPS_PROP_GROUP_DESC
public static final java.lang.String APPS_PROP_GROUP_PERMISSION
public static final java.lang.String APPS_PROP_GROUP_MEMBER_ID
public static final java.lang.String APPS_PROP_GROUP_ROLE
public static final java.lang.String APPS_PROP_GROUP_EMAIL
public AppsGroupsService(java.lang.String adminUser, java.lang.String adminPassword, java.lang.String domain, java.lang.String applicationName) throws AuthenticationException
adminUser
- Administrator usernameadminPassword
- Administrator passworddomain
- Domain being configuredapplicationName
- Application name consuming the APIAuthenticationException
- If an authentication error occurspublic AppsGroupsService(java.lang.String domain, java.lang.String applicationName) throws AuthenticationException
setUserCredentials
or setUserToken
when using this
constructor.domain
- Domain being configuredapplicationName
- Application name consuming the APIAuthenticationException
- If an authentication error occurspublic GenericFeed getNextPage(Link atomLink) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
atomLink
- The feed link for next pageAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic boolean doesEntityExist(java.lang.String feedUrlSuffix) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
feedUrlSuffix
- The suffix of the feed URL to be investigated.AppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic boolean isMember(java.lang.String groupId, java.lang.String memberId) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Group to be checked formemberId
- Username/GroupAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic boolean isOwner(java.lang.String groupId, java.lang.String email) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Group ownership to be checked foremail
- Owner's emailAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericEntry createGroup(java.lang.String groupId, java.lang.String groupName, java.lang.String groupDescription, java.lang.String emailPermission) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- A unique identifier for the groupgroupName
- Name of the groupgroupDescription
- A description for the groupemailPermission
- Email permission for userAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericEntry updateGroup(java.lang.String groupId, java.lang.String groupName, java.lang.String groupDescription, java.lang.String emailPermission) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupgroupName
- Name of the group. A null or empty group name will
preserve the old valuegroupDescription
- Description of the group. A null or empty value
will preserve the old valueemailPermission
- Email permissions associated with the group. A null
or empty value will preserve the old valueAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic void deleteGroup(java.lang.String groupId) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericEntry retrieveGroup(java.lang.String groupId) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericEntry addMemberToGroup(java.lang.String groupId, java.lang.String memberName) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupmemberName
- Member username, group name or an email addressAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic void deleteMemberFromGroup(java.lang.String groupId, java.lang.String memberName) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupmemberName
- Member username or group nameAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
public GenericFeed retrieveAllMembers(java.lang.String groupId) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
public GenericFeed retrievePageOfMembers(Link next) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
next
- Atom link to the next pageAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
public GenericEntry addOwnerToGroup(java.lang.String groupId, java.lang.String ownerName) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- Unique ID of the groupownerName
- Member username or group nameAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic void removeOwnerFromGroup(java.lang.String email, java.lang.String groupId) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
email
- Owner email addressgroupId
- Unique ID of the groupAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericFeed retrieveAllGroups() throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
AppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericFeed retrievePageOfGroups(Link next) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
AppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericFeed retrieveGroups(java.lang.String memberName, boolean directOnly) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
memberName
- Member usernamedirectOnly
- If true, members with direct association only will be
consideredAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericFeed retreiveGroupOwners(java.lang.String groupId) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
groupId
- The unique ID of the groupAppsForYourDomainException
- If a Provisioning API error occursjava.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic java.util.List<GenericEntry> retrieveAllPagesOfGroups() throws java.net.MalformedURLException, java.io.IOException, ServiceException
java.net.MalformedURLException
- If a URL related error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service fails