PHP Class AppserverIo\Appserver\Core\AbstractExtractor

Inheritance: implements AppserverIo\Appserver\Core\Interfaces\ExtractorInterface
Show file Open project: appserver-io/appserver

Protected Properties

Property Type Description
$extractorNode AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface The extractor node configuration data.
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance.
$service string The container's base directory.

Public Methods

Method Description
__construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface $extractorNode ) Constructor to initialize the extractor instance with the initial context and the extractor node configuration data.
copyDir ( string $src, string $dst ) : void Copies a directory recursively.
deployWebapps ( ) : void Will actually deploy all webapps.
flagArchive ( SplFileInfo $archive, string $flag ) : void Flags the archive in specific states of extraction
getDeployDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string Returns the container's deploy directory.
getExtractorNode ( ) : AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface Returns the extractor node configuration data.
getInitialContext ( ) : AppserverIo\Appserver\Application\Interfaces\ContextInterface Returns the inital context instance.
getService ( ) : AppserverIo\Appserver\Core\Api\AbstractFileOperationService Returns the service instance to use.
getTmpDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string Returns the container's tmp directory.
getWebappsDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string Returns the container's webapps directory.
isDeployable ( SplFileInfo $archive ) : boolean (non-PHPdoc)
isUndeployable ( SplFileInfo $archive ) : boolean (non-PHPdoc)
newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface (non-PHPdoc)
restoreBackup ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, SplFileInfo $archive ) : void Restores the backup files from the backup directory.
soakArchive ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, SplFileInfo $archive ) : void (non-PHPdoc)
undeployArchive ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, SplFileInfo $archive ) : void (non-PHPdoc)
unflagArchive ( SplFileInfo $archive ) : void Deletes all old flags, so the app will be undeployed with the next appserver restart.

Protected Methods

Method Description
getFlags ( ) : array Returns all flags in array.
removeDir ( SplFileInfo $dir, boolean $alsoRemoveFiles = true ) : void Removes a directory recursively.
setUserRight ( SplFileInfo $fileInfo ) : void Sets the configured user/group settings on the passed file.
setUserRights ( SplFileInfo $targetDir ) : void Will set the owner and group on the passed directory.

Method Details

__construct() public method

Constructor to initialize the extractor instance with the initial context and the extractor node configuration data.
public __construct ( AppserverIo\Appserver\Application\Interfaces\ContextInterface $initialContext, AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface $extractorNode )
$initialContext AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance
$extractorNode AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface The extractor node configuration data

copyDir() public method

Copies a directory recursively.
See also: AppserverIo\Appserver\Core\Api\AbstractService::copyDir()
public copyDir ( string $src, string $dst ) : void
$src string The source directory to copy
$dst string The target directory
return void

deployWebapps() public method

Will actually deploy all webapps.
public deployWebapps ( ) : void
return void

flagArchive() public method

Flags the archive in specific states of extraction
public flagArchive ( SplFileInfo $archive, string $flag ) : void
$archive SplFileInfo The archive to flag
$flag string The flag to set
return void

getDeployDir() public method

Returns the container's deploy directory.
public getDeployDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the temporary directory for
$relativePathToAppend string A relative path to append
return string

getExtractorNode() public method

Returns the extractor node configuration data.
public getExtractorNode ( ) : AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface
return AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface The extractor node configuration data

getFlags() protected method

Returns all flags in array.
protected getFlags ( ) : array
return array

getInitialContext() public method

Returns the inital context instance.
public getInitialContext ( ) : AppserverIo\Appserver\Application\Interfaces\ContextInterface
return AppserverIo\Appserver\Application\Interfaces\ContextInterface The initial context instance

getService() public method

Returns the service instance to use.
public getService ( ) : AppserverIo\Appserver\Core\Api\AbstractFileOperationService
return AppserverIo\Appserver\Core\Api\AbstractFileOperationService $service The service to use

getTmpDir() public method

Returns the container's tmp directory.
public getTmpDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the temporary directory for
$relativePathToAppend string A relative path to append
return string

getWebappsDir() public method

Returns the container's webapps directory.
public getWebappsDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container to return the temporary directory for
$relativePathToAppend string A relative path to append
return string The web application directory

isDeployable() public method

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\Interfaces\ExtractorInterface::isDeployable()
public isDeployable ( SplFileInfo $archive ) : boolean
$archive SplFileInfo The archive object
return boolean

isUndeployable() public method

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\Interfaces\ExtractorInterface::isUndeployable()
public isUndeployable ( SplFileInfo $archive ) : boolean
$archive SplFileInfo The archive object
return boolean

newService() public method

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\InitialContext::newService()
public newService ( string $className ) : AppserverIo\Appserver\Core\Api\ServiceInterface
$className string The API service class name to return the instance for
return AppserverIo\Appserver\Core\Api\ServiceInterface The service instance

removeDir() protected method

Removes a directory recursively.
protected removeDir ( SplFileInfo $dir, boolean $alsoRemoveFiles = true ) : void
$dir SplFileInfo The directory to remove
$alsoRemoveFiles boolean The flag for removing files also
return void

restoreBackup() public method

Restores the backup files from the backup directory.
public restoreBackup ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, SplFileInfo $archive ) : void
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container the archive belongs to
$archive SplFileInfo To restore the files for
return void

setUserRight() protected method

Sets the configured user/group settings on the passed file.
protected setUserRight ( SplFileInfo $fileInfo ) : void
$fileInfo SplFileInfo The file to set user/group for
return void

setUserRights() protected method

Will set the owner and group on the passed directory.
protected setUserRights ( SplFileInfo $targetDir ) : void
$targetDir SplFileInfo The directory to set the rights for
return void

soakArchive() public method

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\Interfaces\ExtractorInterface::soakArchive()
public soakArchive ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, SplFileInfo $archive ) : void
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container the archive belongs to
$archive SplFileInfo The archive to be soaked
return void

undeployArchive() public method

(non-PHPdoc)
See also: AppserverIo\Appserver\Core\Interfaces\ExtractorInterface::undeployArchive()
public undeployArchive ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, SplFileInfo $archive ) : void
$containerNode AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface The container the archive belongs to
$archive SplFileInfo The archive file to be undeployed
return void

unflagArchive() public method

Deletes all old flags, so the app will be undeployed with the next appserver restart.
public unflagArchive ( SplFileInfo $archive ) : void
$archive SplFileInfo The archive to unflag
return void

Property Details

$extractorNode protected property

The extractor node configuration data.
protected ExtractorNodeInterface,AppserverIo\Appserver\Core\Api\Node $extractorNode
return AppserverIo\Appserver\Core\Api\Node\ExtractorNodeInterface

$initialContext protected property

The initial context instance.
protected ContextInterface,AppserverIo\Appserver\Application\Interfaces $initialContext
return AppserverIo\Appserver\Application\Interfaces\ContextInterface

$service protected property

The container's base directory.
protected string $service
return string