org.alfresco.repo.cmis.client
Class AbstractCMISConnectionManagerImpl

java.lang.Object
  extended by org.alfresco.repo.cmis.client.CMISHelper
      extended by org.alfresco.repo.cmis.client.AbstractCMISConnectionManagerImpl
All Implemented Interfaces:
CMISConnectionManager
Direct Known Subclasses:
CMISLocalConnectionManagerImpl, CMISRemoteConnectionManagerImpl

public abstract class AbstractCMISConnectionManagerImpl
extends CMISHelper
implements CMISConnectionManager

Connection manager base class.


Field Summary
protected  org.alfresco.service.cmr.security.AuthenticationService authenticationService
           
protected  org.springframework.extensions.config.ConfigService configService
           
static java.lang.String DEFAULT_CONNECTION_ID
           
protected  java.util.concurrent.locks.ReentrantReadWriteLock lock
           
static char RESERVED_ID_CHAR
           
static java.lang.String SERVER_DESCRIPTION
           
static java.lang.String SERVER_NAME
           
protected  java.util.Map servers
           
protected  org.apache.chemistry.opencmis.client.api.SessionFactory sessionFactory
           
protected  java.util.LinkedHashMap sharedConnections
           
protected  int sharedConnectionsCapacity
           
protected  java.util.LinkedHashMap userConnections
           
protected  int userConnectionsCapacity
           
 
Constructor Summary
AbstractCMISConnectionManagerImpl()
           
 
Method Summary
protected  CMISConnection createConnection(CMISServer server, java.lang.String connectionId, boolean isShared)
           
 CMISServer createServerDefinition(CMISServer server, java.lang.String username, java.lang.String password)
          Creates a new server definition from a template.
 CMISServer createServerDefinition(CMISServer server, java.lang.String username, java.lang.String password, java.lang.String repositoryId)
          Creates a new server definition from a template.
protected  CMISServer createServerDefinition(java.util.Map parameters)
           
 CMISServer createServerDefinition(java.lang.String serverName, java.util.Map parameters)
          Creates a new server definition.
protected  org.apache.chemistry.opencmis.client.api.Session createSession(java.util.Map parameters)
           
 CMISConnection createSharedConnection(CMISServer server, java.lang.String connectionId)
          Creates a new connection that is visible to all users.
 CMISConnection createUserConnection(CMISServer server, java.lang.String connectionId)
          Creates a new connection that is only visible to the current user.
protected  java.lang.String createUserConnectionId(java.lang.String username, java.lang.String connectionId)
           
abstract  CMISConnection getConnection()
          Gets or creates a connection to the local server or a default server.
 CMISConnection getConnection(java.lang.String connectionId)
          Returns a specific connection or null if the connection id is unknown.
 java.util.List getRepositories(CMISServer server)
          Returns all repositories available at this server.
 CMISServer getServerDefinition(java.lang.String serverName)
          Gets a server definitions by name.
 java.util.List getServerDefinitions()
          Returns all configured server definitions.
 java.util.List getSharedConnections()
          Returns all shared connections.
 java.util.List getUserConnections()
          Returns all user connections.
 void init()
           
 void removeConnection(CMISConnection connection)
           
 void setAuthenticationService(org.alfresco.service.cmr.security.AuthenticationService authenticationService)
           
 void setConfigService(org.springframework.extensions.config.ConfigService configService)
           
 void setSharedConnectionsCapacity(int sharedConnectionsCapacity)
           
 void setUserConnectionsCapacity(int userConnectionsCapacity)
           
 
Methods inherited from class org.alfresco.repo.cmis.client.CMISHelper
createContentStream, createContentStream, createMap, isDocument, isFolder, isPolicy, isRelationship
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.repo.cmis.client.CMISConnectionManager
createDefaultConnection
 

Field Detail

SERVER_NAME

public static final java.lang.String SERVER_NAME
See Also:
Constant Field Values

SERVER_DESCRIPTION

public static final java.lang.String SERVER_DESCRIPTION
See Also:
Constant Field Values

DEFAULT_CONNECTION_ID

public static final java.lang.String DEFAULT_CONNECTION_ID
See Also:
Constant Field Values

RESERVED_ID_CHAR

public static final char RESERVED_ID_CHAR
See Also:
Constant Field Values

configService

protected org.springframework.extensions.config.ConfigService configService

authenticationService

protected org.alfresco.service.cmr.security.AuthenticationService authenticationService

