|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.okiproject.serviceapi.file.Cabinet
Copyright (c) 2001 Massachusetts Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
They may manage quotas, that is, if the implementation supports quotas, each Agent may be assigned a quota of space used in the Cabinet.
Cabinets contain CabinetEntries, each of which may be a ByteStore or a Cabinet. They are known by their GUIDs and optionally by name, where the name is a string with no syntax, and may represent a filename, e.g. logo.gif or a name and path within a heirarchy, e.g. images/logos/logo1.gif
It is a goal that a Cabinet be representable as a jar file and vice versa. A Cabinet may be converted to a jar file using a method.
One special type of Cabinet is used to store URLs, the implementation is built around java.net.URL. The name of the ByteStore is a URL. The cabinet is read-only, doesn't support quotas or versioning.
ByteStores and Cabinets are added to Cabinets. Cabinets are created in CabinetFactories and ByteStores are created in Cabinets.
Constructor Summary | |
Cabinet()
|
Method Summary | |
void |
add(ByteStore byteStore)
Method add |
void |
add(Cabinet subCabinet)
Method add |
ByteStore |
createByteStore()
Method createByteStore |
ByteStore |
createByteStore(java.lang.String name)
Method createByteStore |
ByteStore |
createByteStore(java.lang.String name,
ByteStore old)
Method createByteStore |
ByteStore |
createTempByteStore()
Method createTempByteStore |
java.util.Enumeration |
entries()
Method entries |
long |
getAvailableBytes()
Method getAvailableBytes |
ByteStore |
getByteStore(org.okiproject.serviceapi.guid.GUID guid)
Method getByteStore |
ByteStore |
getByteStore(java.lang.String name)
Method getByteStore |
CabinetEntry |
getCabinetEntry(org.okiproject.serviceapi.guid.GUID guid)
Method getCabinetEntry |
CabinetEntry |
getCabinetEntry(java.lang.String name)
Method getCabinetEntry |
java.util.Properties |
getProperties()
Method getProperties |
long |
getQuota(org.okiproject.serviceapi.common.Agent owner)
Method getQuota |
long |
getQuotaUsed(org.okiproject.serviceapi.common.Agent owner)
Method getQuotaUsed |
long |
getUsedBytes()
Method getUsedBytes |
void |
remove(ByteStore byteStore)
Method remove |
void |
remove(Cabinet subCabinet)
Method remove |
void |
setQuota(org.okiproject.serviceapi.common.Agent owner,
long quotaBytes)
Method setQuota |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Cabinet()
Method Detail |
public java.util.Properties getProperties()
public ByteStore createTempByteStore()
public ByteStore createByteStore()
public ByteStore createByteStore(java.lang.String name)
name
- public ByteStore createByteStore(java.lang.String name, ByteStore old)
name
- old
- public void add(Cabinet subCabinet)
subCabinet
- public void add(ByteStore byteStore)
byteStore
- public void remove(Cabinet subCabinet)
subCabinet
- public void remove(ByteStore byteStore)
byteStore
- public void setQuota(org.okiproject.serviceapi.common.Agent owner, long quotaBytes)
owner
- quotaBytes
- public long getQuota(org.okiproject.serviceapi.common.Agent owner)
owner
- public long getQuotaUsed(org.okiproject.serviceapi.common.Agent owner)
owner
- public long getAvailableBytes()
public long getUsedBytes()
public ByteStore getByteStore(org.okiproject.serviceapi.guid.GUID guid)
guid
- public ByteStore getByteStore(java.lang.String name)
name
- public java.util.Enumeration entries()
public CabinetEntry getCabinetEntry(org.okiproject.serviceapi.guid.GUID guid)
guid
- public CabinetEntry getCabinetEntry(java.lang.String name)
name
-
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |