|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.universe.server.UniverseLocal
public class UniverseLocal
Universe local. Relative paths are NEVER allowed.
There are some places where lock races could occur. For this simple server, it isn't much of a deal. If they become a problem, I'll fix them later. It's mostly the time between a lock is checked and the operation is actually done, like in delete.
CONFIGS:
CONFIG_PATH "path" = root path to universe
Version History
EPG - New - 2 JUL 04 EPG - Add multi-Strings. It's a bit messy now - 10 AUG 06
Field Summary |
---|
Fields inherited from interface things.universe.Universe |
---|
CONFIG_CLEARANCE, CONFIG_LIST, CONFIG_NAME, CONFIG_PATH, CONFIG_ROOT, CONFIG_TYPE, CONFIG_TYPE_LOCAL |
Constructor Summary | |
---|---|
UniverseLocal()
|
Method Summary | |
---|---|
void |
delete(java.lang.String... name)
Delete an object. |
void |
deleteByKey(java.lang.String key)
Delete an object. |
boolean |
exists(java.lang.String... name)
Check to see if an object exists |
java.lang.String |
feature(java.lang.String name,
ThingsPropertyView params)
Activate a feature by name. |
java.lang.String |
featureByKey(java.lang.String key,
ThingsPropertyView params)
Activate a feature by name. |
void |
finalizeUniverse()
This will always be called when the universe is accessor is destroyed. |
void |
genesis(java.lang.String path,
UniverseID uid)
This will always be called when the universe server is created. |
UniverseID |
getId()
Get the id for this universe. |
Accessor |
getObjectAccessor(java.lang.String... name)
Get an object accessor for the named object. |
java.io.InputStream |
getStream(java.lang.String... name)
Get an InputStream that can read from the universe object |
java.io.InputStream |
getStreamByKey(java.lang.String key)
Get an InputStream that can read from the universe object. |
java.lang.String |
getValidatedName(java.lang.String... name)
Get a validated name for the object. |
boolean |
isLocked(java.lang.String... name)
Check to see if the object is locked. |
long |
lastModifiedDate(java.lang.String... name)
Get the last modified date in milliseconds from epoch time. |
java.lang.String |
lock(java.lang.String... name)
Lock an object. |
java.io.File |
makeLocal(java.lang.String... name)
Make a local reference or copy of the object in a FILE. |
java.util.Collection<java.lang.String> |
match(java.lang.String... name)
Get all the object names that match the path. |
java.io.OutputStream |
putStream(java.lang.String... name)
Get an OutputStream that can write to the universe object. |
java.io.OutputStream |
putStreamAppender(java.lang.String... name)
Get an OutputStream that can write to the universe object. |
java.io.OutputStream |
putStreamAppenderByKey(java.lang.String key)
Get an OutputStream that can write to the universe object. |
java.io.OutputStream |
putStreamByKey(java.lang.String key)
Get an OutputStream that can write to the universe object. |
void |
releaseLocal(java.io.File theLocalFile)
Release a local reference or copy of the object in a FILE. |
java.lang.String |
reserveUnique(java.lang.String base)
Reserve unique object in the universe. |
long |
size(java.lang.String... name)
Report the size object from the universe in bytes. |
boolean |
unlock(java.lang.String key)
Unlock an object using a key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UniverseLocal()
Method Detail |
---|
public UniverseID getId() throws UniverseException
getId
in interface Universe
UniverseException
UniverseID
public java.lang.String getValidatedName(java.lang.String... name) throws UniverseException
getValidatedName
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public Accessor getObjectAccessor(java.lang.String... name) throws UniverseException
getObjectAccessor
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public java.io.InputStream getStream(java.lang.String... name) throws UniverseException
getStream
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public java.io.InputStream getStreamByKey(java.lang.String key) throws UniverseException
getStreamByKey
in interface Universe
key
- a valid key for the object
UniverseException
public java.io.OutputStream putStream(java.lang.String... name) throws UniverseException
putStream
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public java.io.OutputStream putStreamByKey(java.lang.String key) throws UniverseException
putStreamByKey
in interface Universe
key
- a valid key for the object
UniverseException
public java.io.OutputStream putStreamAppender(java.lang.String... name) throws UniverseException
putStreamAppender
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public java.io.OutputStream putStreamAppenderByKey(java.lang.String key) throws UniverseException
putStreamAppenderByKey
in interface Universe
key
- a valid key for the object
UniverseException
public java.lang.String reserveUnique(java.lang.String base) throws UniverseException
reserveUnique
in interface Universe
base
- base path for the object (including root object name)
UniverseException
public java.lang.String lock(java.lang.String... name) throws UniverseException
lock
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public boolean unlock(java.lang.String key) throws UniverseException
unlock
in interface Universe
key
- a key that can unlock it
UniverseException
public boolean isLocked(java.lang.String... name) throws UniverseException
isLocked
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public java.io.File makeLocal(java.lang.String... name) throws UniverseException
This will lock the object until released. No other operations will be allowed.
This could be a good way to subvert security, if the implementation allows it. It is up to the implementation to keep the world safe from local files.
makeLocal
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public void releaseLocal(java.io.File theLocalFile) throws UniverseException
releaseLocal
in interface Universe
theLocalFile
- the file. If nonsensical, it will quietly return.
UniverseException
public boolean exists(java.lang.String... name) throws UniverseException
exists
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public void delete(java.lang.String... name) throws UniverseException
delete
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public void deleteByKey(java.lang.String key) throws UniverseException
deleteByKey
in interface Universe
key
- a key that can unlock it
UniverseException
public long size(java.lang.String... name) throws UniverseException
size
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public long lastModifiedDate(java.lang.String... name) throws UniverseException
lastModifiedDate
in interface Universe
name
- universe object name (path components will be appended).
UniverseException
public java.util.Collection<java.lang.String> match(java.lang.String... name) throws UniverseException
match
in interface Universe
name
- universe object name, partial name, and/or path (path components will be appended)
UniverseException
public java.lang.String feature(java.lang.String name, ThingsPropertyView params) throws UniverseException
feature
in interface Universe
name
- name of the featureparams
- parameters for the feature expressed as a view
UniverseException
ThingsPropertyView
public java.lang.String featureByKey(java.lang.String key, ThingsPropertyView params) throws UniverseException
featureByKey
in interface Universe
key
- key to the objectparams
- parameters for the feature expressed as a view
UniverseException
ThingsPropertyView
public void genesis(java.lang.String path, UniverseID uid) throws UniverseException
path
- immutable path to the rootuid
- immutable id
UniverseException
UniverseID
public void finalizeUniverse() throws UniverseException
finalizeUniverse
in interface Universe
UniverseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |