org.jboss.system.server.profileservice.repository
Class AbstractAttachmentStore

java.lang.Object
  extended by org.jboss.system.server.profileservice.repository.AbstractAttachmentStore
All Implemented Interfaces:
AttachmentStore

public class AbstractAttachmentStore
extends Object
implements AttachmentStore

The AbstractAttachmentStore.

Version:
$Revision: 89187 $
Author:
Emanuel Muckenhuber

Field Summary
static String METADATA_NAME
          The metadata name
 
Constructor Summary
AbstractAttachmentStore(File root)
           
AbstractAttachmentStore(URI uri)
           
 
Method Summary
 org.jboss.deployers.client.spi.Deployment createDeployment(org.jboss.profileservice.spi.ProfileDeployment deployment)
          Create a MC deployment.
protected  PersistenceRoot createPersistedMetaData(PersistenceRoot root, org.jboss.managed.api.ManagedObject managedObject, org.jboss.managed.api.ManagedComponent component, boolean remove)
          create the xml meta data for persisting the managed object.
protected  String createRelativeDeploymentPath(org.jboss.virtual.VirtualFile vf)
          Create the relative path to the persisted deployment attachment meta data.
 URI getAttachmentStoreRoot()
          Get the uri where the attachments are stored.
protected  org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext getDeploymentContext(String name)
          Get deployment context.
 org.jboss.deployers.structure.spi.main.MainDeployerStructure getMainDeployer()
           
protected  String getMetaDataPathName(String deploymentPath)
          Get the metadata path, based on a relative path.
 PersistenceFactory getPersistenceFactory()
           
 AbstractFileAttachmentsSerializer getSerializer()
           
protected static URI getURI(File root)
           
 PersistenceRoot loadAttachment(org.jboss.virtual.VirtualFile deploymentCtx, AttachmentMetaData attachment)
          Load a attachment.
protected  RepositoryAttachmentMetaData loadAttachmentMetaData(String relativeDeploymentPath)
          Load the attachment metadata for a deployment.
 RepositoryAttachmentMetaData loadMetaData(org.jboss.virtual.VirtualFile deploymentRoot)
          Load the repository attachment meta data
 void removeComponent(String ctx, org.jboss.managed.api.ManagedComponent comp)
          Remove a component from the attachment.
 void saveAttachment(String deploymentName, org.jboss.managed.api.ManagedComponent component, boolean remove)
           
 void setMainDeployer(org.jboss.deployers.structure.spi.main.MainDeployerStructure mainDeployer)
           
 void setPersistenceFactory(PersistenceFactory persistenceFactory)
           
 void setSerializer(AbstractFileAttachmentsSerializer serializer)
           
 void updateDeployment(String ctx, org.jboss.managed.api.ManagedComponent comp)
          Persist the managed component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METADATA_NAME

public static final String METADATA_NAME
The metadata name

See Also:
Constant Field Values
Constructor Detail

AbstractAttachmentStore

public AbstractAttachmentStore(File root)

AbstractAttachmentStore

public AbstractAttachmentStore(URI uri)
Method Detail

getURI

protected static URI getURI(File root)

getAttachmentStoreRoot

public URI getAttachmentStoreRoot()
Description copied from interface: AttachmentStore
Get the uri where the attachments are stored.

Specified by:
getAttachmentStoreRoot in interface AttachmentStore
Returns:
the attachment store root

getMainDeployer

public org.jboss.deployers.structure.spi.main.MainDeployerStructure getMainDeployer()

setMainDeployer

public void setMainDeployer(org.jboss.deployers.structure.spi.main.MainDeployerStructure mainDeployer)

getSerializer

public AbstractFileAttachmentsSerializer getSerializer()

setSerializer

public void setSerializer(AbstractFileAttachmentsSerializer serializer)

getPersistenceFactory

public PersistenceFactory getPersistenceFactory()

setPersistenceFactory

public void setPersistenceFactory(PersistenceFactory persistenceFactory)

createDeployment

public org.jboss.deployers.client.spi.Deployment createDeployment(org.jboss.profileservice.spi.ProfileDeployment deployment)
                                                           throws Exception
Description copied from interface: AttachmentStore
Create a MC deployment.

Specified by:
createDeployment in interface AttachmentStore
Returns:
Throws:
Exception

loadAttachmentMetaData

protected RepositoryAttachmentMetaData loadAttachmentMetaData(String relativeDeploymentPath)
Load the attachment metadata for a deployment.

Parameters:
relativeDeploymentPath - the relative path
Returns:
the attachment metadata

loadMetaData

public RepositoryAttachmentMetaData loadMetaData(org.jboss.virtual.VirtualFile deploymentRoot)
                                          throws Exception
Description copied from interface: AttachmentStore
Load the repository attachment meta data

Specified by:
loadMetaData in interface AttachmentStore
Parameters:
deploymentRoot - the deployment root
Returns:
the persisted meta data or null if it does not exist
Throws:
Exception

removeComponent

public void removeComponent(String ctx,
                            org.jboss.managed.api.ManagedComponent comp)
                     throws Exception
Description copied from interface: AttachmentStore
Remove a component from the attachment.

Specified by:
removeComponent in interface AttachmentStore
Parameters:
ctx - the deployment context name
comp - the managed componenbt
Throws:
Exception

updateDeployment

public void updateDeployment(String ctx,
                             org.jboss.managed.api.ManagedComponent comp)
                      throws Exception
Description copied from interface: AttachmentStore
Persist the managed component.

Specified by:
updateDeployment in interface AttachmentStore
Parameters:
ctx - the deployment context name
comp - the managed componenbt
Throws:
Exception

saveAttachment

public void saveAttachment(String deploymentName,
                           org.jboss.managed.api.ManagedComponent component,
                           boolean remove)
                    throws Exception
Throws:
Exception

createPersistedMetaData

protected PersistenceRoot createPersistedMetaData(PersistenceRoot root,
                                                  org.jboss.managed.api.ManagedObject managedObject,
                                                  org.jboss.managed.api.ManagedComponent component,
                                                  boolean remove)
create the xml meta data for persisting the managed object.

Parameters:
parent - the parent managed object.
the - managed object
handler - the persistence handler
Returns:
the xml metadata.

loadAttachment

public PersistenceRoot loadAttachment(org.jboss.virtual.VirtualFile deploymentCtx,
                                      AttachmentMetaData attachment)
                               throws Exception
Description copied from interface: AttachmentStore
Load a attachment.

Specified by:
loadAttachment in interface AttachmentStore
Returns:
Throws:
Exception

getMetaDataPathName

protected String getMetaDataPathName(String deploymentPath)
Get the metadata path, based on a relative path.

Parameters:
deploymentPath - the relative path to the deployment
Returns:

createRelativeDeploymentPath

protected String createRelativeDeploymentPath(org.jboss.virtual.VirtualFile vf)
                                       throws Exception
Create the relative path to the persisted deployment attachment meta data. The string is simpleName + "-" + hash (based on the URI of the deployment)

Parameters:
deployment - the deployment
Returns:
the relative name
Throws:
Exception

getDeploymentContext

protected org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext getDeploymentContext(String name)
Get deployment context.

Parameters:
name - the deployment context name
Returns:
vfs deployment context or null if doesn't exist or not vfs based


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.