org.eaglei.services.repository
Class RepositorySecurityProvider

java.lang.Object
  extended by org.eaglei.services.repository.AbstractRepositoryProvider
      extended by org.eaglei.services.repository.RepositorySecurityProvider
All Implemented Interfaces:
SecurityProvider

public final class RepositorySecurityProvider
extends AbstractRepositoryProvider
implements SecurityProvider

Author:
Ricardo De Lima, Lucy Hadden, Daniela Bourges, Ted Bashor April 11, 2010 Center for Biomedical Informatics (CBMI)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eaglei.services.repository.AbstractRepositoryProvider
AbstractRepositoryProvider.RestCommands
 
Field Summary
 
Fields inherited from class org.eaglei.services.repository.AbstractRepositoryProvider
DEFAULT_REPOSITORY_URI, DEFAULT_REPOSITORY_URL, FORMAT_VALUE, LABEL_QUERY_FAILED, WORKFLOW_TRANSITION_ALLOWED, WORKFLOW_TRANSITION_FROM, WORKFLOW_TRANSITION_FROM_LABEL, WORKFLOW_TRANSITION_LABEL, WORKFLOW_TRANSITION_SUBJECT, WORKFLOW_TRANSITION_TO, WORKFLOW_TRANSITION_TO_LABEL
 
Constructor Summary
RepositorySecurityProvider(InstitutionRegistry institutionRegistry)
          Initialize from InstitutionRegistry configuration info.
 
Method Summary
 org.apache.commons.httpclient.HttpClient getHttpClient(org.eaglei.security.Session session)
          Retrieves the HttpClient associated with the passed in Session object (if one exists).
 org.eaglei.security.Session getSession(java.lang.String sessionId)
           
 java.util.List<java.util.HashMap<java.lang.String,java.lang.String>> getWorkspaces(java.lang.String institutionId, java.lang.String sessionId)
           
 boolean isOnline(java.lang.String institutionId)
           
 boolean isValid(java.lang.String sessionId, boolean shouldThrow)
          Checks the validity of the passed in session object and the associated RepositorySession object.
 java.util.List<java.util.HashMap<java.lang.String,org.eaglei.model.EIEntity>> listWorkFlowTransitions(java.lang.String institutionId, java.lang.String sessionId, org.eaglei.model.EIEntity workspaceEntity)
           
 org.eaglei.security.Session logIn(java.lang.String institutionId, java.lang.String user, java.lang.String password)
           
 void logOut(java.lang.String sessionId)
           
 org.eaglei.security.Session whoami(java.lang.String sessionId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositorySecurityProvider

public RepositorySecurityProvider(InstitutionRegistry institutionRegistry)
Initialize from InstitutionRegistry configuration info.

Method Detail

logIn

public org.eaglei.security.Session logIn(java.lang.String institutionId,
                                         java.lang.String user,
                                         java.lang.String password)
                                  throws RepositoryProviderException
Specified by:
logIn in interface SecurityProvider
Throws:
RepositoryProviderException

logOut

public void logOut(java.lang.String sessionId)
            throws RepositoryProviderException
Specified by:
logOut in interface SecurityProvider
Throws:
RepositoryProviderException

whoami

public org.eaglei.security.Session whoami(java.lang.String sessionId)
                                   throws RepositoryProviderException
Specified by:
whoami in interface SecurityProvider
Throws:
RepositoryProviderException

isValid

public boolean isValid(java.lang.String sessionId,
                       boolean shouldThrow)
                throws RepositoryProviderException
Checks the validity of the passed in session object and the associated RepositorySession object. Optionally throws an exception for invalid sessions if the boolean flag shouldThrow is set to true.

Specified by:
isValid in interface SecurityProvider
Parameters:
session - The Session object being validated.
shouldThrow - If true then an invalid session will result in an exception, if false then an invalid session will result in a log message and a return of false.
Returns:
True if the session and the associated RepositorySession are valid. False otherwise.
Throws:
RepositoryProviderException - If the boolean shouldThrow flag is set to true and the passed in session is invalid.

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient(org.eaglei.security.Session session)
Retrieves the HttpClient associated with the passed in Session object (if one exists).

Specified by:
getHttpClient in interface SecurityProvider
Parameters:
session - The session whose HttpClient is sought.
Returns:
The HttpClient associated with the Session object or null if none exists.

isOnline

public boolean isOnline(java.lang.String institutionId)
Specified by:
isOnline in interface SecurityProvider

listWorkFlowTransitions

public java.util.List<java.util.HashMap<java.lang.String,org.eaglei.model.EIEntity>> listWorkFlowTransitions(java.lang.String institutionId,
                                                                                                             java.lang.String sessionId,
                                                                                                             org.eaglei.model.EIEntity workspaceEntity)
                                                                                                      throws RepositoryProviderException
Specified by:
listWorkFlowTransitions in interface SecurityProvider
Throws:
RepositoryProviderException

getWorkspaces

public java.util.List<java.util.HashMap<java.lang.String,java.lang.String>> getWorkspaces(java.lang.String institutionId,
                                                                                          java.lang.String sessionId)
                                                                                   throws RepositoryProviderException
Specified by:
getWorkspaces in interface SecurityProvider
Throws:
RepositoryProviderException

getSession

public org.eaglei.security.Session getSession(java.lang.String sessionId)
Specified by:
getSession in interface SecurityProvider


Copyright © 2009-2011 Eagle-I. All Rights Reserved.