Skip to content

Commit

Permalink
Change name to connectionType
Browse files Browse the repository at this point in the history
  • Loading branch information
s-rubenstein committed May 6, 2021
1 parent 64e80f6 commit 4f5fe60
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LdapRegistrationDAO(
}
}

override def getConnectionTarget(): ConnectionType = ConnectionType.LDAP
override def getConnectionType(): ConnectionType = ConnectionType.LDAP

override def createUser(user: WorkbenchUser, samRequestContext: SamRequestContext): IO[WorkbenchUser] = {
val attrs = List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import scala.util.{Failure, Try}

class PostgresDirectoryDAO(protected val writeDbRef: DbReference, protected val readDbRef: DbReference)(implicit val cs: ContextShift[IO], timer: Timer[IO]) extends DirectoryDAO with DatabaseSupport with PostgresGroupDAO {

override def getConnectionTarget(): ConnectionType = ConnectionType.Postgres
override def getConnectionType(): ConnectionType = ConnectionType.Postgres

override def createGroup(group: BasicWorkbenchGroup, accessInstructionsOpt: Option[String], samRequestContext: SamRequestContext): IO[BasicWorkbenchGroup] = {
serializableWriteTransaction("createGroup", samRequestContext)({ implicit session =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.broadinstitute.dsde.workbench.sam.util.SamRequestContext
* away from a solution that requires that the Apache proxies query this group, we can remove the RegistrationDAO.
*/
trait RegistrationDAO {
def getConnectionTarget(): ConnectionType
def getConnectionType(): ConnectionType
def createUser(user: WorkbenchUser, samRequestContext: SamRequestContext): IO[WorkbenchUser]
def loadUser(userId: WorkbenchUserId, samRequestContext: SamRequestContext): IO[Option[WorkbenchUser]]
def deleteUser(userId: WorkbenchUserId, samRequestContext: SamRequestContext): IO[Unit]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class StatusService(
private def checkOpenDJ(): IO[SubsystemStatus] = IO {
// Since Status calls are ~80% of all Sam calls and are easy to track separately, Status calls are not being traced.
logger.info("checking opendj connection")
if (ldapRegistrationDAO.getConnectionTarget() != ConnectionType.LDAP) {
if (ldapRegistrationDAO.getConnectionType() != ConnectionType.LDAP) {
HealthMonitor.failedStatus("Connection of RegistrationDAO is not to OpenDJ")
} else {
if (ldapRegistrationDAO.checkStatus(SamRequestContext(None)))
Expand All @@ -51,7 +51,7 @@ class StatusService(

private def checkDatabase(): IO[SubsystemStatus] = IO {
logger.info("checking database connection")
if (directoryDAO.getConnectionTarget() != ConnectionType.Postgres) {
if (directoryDAO.getConnectionType() != ConnectionType.Postgres) {
HealthMonitor.failedStatus("Connection of RegistrationDAO is not to Postgres")
} else {
if (directoryDAO.checkStatus(SamRequestContext(None)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MockDirectoryDAO(private val groups: mutable.Map[WorkbenchGroupIdentity, W

private val groupAccessInstructions: mutable.Map[WorkbenchGroupName, String] = new TrieMap()

override def getConnectionTarget(): ConnectionType = ConnectionType.Postgres
override def getConnectionType(): ConnectionType = ConnectionType.Postgres

override def createGroup(group: BasicWorkbenchGroup, accessInstruction: Option[String] = None, samRequestContext: SamRequestContext): IO[BasicWorkbenchGroup] =
if (groups.keySet.contains(group.id)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MockRegistrationDAO extends RegistrationDAO {
private val petServiceAccountsByUser: mutable.Map[PetServiceAccountId, PetServiceAccount] = new TrieMap()
private val petsWithEmails: mutable.Map[WorkbenchEmail, PetServiceAccountId] = new TrieMap()

override def getConnectionTarget(): ConnectionType = ConnectionType.LDAP
override def getConnectionType(): ConnectionType = ConnectionType.LDAP

override def createUser(user: WorkbenchUser, samRequestContext: SamRequestContext): IO[WorkbenchUser] =
if (users.keySet.contains(user.id)) {
Expand Down

0 comments on commit 4f5fe60

Please sign in to comment.