com.sap.security.api
Class PrincipalIterator
java.lang.Object
|
+--com.sap.security.api.PrincipalIterator
- All Implemented Interfaces:
- java.util.Iterator
- public class PrincipalIterator
- extends java.lang.Object
- implements java.util.Iterator
Class PrincipalIterator is used to change the return type of
iterators returned by this API (e.g. IUser.getRoles(...))
The following return types are available:
PrincipalIterator.ITERATOR_TYPE_PRINCIPALS
(default) Returns IPrincipal objects
PrincipalIterator.ITERATOR_TYPE_UNIQUEIDS_CHECKED
Returns unique ids (String) of existing principals
PrincipalIterator.ITERATOR_TYPE_UNIQUEIDS_NOT_CHECKED
Returns unique ids (String) of principals without checking their existence
Example:
Iterator it = user.getRoles(true);
PrincipalIterator pIterator = new PrincipalIterator(it, PrincipalIterator.ITERATOR_TYPE_PRINCIPALS);
while (pIterator.hasNext())
{
IPrincipal principal = (IPrincipal)pIterator.next();
}
|
Constructor Summary |
PrincipalIterator(java.util.Iterator iterator)
Constructor of PrincipalIterator. |
PrincipalIterator(java.util.Iterator iterator,
int type)
Constructor of PrincipalIterator where the return type can be expicitely specified. |
|
Method Summary |
boolean |
hasNext()
Checks whether there are more objects. |
java.lang.Object |
next()
Returns the next object. |
void |
remove()
This method is not supported. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ITERATOR_TYPE_UNIQUEIDS_CHECKED
public static int ITERATOR_TYPE_UNIQUEIDS_CHECKED
ITERATOR_TYPE_UNIQUEIDS_NOT_CHECKED
public static int ITERATOR_TYPE_UNIQUEIDS_NOT_CHECKED
ITERATOR_TYPE_PRINCIPALS
public static int ITERATOR_TYPE_PRINCIPALS
PrincipalIterator
public PrincipalIterator(java.util.Iterator iterator,
int type)
- Constructor of PrincipalIterator where the return type can be expicitely specified.
- Parameters:
iterator: - the original iterator, which was returned by UME objectstype: - the type which should be returned by the next()-method
PrincipalIterator
public PrincipalIterator(java.util.Iterator iterator)
- Constructor of PrincipalIterator.
A PrincipalIterator which was instanciated by this constructor will return the default
type (IPrincipal objects where the existence is checked).
- Parameters:
iterator: - the original iterator, which was returned by UME objects
hasNext
public boolean hasNext()
- Checks whether there are more objects.
- Specified by:
hasNext in interface java.util.Iterator
next
public java.lang.Object next()
- Returns the next object.
- Specified by:
next in interface java.util.Iterator
- Throws:
NoSuchElementException - if there are no more objects to return.
remove
public void remove()
- This method is not supported.
- Specified by:
remove in interface java.util.Iterator
- Throws:
UnsupportedOperationException -
Copyright © 2002 SAP AG All Rights Reserved.