com.sas.entities
Interface RemoteEntityInterface

All Superinterfaces:
java.rmi.Remote, RemoteBaseEntityInterface, RemoteBaseEntityValueInterface, com.sas.RemoteObjectInterface
All Known Subinterfaces:
EntityInterface
All Known Implementing Classes:
Entity, RemoteEntity

public interface RemoteEntityInterface
extends RemoteBaseEntityInterface

RemoteEntityInterface extends the functionality of RemoteBaseEntityInterface. It allows the user to specify customizers and validators for Entities as well as obtaining attribute information.

See Also:
RemoteBaseEntityInterface

Method Summary
 void addAttributeValidator(java.lang.String attributeName, java.beans.VetoableChangeListener listener)
          Set a validator for an attribute.
 void clear()
          Clear ("unset") all attribute values.
 void clearAttribute(java.lang.String attributeName)
          Clear ("unset") an individual attribute.
 AttributeDescriptorInterface getAttributeDescriptor(java.lang.String attributeName)
          Returns an AttributeDescriptor
 AttributeDescriptorInterface[] getAttributeDescriptors()
          Returns an array of AttributeDescriptors
 AttributeGroupInterface getAttributeGroup()
          Return a list of attributes and their descriptions.
 AttributeTypeInterface getAttributeType(java.lang.String attributeName)
          Returns the type of an attribute.
 java.util.Map getAttributeValidators()
          Return a map of attribute validators.
 AttributeDescriptorInterface[] getBooleanSpecifiedAttributeDescriptors(java.util.Map map)
          Returns an array of AttributeDescriptors that meet specified boolean attribute criteria.
 java.lang.String getCustomizer(java.lang.String context)
          Return this object's customizer.
 java.util.List getCustomizerContexts()
          Returns a list of customizer contexts.
 java.lang.String getEntityKey()
          Return the Entity's unique key.
 RemoteEntityInterface getPrototype()
          Get the prototype object from which the Entity inherits dynamic attributes from.
 boolean isAllRequiredAttributesAssigned()
          Returns true if all attributes, designated as required, have had a value assigned or the attribute has a default value.
 boolean isAttributeAssigned(java.lang.String attributeName)
          Returns true if an attribute has had a value assigned or the attribute has a default value.
 void removeAttributeValidator(java.lang.String attributeName, java.beans.VetoableChangeListener listener)
          Remove a validator for an attribute.
 boolean sameEntity(EntityKeyInterface entity)
          Test if this Entity's key equals the key of another Entity.
 void setCustomizer(java.lang.String context, java.lang.String customizer)
          Set the customizer for a specific context.
 void setEntityKey(java.lang.String key)
          Assign an entity key to the Entity.
 void setPrototype(RemoteEntityInterface prototype)
          Set the prototype object from which the Entity inherits dynamic attributes from.
 
Methods inherited from interface com.sas.entities.RemoteBaseEntityInterface
containsAttributeNamed, getAttribute, getAttributes, getStringAttribute, listAttributeNames, removeAllAttributes, removeAttribute, setAttributes
 
Methods inherited from interface com.sas.entities.RemoteBaseEntityValueInterface
getAttribute, setAttribute
 

Method Detail

getAttributeGroup

AttributeGroupInterface getAttributeGroup()
                                          throws java.rmi.RemoteException
Return a list of attributes and their descriptions.

Returns:
an AttributeGroupInterface from which you can access each attribute by name or get them all as an array. AttributeGroupInterface provides a structured, hierarchical grouping of an Entity's attributes.
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

getAttributeType

AttributeTypeInterface getAttributeType(java.lang.String attributeName)
                                        throws java.rmi.RemoteException,
                                               java.util.NoSuchElementException
Returns the type of an attribute.

Parameters:
attributeName - attribute name
Returns:
type information for an attribute
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
java.util.NoSuchElementException - if there is no such value in the Entity (this is necessary to distinguish between no such attributeName and a value of null)
See Also:
AttributeTypeInterface

getAttributeDescriptors

AttributeDescriptorInterface[] getAttributeDescriptors()
                                                       throws java.rmi.RemoteException
Returns an array of AttributeDescriptors

Returns:
array of AttributeDescriptors
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

getAttributeDescriptor

AttributeDescriptorInterface getAttributeDescriptor(java.lang.String attributeName)
                                                    throws java.rmi.RemoteException,
                                                           java.util.NoSuchElementException
Returns an AttributeDescriptor

Returns:
AttributeDescriptor
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
java.util.NoSuchElementException - if there is no such value in this entity (this is necessary to distinguish between no such attributeName and a value of null)

isAttributeAssigned

boolean isAttributeAssigned(java.lang.String attributeName)
                            throws java.rmi.RemoteException,
                                   java.util.NoSuchElementException
Returns true if an attribute has had a value assigned or the attribute has a default value.

Returns:
true if attribute has had value assigned or default value; false otherwise
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
java.util.NoSuchElementException - if there is no such value in the Entity (this is necessary to distinguish between no such attributeName and a value of null)

isAllRequiredAttributesAssigned

boolean isAllRequiredAttributesAssigned()
                                        throws java.rmi.RemoteException
Returns true if all attributes, designated as required, have had a value assigned or the attribute has a default value.

Returns:
true if required attributes have had a value assigned or default value; false otherwise
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

clear

void clear()
           throws java.rmi.RemoteException
Clear ("unset") all attribute values. Attributes would inherit their default values.

Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

clearAttribute

void clearAttribute(java.lang.String attributeName)
                    throws java.rmi.RemoteException
Clear ("unset") an individual attribute. The attribute would inherit its default value.

Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

addAttributeValidator

void addAttributeValidator(java.lang.String attributeName,
                           java.beans.VetoableChangeListener listener)
                           throws java.rmi.RemoteException
Set a validator for an attribute. If a listener is added for an attribute, then before a setAttribute stores the new value, the Entity fires a PropertyChangeEvent to all listeners and one or more listeners may veto the change by throwing a PropertyVetoException.

Parameters:
attributeName - name of the attribute
listener - object that implements VetoableChangeListener
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

removeAttributeValidator

void removeAttributeValidator(java.lang.String attributeName,
                              java.beans.VetoableChangeListener listener)
                              throws java.rmi.RemoteException
Remove a validator for an attribute.

Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
See Also:
addAttributeValidator(String, VetoableChangeListener)

getAttributeValidators

java.util.Map getAttributeValidators()
                                     throws java.rmi.RemoteException
Return a map of attribute validators. The map keys are attribute names. The map values are either a single VetoableChangeListener or a List of VetoableChangeListener listeners.

Returns:
attribute validators
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

getPrototype

RemoteEntityInterface getPrototype()
                                   throws java.rmi.RemoteException
Get the prototype object from which the Entity inherits dynamic attributes from. Any attribute requests made to this object which do not exist on the Entity are delegated to the prototype.

Returns:
prototype object
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

setPrototype

void setPrototype(RemoteEntityInterface prototype)
                  throws java.rmi.RemoteException
Set the prototype object from which the Entity inherits dynamic attributes from. If a prototype already exists, it is discarded. The new prototype may be null.

Parameters:
prototype - object from which the Entity inherits dynamic attributes from
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

getCustomizer

java.lang.String getCustomizer(java.lang.String context)
                               throws java.rmi.RemoteException
Return this object's customizer. A customizer is a standalone editor used to customize or edit a value. It does not reside inside a UI (User Interface) element as an editor does, but defines its own window. If none exists on the Entity, the customizer of the AttributeType is returned. The context indicates how you would like the editor expressed, in the same form as the validator context.

Parameters:
context - the context, such as a Java, COM, or WEB context
Returns:
Entity customizer
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
See Also:
EntityContextInterface

setCustomizer

void setCustomizer(java.lang.String context,
                   java.lang.String customizer)
                   throws java.rmi.RemoteException
Set the customizer for a specific context.

Parameters:
context - the context, such as a Java, COM, or WEB context
customizer - the name of the customizer
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
See Also:
EntityContextInterface

getCustomizerContexts

java.util.List getCustomizerContexts()
                                     throws java.rmi.RemoteException
Returns a list of customizer contexts.

Returns:
list of contexts
Throws:
java.rmi.RemoteException

getBooleanSpecifiedAttributeDescriptors

AttributeDescriptorInterface[] getBooleanSpecifiedAttributeDescriptors(java.util.Map map)
                                                                       throws java.rmi.RemoteException,
                                                                              java.lang.NoSuchMethodException
Returns an array of AttributeDescriptors that meet specified boolean attribute criteria. This method is intended to be used to retrieve only those AttributeDescriptors that have a specified value for a particular boolean attribute. The following example will retrieve only those AttributeDescriptors with isModifiable set to false and isVisible set to true:
 HashMap map = new HashMap();
 map.put(AttributeDescriptorInterface.MODIFIABLE,Boolean.FALSE);
 map.put(AttributeDescriptorInterface.VISIBLE,Boolean.TRUE);
 try {
     RemoteEntity rentity = new RemoteEntity();
     AttributeDescriptorInterface[] adi = rentity.getBooleanSpecifiedAttributeDescriptors(map);
 }
 catch(NoSuchMethodException e) {}
 

Parameters:
map - set of name/value pairs consisting of attribute/value
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
java.lang.NoSuchMethodException - if method does not exist on the AttributeDescriptorInterface
java.lang.IllegalArgumentException - if map parameter is empty or a non-boolean value is specified for the value (name/value pair)
See Also:
AttributeDescriptorInterface

getEntityKey

java.lang.String getEntityKey()
                              throws java.rmi.RemoteException
Return the Entity's unique key.

Returns:
unique key.
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity

setEntityKey

void setEntityKey(java.lang.String key)
                  throws java.rmi.RemoteException,
                         java.lang.IllegalStateException
Assign an entity key to the Entity.

Parameters:
key - the key with which the Entity can be identified
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity
java.lang.IllegalStateException - if the Entity already has a non-null key. Not all Entity implementations are required to throw this exception; some may allow replacing a non-null key.

sameEntity

boolean sameEntity(EntityKeyInterface entity)
                   throws java.rmi.RemoteException
Test if this Entity's key equals the key of another Entity.

Returns:
true if the other entity's key is the same as getEntityKey(). Return false if entity is null.
Throws:
java.rmi.RemoteException - if there was an IO error communicating with the Entity



Copyright © 2009 SAS Institute Inc. All Rights Reserved.