public class VirtualAdminCommandsFileResourceManager extends FileResourceManager implements ResourceManager, ResourceManagerErrorCodes
FileResourceManager.TransactionContext| Modifier and Type | Field and Description |
|---|---|
protected String |
virtualAdminPath |
cleanUp, CONTEXT_FILE, debug, DEFAULT_COMMIT_TIMEOUT_FACTOR, DEFAULT_ISOLATION_LEVEL, DEFAULT_PARAMETER_ENCODING, DEFAULT_TIMEOUT_MSECS, defaultTimeout, dirty, globalOpenResources, globalTransactions, idCnt, idMapper, LOCK_ACCESS, LOCK_COMMIT, LOCK_EXCLUSIVE, LOCK_SHARED, lockManager, logger, NATIVE_ISOLATION_LEVEL, NO_LOCK, OPERATION_MODE_RECOVERING, OPERATION_MODE_STARTED, OPERATION_MODE_STARTING, OPERATION_MODE_STOPPED, OPERATION_MODE_STOPPING, operationMode, storeDir, txIdMapper, WORK_CHANGE_DIR, WORK_DELETE_DIR, workDirISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_READ_UNCOMMITTED, ISOLATION_LEVEL_REPEATABLE_READ, ISOLATION_LEVEL_SERIALIZABLE, PREPARE_FAILURE, PREPARE_SUCCESS, PREPARE_SUCCESS_READONLY, SHUTDOWN_MODE_KILL, SHUTDOWN_MODE_NORMAL, SHUTDOWN_MODE_ROLLBACKSTATUS_ACTIVE, STATUS_COMMITTED, STATUS_COMMITTING, STATUS_MARKED_ROLLBACK, STATUS_NO_TRANSACTION, STATUS_PREPARED, STATUS_PREPARING, STATUS_ROLLEDBACK, STATUS_ROLLING_BACK, STATUS_UNKNOWNERR_DEAD_LOCK, ERR_DUP_TX, ERR_ISOLATION_LEVEL_UNSUPPORTED, ERR_LOCK, ERR_MARKED_FOR_ROLLBACK, ERR_NO_LOCK, ERR_NO_SUCH_RESOURCE, ERR_NO_TX, ERR_RESOURCE_EXISTS, ERR_RESOURCEID_INVALID, ERR_SYSTEM, ERR_SYSTEM_INCONSISTENT, ERR_THREAD_INVALID, ERR_TX_INACTIVE, ERR_TX_INCONSISTENT, ERR_TXID_INVALID, ERR_UNKNOWN| Constructor and Description |
|---|
VirtualAdminCommandsFileResourceManager(String storeDir,
String workDir,
boolean urlEncodePath,
LoggerFacade logger)
Creates a new resource manager operation on the specified directories.
|
VirtualAdminCommandsFileResourceManager(String storeDir,
String workDir,
boolean urlEncodePath,
LoggerFacade logger,
boolean debug)
Creates a new resource manager operation on the specified directories.
|
VirtualAdminCommandsFileResourceManager(String storeDir,
String workDir,
ResourceIdToPathMapper idMapper,
LoggerFacade logger,
boolean debug)
Creates a new resource manager operation on the specified directories.
|
VirtualAdminCommandsFileResourceManager(String storeDir,
String workDir,
ResourceIdToPathMapper idMapper,
TransactionIdToPathMapper txIdMapper,
LoggerFacade logger,
boolean debug)
Creates a new resource manager operation on the specified directories.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkForVirtualAdminCommand(Object resourceId) |
void |
copyResource(Object txId,
Object fromResourceId,
Object toResourceId,
boolean overwrite) |
void |
createResource(Object txId,
Object resourceId)
Creates a resource.
|
void |
createResource(Object txId,
Object resourceId,
boolean assureOnly)
Creates a resource.
|
void |
deleteResource(Object txId,
Object resourceId)
Deletes a resource.
|
void |
deleteResource(Object txId,
Object resourceId,
boolean assureOnly)
Deletes a resource.
|
protected InputStream |
executeAdminCommand(Object resourceId) |
String |
getVirtualAdminPath() |
protected boolean |
isAKnowCommand(String command) |
protected boolean |
isVirtualAdminId(Object resourceId) |
void |
moveResource(Object txId,
Object fromResourceId,
Object toResourceId,
boolean overwrite) |
InputStream |
readResource(Object resourceId)
Opens a streamable resource for a single reading request not inside the scope of a transaction.
|
InputStream |
readResource(Object txId,
Object resourceId)
Opens a streamable resource for reading.
|
boolean |
resourceExists(Object resourceId)
Checks if a resource exists wihtout being in a transaction.
|
boolean |
resourceExists(Object txId,
Object resourceId)
Checks if a resource exists.
|
void |
setVirtualAdminPath(String virutalAdminPath) |
OutputStream |
writeResource(Object txId,
Object resourceId,
boolean append) |
applyDeletes, assureLeadingSlash, assureNotMarkedForRollback, assureRMReady, assureStarted, closeOpenResource, commitTransaction, fileInitialSaneCheck, generatedUniqueTxId, getChangePath, getContext, getDefaultIsolationLevel, getDefaultTransactionTimeout, getDeletePath, getIsolationLevel, getLogger, getMainPath, getPathForRead, getPathForWrite, getSharedLockLevel, getStoreDir, getSupportedIsolationLevels, getTransactionBaseDir, getTransactionState, getTransactionTimeout, getWorkDir, isIsolationLevelSupported, lockResource, lockResource, lockResource, markTransactionForRollback, prepareTransaction, recover, recoverContexts, registerOpenResource, releaseGlobalOpenResources, reset, rollBackOrForward, rollbackTransaction, setDefaultTransactionTimeout, setDirty, setIsolationLevel, setTransactionTimeout, shutdown, start, startTransaction, stop, stop, sync, txInitialSaneCheck, txInitialSaneCheckForWriting, undoScheduledChangeOrCreate, undoScheduledDelete, waitForAllTxToStop, writeResourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommitTransaction, getDefaultIsolationLevel, getDefaultTransactionTimeout, getIsolationLevel, getSupportedIsolationLevels, getTransactionState, getTransactionTimeout, isIsolationLevelSupported, lockResource, lockResource, lockResource, markTransactionForRollback, prepareTransaction, recover, rollbackTransaction, setIsolationLevel, setTransactionTimeout, start, startTransaction, stop, stop, writeResourceprotected String virtualAdminPath
public VirtualAdminCommandsFileResourceManager(String storeDir, String workDir, boolean urlEncodePath, LoggerFacade logger)
storeDir - directory where main data should go after commitworkDir - directory where transactions store temporary dataurlEncodePath - if set to true encodes all paths to allow for
any kind of characterslogger - the logger to be used by this storepublic VirtualAdminCommandsFileResourceManager(String storeDir, String workDir, boolean urlEncodePath, LoggerFacade logger, boolean debug)
storeDir - directory where main data should go after commitworkDir - directory where transactions store temporary dataurlEncodePath - if set to true encodes all paths to allow for
any kind of characterslogger - the logger to be used by this storedebug - if set to true logs all locking information to
"transaction.log" for debugging inspectionpublic VirtualAdminCommandsFileResourceManager(String storeDir, String workDir, ResourceIdToPathMapper idMapper, LoggerFacade logger, boolean debug)
storeDir - directory where main data should go after commitworkDir - directory where transactions store temporary dataidMapper - mapper for resourceId to pathlogger - the logger to be used by this storedebug - if set to true logs all locking information to
"transaction.log" for debugging inspectionpublic VirtualAdminCommandsFileResourceManager(String storeDir, String workDir, ResourceIdToPathMapper idMapper, TransactionIdToPathMapper txIdMapper, LoggerFacade logger, boolean debug)
storeDir - directory where main data should go after commitworkDir - directory where transactions store temporary dataidMapper - mapper for resourceId to pathtxIdMapper - mapper for transaction id to pathlogger - the logger to be used by this storedebug - if set to true logs all locking information to
"transaction.log" for debugging inspectionpublic String getVirtualAdminPath()
public void setVirtualAdminPath(String virutalAdminPath)
public boolean resourceExists(Object resourceId) throws ResourceManagerException
ResourceManagerresourceExists in interface ResourceManagerresourceExists in class FileResourceManagerresourceId - identifier for the resource to check fortrue if the resource existsResourceManagerException - if an error occuredpublic boolean resourceExists(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerresourceExists in interface ResourceManagerresourceExists in class FileResourceManagertxId - identifier for the transaction in which the resource is to be checked forresourceId - identifier for the resource to check fortrue if the resource existsResourceManagerException - if an error occuredpublic void deleteResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerdeleteResource in interface ResourceManagerdeleteResource in class FileResourceManagertxId - identifier for the transaction in which the resource is to be deletedresourceId - identifier for the resource to be deletedResourceManagerException - if the resource does not exist or any other error occuredpublic void deleteResource(Object txId, Object resourceId, boolean assureOnly) throws ResourceManagerException
ResourceManagerdeleteResource in interface ResourceManagerdeleteResource in class FileResourceManagertxId - identifier for the transaction in which the resource is to be deletedresourceId - identifier for the resource to be deletedassureOnly - if set to true this method will not throw an exception when the resource does not existResourceManagerException - if the resource does not exist and assureOnly was not set to true or any other error occuredpublic void createResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagercreateResource in interface ResourceManagercreateResource in class FileResourceManagertxId - identifier for the transaction in which the resource is to be createdresourceId - identifier for the resource to be createdResourceManagerException - if the resource already exist or any other error occuredpublic void createResource(Object txId, Object resourceId, boolean assureOnly) throws ResourceManagerException
ResourceManagercreateResource in interface ResourceManagercreateResource in class FileResourceManagertxId - identifier for the transaction in which the resource is to be createdresourceId - identifier for the resource to be createdassureOnly - if set to true this method will not throw an exception when the resource already existsResourceManagerException - if the resource already exists and assureOnly was not set to true or any other error occuredpublic void copyResource(Object txId, Object fromResourceId, Object toResourceId, boolean overwrite) throws ResourceManagerException
copyResource in class FileResourceManagerResourceManagerExceptionpublic void moveResource(Object txId, Object fromResourceId, Object toResourceId, boolean overwrite) throws ResourceManagerException
moveResource in class FileResourceManagerResourceManagerExceptionpublic InputStream readResource(Object resourceId) throws ResourceManagerException
ResourceManagerreadResource in interface ResourceManagerreadResource in class FileResourceManagerresourceId - identifier for the streamable resource to be openedResourceManagerException - if the resource does not exist or any other error occuredpublic InputStream readResource(Object txId, Object resourceId) throws ResourceManagerException
ResourceManagerreadResource in interface ResourceManagerreadResource in class FileResourceManagertxId - identifier for the transaction in which the streamable resource is to be openendresourceId - identifier for the streamable resource to be openedResourceManagerException - if the resource does not exist or any other error occuredprotected void checkForVirtualAdminCommand(Object resourceId) throws ResourceManagerException
ResourceManagerExceptionprotected boolean isVirtualAdminId(Object resourceId)
protected InputStream executeAdminCommand(Object resourceId)
protected boolean isAKnowCommand(String command)
public OutputStream writeResource(Object txId, Object resourceId, boolean append) throws ResourceManagerException
writeResource in class FileResourceManagerResourceManagerExceptionCopyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.