|
Knopflerfish OSGi 2.4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knopflerfish.util.metatype.OCD
Implementation of the ObjectClassDefinition interface.
Field Summary |
Fields inherited from interface org.osgi.service.metatype.ObjectClassDefinition |
ALL, OPTIONAL, REQUIRED |
Constructor Summary | |
OCD(java.lang.String id,
java.lang.String name,
java.lang.String desc,
java.util.Dictionary props)
Creates an OCD with attribute definitions from an existing dictionary. |
|
OCD(java.lang.String id,
java.lang.String name,
java.lang.String desc,
java.net.URL sourceURL)
Create a new, empty ObjectClassDefinition. |
Method Summary | |
void |
add(AD attr,
int filter)
Add an attribute definition |
void |
addIcon(int size,
java.lang.String url)
|
AttributeDefinition[] |
getAttributeDefinitions(int filter)
Return the attribute definitions for this object class. |
java.lang.String |
getDescription()
Get description of OCD. |
java.io.InputStream |
getIcon(int size)
This code is handles multiple icon sizes but the spec. |
java.lang.String |
getID()
Return the id of this object class. |
int |
getMaxInstances()
Get maximum number of instances. |
java.lang.String |
getName()
Return the name of this object class. |
void |
setIconURL(java.lang.String url)
Set URL to icon |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OCD(java.lang.String id, java.lang.String name, java.lang.String desc, java.net.URL sourceURL)
id
- unique ID of the definition.name
- human-readable name of the definition. If set to
null,
use id as name.desc
- human-readable description of the definition
java.lang.IllegalArgumentException
- if id is public OCD(java.lang.String id, java.lang.String name, java.lang.String desc, java.util.Dictionary props)
id
- unique ID of the definition.name
- human-readable name of the definition. If set to null,
use id as name.desc
- human-readable description of the definitionprops
- set of key value pairs used for attribute definitions.
all entries in props will be set as REQUIRED
atttributes.
java.lang.IllegalArgumentException
- if id is Method Detail |
public void add(AD attr, int filter)
attr
- definition to addfilter
- either OPTIONAL or REQUIRED
Illegalargumentexception
- if filter is not OPTIONAL or REQUIREDpublic AttributeDefinition[] getAttributeDefinitions(int filter)
ObjectClassDefinition
Return a set of attributes. The filter parameter can distinguish between
ALL
,REQUIRED
or the OPTIONAL
attributes.
getAttributeDefinitions
in interface ObjectClassDefinition
filter
- ALL
,REQUIRED
,OPTIONAL
null
if no
attributes are selectedpublic java.lang.String getDescription()
getDescription
in interface ObjectClassDefinition
public java.io.InputStream getIcon(int size) throws java.io.IOException
getIcon
in interface ObjectClassDefinition
size
- Size of icon requested, if size is 0 return largest icon.
null
java.io.IOException
- If the InputStream
cannot be returned.public int getMaxInstances()
public void setIconURL(java.lang.String url)
public void addIcon(int size, java.lang.String url)
public java.lang.String getID()
ObjectClassDefinition
ObjectDefintion
objects share a global namespace in the
registry. They share this aspect with LDAP/X.500 attributes. In these
standards the OSI Object Identifier (OID) is used to uniquely identify
object classes. If such an OID exists, (which can be requested at several
standard organisations and many companies already have a node in the
tree) it can be returned here. Otherwise, a unique id should be returned
which can be a java class name (reverse domain name) or generated with a
GUID algorithm. Note that all LDAP defined object classes already have an
OID associated. It is strongly advised to define the object classes from
existing LDAP schemes which will give the OID for free. Many such schemes
exist ranging from postal addresses to DHCP parameters.
getID
in interface ObjectClassDefinition
public java.lang.String getName()
ObjectClassDefinition
getName
in interface ObjectClassDefinition
|
Knopflerfish OSGi 2.4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |