Class ModelClient
java.lang.Object
io.continual.services.SimpleService
io.continual.services.model.impl.client.ModelClient
- All Implemented Interfaces:
Model,ModelCapabilities,io.continual.services.Service,Closeable,AutoCloseable
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.continual.services.model.core.Model
Model.ModelRequestContextBuilder, Model.ObjectUpdater, Model.RelationSelector, Model.RelationTypeNested classes/interfaces inherited from interface io.continual.services.Service
io.continual.services.Service.FailedToStart -
Constructor Summary
ConstructorsConstructorDescriptionModelClient(io.continual.services.ServiceContainer sc, org.json.JSONObject config) ModelClient(String modelId, String baseUrl, io.continual.util.naming.Path pathPrefix, String username, String password) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createIndex(String field) createUpdate(ModelRequestContext context, io.continual.util.naming.Path objectPath) booleanexists(ModelRequestContext context, io.continual.util.naming.Path objectPath) getId()getInboundRelationsNamed(ModelRequestContext context, io.continual.util.naming.Path forObject, String named) longlonglonggetOutboundRelationsNamed(ModelRequestContext context, io.continual.util.naming.Path forObject, String named) listChildrenOfPath(ModelRequestContext context, io.continual.util.naming.Path prefix, PageRequest pr) <T,K> T load(ModelRequestContext context, io.continual.util.naming.Path objectPath, ModelObjectFactory<T, K> factory, K userContext) protected voidrelate(ModelRequestContext context, ModelRelation userReln) booleanremove(ModelRequestContext context, io.continual.util.naming.Path objectPath) selectRelations(io.continual.util.naming.Path objectPath) setRelationType(ModelRequestContext context, String relnName, Model.RelationType rt) booleanunrelate(ModelRequestContext context, ModelRelation reln) booleanunrelate(ModelRequestContext context, String relnId) Methods inherited from class io.continual.services.SimpleService
isRunning, onStartRequested, requestFinish, requestFinishAndWait, startMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.continual.services.model.core.Model
listChildrenOfPath, load, load, load, unrelateMethods inherited from interface io.continual.services.Service
isRunning, requestFinish, start
-
Constructor Details
-
ModelClient
-
ModelClient
public ModelClient(io.continual.services.ServiceContainer sc, org.json.JSONObject config) throws io.continual.builder.Builder.BuildFailure - Throws:
io.continual.builder.Builder.BuildFailure
-
-
Method Details
-
getId
-
getMaxSerializedObjectLength
public long getMaxSerializedObjectLength()- Specified by:
getMaxSerializedObjectLengthin interfaceModelCapabilities
-
getMaxPathLength
public long getMaxPathLength()- Specified by:
getMaxPathLengthin interfaceModelCapabilities
-
getMaxRelnNameLength
public long getMaxRelnNameLength()- Specified by:
getMaxRelnNameLengthin interfaceModelCapabilities
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getRequestContextBuilder
- Specified by:
getRequestContextBuilderin interfaceModel
-
listChildrenOfPath
public ModelPathListPage listChildrenOfPath(ModelRequestContext context, io.continual.util.naming.Path prefix, PageRequest pr) throws ModelServiceException, ModelRequestException - Specified by:
listChildrenOfPathin interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
startQuery
- Specified by:
startQueryin interfaceModel
-
setRelationType
public Model setRelationType(ModelRequestContext context, String relnName, Model.RelationType rt) throws ModelServiceException, ModelRequestException - Specified by:
setRelationTypein interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
relate
public ModelRelationInstance relate(ModelRequestContext context, ModelRelation userReln) throws ModelServiceException, ModelRequestException - Specified by:
relatein interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
unrelate
public boolean unrelate(ModelRequestContext context, ModelRelation reln) throws ModelServiceException, ModelRequestException - Specified by:
unrelatein interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
unrelate
public boolean unrelate(ModelRequestContext context, String relnId) throws ModelServiceException, ModelRequestException - Specified by:
unrelatein interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
getInboundRelationsNamed
public List<ModelRelationInstance> getInboundRelationsNamed(ModelRequestContext context, io.continual.util.naming.Path forObject, String named) throws ModelServiceException, ModelRequestException -
getOutboundRelationsNamed
public List<ModelRelationInstance> getOutboundRelationsNamed(ModelRequestContext context, io.continual.util.naming.Path forObject, String named) throws ModelServiceException, ModelRequestException -
exists
public boolean exists(ModelRequestContext context, io.continual.util.naming.Path objectPath) throws ModelServiceException, ModelRequestException - Specified by:
existsin interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
load
public <T,K> T load(ModelRequestContext context, io.continual.util.naming.Path objectPath, ModelObjectFactory<T, K> factory, K userContext) throws ModelItemDoesNotExistException, ModelServiceException, ModelRequestException- Specified by:
loadin interfaceModel- Throws:
ModelItemDoesNotExistExceptionModelServiceExceptionModelRequestException
-
createUpdate
public Model.ObjectUpdater createUpdate(ModelRequestContext context, io.continual.util.naming.Path objectPath) throws ModelRequestException, ModelServiceException - Specified by:
createUpdatein interfaceModel- Throws:
ModelRequestExceptionModelServiceException
-
remove
public boolean remove(ModelRequestContext context, io.continual.util.naming.Path objectPath) throws ModelServiceException, ModelRequestException - Specified by:
removein interfaceModel- Throws:
ModelServiceExceptionModelRequestException
-
createIndex
- Specified by:
createIndexin interfaceModel- Throws:
ModelRequestExceptionModelServiceException
-
startTraversal
- Specified by:
startTraversalin interfaceModel- Throws:
ModelRequestException
-
selectRelations
- Specified by:
selectRelationsin interfaceModel
-
onStopRequested
protected void onStopRequested()- Overrides:
onStopRequestedin classio.continual.services.SimpleService
-