|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.portalclient.dir.PCDirectoryHelper
public class PCDirectoryHelper
Provides a variety of higher level functions to simplify common tasks such as:
Nested Class Summary | |
---|---|
static class |
PCDirectoryHelper.ATTR_NAMES
Constants for user attribute name |
static class |
PCDirectoryHelper.DIR_ALIAS
Static constants to identify common aliases in MWS |
Field Summary | |
---|---|
static int |
TYPE_GROUP
Parameter constant to specify group principals |
static int |
TYPE_ROLE
Parameter constant to specify role principals |
static int |
TYPE_USER
Parameter constant to specify user principals |
Constructor Summary | |
---|---|
PCDirectoryHelper()
|
Method Summary | |
---|---|
static View |
authenticateUser(String userID,
String password)
Authenticate a user with the given userID and password |
static Map |
getAllAttributes(URI principalURI)
Get a map of all attributes associated with a given principal |
static Object |
getAttribute(URI principalAttrProviderURI,
URI principalURI,
String attrName)
Get a specific attribute from a specific principal attribute provider for a principal |
static Map |
getAttributes(URI principalAttrProviderURI,
URI principalURI)
Get a map of attributes for a principal from a specific attribute provider |
static ThingIDList |
getDirectorySvcs()
Get a ThingIDList of all available directory services |
static String |
getDirectoryURI(View view)
Get a directory URI from a View of a principal |
static ListView |
getMembers(URI principalURI)
Get a list of members of a group or role |
static ListView |
getMembership(URI principalURI,
int type)
Get a list of groups or roles that a principal has membership in |
static View |
getPrincipalAttributeProvider(String alias)
Get a View of a principal attribute provider given the provider's alias |
static View |
getSystemDirSvc()
Get a View of the MWS system directory service |
static TypedAttribute |
getTypedAttribute(URI principalAttrProviderURI,
URI principalURI,
String attrName)
Get a specified attribute for a principal from a specific attribute provider. |
static Map |
getTypedAttributes(URI principalAttrProviderURI,
URI principalURI)
Get a map of attributes for a principal from a specific attribute provider. |
static View |
getView(URI uri)
Get a View that exposes the properties of a specified MWS thing |
static ThingIDList |
listRoles()
Retrieve a list of all role defined in the system |
static View |
lookupPrincipalByDN(String dn,
int type)
Lookup a user/group/role based on the principal's dynamic name |
static View |
lookupPrincipalByID(String id,
int type)
Lookup a user/group/role based on id |
static ListView |
searchDirectory(URI directoryServiceURI,
String search,
int type)
Pperforms a search query for principals of a certain type in a specific directory service |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_USER
public static final int TYPE_GROUP
public static final int TYPE_ROLE
Constructor Detail |
---|
public PCDirectoryHelper()
Method Detail |
---|
public static View getView(URI uri) throws Exception
uri
- the MWS thing URI to retrieve a View for
Exception
public static View lookupPrincipalByID(String id, int type) throws Exception
id
- the principal IDtype
- the principal type, either PCDirectoryHelper.TYPE_GROUP
, PCDirectoryHelper.TYPE_ROLE
or PCDirectoryHelper.TYPE_USER
Exception
public static View lookupPrincipalByDN(String dn, int type) throws Exception
dn
- the principal DNtype
- the principal type, either PCDirectoryHelper.TYPE_GROUP
, PCDirectoryHelper.TYPE_ROLE
or PCDirectoryHelper.TYPE_USER
Exception
public static ListView searchDirectory(URI directoryServiceURI, String search, int type) throws Exception
directoryServiceURI
- the URI of the directory service to searchsearch
- The search string. Wildcarding is implied, e.g. 'bob' will match user 'bobby' and 'kabob'type
- the principal type to search for, either PCDirectoryHelper.TYPE_GROUP
, PCDirectoryHelper.TYPE_ROLE
or PCDirectoryHelper.TYPE_USER
Exception
public static Map getAllAttributes(URI principalURI) throws Exception
principalURI
- the URI identifying the principal to retrieve attributes for
Exception
public static Map getAttributes(URI principalAttrProviderURI, URI principalURI) throws Exception
principalAttrProviderURI
- the URI of the attribute provider to retrieve attributes from, null returns the principal's core attributesprincipalURI
- the URI identifying the principal to retrieve attributes for
Exception
public static Object getAttribute(URI principalAttrProviderURI, URI principalURI, String attrName) throws Exception
principalAttrProviderURI
- the URI of the attribute provider to retrieve attributes from, null returns the principal's core attributesprincipalURI
- the URI identifying the principal to retrieve attributes forattrName
- the attribute name to retrieve
Exception
public static Map getTypedAttributes(URI principalAttrProviderURI, URI principalURI) throws Exception
PCDirectoryHelper.DIR_ALIAS.PAP_DYN_ATTR_MAP
attribute provider, which contain information
about attribute data types
principalAttrProviderURI
- the URI of the attribute provider to retrieve attributes from, null returns the principal's core attributesprincipalURI
- the URI identifying the principal to retrieve attributes for
TypedAttribute
pairs
Exception
public static TypedAttribute getTypedAttribute(URI principalAttrProviderURI, URI principalURI, String attrName) throws Exception
PCDirectoryHelper.DIR_ALIAS.PAP_DYN_ATTR_MAP
attribute provider, which contain information
about attribute data types
principalAttrProviderURI
- the URI of the attribute provider to retrieve attributes from, null returns the principal's core attributesprincipalURI
- the URI identifying the principal to retrieve attributes forattrName
- the name of the attribute to retrieve
TypedAttribute
, the object may be null
Exception
public static ListView getMembers(URI principalURI) throws Exception
principalURI
- the URI identifying the principal to retrieve membership for
Exception
public static ListView getMembership(URI principalURI, int type) throws Exception
principalURI
- he URI identifying the principal to retrieve membership intype
- type the principal membership to retrieve, either PCDirectoryHelper.TYPE_GROUP
, PCDirectoryHelper.TYPE_ROLE
Exception
public static ThingIDList listRoles() throws Exception
Exception
public static View authenticateUser(String userID, String password) throws Exception
userID
- the userID to authenticatepassword
- the password to use to authenticate
View
of user if authenticated, may be null
Exception
public static View getSystemDirSvc() throws Exception
Exception
public static ThingIDList getDirectorySvcs() throws Exception
Exception
public static View getPrincipalAttributeProvider(String alias) throws Exception
alias
- the provider to retrieve, see PCDirectoryHelper.DIR_ALIAS
for a list of well known principal attribute provider aliases
Exception
public static String getDirectoryURI(View view) throws Exception
view
- a principal View to extract the principal URI from
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |