|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectNvdmAPI.NvdmConnection
This class is the central interface element of the Novadigm Radia API.
It represents a TCP connection to a Radia Configuration Server (RCS) and
offers methods to manipulate data held in the RCS database.
Before doing any manipulation on the RCS database, a connection has
to be opened, giving the RCS IP address (or it's DNS name) and the
port. When all operations are completed, the connection has to be
closed again. A typical use of NvdmConnection thus looks like this:
NvdmConnection rcs; rcs = new NvdmConnection("15.136.123.255", 3464); // here: set logging options... rcs.open(); // here: do some RCS database manipulation... rcs.close();
Constructor Summary | |
NvdmConnection(java.lang.String mgr,
int port)
Creates a connection instance for the specified Radia Configuration Server. |
|
NvdmConnection(java.lang.String mgr,
int port,
java.lang.String user,
int[] passwd,
int plen)
Creates a connection instance for the specified Radia Configuration Server. |
Method Summary | |
void |
addLoggingLevel(long levelCode)
Adds a level of logging. |
void |
addLoggingType(int typeCode)
Adds a type of logging. |
int |
close()
Closes the connection and destroys the socket. |
int |
createObject(NvdmObject obj)
Creates a new object in the Radia database. |
int |
deleteObject(java.lang.String file,
java.lang.String dom,
java.lang.String clss,
java.lang.String inst)
Deletes an object from the Radia database. |
boolean |
exists(java.lang.String file,
java.lang.String dom,
java.lang.String clss,
java.lang.String inst)
Checks for the existence of an object in the Radia database. |
NvdmObject |
getObject(java.lang.String file,
java.lang.String dom,
java.lang.String clss,
java.lang.String inst)
Reads an object from the Radia database. |
NvdmList |
listClasses(java.lang.String file,
java.lang.String dom,
java.lang.String clss)
Reads a list of class names from the Radia database. |
NvdmList |
listObjects(java.lang.String file,
java.lang.String dom,
java.lang.String clss,
java.lang.String inst)
Reads a list of object names from the Radia database. |
int |
open()
Opens the connection to the RCS by creating a corresponding socket. |
int |
setLoggingDestination(java.lang.String filename)
Specifies a logfile for writing logging information. |
int |
setLoggingStream(java.io.PrintStream where)
Specifies an output stream for writing logging information. |
int |
updateObject(NvdmObject obj)
Modifies an existing object in the Radia database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NvdmConnection(java.lang.String mgr, int port)
setLoggingDestination
,
setLoggingStream
, addLoggingLevel
,
addLoggingType
). The connection is later opened via
open
.
mgr
- DNS name or IP address of the RCSport
- the manager's port numberpublic NvdmConnection(java.lang.String mgr, int port, java.lang.String user, int[] passwd, int plen)
setLoggingDestination
,
setLoggingStream
, addLoggingLevel
,
addLoggingType
). The connection is then opened via
open
.
mgr
- DNS name or IP address of the RCSport
- the manager's port numberuser
- the user name to log on withpasswd
- a list of byte values of the DES-encoded password (number of entries in
the list must be a multiple of 8)plen
- the length of the plain text passwordMethod Detail |
public int setLoggingDestination(java.lang.String filename)
filename
- the name of the logfile (possibly including path information
in the platform-specific format)
RTE.getErrorText
)public int setLoggingStream(java.io.PrintStream where)
System.err
, the standard error stream of the Java console.
where
- the stream where to write logging information (e.g.,
System.err
or System.out
)
RTE.getErrorText
)public void addLoggingLevel(long levelCode)
addLoggingType
.
levelCode
- the code of the logging level to add (see class RTE
)public void addLoggingType(int typeCode)
RTE.ERR
for error information,
RTE.INFO
for all other information.
typeCode
- the code of the logging type to add (RTE.ERR
or RTE.INFO
)public int open()
close
is called. In the case
of an error, null
will be returned and (if configured via
setLoggingDestination
or
setLoggingStream
) an error message
will be written to stderr or a logfile.
RTE.getErrorText
)public int close()
setLoggingDestination
or
setLoggingStream
).
RTE.getErrorText
)public NvdmObject getObject(java.lang.String file, java.lang.String dom, java.lang.String clss, java.lang.String inst)
NvdmObject
for details.
file
- the database filedom
- the database domainclss
- the database classinst
- the object name (32 characters short name)
public int deleteObject(java.lang.String file, java.lang.String dom, java.lang.String clss, java.lang.String inst)
file
- the database filedom
- the database domainclss
- the database classinst
- the object name (32 characters short name)
RTE.getErrorText
)public boolean exists(java.lang.String file, java.lang.String dom, java.lang.String clss, java.lang.String inst)
file
- the database filedom
- the database domainclss
- the database classinst
- the object name (32 characters short name)
public NvdmList listObjects(java.lang.String file, java.lang.String dom, java.lang.String clss, java.lang.String inst)
file
- the database filedom
- the database domainclss
- the database classinst
- a filter for the object name (32 characters short name), may include
wildcards (*)
NvdmList
object representing a list of NvdmEntity
.
In the case of an error, the NvdmList
object is basically "empty" but
only contains an error code which can be read via NvdmList.getRC
.public NvdmList listClasses(java.lang.String file, java.lang.String dom, java.lang.String clss)
file
- the database filedom
- the database domainclss
- a filter for the class name (8 characters short name), may include
wildcards (*)
NvdmList
object representing a list of NvdmEntity
.
In the case of an error, the NvdmList
object is basically "empty" but
only contains an error code which can be read via NvdmList.getRC
.public int createObject(NvdmObject obj)
NvdmObject
must have been correctly
instantiated to hold file, domain, class, and instance name information.
It is not necessary to set every variable defined for the respective class in
the NvdmObject
; variables missing will be set to empty (resulting
in the _BASE_INSTANCE_
values to possibly overwrite them).
Values of variables that are identical to the corresponding values of the
_BASE_INSTANCE_
will be ignored (removed) by the server. Variables
not defined in the class definition will be ignored as well.
obj
- the object to be created
RTE.getErrorText
)public int updateObject(NvdmObject obj)
NvdmObject
must have been correctly
instantiated to hold file, domain, class, and instance name information. The
object must already exist in the database.
It is not necessary to set every variable defined for the respective class in
the NvdmObject
; variables missing will remain unchanged in the database.
Values of variables that are identical to the corresponding values of the
_BASE_INSTANCE_
will be ignored (removed) by the server. Variables
not defined in the class definition will be ignored as well.
obj
- the object to be modified, including the variables (and values) to be modified
RTE.getErrorText
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |