Class ORemoteClient
java.lang.Object
com.orientechnologies.orient.client.remote.ORemoteClient
- All Implemented Interfaces:
OStorageInfo
This object is bound to each remote ODatabase instances.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected OCurrentStorageComponentsFactoryprotected OStorageConfigurationfinal ORemoteConnectionManagerprotected final OrientDBRemotestatic final Stringprotected final Stringprotected final ReentrantReadWriteLockprotected OStorage.STATUSstatic final Stringprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionORemoteClient(ORemoteURLs hosts, String name, OrientDBRemote context, ORemoteConnectionManager connectionManager, OContextConfiguration config) ORemoteClient(ORemoteURLs hosts, String name, OrientDBRemote context, ORemoteConnectionManager connectionManager, OStorage.STATUS status, OContextConfiguration config) -
Method Summary
Modifier and TypeMethodDescriptionintaddCluster(ORemoteClientSession session, String iClusterName, int iRequestedId) intaddCluster(ORemoteClientSession session, String iClusterName, Object... iArguments) voidaddNewClusterToConfiguration(int clusterId, String iClusterName) intaddUser()<T> TbaseNetworkOperation(ORemoteClientSession session, ORemoteClientOperation<T> operation, String errorMessage, int retry) beginRequest(OChannelBinaryAsynchClient network, byte iCommand, ORemoteClientSession session) Acquire a network channel from the pool.static voidbeginResponse(OChannelBinaryAsynchClient iNetwork, ORemoteClientSession session) voidbeginTransaction(ORemoteClientSession session, OTransactionOptimistic transaction) ceilingPhysicalPositions(ORemoteClientSession session, int clusterId, OPhysicalPosition physicalPosition) booleanvoidclose(ORemoteClientSession session) voidclose(ORemoteClientSession session, boolean iForce) voidcloseQuery(ODatabaseDocumentRemote db, String queryId) command(ODatabaseDocumentRemote db, String query, Object[] args) command(ODatabaseDocumentRemote db, String query, Map args) copy(ODatabaseDocumentRemote source, ODatabaseDocumentRemote dest) longcount(ORemoteClientSession session, int iClusterId) longcount(ORemoteClientSession session, int[] iClusterIds) longcountRecords(ORemoteClientSession session) createPush(byte type) booleandropCluster(ORemoteClientSession session, int iClusterId) booleandropCluster(ORemoteClientSession session, String iClusterName) voidendRequest(OChannelBinaryAsynchClient iNetwork) Ends the request and unlock the write lockvoidendResponse(OChannelBinaryAsynchClient iNetwork) End response reached: release the channel in the pool to being reusedexecute(ODatabaseDocumentRemote db, String language, String query, Object[] args) execute(ODatabaseDocumentRemote db, String language, String query, Map args) voidvoidfloorPhysicalPositions(ORemoteClientSession session, int clusterId, OPhysicalPosition physicalPosition) long[]getClusterDataRange(ORemoteClientSession session, int iClusterId) intgetClusterIdByName(String iClusterName) intgetClusterName(ORemoteClientSession session, int clusterId) getClusterNameById(int clusterId) longgetClusterRecordsSizeById(int clusterId) longgetClusterRecordsSizeByName(String clusterName) intprotected StringgetCurrentServerURL(ORemoteClientSession session) intgetName()getNetwork(String iCurrentURL) static OChannelBinaryAsynchClientgetNetwork(String iCurrentURL, ORemoteConnectionManager connectionManager, OContextConfiguration config) protected StringgetNextAvailableServerURL(boolean iIsConnectOperation, ORemoteClientSession session) getPhysicalClusterNameById(int iClusterId) getRecordMetadata(ORemoteClientSession session, ORID rid) getServerURL(ORemoteClientSession session) intgetSessionId(ORemoteClientSession session) longgetSize(ORemoteClientSession session) getType()getURL()getUserName(ORemoteClientSession session) intgetUsers()higherPhysicalPositions(ORemoteClientSession session, int iClusterId, OPhysicalPosition iClusterPosition) voidimportDatabase(ORemoteClientSession session, String options, InputStream inputStream, String name, OCommandOutputListener listener) incrementalBackup(ORemoteClientSession session, String backupDirectory, OCallable<Void, Void> started) voidinitPush(ORemoteClientSession session, OMetadataPushListener handler) booleanbooleanisClosed(ORemoteClientSession session) booleanbooleanisRemote()liveQuery(ODatabaseDocumentRemote db, String query, OLiveQueryClientListener listener, Object[] params) liveQuery(ODatabaseDocumentRemote db, String query, OLiveQueryClientListener listener, Map<String, ?> params) lockRecord(ORemoteClientSession session, OIdentifiable iRecord, OStorage.LOCKING_STRATEGY lockingStrategy, long timeout) lowerPhysicalPositions(ORemoteClientSession session, int iClusterId, OPhysicalPosition physicalPosition) <T extends OBinaryResponse>
TnetworkOperation(ORemoteClientSession session, OBinaryRequest<T> request, String errorMessage) <T extends OBinaryResponse>
TnetworkOperationNoRetry(ORemoteClientSession session, OBinaryRequest<T> request, String errorMessage) <T extends OBinaryResponse>
TnetworkOperationRetryTimeout(ORemoteClientSession baseSession, OBinaryRequest<T> request, String errorMessage, int retry, int timeout) intvoidonPushDisconnect(OChannelBinary network, Exception e) voidonPushReconnect(String host) voidopen(ORemoteClientSession session, String iUserName, String iUserPassword, OContextConfiguration conf) protected voidopenRemoteDatabase(ORemoteClientSession session) voidopenRemoteDatabase(ORemoteClientSession session, OChannelBinaryAsynchClient network) protected voidopenRemoteDatabase(ORemoteClientSession session, String currentURL) paramsArrayToParamsMap(Object[] positionalParams) query(ODatabaseDocumentRemote db, String query, Object[] args) query(ODatabaseDocumentRemote db, String query, Map args) readRecord(ORemoteClientSession session, ORecordId iRid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords) readRecordIfVersionIsNotLatest(ORemoteClientSession session, ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) voidreBeginTransaction(ORemoteClientSession session, OTransactionOptimistic transaction) voidregisterLiveListener(int monitorId, OLiveQueryClientListener listener) voidreload(ORemoteClientSession session) voidremoveClusterFromConfiguration(int iClusterId) intprotected StringreopenRemoteDatabase(ORemoteClientSession session) voidreturnSocket(OChannelBinary network) voidrollback(ORemoteClientSession session, OTransactionInternal iTx) voidsetConflictStrategy(ORecordConflictStrategy strategy) voidsetDefaultClusterId(int defaultClusterId) voidshutdown()voidstickToSession(ORemoteClientSession session) voidunlockRecord(ORemoteClientSession session, OIdentifiable iRecord) voidunstickToSession(ORemoteClientSession session) voidunsubscribeLive(ORemoteClientSession session, int monitorId) voidupdateStorageConfiguration(OStorageConfigurationPayload updatedConfiguration) voidupdateStorageConfiguration(OStorageConfiguration storageConfiguration) protected StringuseNewServerURL(ORemoteClientSession session, String iUrl)
-
Field Details
-
DRIVER_NAME
- See Also:
-
connectionManager
-
context
-
url
-
stateLock
-
configuration
-
componentsFactory
-
name
-
status
-
TYPE
- See Also:
-
ADDRESS_SEPARATOR
- See Also:
-
-
Constructor Details
-
ORemoteClient
public ORemoteClient(ORemoteURLs hosts, String name, OrientDBRemote context, ORemoteConnectionManager connectionManager, OContextConfiguration config) -
ORemoteClient
public ORemoteClient(ORemoteURLs hosts, String name, OrientDBRemote context, ORemoteConnectionManager connectionManager, OStorage.STATUS status, OContextConfiguration config)
-
-
Method Details
-
getConfiguration
- Specified by:
getConfigurationin interfaceOStorageInfo
-
checkForRecordValidity
-
getName
- Specified by:
getNamein interfaceOStorageInfo
-
networkOperationRetryTimeout
public <T extends OBinaryResponse> T networkOperationRetryTimeout(ORemoteClientSession baseSession, OBinaryRequest<T> request, String errorMessage, int retry, int timeout) -
networkOperationNoRetry
public <T extends OBinaryResponse> T networkOperationNoRetry(ORemoteClientSession session, OBinaryRequest<T> request, String errorMessage) -
networkOperation
public <T extends OBinaryResponse> T networkOperation(ORemoteClientSession session, OBinaryRequest<T> request, String errorMessage) -
baseNetworkOperation
public <T> T baseNetworkOperation(ORemoteClientSession session, ORemoteClientOperation<T> operation, String errorMessage, int retry) -
isAssigningClusterIds
public boolean isAssigningClusterIds()- Specified by:
isAssigningClusterIdsin interfaceOStorageInfo
-
getSessionId
-
getServerURL
-
open
public void open(ORemoteClientSession session, String iUserName, String iUserPassword, OContextConfiguration conf) -
getSBtreeCollectionManager
-
reload
-
close
-
shutdown
public void shutdown() -
getUsers
public int getUsers() -
addUser
public int addUser() -
removeUser
public int removeUser() -
getClusterNames
- Specified by:
getClusterNamesin interfaceOStorageInfo
-
getRecordMetadata
-
readRecordIfVersionIsNotLatest
public ORawBuffer readRecordIfVersionIsNotLatest(ORemoteClientSession session, ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException - Throws:
ORecordNotFoundException
-
readRecord
public ORawBuffer readRecord(ORemoteClientSession session, ORecordId iRid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords) -
incrementalBackup
-
getClientConfiguration
-
count
-
getClusterDataRange
-
higherPhysicalPositions
public OPhysicalPosition[] higherPhysicalPositions(ORemoteClientSession session, int iClusterId, OPhysicalPosition iClusterPosition) -
ceilingPhysicalPositions
public OPhysicalPosition[] ceilingPhysicalPositions(ORemoteClientSession session, int clusterId, OPhysicalPosition physicalPosition) -
lowerPhysicalPositions
public OPhysicalPosition[] lowerPhysicalPositions(ORemoteClientSession session, int iClusterId, OPhysicalPosition physicalPosition) -
floorPhysicalPositions
public OPhysicalPosition[] floorPhysicalPositions(ORemoteClientSession session, int clusterId, OPhysicalPosition physicalPosition) -
getSize
-
countRecords
-
count
-
stickToSession
-
unstickToSession
-
query
-
query
-
command
-
command
-
execute
public ORemoteQueryResult execute(ODatabaseDocumentRemote db, String language, String query, Object[] args) -
execute
public ORemoteQueryResult execute(ODatabaseDocumentRemote db, String language, String query, Map args) -
closeQuery
-
fetchNextPage
-
commit
-
rollback
-
getClusterIdByName
- Specified by:
getClusterIdByNamein interfaceOStorageInfo
-
getDefaultClusterId
public int getDefaultClusterId()- Specified by:
getDefaultClusterIdin interfaceOStorageInfo
-
setDefaultClusterId
public void setDefaultClusterId(int defaultClusterId) -
addCluster
-
addCluster
-
getClusterNameById
-
getClusterRecordsSizeById
public long getClusterRecordsSizeById(int clusterId) -
getClusterRecordsSizeByName
-
dropCluster
-
getClusterName
-
removeClusterFromConfiguration
public void removeClusterFromConfiguration(int iClusterId) -
getPhysicalClusterNameById
- Specified by:
getPhysicalClusterNameByIdin interfaceOStorageInfo
-
getClusterMap
public int getClusterMap() -
getClusterInstances
-
getClusterConfiguration
-
endRequest
Ends the request and unlock the write lock- Throws:
IOException
-
endResponse
End response reached: release the channel in the pool to being reused- Throws:
IOException
-
isRemote
public boolean isRemote() -
getURL
- Specified by:
getURLin interfaceOStorageInfo
-
getClusters
public int getClusters()- Specified by:
getClustersin interfaceOStorageInfo
-
getType
- Specified by:
getTypein interfaceOStorageInfo
-
getUserName
-
reopenRemoteDatabase
- Throws:
IOException
-
openRemoteDatabase
- Throws:
IOException
-
openRemoteDatabase
public void openRemoteDatabase(ORemoteClientSession session, OChannelBinaryAsynchClient network) throws IOException - Throws:
IOException
-
initPush
-
openRemoteDatabase
-
useNewServerURL
-
beginRequest
public OChannelBinaryAsynchClient beginRequest(OChannelBinaryAsynchClient network, byte iCommand, ORemoteClientSession session) throws IOException Acquire a network channel from the pool. Don't lock the write stream since the connection usage is exclusive.- Parameters:
iCommand- id. Ids described atOChannelBinaryProtocol- Returns:
- connection to server
- Throws:
IOException
-
getNextAvailableServerURL
protected String getNextAvailableServerURL(boolean iIsConnectOperation, ORemoteClientSession session) -
getCurrentServerURL
-
getNetwork
-
getNetwork
public static OChannelBinaryAsynchClient getNetwork(String iCurrentURL, ORemoteConnectionManager connectionManager, OContextConfiguration config) -
beginResponse
public static void beginResponse(OChannelBinaryAsynchClient iNetwork, ORemoteClientSession session) throws IOException - Throws:
IOException
-
updateStorageConfiguration
-
updateStorageConfiguration
-
nextInitialSessionId
public int nextInitialSessionId() -
newInitialSession
-
isClosed
-
copy
-
importDatabase
public void importDatabase(ORemoteClientSession session, String options, InputStream inputStream, String name, OCommandOutputListener listener) -
addNewClusterToConfiguration
-
beginTransaction
-
reBeginTransaction
-
fetchTransaction
-
createPush
-
liveQuery
public OLiveQueryMonitor liveQuery(ODatabaseDocumentRemote db, String query, OLiveQueryClientListener listener, Object[] params) -
liveQuery
public OLiveQueryMonitor liveQuery(ODatabaseDocumentRemote db, String query, OLiveQueryClientListener listener, Map<String, ?> params) -
unsubscribeLive
-
registerLiveListener
-
paramsArrayToParamsMap
-
onPushReconnect
-
onPushDisconnect
-
lockRecord
public OLockRecordResponse lockRecord(ORemoteClientSession session, OIdentifiable iRecord, OStorage.LOCKING_STRATEGY lockingStrategy, long timeout) -
unlockRecord
-
returnSocket
-
getServerURLs
-
getRemoteURLs
-
isDistributed
public boolean isDistributed() -
getStatus
-
close
-
dropCluster
-
getComponentsFactory
-
getContext
-
getRecordConflictStrategy
- Specified by:
getRecordConflictStrategyin interfaceOStorageInfo
-
setConflictStrategy
-
getLiveQueryListener
-