com.kii.sdk.photocolle
Class PhotoColle

java.lang.Object
  extended by com.kii.sdk.photocolle.PhotoColle

public class PhotoColle
extends Object


Constructor Summary
PhotoColle(Context androidContext, AuthenticationContext authenticationContext)
          Constructor of this class.
 
Method Summary
 AuthenticationContext getAuthenticationContext()
          Get AuthenticationContext object.
 CapacityInfo getCapacityInfo()
          Confirm maximum space and free space of this user.
 ContentBodyInfo getContentBodyInfo(FileType fileType, ContentGUID contentGUID, ResizeType resizeType)
          Get content body data.
 ListResponse<ContentGUID> getContentDeletionHistory(FileType fileType, Date minDateDeleted, Integer maxResults, Integer start)
          Get the list of deleted content information.
 ListResponse<ContentInfo> getContentIDList(FileType fileType, boolean forDustbox, DateFilter dateFilter, Integer maxResults, Integer start, SortType sortType)
          Get the list of content information.
 ListResponse<DetailedContentInfo> getContentIDListWithTags(ProjectionType projectionType, FileType fileType, List<TagHead> criteriaList, boolean forDustbox, DateFilter dateFilter, Integer maxResults, Integer start, SortType sortType)
          Get the list of content information with tags.
 ContentThumbnailInfoList getContentThumbnailInfo(ContentGUID... contentGUIDs)
          Get thumbnails.
 ListResponse<Tag> getTagIDList(Category category, FileType fileType, Date minDateModified)
          Get the list of tag information.
 DataID uploadContentBody(FileType fileType, String fileName, long size, MimeType mimeType, InputStream bodyStream)
          Upload a content body data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhotoColle

public PhotoColle(Context androidContext,
                  AuthenticationContext authenticationContext)
           throws ParameterException
Constructor of this class.

Parameters:
androidContext - Android context (Activity or so).
authenticationContext - a context of an authentication.
Throws:
ParameterException - One or more arguments are invalid.
Method Detail

getAuthenticationContext

public AuthenticationContext getAuthenticationContext()
Get AuthenticationContext object.

Returns:
an AuthenticationContext object.

getContentIDList

public ListResponse<ContentInfo> getContentIDList(FileType fileType,
                                                  boolean forDustbox,
                                                  DateFilter dateFilter,
                                                  Integer maxResults,
                                                  Integer start,
                                                  SortType sortType)
                                           throws ApplicationLayerException,
                                                  ConnectionException,
                                                  HttpException,
                                                  ParameterException,
                                                  ResponseBodyParseException,
                                                  InvalidTokenException
Get the list of content information. Do not call this method on the main thread.

Parameters:
fileType - The file type to select contents. This API does not support ALL.
forDustbox - The flag to select contents from dust box or not.
dateFilter - The filter of minimum date time. Contents are selected if contents's date time is equal or greater than this value. This parameter is optional. ModifiedDateFilter or UploadDateFilter can be used as this parameter.
maxResults - The maximum of results in list. This parameter is optional. If this parameter is null, then 100 is used. Domain of this parameter is between 1 and 100. Otherwise, this method throws an exception.
start - The start index of selected results. This parameter is optional. If this parameter is null, then 1 is used. Domain of this parameter is equal or greater than 1. Otherwise, this method throws an exception.
sortType - Type of sort. This method can not use SortType.SCORE_DESC.
Returns:
The list of target content information.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

getContentIDListWithTags

public ListResponse<DetailedContentInfo> getContentIDListWithTags(ProjectionType projectionType,
                                                                  FileType fileType,
                                                                  List<TagHead> criteriaList,
                                                                  boolean forDustbox,
                                                                  DateFilter dateFilter,
                                                                  Integer maxResults,
                                                                  Integer start,
                                                                  SortType sortType)
                                                           throws ApplicationLayerException,
                                                                  ConnectionException,
                                                                  HttpException,
                                                                  ParameterException,
                                                                  ResponseBodyParseException,
                                                                  InvalidTokenException
Get the list of content information with tags. Do not call this method on the main thread.

Parameters:
projectionType - The type of projection rule. If projectionType is FILE_COUNT, then fileType is only meaningful parameter. Other parameters are ignored.
fileType - The file type to select contents.
criteriaList - The tags to select contents. This parameter is optional. This list can have five tags at the maximum. If this list has more than five tags, then this method throws an exception.
forDustbox - The flag to select contents from dust box or not.
dateFilter - The filter of minimum date time. Contents are selected if content's date time is equal or greater than this value. This parameter is optional. ModifiedDateFilter or UploadDateFilter can be used as this parameter.
maxResults - The maximum of results in list. This parameter is optional. If this parameter is null, then 1000 is used. Domain of this parameter is between 1 and 1000. Otherwise, this method throws an exception.
start - The start index of selected results. This parameter is optional. If this parameter is null, then 1 is used. Domain of this parameter is equal or greater than 1. Otherwise, this method throws an exception.
sortType - Type of sort.
Returns:
The list of target content information.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

getTagIDList

