public abstract class AbstractAccount extends AbstractObjectStoreEntity<AccountInformation> implements Account
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
ALLOW_CACHING, info, staleHeaders| Constructor and Description |
|---|
AbstractAccount(AccountCommandFactory commandFactory,
ContainerFactory<Container> containerFactory,
ContainerFactory<Website> websiteFactory,
boolean allowCaching) |
| Modifier and Type | Method and Description |
|---|---|
Access |
authenticate()
Trigger the authentication against Object Store.
|
protected Metadata |
createMetadataEntry(java.lang.String name,
java.lang.String value) |
Access |
getAccess()
Obtain the Access interface
|
long |
getActualServerTimeInSeconds(long seconds)
Calculate the server time taking into account the number of seconds passed.
|
long |
getBytesUsed()
The number of bytes stored by the StoredObjects in all Containers in the Account.
|
Container |
getContainer(java.lang.String containerName)
Returns a handle for a container.
|
int |
getCount()
The number of child entities (ListSubjects) that are being held by the ListHolder
|
AccountCommandFactory |
getFactory() |
java.lang.String |
getHashPassword()
Returns the hash password originally set on Account.
|
protected void |
getInfo(boolean allowErrorLog) |
int |
getMaxPageSize()
The ObjectStore server will force a maximum page size.
|
int |
getNumberOfCalls()
Returns the number of HTTP calls that have been made to the ObjectStore server.
|
int |
getObjectCount()
The number of StoredObjects in all Containers in the Account.
|
java.lang.String |
getOriginalHost()
Returns the original host, regardless of the configured and private host settings
|
PaginationMap |
getPaginationMap(int pageSize)
Returns a PaginationMap of a listing of Containers.
|
PaginationMap |
getPaginationMap(java.lang.String prefix,
int pageSize)
Returns a PaginationMap of a listing of Containers.
|
java.lang.String |
getPathForEntity() |
java.lang.String |
getPreferredRegion()
Returns the preferred region of the account.
|
java.lang.String |
getPrivateURL()
Returns the private URL which is used for the underlying stored objects
|
java.lang.String |
getPublicURL()
Returns the URL which is used for the underlying stored objects
|
long |
getServerTime()
Returns the server time in milliseconds since 1970
|
Tenants |
getTenants()
Returns the tenants of the account.
|
Website |
getWebsite(java.lang.String containerName)
Returns a handle for a website.
|
void |
increaseCallCounter()
Increase the call counter which tracks how many calls are made to the ObjectStore
|
boolean |
isAllowReauthenticate()
Whether reauthentication on expiration of the authentication token is allowed, or this is done
manually by the client
|
boolean |
isTenantSupplied()
Checks whether a tenant ID and/or name were supplied.
|
java.util.Collection<Container> |
list()
Returns all the containers in an Account.
|
java.util.Collection<Container> |
list(PaginationMap paginationMap,
int page)
Returns a number equal to pageSize of Container elements, starting with the first element
after the Container named the same as marker.
|
java.util.Collection<Container> |
list(java.lang.String prefix,
java.lang.String marker,
int pageSize)
Returns a number equal to pageSize of Container elements, starting with the first element
after the Container named the same as marker.
|
void |
resetContainerCache()
Empties the Container Cache
|
protected void |
saveSpecificMetadata() |
AbstractAccount |
setAllowContainerCaching(boolean allowContainerCaching)
If ContainerCaching is enabled, Account will keep track of its Container instances and reuse them.
|
AbstractAccount |
setAllowReauthenticate(boolean allowReauthenticate)
An ObjectStore authentication token will expire after 24 hours.
|
AbstractAccount |
setHashPassword(java.lang.String hashPassword)
Saves the password to the Account.
|
Account |
setPreferredRegion(java.lang.String preferredRegion)
Set the preferred region for the account.
|
AbstractAccount |
setPrivateHost(java.lang.String privateHost)
Set your own private host to prefix the URLs of objects
|
AbstractAccount |
setPublicHost(java.lang.String publicHost)
Set your own host to prefix the URLs of objects
|
void |
synchronizeWithServerTime()
Compares the local time to the server time and maintains a number of milliseconds to account for the
difference.
|
checkForInfo, checkForInfo, checkForInfoAndAllowHeaderSet, checkForInfoDisallowErrorLog, exists, getMetadata, getMetadata, getPath, invalidate, isAllowCaching, isInfoRetrieved, isStale, reload, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setInfoRetrieved, setMetadataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMetadata, getMetadata, getPath, removeAndDoNotSaveMetadata, removeAndSaveMetadata, saveMetadata, setAndDoNotSaveMetadata, setAndSaveMetadata, setMetadatapublic AbstractAccount(AccountCommandFactory commandFactory, ContainerFactory<Container> containerFactory, ContainerFactory<Website> websiteFactory, boolean allowCaching)
public java.util.Collection<Container> list()
ListHolderlist in interface ListHolder<Container>public java.util.Collection<Container> list(PaginationMap paginationMap, int page)
ListHolderlist in interface ListHolder<Container>paginationMap - the map that is fetched with getPaginationMap and maps from page to markerpage - the page to return the Containers forpublic java.util.Collection<Container> list(java.lang.String prefix, java.lang.String marker, int pageSize)
ListHolderlist in interface ListHolder<Container>prefix - show only the results starting with prefixmarker - the last element on the previous pagepageSize - the number of elements to returnpublic PaginationMap getPaginationMap(java.lang.String prefix, int pageSize)
ListHoldergetPaginationMap in interface ListHolder<Container>prefix - the names must start with the prefix or else will be filtered outpageSize - number of elements on a single pagepublic PaginationMap getPaginationMap(int pageSize)
ListHoldergetPaginationMap in interface ListHolder<Container>pageSize - number of elements on a single pagepublic java.lang.String getHashPassword()
AccountgetHashPassword in interface Accountpublic AbstractAccount setHashPassword(java.lang.String hashPassword)
AccountsetHashPassword in interface AccounthashPassword - the password to use for generating the hashespublic AbstractAccount setPublicHost(java.lang.String publicHost)
AccountsetPublicHost in interface AccountpublicHost - host of an object's URLpublic AbstractAccount setPrivateHost(java.lang.String privateHost)
AccountsetPrivateHost in interface AccountprivateHost - host of an object's private URLpublic AbstractAccount setAllowReauthenticate(boolean allowReauthenticate)
AccountsetAllowReauthenticate in interface AccountallowReauthenticate - whether reauthentication is allowedpublic AbstractAccount setAllowContainerCaching(boolean allowContainerCaching)
AccountsetAllowContainerCaching in interface AccountallowContainerCaching - whether container caching is allowedpublic Account setPreferredRegion(java.lang.String preferredRegion)
AccountsetPreferredRegion in interface AccountpreferredRegion - the preferred region for the accountpublic boolean isAllowReauthenticate()
AccountisAllowReauthenticate in interface Accountpublic int getCount()
ListHoldergetCount in interface ListHolder<Container>public long getBytesUsed()
AccountgetBytesUsed in interface Accountpublic int getObjectCount()
AccountgetObjectCount in interface Accountpublic long getServerTime()
AccountgetServerTime in interface Accountpublic long getActualServerTimeInSeconds(long seconds)
AccountgetActualServerTimeInSeconds in interface Accountseconds - number of seconds after the actual server timepublic void synchronizeWithServerTime()
AccountsynchronizeWithServerTime in interface Accountprotected Metadata createMetadataEntry(java.lang.String name, java.lang.String value)
createMetadataEntry in class AbstractObjectStoreEntity<AccountInformation>public int getMaxPageSize()
ListHoldergetMaxPageSize in interface ListHolder<Container>public void increaseCallCounter()
AccountincreaseCallCounter in interface Accountpublic int getNumberOfCalls()
AccountgetNumberOfCalls in interface Accountpublic AccountCommandFactory getFactory()
public Access authenticate()
Accountauthenticate in interface Accountpublic Access getAccess()
Accountpublic java.lang.String getPreferredRegion()
AccountgetPreferredRegion in interface Accountpublic java.lang.String getPublicURL()
AccountgetPublicURL in interface Accountpublic java.lang.String getPrivateURL()
AccountgetPrivateURL in interface Accountprotected void saveSpecificMetadata()
saveSpecificMetadata in class AbstractObjectStoreEntity<AccountInformation>protected void getInfo(boolean allowErrorLog)
getInfo in class AbstractObjectStoreEntity<AccountInformation>public Tenants getTenants()
AccountgetTenants in interface Accountpublic boolean isTenantSupplied()
AccountisTenantSupplied in interface Accountpublic java.lang.String getPathForEntity()
throws java.io.UnsupportedEncodingException
getPathForEntity in class AbstractObjectStoreEntity<AccountInformation>java.io.UnsupportedEncodingExceptionpublic Container getContainer(java.lang.String containerName)
AccountgetContainer in interface AccountcontainerName - name of the container to create a handle forpublic Website getWebsite(java.lang.String containerName)
AccountgetWebsite in interface AccountcontainerName - name of the website to create a handle forpublic void resetContainerCache()
AccountresetContainerCache in interface Accountpublic java.lang.String getOriginalHost()
AccountgetOriginalHost in interface AccountCopyright © 2012-2020 42 BV. All Rights Reserved.