sessionFactory

protected final org.apache.chemistry.opencmis.client.api.SessionFactory sessionFactory

sharedConnections

protected java.util.LinkedHashMap sharedConnections

userConnections

protected java.util.LinkedHashMap userConnections

userConnectionsCapacity

protected int userConnectionsCapacity

sharedConnectionsCapacity

protected int sharedConnectionsCapacity

servers

protected java.util.Map servers

lock

protected final java.util.concurrent.locks.ReentrantReadWriteLock lock
Constructor Detail

AbstractCMISConnectionManagerImpl

public AbstractCMISConnectionManagerImpl()
Method Detail

setConfigService

public void setConfigService(org.springframework.extensions.config.ConfigService configService)

setAuthenticationService

public void setAuthenticationService(org.alfresco.service.cmr.security.AuthenticationService authenticationService)

setUserConnectionsCapacity

public void setUserConnectionsCapacity(int userConnectionsCapacity)

setSharedConnectionsCapacity

public void setSharedConnectionsCapacity(int sharedConnectionsCapacity)

init

public void init()

createUserConnection

public CMISConnection createUserConnection(CMISServer server,
                                           java.lang.String connectionId)
Description copied from interface: CMISConnectionManager
Creates a new connection that is only visible to the current user.

Specified by:
createUserConnection in interface CMISConnectionManager

createUserConnectionId

protected java.lang.String createUserConnectionId(java.lang.String username,
                                                  java.lang.String connectionId)

createSharedConnection

public CMISConnection createSharedConnection(CMISServer server,
                                             java.lang.String connectionId)
Description copied from interface: CMISConnectionManager
Creates a new connection that is visible to all users.

Specified by:
createSharedConnection in interface CMISConnectionManager

createConnection

protected CMISConnection createConnection(CMISServer server,
                                          java.lang.String connectionId,
                                          boolean isShared)

getConnection

public abstract CMISConnection getConnection()
Description copied from interface: CMISConnectionManager
Gets or creates a connection to the local server or a default server.

Specified by:
getConnection in interface CMISConnectionManager

getConnection

public CMISConnection getConnection(java.lang.String connectionId)
Description copied from interface: CMISConnectionManager
Returns a specific connection or null if the connection id is unknown.

Specified by:
getConnection in interface CMISConnectionManager

getUserConnections

public java.util.List getUserConnections()
Description copied from interface: CMISConnectionManager
Returns all user connections.

Specified by:
getUserConnections in interface CMISConnectionManager

getSharedConnections

public java.util.List getSharedConnections()
Description copied from interface: CMISConnectionManager
Returns all shared connections.

Specified by:
getSharedConnections in interface CMISConnectionManager

removeConnection

public void removeConnection(CMISConnection connection)

createSession

protected org.apache.chemistry.opencmis.client.api.Session createSession(java.util.Map parameters)

getServerDefinitions

public java.util.List getServerDefinitions()
Description copied from interface: CMISConnectionManager
Returns all configured server definitions.

Specified by:
getServerDefinitions in interface CMISConnectionManager

getServerDefinition

public CMISServer getServerDefinition(java.lang.String serverName)
Description copied from interface: CMISConnectionManager
Gets a server definitions by name.

Specified by:
getServerDefinition in interface CMISConnectionManager

createServerDefinition

public CMISServer createServerDefinition(java.lang.String serverName,
                                         java.util.Map parameters)
Description copied from interface: CMISConnectionManager
Creates a new server definition.

Specified by:
createServerDefinition in interface CMISConnectionManager

createServerDefinition

public CMISServer createServerDefinition(CMISServer server,
                                         java.lang.String username,
                                         java.lang.String password)
Description copied from interface: CMISConnectionManager
Creates a new server definition from a template.

Specified by:
createServerDefinition in interface CMISConnectionManager

createServerDefinition

public CMISServer createServerDefinition(CMISServer server,
                                         java.lang.String username,
                                         java.lang.String password,
                                         java.lang.String repositoryId)
Description copied from interface: CMISConnectionManager
Creates a new server definition from a template.

Specified by:
createServerDefinition in interface CMISConnectionManager

createServerDefinition

protected CMISServer createServerDefinition(java.util.Map parameters)

getRepositories

public java.util.List getRepositories(CMISServer server)
Description copied from interface: CMISConnectionManager
Returns all repositories available at this server.

Specified by:
getRepositories in interface CMISConnectionManager


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.