railo.commons.io.res.type.datasource
Class DatasourceResourceProvider

java.lang.Object
  extended by railo.commons.io.res.type.datasource.DatasourceResourceProvider
All Implemented Interfaces:
Serializable, ResourceProvider, Sizeable

public final class DatasourceResourceProvider
extends Object
implements ResourceProvider, Sizeable

Resource Provider for ram resource

See Also:
Serialized Form

Nested Class Summary
 class DatasourceResourceProvider.ConnectionData
           
 
Field Summary
static int DBTYPE_ANSI92
           
static int DBTYPE_MSSQL
           
static int DBTYPE_MYSQL
           
 
Constructor Summary
DatasourceResourceProvider()
           
 
Method Summary
 boolean concatSupported(DatasourceResourceProvider.ConnectionData data)
           
 void create(DatasourceResourceProvider.ConnectionData data, int fullPathHash, int pathHash, String path, String name, int type)
           
 void delete(DatasourceResourceProvider.ConnectionData data, int fullPathHash, String path, String name)
           
 Map getArguments()
          returns the arguments defined for this resource
 Attr getAttr(DatasourceResourceProvider.ConnectionData data, int fullPathHash, String path, String name)
           
 Attr[] getAttrs(DatasourceResourceProvider.ConnectionData data, int pathHash, String path)
           
 InputStream getInputStream(DatasourceResourceProvider.ConnectionData data, int fullPathHash, String path, String name)
           
 OutputStream getOutputStream(DatasourceResourceProvider.ConnectionData data, int fullPathHash, int pathHash, String path, String name, boolean append)
           
 Resource getResource(String path)
          return a resource that match given path
 String getScheme()
          returns the scheme of the resource
 ResourceProvider init(String scheme, Map arguments)
          initalize ram resource
 boolean isAttributesSupported()
          returns if the resource support attributes for his resources
 boolean isCaseSensitive()
          returns if the resources of the provider are case-sensitive or not
 boolean isModeSupported()
          returns if the resource support mode for his resources
 void lock(Resource res)
           
 DatasourceResourceProvider.ConnectionData parse(StringBuilder subPath, String path)
           
 void read(Resource res)
           
 boolean setLastModified(DatasourceResourceProvider.ConnectionData data, int fullPathHash, String path, String name, long time)
           
 boolean setMode(DatasourceResourceProvider.ConnectionData data, int fullPathHash, String path, String name, int mode)
           
 void setResources(Resources resources)
           
 long sizeOf()
          return the size of the object
 void unlock(Resource res)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBTYPE_ANSI92

public static final int DBTYPE_ANSI92
See Also:
Constant Field Values

DBTYPE_MSSQL

public static final int DBTYPE_MSSQL
See Also:
Constant Field Values

DBTYPE_MYSQL

public static final int DBTYPE_MYSQL
See Also:
Constant Field Values
Constructor Detail

DatasourceResourceProvider

public DatasourceResourceProvider()
Method Detail

sizeOf

public long sizeOf()
Description copied from interface: Sizeable
return the size of the object

Specified by:
sizeOf in interface Sizeable
Returns:
size of the object

init

public ResourceProvider init(String scheme,
                             Map arguments)
initalize ram resource

Specified by:
init in interface ResourceProvider
Parameters:
scheme -
arguments -
Returns:
RamResource

getResource

public Resource getResource(String path)
Description copied from interface: ResourceProvider
return a resource that match given path

Specified by:
getResource in interface ResourceProvider
Returns:
matching resource to path

parse

public DatasourceResourceProvider.ConnectionData parse(StringBuilder subPath,
                                                       String path)

getScheme

public String getScheme()
Description copied from interface: ResourceProvider
returns the scheme of the resource

Specified by:
getScheme in interface ResourceProvider
Returns:
scheme

setResources

public void setResources(Resources resources)
Specified by:
setResources in interface ResourceProvider

lock

public void lock(Resource res)
          throws IOException
Specified by:
lock in interface ResourceProvider
Throws:
IOException

unlock

public void unlock(Resource res)
Specified by:
unlock in interface ResourceProvider

read

public void read(Resource res)
          throws IOException
Specified by:
read in interface ResourceProvider
Throws:
IOException

isAttributesSupported

public boolean isAttributesSupported()
Description copied from interface: ResourceProvider
returns if the resource support attributes for his resources

Specified by:
isAttributesSupported in interface ResourceProvider
Returns:
is attributes supported or not

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: ResourceProvider
returns if the resources of the provider are case-sensitive or not

Specified by:
isCaseSensitive in interface ResourceProvider
Returns:
is resource case-sensitive or not

isModeSupported

public boolean isModeSupported()
Description copied from interface: ResourceProvider
returns if the resource support mode for his resources

Specified by:
isModeSupported in interface ResourceProvider
Returns:
is mode supported or not

getAttr

public Attr getAttr(DatasourceResourceProvider.ConnectionData data,
                    int fullPathHash,
                    String path,
                    String name)

getAttrs

public Attr[] getAttrs(DatasourceResourceProvider.ConnectionData data,
                       int pathHash,
                       String path)
                throws PageException
Throws:
PageException

create

public void create(DatasourceResourceProvider.ConnectionData data,
                   int fullPathHash,
                   int pathHash,
                   String path,
                   String name,
                   int type)
            throws IOException
Throws:
IOException

delete

public void delete(DatasourceResourceProvider.ConnectionData data,
                   int fullPathHash,
                   String path,
                   String name)
            throws IOException
Throws:
IOException

getInputStream

public InputStream getInputStream(DatasourceResourceProvider.ConnectionData data,
                                  int fullPathHash,
                                  String path,
                                  String name)
                           throws IOException
Throws:
IOException

getOutputStream

public OutputStream getOutputStream(DatasourceResourceProvider.ConnectionData data,
                                    int fullPathHash,
                                    int pathHash,
                                    String path,
                                    String name,
                                    boolean append)
                             throws IOException
Throws:
IOException

setLastModified

public boolean setLastModified(DatasourceResourceProvider.ConnectionData data,
                               int fullPathHash,
                               String path,
                               String name,
                               long time)

setMode

public boolean setMode(DatasourceResourceProvider.ConnectionData data,
                       int fullPathHash,
                       String path,
                       String name,
                       int mode)

concatSupported

public boolean concatSupported(DatasourceResourceProvider.ConnectionData data)

getArguments

public Map getArguments()
Description copied from interface: ResourceProvider
returns the arguments defined for this resource

Specified by:
getArguments in interface ResourceProvider
Returns:
scheme


Copyright © 2012 Railo