|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.layerindependent.descriptions.BasicStorageHints
public class BasicStorageHints
Constants and implementation of set of Storage Hints.
Field Summary | |
---|---|
static java.lang.String |
HINT
generic hint String for error identification |
static java.lang.String |
HINT_NAME_ACCESS_METHOD
This hint is used to further specify a particular method of a protocol to use to access content. |
static java.lang.String |
HINT_NAME_APPEND_CONTENT
Defines whether the content should be appended to the preexisting content when storing at a location or existing content entirely replaced (which would be the default behaviour). |
static java.lang.String |
HINT_NAME_APPEND_NAME_TO_LOCATION
Defines that the name of an object should be appended to the given file location. |
static java.lang.String |
HINT_NAME_APPEND_OID_TO_LOCATION
Defines that the id of an object should be appended to the given file location. |
static java.lang.String |
HINT_NAME_BYTES_TRANSFERRED
Informs about how many bytes actually have been transferred |
static java.lang.String |
HINT_NAME_CATALOG_FILE_NAME
Used to return additional information about where a file has been stored, in particular when used together with a Grid file catalog like lfc. |
static java.lang.String |
HINT_NAME_CONTENT_LOCATION
Defines where files are located |
static java.lang.String |
HINT_NAME_CONTENT_MIMETYPE
Specifies a mime tpye like PROPERTY_VALUE_MIME_TYPE_* that should be stored as property PROPERTY_TYPE_MIME_TYPE after upload of content. |
static java.lang.String |
HINT_NAME_DELEGATED_CREDENTIALS
Defines the credentials that should be used, if applicable |
static java.lang.String |
HINT_NAME_DELETE_AFTER_TRANSFER
Defines after a file has been transfered, it should be deleted Since value of hint has to be defined as well, this is normally set to HINT_VALUE_TRUE |
static java.lang.String |
HINT_NAME_DO_NOT_REGISTER_FILE_IN_CATALOG
Defines that the transferred file should not be registered in the used file catalog, e.g. |
static java.lang.String |
HINT_NAME_DO_NOT_UPDATE_CONTENT_MIMETYPE
Specifies to not update the content mimetype. |
static java.lang.String |
HINT_NAME_ELAPSED_TRANSFER_TIME
Informs about how many milliseconds have been spent on the actual file transfer |
static java.lang.String |
HINT_NAME_ERROR_MESSAGE
This hint is used to give detailed report about a failure reusing the the existing hint API for signaling that an operation could not be executed as requested. |
static java.lang.String |
HINT_NAME_GUESS_CONTENT_MIMETYPE
Defines that, if possible, it is better to guess the content mimetype based on some appropriate approach instead of relying on the inforamtion given otherwise. |
static java.lang.String |
HINT_NAME_IMPORT_VIRTUALLY
Defines the password that should be used, if applicable Since value of hint has to be defined as well, this is normally set to HINT_VALUE_TRUE |
static java.lang.String |
HINT_NAME_INITIATED_BY
Defines the distinguished name that should be stored as the user that initiated some operation and therefore get stored as "created by" / "modified by" |
static java.lang.String |
HINT_NAME_IS_LARGE_FILE
Defines that the transferred file should be treated as a large file, in particular GFAL large file support should be used. |
static java.lang.String |
HINT_NAME_LIMIT_CONTENT_LENGTH_READ
Defines the maximal length of bytes to be transferred |
static java.lang.String |
HINT_NAME_NEW_FILE_INSTEAD_OF_REPLACEMENT
Defines that any existing file should not be overwritten with new content. |
static java.lang.String |
HINT_NAME_OBJECT_ALREADY_VISITED
Indicates that this object was visited before and to avoid both, unnecessary data transfer and endless loop, traversing stopped here Since value of hint has to be defined as well, if it is set, then the value HINT_VALUE_TRUE |
static java.lang.String |
HINT_NAME_PASSWORD
Defines the password that should be used, if applicable |
static java.lang.String |
HINT_NAME_PREDEFINED_ID
When a new object is created, this hint can be specified to make sure that it gets assigned a particular ID. |
static java.lang.String |
HINT_NAME_PREFERRED_BUFFER_SIZE
Defines the preferred buffer size that should be used, if possible. |
static java.lang.String |
HINT_NAME_REACHED_MAX_RECURSION_DEPTH
Defines that recursion stopped because maximum depth reached Since value of hint has to be defined as well, if it is set, then the value HINT_VALUE_TRUE |
static java.lang.String |
HINT_NAME_READING_START_OFFSET
Defines a positive number of bytes that should be skipped at the beginning of the file |
static java.lang.String |
HINT_NAME_RETURN_NO_HINTS
Defines that no hints should be returned Since value of hint has to be defined as well, this is normally set to HINT_VALUE_TRUE } |
static java.lang.String |
HINT_NAME_RETURN_OBJECT_WITHOUT_REFERENCES
Defines that properties, but no referenced objects should be returned, can be combined with HINT_NAME_RETURN_NO_HINTS . |
static java.lang.String |
HINT_NAME_RETURN_PLAIN_OBJECT
Defines that no properties and no referenced objects should be returned, can be combined with HINT_NAME_RETURN_NO_HINTS . |
static java.lang.String |
HINT_NAME_SMALL_FILES_IN_MESSAGE
Defines that if a file is known to be smaller than some threshold, raw content will be returned by the server using inmessage:// instead of whatever has been defined as location to remove the overhead of reading them from disk, if they should not be stored permanently at the client, but processed by the client in memory anyway. |
static java.lang.String |
HINT_NAME_SMALL_FILES_SIZE
Defines the size in bytes of files, that should be considered small and therefore might be treated specifically. |
static java.lang.String |
HINT_NAME_TRANSFER_CONTENT_IF_UPDATED_AFTER
Defines that raw content should only be transfered, if there has been a update after some timestamp. |
static java.lang.String |
HINT_NAME_USERNAME
Defines the username that should be used, if applicable |
static java.lang.String |
HINT_NAME_WARNING
This hint is used to give a feedback if a situation occured, which is not by definition an error, but may have negative side-effects of which the user should be informed. |
static java.lang.String |
HINT_VALUE_ACCESS_METHOD_HTTP_GET
Indicates that HTTP request should be formulated as GET. |
static java.lang.String |
HINT_VALUE_ACCESS_METHOD_HTTP_HEAD
Indicates that HTTP request should be formulated as HEAD. |
static java.lang.String |
HINT_VALUE_ACCESS_METHOD_HTTP_POST
Indicates that HTTP request should be formulated as POST. |
static java.lang.String |
HINT_VALUE_FALSE
Constant to define a valid string to represent 'false' |
static java.lang.String |
HINT_VALUE_TRUE
Constant to define a valid string to represent 'true' |
static BasicStorageHints |
NO_HINTS
Deprecated. |
static java.lang.String |
VALUE_SEPARATOR
In case the value of a hint consists of several individual parts that should easy to be programmatically split up again, this separator should be used to have an easy an consistent way to do so. |
Constructor Summary | |
---|---|
BasicStorageHints()
|
Method Summary | |
---|---|
void |
addConsumedHint(java.lang.String name,
java.lang.String value)
Adds a hint and immediately marks it as consumed. |
void |
addHint(java.lang.String name,
java.lang.String value)
Adds a new hint or replaces any existing one with the same name. |
void |
addWarning(java.lang.String message)
Adds a human-readable warning to the hints. |
java.lang.String |
consumeHint(java.lang.String name,
boolean onlyPreviouslyUnconsumed)
Return the value for a hint and mark it immediately as consumed |
java.lang.String |
consumeHint(java.lang.String name,
boolean onlyPreviouslyUnconsumed,
java.lang.String defaultValue,
boolean consumeDefault)
Return the value for a hint and mark it immediately as consumed |
BasicStorageHints |
getConsumedHints()
Returns a representation that contains all the hints (and only those hints), that have been flagged as consumed. |
java.util.Set |
getHintNames()
Returns a set of all names of assigned hints |
java.lang.String |
getHintValue(java.lang.String name)
Return the value for a hint |
java.lang.String |
getHintValue(java.lang.String name,
java.lang.String defaultValue)
Return the value for a hint |
BasicStorageHints |
getUnconsumedHints()
Returns a representation that contains only those hints, that have not been flagged as consumed. |
static java.lang.String[] |
getWarings(BasicStorageHints h)
Returns an array of individual warnings instead of a single, long string containing all warnings. |
java.lang.String[] |
getWarnings()
Returns an array of individual warnings instead of a single, long string containing all warnings. |
boolean |
hasConsumedHint(java.lang.String name)
Returns whether a hint with a particular name has been assigned and has been consumed already |
boolean |
hasHint(java.lang.String name)
Returns whether a hint with a particular name has been assigned |
boolean |
hasUnconsumedHint(java.lang.String name)
Returns whether a hint with a particular name has been assigned and not yet consumed |
boolean |
isConsumedHint(java.lang.String name)
Returns whether a hint has been flagged as consumed. |
int |
length()
Returns the number of assigned hints |
boolean |
markHint(java.lang.String name,
boolean consumed)
Flags an hint as consumed or removes a flag |
java.lang.String |
removeHint(java.lang.String name)
Removes a particular hint |
static java.lang.String[] |
splitWarnings(java.lang.String concatinatedWarningMessages)
Splits a potentially lng string containing several warnings into it's individual parts. |
java.lang.String |
toString()
A human-readable representation as string of all hints |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String HINT
public static final java.lang.String HINT_NAME_READING_START_OFFSET
public static final java.lang.String HINT_NAME_LIMIT_CONTENT_LENGTH_READ
public static final java.lang.String HINT_NAME_PREFERRED_BUFFER_SIZE
public static final java.lang.String HINT_NAME_USERNAME
public static final java.lang.String HINT_NAME_PASSWORD
public static final java.lang.String HINT_NAME_DELEGATED_CREDENTIALS
public static final java.lang.String HINT_NAME_INITIATED_BY
BasicPropertyDescription.PROPERTY_NAME_CREATED_BY
,
BasicPropertyDescription.PROPERTY_NAME_MODIFIED_BY
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_IMPORT_VIRTUALLY
HINT_VALUE_TRUE
public static final java.lang.String HINT_NAME_DELETE_AFTER_TRANSFER
HINT_VALUE_TRUE
public static final java.lang.String HINT_NAME_TRANSFER_CONTENT_IF_UPDATED_AFTER
BasicPropertyDescription.PROPERTY_NAME_OBJECT_MODIFIED
can be
used directly. Since value of hint has to be defined as well, this is
normally set to HINT_VALUE_TRUE
}
BasicPropertyDescription.PROPERTY_NAME_OBJECT_MODIFIED
,
BasicPropertyDescription.PROPERTY_TYPE_TIME_IN_MILLISECONDS
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_SMALL_FILES_IN_MESSAGE
HINT_VALUE_TRUE
}
HINT_NAME_SMALL_FILES_SIZE
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_SMALL_FILES_SIZE
public static final java.lang.String HINT_NAME_IS_LARGE_FILE
HINT_VALUE_TRUE
public static final java.lang.String HINT_NAME_DO_NOT_REGISTER_FILE_IN_CATALOG
HINT_VALUE_TRUE
}
public static final java.lang.String HINT_NAME_CATALOG_FILE_NAME
public static final java.lang.String HINT_NAME_APPEND_CONTENT
public static final java.lang.String HINT_NAME_APPEND_NAME_TO_LOCATION
HINT_VALUE_TRUE
public static final java.lang.String HINT_NAME_APPEND_OID_TO_LOCATION
HINT_VALUE_TRUE
}
public static final java.lang.String HINT_NAME_NEW_FILE_INSTEAD_OF_REPLACEMENT
HINT_VALUE_TRUE
}
HINT_NAME_CONTENT_LOCATION
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_CONTENT_MIMETYPE
BasicPropertyDescription.PROPERTY_TYPE_MIME_TYPE
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_DO_NOT_UPDATE_CONTENT_MIMETYPE
BasicPropertyDescription.PROPERTY_TYPE_MIME_TYPE
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_GUESS_CONTENT_MIMETYPE
HINT_NAME_CONTENT_MIMETYPE
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_CONTENT_LOCATION
public static final java.lang.String HINT_NAME_BYTES_TRANSFERRED
public static final java.lang.String HINT_NAME_ELAPSED_TRANSFER_TIME
public static final java.lang.String HINT_NAME_RETURN_NO_HINTS
HINT_VALUE_TRUE
}
public static final java.lang.String HINT_NAME_RETURN_PLAIN_OBJECT
HINT_NAME_RETURN_NO_HINTS
. Since value of
hint has to be defined as well, this is normally set to
HINT_VALUE_TRUE
HINT_NAME_RETURN_NO_HINTS
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_RETURN_OBJECT_WITHOUT_REFERENCES
HINT_NAME_RETURN_NO_HINTS
. Since value of
hint has to be defined as well, this is normally set to
HINT_VALUE_TRUE
HINT_NAME_RETURN_NO_HINTS
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_REACHED_MAX_RECURSION_DEPTH
HINT_VALUE_TRUE
public static final java.lang.String HINT_NAME_OBJECT_ALREADY_VISITED
HINT_VALUE_TRUE
public static final java.lang.String HINT_NAME_PREDEFINED_ID
public static final java.lang.String HINT_NAME_ERROR_MESSAGE
HINT_NAME_WARNING
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_WARNING
HINT_NAME_ERROR_MESSAGE
.
HINT_NAME_ERROR_MESSAGE
,
Constant Field Valuespublic static final java.lang.String HINT_NAME_ACCESS_METHOD
HINT_VALUE_ACCESS_METHOD_HTTP_GET
,
HINT_VALUE_ACCESS_METHOD_HTTP_POST
,
Constant Field Valuespublic static final java.lang.String HINT_VALUE_ACCESS_METHOD_HTTP_GET
HINT_VALUE_ACCESS_METHOD_HTTP_POST
.
HINT_NAME_ACCESS_METHOD
,
Constant Field Valuespublic static final java.lang.String HINT_VALUE_ACCESS_METHOD_HTTP_POST
HINT_NAME_ACCESS_METHOD
,
Constant Field Valuespublic static final java.lang.String HINT_VALUE_ACCESS_METHOD_HTTP_HEAD
HINT_NAME_ACCESS_METHOD
,
Constant Field Valuespublic static final java.lang.String VALUE_SEPARATOR
String.split(String)
should yield the
individual parts again.
public static final java.lang.String HINT_VALUE_FALSE
public static final java.lang.String HINT_VALUE_TRUE
@Deprecated public static final BasicStorageHints NO_HINTS
Constructor Detail |
---|
public BasicStorageHints()
Method Detail |
---|
public void addHint(java.lang.String name, java.lang.String value)
name
- the name of the hintvalue
- the value of the hintpublic void addConsumedHint(java.lang.String name, java.lang.String value)
name
- the name of the hintvalue
- the value of the hintpublic java.lang.String getHintValue(java.lang.String name)
name
- the name of the hint
null
public java.lang.String getHintValue(java.lang.String name, java.lang.String defaultValue)
name
- the name of the hintdefaultValue
- if value has not been set, this value will be return (instead
of null)
defaultValue
public java.lang.String consumeHint(java.lang.String name, boolean onlyPreviouslyUnconsumed)
name
- the name of the hintonlyPreviouslyUnconsumed
- if set to true, only hints will get returned, which have not
been marked as consumed yet. Instead, this will then also
return null
.
null
public java.lang.String consumeHint(java.lang.String name, boolean onlyPreviouslyUnconsumed, java.lang.String defaultValue, boolean consumeDefault)
name
- the name of the hintonlyPreviouslyUnconsumed
- if set to true, only hints will get returned, which have not
been marked as consumed yet. Instead, this will then also
return null
.defaultValue
- if value has not been set, this value will be return (instead
of null)consumeDefault
- if set to true, a new consumed hint will get created with the
given name and default value
defaultValue
public java.util.Set getHintNames()
public java.lang.String removeHint(java.lang.String name)
name
- the name of the hint
public boolean hasHint(java.lang.String name)
name
- the name of the hint
public boolean hasUnconsumedHint(java.lang.String name)
name
- the name of the hint
public boolean hasConsumedHint(java.lang.String name)
name
- the name of the hint
public boolean isConsumedHint(java.lang.String name)
name
- the name of the hint
public boolean markHint(java.lang.String name, boolean consumed)
name
- name of the hintconsumed
- true, if hint has been consumed; false otherwise
public BasicStorageHints getConsumedHints()
public BasicStorageHints getUnconsumedHints()
public int length()
public java.lang.String toString()
toString
in class java.lang.Object
public void addWarning(java.lang.String message)
VALUE_SEPARATOR
.
message
- the new warning message to addpublic static java.lang.String[] splitWarnings(java.lang.String concatinatedWarningMessages)
VALUE_SEPARATOR
.
concatinatedWarningMessages
- the message that might contain concatinated warnings
null
, if
the String was null
public static java.lang.String[] getWarings(BasicStorageHints h)
h
- the hints to extract the warnings from
null
, if
there was no warning in the hintspublic java.lang.String[] getWarnings()
null
, if
there was no warning set for this object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |