public class AuditService extends AppsPropertyService
GoogleService.AccountDeletedException, GoogleService.AccountDisabledException, GoogleService.CaptchaRequiredException, GoogleService.InvalidCredentialsException, GoogleService.NotVerifiedException, GoogleService.ServiceUnavailableException, GoogleService.SessionExpiredException, GoogleService.TermsNotAgreedException
Service.ClientOutputProperties, Service.GDataRequest, Service.GDataRequestFactory, Service.Versions
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BASE_URL |
APPS_SERVICE, DOMAIN_NAME, HTTPS_PROTOCOL
Constructor and Description |
---|
AuditService(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.
|
AuditService(java.lang.String adminEmail,
java.lang.String adminPassword,
java.lang.String domain,
java.lang.String applicationName)
Parameterized constructor for AuditService.
|
Modifier and Type | Method and Description |
---|---|
GenericEntry |
createAccountInfoRequest(java.lang.String user)
Creates a new Account Information request.
|
GenericEntry |
createMailboxDumpRequest(MailBoxDumpRequest mailBoxDumpRequest)
Creates a new request for obtaining a user mailbox dump.
|
GenericEntry |
createMailMonitor(java.lang.String sourceUser,
MailMonitor mailMonitor)
Creates a new monitoring task to begin an audit.
|
void |
deleteAccountInfoRequest(java.lang.String user,
java.lang.String requestId)
Deletes the account info request for the given user
|
boolean |
deleteMailboxDumpRequest(java.lang.String user,
java.lang.String id)
Deletes the mailbox dump request for the given ID and user.
|
void |
deleteMonitor(java.lang.String sourceUser,
java.lang.String destUser)
Removes the monitor configured for the given source and destination user.
|
GenericEntry |
retrieveAccountInfoRequest(java.lang.String user,
java.lang.String requestId)
Retrieves a previously created account/services related information request
for the given user.
|
java.util.List<GenericEntry> |
retrieveAllAccountInfoRequests(java.util.Date fromDate)
Retrieve all the Account info requests from the given start date.
|
java.util.List<GenericEntry> |
retrieveAllMailboxDumpRequests(java.util.Date fromDate)
Retrieves all mailbox dump requests from the given start date.
|
GenericEntry |
retrieveMailboxDumpRequest(java.lang.String user,
java.lang.String id)
Retrieves the mailbox dump request for the given ID and user.
|
GenericFeed |
retrieveMonitors(java.lang.String sourceUser)
Retrieves all the monitors of a given user.
|
GenericFeed |
retrieveNextPageOfAccountInfoRequests(Link next)
Retrieves the next page of account info requests by following the atom next
link.
|
GenericFeed |
retrieveNextPageOfMailboxDumpRequests(Link next)
Retrieves the next page of mailbox dump requests by following the atom next
link.
|
GenericFeed |
retrievePageOfAccountInfoRequests(java.util.Date fromDate)
Retrieves a page of account info requests from the given optional start
date.
|
GenericFeed |
retrievePageOfMailboxDumpRequests(java.util.Date fromDate)
Retrieves a page of mailbox dump requests from the given start date.
|
GenericEntry |
uploadPublicKey(java.lang.String base64encodedKey)
Upload a public key for signing mailbox dump archives.
|
delete, getEntry, getEntry, getFeed, getFeed, insert, query, update
addCookie, batch, createRequest, delete, getAuthToken, getAuthTokenFactory, getCookieManager, getCookies, getEntry, getFeed, getFeed, getFeed, handlesCookies, makePostRequest, setAuthSubToken, setAuthSubToken, setAuthTokenFactory, setCookieManager, setHandlesCookies, setOAuthCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserCredentials, setUserToken, tokenChanged
createBatchRequest, createDeleteRequest, createEntryRequest, createFeedRequest, createFeedRequest, createInsertRequest, createLinkQueryRequest, createPatchRequest, createUpdateRequest, delete, delete, getAltRegistry, getContentType, getDefaultAltRegistry, getExtensionProfile, getFeed, getMetadataRegistry, getProtocolVersion, getRequestFactory, getSchema, getServiceVersion, getStreamFromLink, getStrictValidation, getVersion, introspect, parseResponseData, patch, patch, query, query, setAcceptLanguage, setAltRegistry, setConnectTimeout, setContentType, setExtensionProfile, setHeader, setOAuthProxyHeaders, setPrivateHeader, setProtocolVersion, setReadTimeout, setRequestFactory, setStrictValidation, setTimeouts, update, useSsl, writeRequestData
public static final java.lang.String BASE_URL
public AuditService(java.lang.String adminEmail, java.lang.String adminPassword, java.lang.String domain, java.lang.String applicationName) throws AuthenticationException
adminEmail
- email id of the administratoradminPassword
- password for the administrator accountdomain
- the domain to be monitoredapplicationName
- application name for e.g audit-mycompanyAuthenticationException
- if an authentication related error occurs.public AuditService(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 GenericEntry createMailMonitor(java.lang.String sourceUser, MailMonitor mailMonitor) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
sourceUser
- is the user who receives or sends messages that are being
audited.mailMonitor
- a POJO with details of the monitoring taskAppsForYourDomainException
- If an Audit 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 retrieveMonitors(java.lang.String sourceUser) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
sourceUser
- user whose monitors are to be retrievedAppsForYourDomainException
- If an Audit 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 deleteMonitor(java.lang.String sourceUser, java.lang.String destUser) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
sourceUser
- the user who is being monitoreddestUser
- this user is the auditor who receives the audited email
messages as blind carbon copies (Bcc).AppsForYourDomainException
- If an Audit 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 uploadPublicKey(java.lang.String base64encodedKey) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
base64encodedKey
- a Base64 encoded, PGP format ASCII read RSA keyAppsForYourDomainException
- If an Audit 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 createMailboxDumpRequest(MailBoxDumpRequest mailBoxDumpRequest) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
uploadPublicKey
and are
available in mbox formatmailBoxDumpRequest
- a POJO with request details.AppsForYourDomainException
- If an Audit 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> retrieveAllMailboxDumpRequests(java.util.Date fromDate) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
fromDate
- optional date in the format 'yyyy-MM-dd hh:mm' in UTC. Pass
null
to retrieve without date filter.AppsForYourDomainException
- If an Audit 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 retrievePageOfMailboxDumpRequests(java.util.Date fromDate) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
fromDate
- optional date in the format 'yyyy-MM-dd hh:mm' in UTC. Pass
null
to retrieve without date filterAppsForYourDomainException
- If an Audit 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 retrieveNextPageOfMailboxDumpRequests(Link next) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
next
- The feed link for next pageAppsForYourDomainException
- If an Audit 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 retrieveMailboxDumpRequest(java.lang.String user, java.lang.String id) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
user
- the user whose dump requests need to be retrievedid
- the requestId of the mailbox dump requestAppsForYourDomainException
- If an Audit 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 deleteMailboxDumpRequest(java.lang.String user, java.lang.String id) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
user
- the user whose dump requests need to be deleted.id
- the requestId of the mailbox dump request.AppsForYourDomainException
- If an Audit 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 createAccountInfoRequest(java.lang.String user) throws AppsForYourDomainException, java.io.IOException, ServiceException
user
- the domain user whose account information is to be auditedAppsForYourDomainException
- If an Audit API error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericEntry retrieveAccountInfoRequest(java.lang.String user, java.lang.String requestId) throws AppsForYourDomainException, java.io.IOException, ServiceException
user
- the user whose account info is being retrievedrequestId
- the unique requestId identifying the requestAppsForYourDomainException
- If an Audit API error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic java.util.List<GenericEntry> retrieveAllAccountInfoRequests(java.util.Date fromDate) throws AppsForYourDomainException, java.io.IOException, ServiceException
fromDate
- optional date in the format 'yyyy-MM-dd hh:mm' in UTC. Pass
null
to retrieve without date filter.AppsForYourDomainException
- If an Audit API error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service failspublic GenericFeed retrievePageOfAccountInfoRequests(java.util.Date fromDate) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
null
for date to retrieve requests without date
filter.fromDate
- optional date in the format 'yyyy-MM-dd hh:mm' in UTC. Pass
null
to retrieve without date filterAppsForYourDomainException
- If an Audit 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 retrieveNextPageOfAccountInfoRequests(Link next) throws AppsForYourDomainException, java.net.MalformedURLException, java.io.IOException, ServiceException
next
- The feed link for next pageAppsForYourDomainException
- If an Audit 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 deleteAccountInfoRequest(java.lang.String user, java.lang.String requestId) throws AppsForYourDomainException, java.io.IOException, ServiceException
user
- the user whose request is to be deletedrequestId
- the unique id of the requestAppsForYourDomainException
- If an Audit API error occursjava.io.IOException
- If a network I/O related error occursServiceException
- If the API service fails