org.javaswift.joss.model
Interface Container

All Superinterfaces:
Comparable<Container>, ListHolder<StoredObject>, ListSubject, ObjectStoreEntity
All Known Subinterfaces:
Website
All Known Implementing Classes:
AbstractContainer, AbstractWebsite, ContainerImpl, ContainerMock, WebsiteImpl, WebsiteMock

public interface Container
extends ObjectStoreEntity, Comparable<Container>, ListHolder<StoredObject>, ListSubject

A Container is the entity that holds StoredObjects. This handle allows you to access those objects and set/get information on the container itself. To make sure a Container exists, you can call exists which places a call to the Object Store for its information. To ascertain the creation of a Container, call its create method. By calling delete, the Container is removed from the Object Store. Containers start out as private, which means that the StoredObjects in the Container can not be accessed through the public URL. Set the Container to public to be able to do this. It is also important to understand that getObject does not create an StoredObject, or otherwise place a call to the Object Store. It just returns a handle for a StoredObject.

Author:
Robert Bor

Method Summary
 Container create()
          Creates a Container in the Account.
 void delete()
          Deletes a Container from the Account.
 boolean exists()
          Checks whether a container exists
 Account getAccount()
           
 long getBytesUsed()
          The number of bytes stored by the StoredObjects in the Container.
 String getContainerReadPermission()
           
 String getcontainerWritePermission()
           
 int getCount()
          The number of StoredObjects in the Container.
 FormPost getFormPost(String redirect, long maxFileSize, long maxFileCount, long seconds)
          Returns a signature that can be used to upload files directly from the browser, using a basic form element.
 StoredObject getObject(String name)
          Returns a handle for an object.
 StoredObject getObjectSegment(String name, int part)
          Returns an object that represents a segment of a single large object
 boolean isInfoRetrieved()
          Returns whether the metadata of the container has been retrieved
 boolean isPublic()
           
 void makePrivate()
          Takes a single Container and makes it private.
 void makePublic()
          Takes a single Container and makes it public.
 void reload()
          Force the Account to reload its metadata
 void setBytesUsed(long bytesUsed)
           
 void setContainerRights(String writePermissions, String readPermissions)
           
 void setCount(int count)
           
 
Methods inherited from interface org.javaswift.joss.model.ObjectStoreEntity
getMetadata, getMetadata, getPath, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setMetadata
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.javaswift.joss.model.ListHolder
getMaxPageSize, getPaginationMap, getPaginationMap, list, list, list
 
Methods inherited from interface org.javaswift.joss.model.ListSubject
getName, metadataSetFromHeaders
 

Method Detail

makePublic

void makePublic()
Takes a single Container and makes it public. ALL (!) the objects in the Container are now public, so be very careful exercising this option. The public URL can now be used to access objects.


makePrivate

void makePrivate()
Takes a single Container and makes it private. All the objects in the Container are now private and can no longer be accessed through the public URL.


create

Container create()
Creates a Container in the Account.


delete

void delete()
Deletes a Container from the Account. Note that the Container must be empty in order to be deleted.


exists

boolean exists()
Checks whether a container exists

Returns:
whether the container exists

getObject

StoredObject getObject(String name)
Returns a handle for an object. Note that this method DOES NOT create an object in the Object Store

Parameters:
name - name of the object to create a handle for
Returns:
the object handle

getObjectSegment

StoredObject getObjectSegment(String name,
                              int part)
Returns an object that represents a segment of a single large object

Parameters:
name - the name of the object to create a handle for
part - the part of the large object that the segment represents
Returns:
the object handle

isInfoRetrieved

boolean isInfoRetrieved()
Returns whether the metadata of the container has been retrieved

Returns:
true if the metadata has been retrieved

reload

void reload()
Force the Account to reload its metadata


getCount

int getCount()
The number of StoredObjects in the Container. If the Container was read by Account.list, this value will not be refetched from the server, unless caching is disabled.

Specified by:
getCount in interface ListHolder<StoredObject>
Returns:
number of StoredObjects

getBytesUsed

long getBytesUsed()
The number of bytes stored by the StoredObjects in the Container. If the Container was read by Account.list, this value will not be refetched from the server, unless caching is disabled.

Returns:
number of bytes

getFormPost

FormPost getFormPost(String redirect,
                     long maxFileSize,
                     long maxFileCount,
                     long seconds)
Returns a signature that can be used to upload files directly from the browser, using a basic form element.

Parameters:
redirect - redirection URL after the upload has succeeded
maxFileSize - max number of bytes allowed to upload
maxFileCount - max number of files allowed to upload
seconds - number of seconds for the temporary URL to be valid
Returns:
FormPost signature for uploading an object directly from the browser

isPublic

boolean isPublic()

setCount

void setCount(int count)

setBytesUsed

void setBytesUsed(long bytesUsed)

getAccount

Account getAccount()

setContainerRights

void setContainerRights(String writePermissions,
                        String readPermissions)

getContainerReadPermission

String getContainerReadPermission()

getcontainerWritePermission

String getcontainerWritePermission()


Copyright © 2012-2014 42 BV. All Rights Reserved.