public ListResponse<Tag> getTagIDList(Category category,
                                      FileType fileType,
                                      Date minDateModified)
                               throws ApplicationLayerException,
                                      ConnectionException,
                                      HttpException,
                                      ParameterException,
                                      ResponseBodyParseException,
                                      InvalidTokenException
Get the list of tag information. Do not call this method on the main thread.

Parameters:
category - The category to select tags.
fileType - The file type of content to select tags. This parameter is optional.
minDateModified - The filter of minimum modified date time. Tags are selected if tag's modified date time is equal or greater than this value. This parameter is optional.
Returns:
The list of tag information.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

getContentDeletionHistory

public ListResponse<ContentGUID> getContentDeletionHistory(FileType fileType,
                                                           Date minDateDeleted,
                                                           Integer maxResults,
                                                           Integer start)
                                                    throws ApplicationLayerException,
                                                           ConnectionException,
                                                           HttpException,
                                                           ParameterException,
                                                           ResponseBodyParseException,
                                                           InvalidTokenException
Get the list of deleted content information. Do not call this method on the main thread.

Parameters:
fileType - The file type to select contents. This API does not support ALL.
minDateDeleted - The filter of minimum deleted date time. Contents are selected if content's deleted date time is equal or greater than this value. This parameter is optional.
maxResults - The maximum of results in list. This parameter is optional. If this parameter is null, then 100 is used. Domain of this parameter is between 1 and 100. Otherwise, this method throws an exception.
start - The start index of selected results. This parameter is optional. If this parameter is null, then 1 is used. Domain of this parameter is equal or greater than 1. Otherwise, this method throws an exception.
Returns:
The list of deleted content information.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

getContentBodyInfo

public ContentBodyInfo getContentBodyInfo(FileType fileType,
                                          ContentGUID contentGUID,
                                          ResizeType resizeType)
                                   throws ApplicationLayerException,
                                          ConnectionException,
                                          HttpException,
                                          ParameterException,
                                          ResponseBodyParseException,
                                          InvalidTokenException
Get content body data. Do not call this method on the main thread.

Parameters:
fileType - The file type for selecting content. This API does not support ALL.
contentGUID - guid of selecting content.
resizeType - The resize type. if ResizeType.RESIZED_IMAGE or ResizeType.RESIZED_VIDEO is selected, then returned content is resized. resizeType is restricted by fileType. Detail of the restrictions are shown by following table:
FileType Allowed ResizeType
IMAGE ORIGINAL, RESIZED_IMAGE
SLIDE_MOVIE ORIGINAL, RESIZED_IMAGE
VIDEO ORIGINAL, RESIZED_IMAGE, RESIZED_VIDEO
Returns:
Content body data.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

getContentThumbnailInfo

public ContentThumbnailInfoList getContentThumbnailInfo(ContentGUID... contentGUIDs)
                                                 throws ApplicationLayerException,
                                                        ConnectionException,
                                                        HttpException,
                                                        ParameterException,
                                                        ResponseBodyParseException,
                                                        InvalidTokenException
Get thumbnails. Do not call this method on the main thread.

Parameters:
contentGUIDs - The guids to select thumbnails. This parameter has 30 guids at the maximum.
Returns:
A list of thumbnails.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

uploadContentBody

public DataID uploadContentBody(FileType fileType,
                                String fileName,
                                long size,
                                MimeType mimeType,
                                InputStream bodyStream)
                         throws UploadException,
                                ConnectionException,
                                HttpException,
                                ParameterException,
                                ResponseBodyParseException,
                                InvalidTokenException
Upload a content body data. Do not call this method on the main thread.

Parameters:
fileType - The file type of this content. This method can not use FileType.SLIDE_MOVIE.
fileName - The file name with extension of this content.
size - The data size of this content. If fileType equals IMAGE, the maximum of size is 30MB. If fileType equals VIDEO, the maximum of size is 100MB.
mimeType - The mimeType of this content. mimeType is restricted by fileType. Detail of the restrictions are shown by following table:
FileType Allowed MimeType
IMAGE JPEG, PJPEG
VIDEO THREE_GP, AVI, QUICKTIME, MP4, VND_MTS, MPEG
bodyStream - Data to upload. If fileType equals IMAGE, the maximum of data size is 30MB. If fileType equals VIDEO, the maximum of data size is 100MB. (Same as size parameter)
Returns:
ID of this uploaded content. This ID is assigned by server.
Throws:
UploadException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.

getCapacityInfo

public CapacityInfo getCapacityInfo()
                             throws ApplicationLayerException,
                                    ConnectionException,
                                    HttpException,
                                    ParameterException,
                                    ResponseBodyParseException,
                                    InvalidTokenException
Confirm maximum space and free space of this user. Do not call this method on the main thread.

Returns:
Maximum space and free space of this user. maximum space can be negative if server does not response maximum space.
Throws:
ApplicationLayerException - a sending request is failed to execute on a server.
ConnectionException - network IO error occurred.
HttpException - received unexpected status code in HTTP session.
ParameterException - parameter is invalid.
ResponseBodyParseException - this method received unexpected response body data from server
InvalidTokenException - token is expired.