AdventNet Web NMS 4 API Specification

com.adventnet.management
Class Property

java.lang.Object
  |
  +--com.adventnet.management.Property
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ClientProperty, CLIProperty, CorbaProperty, FTPProperty, SnmpProperty, TftpProperty, TL1Property

public abstract class Property
extends java.lang.Object
implements java.io.Serializable

This class defines the generic Property object used by the ManagementServices implementation for all transactions with user client applications and Protocol Provider(s).
This abstract class is implemented by the ProtocolProvider(s) .
The applications instantiate the required Property , set it up according to the transaction and submit it to the ManagementServices implementation.

Applications use the method setComponent(Object) to pass their Object reference to receive all asynchronous responses and notifications.

Setting the parameters of a ProtocolProperty for performing Request Transactions with Management Services .

  • Connectionless Protocol :

  • a) Request (Synchronous ) : Setting up a request Property for a synchronous response.
    b) Request (Asynchronous) : Setting up a request Property for an asynchronous response.
    c) Polling registration : Setting up a Property request to be registered for polling .
    d) Event registration : : Setting up a Property request to be registered for receiving Events.

  • Connection Oriented Protocol :

  • a) Request (Synchronous ) : Setting up a request Property for a synchronous response.
    b) Request (Asynchronous) : Setting up a request Property for an asynchronous response.
    c) Polling registration : Setting up a Property request to be registered for polling .
    e) Event registration : : Setting up a Property request to be registered for receiving Events.
    e) Establish Session : : Setting up a Property request to establish a device session .

    See Also:
    Serialized Form

    Field Summary
    static int OP_READ
              Constant for specifying the type of operation like read to be done with this properties.
    static int OP_WRITE
              Constant for specifying the type of operation like write to be done with this properties.
    static int RESULT_INT
              Constant for specifying the type of int result
    static int RESULT_LONG
              Constant for specifying the type of long result
    static int RESULT_OBJECT
              Constant for specifying the type of Object result
    static int RESULT_STRING
              Constant for specifying the type of String result
     
    Constructor Summary
    Property()
               
     
    Method Summary
     void addSubProperty(java.lang.String tagName, java.lang.String identifier, java.lang.String type, java.util.ArrayList params)
              This method must be implemented by extented Property class to combine several request Property(s) into a single request Property.
    abstract  void copy(Property p)
              This will copy the attributes of the given Property instance into curent instance.
    abstract  java.lang.String getCombinedPropKey()
              Used by management server to support multiple ProtocolProperty(s) to be combined and send as single protocol PDU.
     java.lang.Object getComponent()
              The ManagementServices uses this method to get the Object reference of applications to submit the respective responses and events.
    abstract  java.lang.String getEventKey()
              Used by the management server to support caching of event registrations.
     java.lang.String getFilterClass()
              This is used by user client applications to get the name of the Class used for filtering the responses recieved from the ProtocolProvider before being given to the application.
     java.lang.String getFilterParameters()
              This method is used to get the parameters to be passed as argument to the getFilteredObject method of the Filter class.
     java.lang.String getGroupName()
              Get the groupname by which the default properties will be loaded from config file.
     java.lang.String getMethodName()
              This is used to get the name of the method which gets the result for request response transactions .
     java.lang.String[] getMethodParameterClassNames()
              Returns the class names of the parameters of the method which gets the result for request response transactions .
     java.lang.Object[] getMethodParameterValues()
              Return the values of the parameters to be passed to the method which gets the result for request response transactions .
     int getMethodResultParameterIndex()
              This is used to get the index of the method parameters for the method which gets the result for request response transactions .
     int getOperationType()
              Return the type of the command which will specify whether the request is to read or write.
     long getPollInterval()
              This is used to get the polling interval(in milliseconds) used for poll registration.
    abstract  java.util.Hashtable getProperties()
              This method will be used to get the values of the parameters in the Property .
     java.lang.String getPropertyType()
              Get the type name of the Property.
     java.lang.Object getProtocolPDU()
              This method is implemented by the extented Property class to return a protocol PDU for request Property .
     int getRequestID()
              This method is used to get the requestId of a Property which is unique for each transaction between the ManagementServer and the ProtocolProvider.
     int getResultType()
              This method is used by applications to get the Class type of result which is returned to the user client aplications in Request Response transactions.
     int getRetries()
              This is used to get the number of retries specified for this Property.
     java.lang.String getSessionId()
              Get the Session Id of the request Property.
    abstract  java.lang.String getSessionKey()
              Used by the management server to support device connection pooling.
     int getTimeout()
              This method is used to get the timeout value (in milliseconds) of this Property.
     java.util.Hashtable getUserProperties()
              The method returns all the user properties set in this Property object as a key,value pair in a java.lang.Properties object.
     java.lang.String getUserProperty(java.lang.String nam)
              The method returns the value of user property present matching the name passed as argument.
     byte getWriteType()
              Return the Class type of the value for the OP_WRITE operation.
     byte[] getWriteTypes()
              Return the class types of the set of values to be set for the OP_WRITE operation.
     java.lang.String getWriteValue()
              This is used to get the value specified for a OP_WRITE operation in a Property request .
     java.lang.String[] getWriteValues()
              This is used to get the values specified for a OP_WRITE operation in a Property request .
     java.lang.String removeUserProperty(java.lang.String nam)
              The method removes any user property present in the object matching the name passed as arguement and returns the value of the property if it exists, else null is returned.
     void setComponent(java.lang.Object obj)
              Applications use this Method to pass their Object reference to receive asynchronous responses and notifications.
     void setFilterClass(java.lang.String fClass)
              This is used by user client applications to set the name of a Class which implements the interface Filter The responses recieved from the ProtocolProvider will be passed to this filter before being given to the application.
     void setFilterParameters(java.lang.String fParam)
              This method is used by user client applications to set the parameters to be passed as argument to the getFilteredObject method of the Filter class along with the response from the provider.
     void setGroupName(java.lang.String gName)
              Set the groupname of the Property .
     void setMethodDetail(java.lang.String name, int pos_result_parameter, java.lang.String[] parameterClassNames, java.lang.Object[] parameterValues)
              This is used by applicatons to set the details of the method to get the result for request response transactions
     void setMethodName(java.lang.String name)
              This method is set by the user client application to specify the method to which the result is to be given for Request-Response transactions.
     void setOperationType(int type)
              Set the type of the command which will specify whether the request is to read or write.
     void setPollInterval(long p)
              This is used to set the polling interval(in milliseconds) used for poll registration.
    abstract  void setProperties(java.util.Hashtable p)
              This method will be used by the ManagementServer to set the values of a list of parameters in the Property .
     void setPropertyType(java.lang.String type)
              Set the type name of the Property.
     void setProtocolPDU(java.lang.Object pdu)
              This method is used by the ManagementServer to set the ProtocolPDU for a request Property which it had obtained using getProtocolPDU from the ProtocolProvider .
     void setRequestID(int reqid)
              This method is used by the ManagementServer to set the requestId of a Property which is unique for each transaction between the ManagementServer and the ProtocolProvider.
     void setResultType(int type)
              This method is used by applications to set the Class type of result which is returned to the user client aplications in Request Response transactions.
     void setRetries(int r)
              This is used to set the number of retries specified for a Property.
     void setSessionId(java.lang.String sesId)
              Set the Session Id of the request Property.
     void setTimeout(int t)
              This is used to set the timeout(in milliseconds) for this Property.
     void setUserProperty(java.lang.String nam, java.lang.String val)
              This method sets a user property to the Property Object.
     void setWriteType(byte type)
              Set the Class type of the value for the OP_WRITE operation.
     void setWriteTypes(byte[] types)
              Set the class types of the set of values to be set for the OP_WRITE operation.
     void setWriteValue(java.lang.String val)
              This is used to set the value for a OP_WRITE operation in a Property request .
     void setWriteValues(java.lang.String[] vals)
              This is used to set the values for a OP_WRITE operation in a Property request .
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    RESULT_INT

    public static int RESULT_INT
    Constant for specifying the type of int result

    RESULT_LONG

    public static int RESULT_LONG
    Constant for specifying the type of long result

    RESULT_STRING

    public static int RESULT_STRING
    Constant for specifying the type of String result

    RESULT_OBJECT

    public static int RESULT_OBJECT
    Constant for specifying the type of Object result

    OP_READ

    public static int OP_READ
    Constant for specifying the type of operation like read to be done with this properties.

    OP_WRITE

    public static int OP_WRITE
    Constant for specifying the type of operation like write to be done with this properties.
    Constructor Detail

    Property

    public Property()
    Method Detail

    getPollInterval

    public long getPollInterval()
    This is used to get the polling interval(in milliseconds) used for poll registration.
    Returns:
    Poll Interval currently set as long.

    setPollInterval

    public void setPollInterval(long p)
    This is used to set the polling interval(in milliseconds) used for poll registration. If this field is not set, then the default value 1000 is taken.
    Parameters:
    p - - Poll Interval to be set as long.

    getTimeout

    public int getTimeout()
    This method is used to get the timeout value (in milliseconds) of this Property.
    Returns:
    Timeout value currently set as int.

    setTimeout

    public void setTimeout(int t)
    This is used to set the timeout(in milliseconds) for this Property. If this field is not set, then the default value 1000 is taken.
    Parameters:
    t - - Timeout to be set as int.

    getRetries

    public int getRetries()
    This is used to get the number of retries specified for this Property.
    Returns:
    Retries value currently set as int.

    setRetries

    public void setRetries(int r)
    This is used to set the number of retries specified for a Property. If this field is not set, then the default value 0 is taken.
    Parameters:
    r - - Retries be set as int.

    getWriteValue

    public java.lang.String getWriteValue()
    This is used to get the value specified for a OP_WRITE operation in a Property request .
    Returns:
    write value currently set in this Request.

    setWriteValue

    public void setWriteValue(java.lang.String val)
    This is used to set the value for a OP_WRITE operation in a Property request .
    Parameters:
    val - - write value be set as String.

    getWriteValues

    public java.lang.String[] getWriteValues()
    This is used to get the values specified for a OP_WRITE operation in a Property request .
    Returns:
    write values array currently set in this Request.

    setWriteValues

    public void setWriteValues(java.lang.String[] vals)
    This is used to set the values for a OP_WRITE operation in a Property request .
    Parameters:
    vals - - write values to be set as String array.

    setRequestID

    public void setRequestID(int reqid)
    This method is used by the ManagementServer to set the requestId of a Property which is unique for each transaction between the ManagementServer and the ProtocolProvider.
    The ProtocolProvider sets this requestId in the response ManagementServerResultEvent to match the request.
    The ProctocolProvider(s) can use this requestId in the PDU itself for simplicity.
    (Like requestId in SNMP PDU & Ctag in TL1 Request Message).
    Parameters:
    reqid - - requestID of the request.

    getRequestID

    public int getRequestID()
    This method is used to get the requestId of a Property which is unique for each transaction between the ManagementServer and the ProtocolProvider.
    Returns:
    requestID of the request.

    setProperties

    public abstract void setProperties(java.util.Hashtable p)
    This method will be used by the ManagementServer to set the values of a list of parameters in the Property . This method is implemented by the extented Property class. This is a convenience method for setting all the properties in one single call. This is used to load default properties of a Property from defaultProperties files for that particular Protocol which are specified in /conf directory .
    Parameters:
    p - - Hashtable containing the attributes to be set as name, value pair.

    getProperties

    public abstract java.util.Hashtable getProperties()
    This method will be used to get the values of the parameters in the Property . This method is implemented by the extented Property class.
    Returns:
    Hashtable containing the attributes of this Property as name, value pair.

    getOperationType

    public int getOperationType()
    Return the type of the command which will specify whether the request is to read or write.
    Returns:
    OP_READ or OP_WRITE.

    setOperationType

    public void setOperationType(int type)
    Set the type of the command which will specify whether the request is to read or write. If this field is not set, then the default value OP_READ is taken.
    Parameters:
    type - the value may be OP_READ or OP_WRITE or values defined by the Protocol Provider's Property implementation.

    getResultType

    public int getResultType()
    This method is used by applications to get the Class type of result which is returned to the user client aplications in Request Response transactions.
    Returns:
    - any one of the types in , RESULT_INT , RESULT_LONG , RESULT_STRING and RESULT_OBJECT.

    setResultType

    public void setResultType(int type)
    This method is used by applications to set the Class type of result which is returned to the user client aplications in Request Response transactions.
    The ManagementServer converts the result to this type before giving the responses to the applications. If this field is not set, then the default value RESULT_STRING is taken.
    Parameters:
    type - - any one of the types in , RESULT_INT , RESULT_LONG , RESULT_STRING and RESULT_OBJECT.
    If it is set to RESULT_OBJECT the ManagementServer gives the same result type to the applications as it is recieved from the ProtocolProvider.

    getComponent

    public java.lang.Object getComponent()
    The ManagementServices uses this method to get the Object reference of applications to submit the respective responses and events.
    Returns:
    Object - The Object instance for receiving asynchronous responses and notifications.

    setComponent

    public void setComponent(java.lang.Object obj)
    Applications use this Method to pass their Object reference to receive asynchronous responses and notifications.
    The Object may implement the following interfaces :
    ProtocolListener - To Receive asynchronous and Poll responses.
    MSEventListener - To Receive Event notifications.
    DeviceConnectionListener - To Receive Device session loss notifications for connection oriented protocols.
    ExceptionListener - To Receive unhandled Exceptions in ManagementServer Framework .
    Parameters:
    obj - - The Object instance for receiving asynchronous responses and notifications.

    getMethodName

    public java.lang.String getMethodName()
    This is used to get the name of the method which gets the result for request response transactions .
    Returns:
    String representing the method name to be invoked for passing the response.

    setMethodName

    public void setMethodName(java.lang.String name)
    This method is set by the user client application to specify the method to which the result is to be given for Request-Response transactions.
    Parameters:
    name - - method name to be invoked as String.

    getMethodResultParameterIndex

    public int getMethodResultParameterIndex()
    This is used to get the index of the method parameters for the method which gets the result for request response transactions .

    getMethodParameterClassNames

    public java.lang.String[] getMethodParameterClassNames()
    Returns the class names of the parameters of the method which gets the result for request response transactions .

    getMethodParameterValues

    public java.lang.Object[] getMethodParameterValues()
    Return the values of the parameters to be passed to the method which gets the result for request response transactions .

    setMethodDetail

    public void setMethodDetail(java.lang.String name,
                                int pos_result_parameter,
                                java.lang.String[] parameterClassNames,
                                java.lang.Object[] parameterValues)
    This is used by applicatons to set the details of the method to get the result for request response transactions
    Parameters:
    name - - the name of the method to be invoked .
    pos_result_parameter - - the position of the parameter to which the result content will be passed on the method specified, name.
    parameterClassNames - - an array of type of the classes of the parameters to the result method invoked .
    parameterValues - - an array of the values to be passed to the method's parameters on default.
    Details

    setGroupName

    public void setGroupName(java.lang.String gName)
    Set the groupname of the Property . The parameters for that particular Property will be loaded from the file file /conf/GroupName.xml
    Parameters:
    gName - the groupname associated with the set of properties in file.

    getGroupName

    public java.lang.String getGroupName()
    Get the groupname by which the default properties will be loaded from config file.
    Returns:
    the goupname associated with the set of properties in config file.

    setPropertyType

    public void setPropertyType(java.lang.String type)
    Set the type name of the Property. The ProtocolProvider(s) use this method to set their respective protocol type names like SNMP, TL1 etc.
    Parameters:
    type - - Property type as a String.

    getPropertyType

    public java.lang.String getPropertyType()
    Get the type name of the Property. This will identify the ProtocolProvider to be invoked for this request Property.
    Returns:
    - Property type as a String.

    setFilterClass

    public void setFilterClass(java.lang.String fClass)
    This is used by user client applications to set the name of a Class which implements the interface Filter The responses recieved from the ProtocolProvider will be passed to this filter before being given to the application.
    Parameters:
    fClass - - filter class name.

    getFilterClass

    public java.lang.String getFilterClass()
    This is used by user client applications to get the name of the Class used for filtering the responses recieved from the ProtocolProvider before being given to the application.
    Returns:
    - filter class name.

    setFilterParameters

    public void setFilterParameters(java.lang.String fParam)
    This method is used by user client applications to set the parameters to be passed as argument to the getFilteredObject method of the Filter class along with the response from the provider. The filter class can be set using setFilterClass(String).
    Parameters:
    fParam - - filter parameters.

    getFilterParameters

    public java.lang.String getFilterParameters()
    This method is used to get the parameters to be passed as argument to the getFilteredObject method of the Filter class. The filter class can be set using setFilterClass(String)

    getWriteType

    public byte getWriteType()
    Return the Class type of the value for the OP_WRITE operation.
    Returns:
    type as byte value.

    setWriteType

    public void setWriteType(byte type)
    Set the Class type of the value for the OP_WRITE operation.
    Parameters:
    type - - type to set as byte.

    getWriteTypes

    public byte[] getWriteTypes()
    Return the class types of the set of values to be set for the OP_WRITE operation.
    Returns:
    types as byte array.

    setWriteTypes

    public void setWriteTypes(byte[] types)
    Set the class types of the set of values to be set for the OP_WRITE operation.
    Parameters:
    types - - types to set as byte array.

    getSessionId

    public java.lang.String getSessionId()
    Get the Session Id of the request Property. This indicates the established session for which the request is made . This is applicable only for connection oriented protocols.
    Returns:
    the Session Id as a String.

    setSessionId

    public void setSessionId(java.lang.String sesId)
    Set the Session Id of the request Property. This indicates the established session for which the request is made . This is applicable only for connection oriented protocols.
    Parameters:
    sesId - - the Session Id as a String.

    getCombinedPropKey

    public abstract java.lang.String getCombinedPropKey()
    Used by management server to support multiple ProtocolProperty(s) to be combined and send as single protocol PDU. This returns a String combinedPropKey which shall be unique for request Property(s) that can be sent as single PDU for that particular protocol. This shall be used by the ManagementServer to send such combinable requests as a single request PDU during in Polling.
    Returns:
    the Combined Key as a String.

    getEventKey

    public abstract java.lang.String getEventKey()
    Used by the management server to support caching of event registrations. This returns a string identifier eventKey which will uniquely identify the event registration, for the given property request. The Management server allows multiple applications to perform the same type of event registration while performing a single registration with the Protocol Provider. It returns a generated eventId mapped to this eventKey for all applications which perform registration with the Property having the same eventKey. Applications use the eventId to unregister for notification.
    Returns:
    the Event Key as a String.

    getSessionKey

    public abstract java.lang.String getSessionKey()
    Used by the management server to support device connection pooling. This returns a string identifier sessionKey which will uniquely identify the device session, for the given property request. The Management server allows multiple applications to share the same session using this. ManagementServer returns a generated sessionId mapped to this sessionKey for all applications which perform establishSession with the Property having the same sessionKey. Applications which send requests on this session set the sessionId on the request Property.
    Returns:
    the Session Key as a String.

    setUserProperty

    public void setUserProperty(java.lang.String nam,
                                java.lang.String val)
    This method sets a user property to the Property Object. User properties are additional properties that the user intends to add above the existing set of standard properties present in the Object.
    Parameters:
    nam - - the name of attribute as String.
    val - - the value of attribute as String.

    getUserProperty

    public java.lang.String getUserProperty(java.lang.String nam)
    The method returns the value of user property present matching the name passed as argument. The method returns null if no user property exists with that name.
    Parameters:
    nam - - the name of attribute as String.
    Returns:
    - the value of attribute as String.

    removeUserProperty

    public java.lang.String removeUserProperty(java.lang.String nam)
    The method removes any user property present in the object matching the name passed as arguement and returns the value of the property if it exists, else null is returned.
    Parameters:
    nam - - the name of attribute as String.
    Returns:
    - the value of attribute as String.

    getUserProperties

    public java.util.Hashtable getUserProperties()
    The method returns all the user properties set in this Property object as a key,value pair in a java.lang.Properties object. The keys of properties object will correspond to the name of the user properties and values the corresponding value of the user property. The method will return null if no user property has been set in the Object.
    Returns:
    Hashtable containing the user specified attributes of this Property as name, value pair.

    addSubProperty

    public void addSubProperty(java.lang.String tagName,
                               java.lang.String identifier,
                               java.lang.String type,
                               java.util.ArrayList params)
    This method must be implemented by extented Property class to combine several request Property(s) into a single request Property. This is mainly used by very thin client applications which specify XML based URL(s) for constructing request Property(s) for performing transactions. The submit the request using ClientProperty .
    Parameters:
    tagName - - A tag for identifying the transaction.
    identifier - - The main/key parameter for the transaction .
    type - - The type of the identifier.This is mainly used to indicate method return types in Providers which use method names as identifiers for performing transactions.
    params - - A list of parameters for the transaction. This is mainly used to indicate method arguments in Providers which use method names as identifiers for performing transactions. Example: For SNMP the values could be , tagName - testTag , identifier - 1.1.0 , type -null , params - null .

    getProtocolPDU

    public java.lang.Object getProtocolPDU()
    This method is implemented by the extented Property class to return a protocol PDU for request Property . To be deprecated shortly.

    setProtocolPDU

    public void setProtocolPDU(java.lang.Object pdu)
    This method is used by the ManagementServer to set the ProtocolPDU for a request Property which it had obtained using getProtocolPDU from the ProtocolProvider .
    When the ManagementServer sets this PDU in a request Property using setProtocolPDU ,the Provider sends the PDU directly instead of assembling it from the Property. To be deprecated shortly.

    copy

    public abstract void copy(Property p)
    This will copy the attributes of the given Property instance into curent instance.
    Parameters:
    p - - Property to be copied.

    AdventNet Web NMS 4 API Specification