|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.schematic.internal.CacheSchemaLibrary
public class CacheSchemaLibrary
Nested Class Summary | |
---|---|
class |
CacheSchemaLibrary.SchemaListener
|
protected class |
CacheSchemaLibrary.WrappedFuture
|
Nested classes/interfaces inherited from interface org.infinispan.schematic.SchemaLibrary |
---|
SchemaLibrary.MismatchedTypeProblem, SchemaLibrary.Problem, SchemaLibrary.ProblemType, SchemaLibrary.Results |
Constructor Summary | |
---|---|
CacheSchemaLibrary(org.infinispan.Cache<String,SchematicEntry> schemaStore)
|
Method Summary | |
---|---|
Document |
convertValues(Document document,
SchemaLibrary.Results results)
Look for fields within the document (including nested documents) whose values are not of the expected type for the given schema, but whose values can be converted into the expected type. |
Document |
convertValues(Document document,
String schemaUri)
Look for fields within the document (including nested documents) whose values are not of the expected type for the given schema, but whose values can be converted into the expected type. |
protected Document |
document(SchematicEntry entry)
|
protected org.infinispan.util.concurrent.NotifyingFuture<Document> |
future(org.infinispan.util.concurrent.NotifyingFuture<SchematicEntry> original)
|
Document |
get(String key)
Get the document with the supplied key. |
org.infinispan.util.concurrent.NotifyingFuture<Document> |
getAsync(String key)
Asynchronous version of DocumentLibrary.get(String) . |
String |
getName()
Get the name of this library. |
Document |
put(String key,
Document document)
Store the supplied document at the given key. |
org.infinispan.util.concurrent.NotifyingFuture<Document> |
putAsync(String key,
Document document)
Asynchronous version of DocumentLibrary.put(String, Document) . |
Document |
putIfAbsent(String key,
Document document)
Store the supplied document at the given key. |
org.infinispan.util.concurrent.NotifyingFuture<Document> |
putIfAbsentAsync(String key,
Document document)
Asynchronous version of DocumentLibrary.putIfAbsent(String, Document) . |
Document |
remove(String key)
Remove the existing document at the given key. |
org.infinispan.util.concurrent.NotifyingFuture<Document> |
removeAsync(String key)
Asynchronous version of DocumentLibrary.remove(String) . |
Document |
replace(String key,
Document document)
Replace the existing document at the given key with the document that is supplied. |
org.infinispan.util.concurrent.NotifyingFuture<Document> |
replaceAsync(String key,
Document document)
Asynchronous version of DocumentLibrary.replace(String, Document) . |
void |
start()
|
void |
stop()
|
protected org.infinispan.Cache<String,SchematicEntry> |
store()
|
SchemaLibrary.Results |
validate(Document document,
String schemaUri)
Validate the supplied document against the JSON Schema with the supplied URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheSchemaLibrary(org.infinispan.Cache<String,SchematicEntry> schemaStore)
Method Detail |
---|
public void start()
start
in interface org.infinispan.lifecycle.Lifecycle
public void stop()
stop
in interface org.infinispan.lifecycle.Lifecycle
protected org.infinispan.Cache<String,SchematicEntry> store()
public String getName()
DocumentLibrary
getName
in interface DocumentLibrary
public Document get(String key)
DocumentLibrary
get
in interface DocumentLibrary
key
- the key or identifier for the document
public Document put(String key, Document document)
DocumentLibrary
put
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be stored
public Document putIfAbsent(String key, Document document)
DocumentLibrary
putIfAbsent
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be stored
public Document replace(String key, Document document)
DocumentLibrary
replace
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to replace the existing document
public Document remove(String key)
DocumentLibrary
remove
in interface DocumentLibrary
key
- the key or identifier for the document
public org.infinispan.util.concurrent.NotifyingFuture<Document> getAsync(String key)
DocumentLibrary
DocumentLibrary.get(String)
. This method does not block on remote calls, even if the library
cache mode is synchronous.
getAsync
in interface DocumentLibrary
key
- the key or identifier for the document
public org.infinispan.util.concurrent.NotifyingFuture<Document> putAsync(String key, Document document)
DocumentLibrary
DocumentLibrary.put(String, Document)
. This method does not block on remote calls, even if the
library cache mode is synchronous.
putAsync
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be stored
public org.infinispan.util.concurrent.NotifyingFuture<Document> putIfAbsentAsync(String key, Document document)
DocumentLibrary
DocumentLibrary.putIfAbsent(String, Document)
. This method does not block on remote calls, even
if the library cache mode is synchronous.
putIfAbsentAsync
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be stored
public org.infinispan.util.concurrent.NotifyingFuture<Document> replaceAsync(String key, Document document)
DocumentLibrary
DocumentLibrary.replace(String, Document)
. This method does not block on remote calls, even if
the library cache mode is synchronous.
replaceAsync
in interface DocumentLibrary
key
- the key or identifier for the documentdocument
- the document that is to be stored
public org.infinispan.util.concurrent.NotifyingFuture<Document> removeAsync(String key)
DocumentLibrary
DocumentLibrary.remove(String)
. This method does not block on remote calls, even if the library
cache mode is synchronous.
removeAsync
in interface DocumentLibrary
key
- the key or identifier for the document
public SchemaLibrary.Results validate(Document document, String schemaUri)
SchemaLibrary
validate
in interface SchemaLibrary
document
- the document to be validated; may not be nullschemaUri
- the URI of the JSON Schema that should be used to validate the document; may not be null
public Document convertValues(Document document, SchemaLibrary.Results results)
SchemaLibrary
This is often useful when the results from SchemaLibrary.validate(Document, String)
contain only
mismatched type errors
. In such a case, the document can be converted and the
resulting document will likely satisfy the schema.
convertValues
in interface SchemaLibrary
document
- the document to be validated; may not be nullresults
- the results from the SchemaLibrary.validate(Document, String)
call; may not be null
document
if thepublic Document convertValues(Document document, String schemaUri)
SchemaLibrary
This method is similar to SchemaLibrary.convertValues(Document, Results)
, except that this method automatically runs a JSON
Schema validation to obtain the results. If you've already validated
the document, then
instead of calling this method (which would validate a second time) try calling SchemaLibrary.convertValues(Document, Results)
.
convertValues
in interface SchemaLibrary
document
- the document to be validated; may not be nullschemaUri
- the URI of the JSON Schema that should be used to validate the document; may not be null
document
if theprotected Document document(SchematicEntry entry)
protected org.infinispan.util.concurrent.NotifyingFuture<Document> future(org.infinispan.util.concurrent.NotifyingFuture<SchematicEntry> original)
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |