com.dtolabs.rundeck.core.jndi
Class Jndi

java.lang.Object
  extended by com.dtolabs.rundeck.core.jndi.Jndi

public class Jndi
extends java.lang.Object

Jndi class wrapper. provides methods to connect to and obtain info from jndi server (such as ldap)


Constructor Summary
Jndi(JndiConfig cfg)
           
Jndi(java.lang.String connectionName, java.lang.String connectionPassword, java.lang.String connectionUrl, java.lang.String roleBase, java.lang.String roleNameRDN, java.lang.String roleMemberRDN, java.lang.String userBase, java.lang.String userNameRDN)
          sets parameters needed for initial connection to the jndi server
 
Method Summary
 java.lang.String getConnectionName()
          getter for the jndi connection name
 java.lang.String getConnectionPassword()
          getter for the jndi connection password
 java.lang.String getConnectionUrl()
          getter for the jndi connection url
 javax.naming.directory.DirContext getInitialDirContext()
          getter for the jndi initialDirContext
 java.lang.String getRoleBase()
          getter for the jndi role base
 java.lang.String getRoleMemberRDN()
          setter for the jndi role member rdn
 java.lang.String getRoleNameRDN()
          getter for the jndi role name rdn
 java.lang.String[] getRoles(java.lang.String userName)
          return list of roles associated with given userName
 java.lang.String getUserBase()
          getter for the jndi user base
 java.lang.String getUserNameRDN()
          getter for the jndi username rdn
 java.lang.String[] getUsers(java.lang.String roleName)
          return list of all users for a given role as a String array
 void setConnectionName(java.lang.String connectionName)
          setter for the jndi connection name
 void setConnectionPassword(java.lang.String connectionPassword)
          setter for the jndi connection password
 void setConnectionUrl(java.lang.String connectionUrl)
          setter for the jndi connection url
 void setInitialDirContext(javax.naming.directory.DirContext initialDirContext)
          setter for the jndi initialDirContext
 void setRoleBase(java.lang.String roleBase)
          setter for the jndi role base
 void setRoleMemberRDN(java.lang.String roleMemberRDN)
          setter for the jndi role member rdn
 void setRoleNameRDN(java.lang.String roleNameRDN)
          setter for the jndi role name rdn
 void setUserBase(java.lang.String userBase)
          setter for the jndi user base
 void setUserNameRDN(java.lang.String userNameRDN)
          setter for the jndi username rdn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jndi

public Jndi(java.lang.String connectionName,
            java.lang.String connectionPassword,
            java.lang.String connectionUrl,
            java.lang.String roleBase,
            java.lang.String roleNameRDN,
            java.lang.String roleMemberRDN,
            java.lang.String userBase,
            java.lang.String userNameRDN)
     throws javax.naming.NamingException
sets parameters needed for initial connection to the jndi server

Parameters:
connectionName - distinquished name (dn) to connect to jndi server with
connectionPassword - password for the dn
connectionUrl - url to connect to the jndi server with
roleBase - the suffix for all roles
roleNameRDN - the key name (such as "cn") to reference
roleMemberRDN - the key name to reference members of roles
userBase - the suffix for users
userNameRDN - the key name to reference a username
Throws:
javax.naming.NamingException

Jndi

public Jndi(JndiConfig cfg)
     throws javax.naming.NamingException
Throws:
javax.naming.NamingException
Method Detail

setInitialDirContext

public void setInitialDirContext(javax.naming.directory.DirContext initialDirContext)
setter for the jndi initialDirContext

Parameters:
initialDirContext -

getInitialDirContext

public javax.naming.directory.DirContext getInitialDirContext()
getter for the jndi initialDirContext

Returns:
DirContext

setConnectionName

public void setConnectionName(java.lang.String connectionName)
setter for the jndi connection name

Parameters:
connectionName -

getConnectionName

public java.lang.String getConnectionName()
getter for the jndi connection name

Returns:
String

setConnectionPassword

public void setConnectionPassword(java.lang.String connectionPassword)
setter for the jndi connection password

Parameters:
connectionPassword -

getConnectionPassword

public java.lang.String getConnectionPassword()
getter for the jndi connection password

Returns:
String

setConnectionUrl

public void setConnectionUrl(java.lang.String connectionUrl)
setter for the jndi connection url

Parameters:
connectionUrl -

getConnectionUrl

public java.lang.String getConnectionUrl()
getter for the jndi connection url

Returns:
String

setRoleBase

public void setRoleBase(java.lang.String roleBase)
setter for the jndi role base

Parameters:
roleBase -

getRoleBase

public java.lang.String getRoleBase()
getter for the jndi role base

Returns:
String

setRoleNameRDN

public void setRoleNameRDN(java.lang.String roleNameRDN)
setter for the jndi role name rdn

Parameters:
roleNameRDN -

getRoleNameRDN

public java.lang.String getRoleNameRDN()
getter for the jndi role name rdn

Returns:
String

setRoleMemberRDN

public void setRoleMemberRDN(java.lang.String roleMemberRDN)
setter for the jndi role member rdn

Parameters:
roleMemberRDN -

getRoleMemberRDN

public java.lang.String getRoleMemberRDN()
setter for the jndi role member rdn

Returns:
String

setUserBase

public void setUserBase(java.lang.String userBase)
setter for the jndi user base

Parameters:
userBase -

getUserBase

public java.lang.String getUserBase()
getter for the jndi user base

Returns:
String

setUserNameRDN

public void setUserNameRDN(java.lang.String userNameRDN)
setter for the jndi username rdn

Parameters:
userNameRDN -

getUserNameRDN

public java.lang.String getUserNameRDN()
getter for the jndi username rdn

Returns:
String

getUsers

public java.lang.String[] getUsers(java.lang.String roleName)
                            throws javax.naming.NamingException
return list of all users for a given role as a String array

Parameters:
roleName -
Returns:
String[]
Throws:
javax.naming.NamingException

getRoles

public java.lang.String[] getRoles(java.lang.String userName)
                            throws javax.naming.NamingException
return list of roles associated with given userName

Parameters:
userName -
Returns:
String[]
Throws:
javax.naming.NamingException