com.sap.security.api
Interface IPrincipalMetaData


public interface IPrincipalMetaData

This interface provides methods to

  1. access meta data of principal objects.


Field Summary
static int IPRINCIPAL
           
static int IPRINCIPALSET
           
static java.lang.String VERSIONSTRING
           
 
Method Summary
 java.lang.String[] getAttribute(java.lang.String namespace, java.lang.String name)
          Generic get method to access additional attributes.
 java.lang.String[] getAttributeNames(java.lang.String namespace)
          Gets the names of all attributes contained in the given namespace, or null if that namespace does not exist.
 java.lang.String[] getAttributeNamespaces()
          Gets all non-null namespaces defined for this user.
 java.lang.String getAttributeType(java.lang.String namespace, java.lang.String attributeName)
          Gets the type of the attribute.
 byte[] getBinaryAttribute(java.lang.String namespace, java.lang.String name)
          Generic get method to access additional attributes.
 java.lang.String getDescription(java.util.Locale locale)
          Returns the title of the IPrincipal object which is described by this IPrincipalMetaData object.
 int getPrincipalType()
          Gets the semantic type of the described IPrincipal object, e.g.
 java.lang.String getPrincipalTypeIdentifier()
          Gets the principal type identifier of the described IPrincipal object.
 java.lang.String getTitle(java.util.Locale locale)
          Returns the title of the IPrincipal object which is described by this IPrincipalMetaData object.
 boolean setAttribute(java.lang.String namespace, java.lang.String name, java.lang.String[] values)
          Generic method to associate arbitrary text data with a IPrincipalMetaData object.
 boolean setBinaryAttribute(java.lang.String namespace, java.lang.String name, byte[] value)
          Generic method to associate arbitrary binary data with a IPrincipalMetaData object.
 void setDescription(java.lang.String description, java.util.Locale locale)
          Sets the description for the given locale.
 void setTitle(java.lang.String title, java.util.Locale locale)
          Sets the title for the given locale.
 

Field Detail

VERSIONSTRING

public static final java.lang.String VERSIONSTRING

IPRINCIPAL

public static final int IPRINCIPAL

IPRINCIPALSET

public static final int IPRINCIPALSET
Method Detail

getTitle

public java.lang.String getTitle(java.util.Locale locale)
Returns the title of the IPrincipal object which is described by this IPrincipalMetaData object. Returns the title for the given locale or null, if no title is available for the given locale.
Parameters:
locale - the locale
Returns:
the title for the given locale or null if it's not available

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Returns the title of the IPrincipal object which is described by this IPrincipalMetaData object. Returns the title for the given locale or null, if no title is available for the given locale.
Parameters:
locale - the locale
Returns:
the title for the given locale or null if it's not available

setTitle

public void setTitle(java.lang.String title,
                     java.util.Locale locale)
Sets the title for the given locale. If the given title is null, a already set title for the given locale will be deleted. Null values for the locale are allowed. It is recommended to set at least a description for the locale en_US because this is used as default locale by most applications.
Parameters:
title - the title or null
locale - the locale

setDescription

public void setDescription(java.lang.String description,
                           java.util.Locale locale)
Sets the description for the given locale. If the given description is null, a already set description for the given locale will be deleted. Null values for the locale are allowed. It is recommended to set at least a description for the locale en_US because this is used as default locale by most applications.
Parameters:
description - the description or null
locale - the locale

getPrincipalTypeIdentifier

public java.lang.String getPrincipalTypeIdentifier()
Gets the principal type identifier of the described IPrincipal object. For details about the principal type identifier see IPrincipalFactory.newPrincipal(String)
Returns:
The principal type identifier

getPrincipalType

public int getPrincipalType()
Gets the semantic type of the described IPrincipal object, e.g. IPrincipalMetaData.IPRINCIPAL or IPrincipalMetaData.IPRINCIPALSET
Returns:
The semantic type of the IPrincipalObject

setAttribute

public boolean setAttribute(java.lang.String namespace,
                            java.lang.String name,
                            java.lang.String[] values)
Generic method to associate arbitrary text data with a IPrincipalMetaData object. The method will return true if values is different from the attribute's previous values, false otherwise. Namespace and name can have up to 255 characters. Each value can have up to 255 characters.
Parameters:
namespace - namespace of the attribute to set (max. 255 characters).
name - name of the attribute (max. 255 characters)
values - values of the attribute (each max. 255 characters)
Throws:
UMRuntimeException - if either namespace or name is not supported

setBinaryAttribute

public boolean setBinaryAttribute(java.lang.String namespace,
                                  java.lang.String name,
                                  byte[] value)
Generic method to associate arbitrary binary data with a IPrincipalMetaData object. The method will return true if values is different from the attribute's previous values, false otherwise. Namespace and name can have up to 255 characters.
Parameters:
namespace - namespace of the attribute to set (max. 255 characters).
name - name of the attribute (max. 255 characters)
value - byte array of values of the attribute
Throws:
UMRuntimeException - if either namespace or name is not supported

getAttributeType

public java.lang.String getAttributeType(java.lang.String namespace,
                                         java.lang.String attributeName)
Gets the type of the attribute. Returns IPrincipal.STRING_TYPE if the attribute has the type String, or IPrincipal.BYTE_TYPE if it is a binary attribute. Returns null if the attribute is not available.
Returns:
the type of the attribute

getAttributeNames

public java.lang.String[] getAttributeNames(java.lang.String namespace)
Gets the names of all attributes contained in the given namespace, or null if that namespace does not exist. If namespace does exists but contains no attributes, an empty array will be returned. To retrieve the names of all attributes that are in no distinct namespace, call this method with the parameter null
Parameters:
namespace - namespace or null
Returns:
attribute names in namespace or null

getAttributeNamespaces

public java.lang.String[] getAttributeNamespaces()
Gets all non-null namespaces defined for this user. Implementations must guarantee that even if the namespace null exists, it is not returned as an element in the array. Applications which need to access the namespace null must check for its existence and the contained attributes explicitly via getAttributeNames(null).
Returns:
all non-null namespaces defined for this user

getAttribute

public java.lang.String[] getAttribute(java.lang.String namespace,
                                       java.lang.String name)
Generic get method to access additional attributes. These attributes are contained in separate namespaces, and are accessible via their names. Attributes that are in no distinct namespace are formally located in the namespace null. Each attribute can have multiple String values.
Parameters:
namespace - namespace the attribute is in (may be null)
name - name of the attribute
Returns:
the values of the respective attribute, or null if this namespace or attribute within this namespace does not exist

getBinaryAttribute

public byte[] getBinaryAttribute(java.lang.String namespace,
                                 java.lang.String name)
Generic get method to access additional attributes. These attributes are contained in separate namespaces, and are accessible via their names. Attributes that are in no distinct namespace are formally located in the namespace null.
Parameters:
namespace - namespace the attribute is in (may be null)
name - name of the attribute
Returns:
the values of the respective attribute, or null if this namespace or attribute within this namespace does not exist


Copyright © 2002 SAP AG All Rights Reserved.