netapp.manage
Class NaServer

java.lang.Object
  extended bynetapp.manage.NaServer
Direct Known Subclasses:
NaProxyServer

public class NaServer
extends java.lang.Object

A class used to connect to servers and invoke APIs.


Field Summary
static int HOSTSEQUIV
          Deprecated. As of SDK version 1.4
static int LOGIN_PASSWORD
          Deprecated. As of SDK version 1.4
static int SERVER_TYPE_AGENT
           
static int SERVER_TYPE_DFM
           
static int SERVER_TYPE_FILER
           
static int SERVER_TYPE_NETCACHE
           
static int STYLE_HOSTSEQUIV
           
static int STYLE_LOGIN_PASSWORD
           
static int STYLE_RPC
           
static int TRANSPORT_TYPE_HTTP
           
static int TRANSPORT_TYPE_HTTPS
           
 
Constructor Summary
NaServer(java.net.InetAddress serverAddr)
          Create a server API object with server type SERVER_TYPE_FILER and API version 1.0.
NaServer(java.net.InetAddress serverAddr, int majorVersion, int minorVersion)
          Create a server API object with server type SERVER_TYPE_FILER
NaServer(java.lang.String serverName)
          Create a server API object with server type SERVER_TYPE_FILER and API version 1.0.
NaServer(java.lang.String serverName, int majorVersion, int minorVersion)
          Create a server API object with server type SERVER_TYPE_FILER
 
Method Summary
 void close()
          Close any connections used by this object.
 int getPort()
          Get the TCP port used for API invocations on the server.
 int getServerType()
          Get the server type, which is one of the SERVER_TYPE_ values.
 int getStyle()
          Get the current authentication style.
 int getTransportType()
          Get the transport type, which is one of the TRANSPORT_TYPE_ values.
 NaElement getXMLParseInput(java.lang.String args)
           
 NaElement invokeElem(NaElement xi)
          Invoke a single ONTAPI API.
 void setAdminUser(java.lang.String login, java.lang.String password)
          Set the login and password used for authenticating when an ONTAPI API is invoked.
 void setApiVersion(int majorVersion, int minorVersion)
          Set the API version for requests.
 void setKeepAliveEnabled(boolean enabled)
          Turn HTTP keep alives on or off.
 void setPort(int tcpPort)
          Set the TCP port used for API invocations on the server.
 void setServerType(int serverType)
          Set the URI and TCP port appropriate for the given server type.
 void setSnoop(int level)
          Set the snoop (debugging) level.
 void setStyle(int style)
          Set the authentication style for subsequent ONTAPI authentications.
 void setTransportType(int transportType)
          Set the transport type.
 void setVfilerTunneling(java.lang.String vfiler)
          Set the name of the vfiler on which the API commands need to be invoked .
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SERVER_TYPE_FILER

public static final int SERVER_TYPE_FILER
See Also:
Constant Field Values

SERVER_TYPE_NETCACHE

public static final int SERVER_TYPE_NETCACHE
See Also:
Constant Field Values

SERVER_TYPE_AGENT

public static final int SERVER_TYPE_AGENT
See Also:
Constant Field Values

SERVER_TYPE_DFM

public static final int SERVER_TYPE_DFM
See Also:
Constant Field Values

TRANSPORT_TYPE_HTTP

public static final int TRANSPORT_TYPE_HTTP
See Also:
Constant Field Values

TRANSPORT_TYPE_HTTPS

public static final int TRANSPORT_TYPE_HTTPS
See Also:
Constant Field Values

STYLE_LOGIN_PASSWORD

public static final int STYLE_LOGIN_PASSWORD
See Also:
Constant Field Values

STYLE_HOSTSEQUIV

public static final int STYLE_HOSTSEQUIV
See Also:
Constant Field Values

STYLE_RPC

public static final int STYLE_RPC
See Also:
Constant Field Values

LOGIN_PASSWORD

public static final int LOGIN_PASSWORD
Deprecated. As of SDK version 1.4

See Also:
Constant Field Values

HOSTSEQUIV

public static final int HOSTSEQUIV
Deprecated. As of SDK version 1.4

See Also:
Constant Field Values
Constructor Detail

NaServer

public NaServer(java.net.InetAddress serverAddr)
Create a server API object with server type SERVER_TYPE_FILER and API version 1.0.

Parameters:
serverAddr - The IP address(IPv4 or IPv6) of the API server.

NaServer

public NaServer(java.lang.String serverName)
         throws java.net.UnknownHostException
Create a server API object with server type SERVER_TYPE_FILER and API version 1.0.

Parameters:
serverName - The name of the API server.
Throws:
java.net.UnknownHostException - if the hostname is not known.

NaServer

public NaServer(java.net.InetAddress serverAddr,
                int majorVersion,
                int minorVersion)
Create a server API object with server type SERVER_TYPE_FILER

Parameters:
serverAddr - The IP address(IPv4 or IPv6) of the API server.
majorVersion - The major API version number required, for example "1" if version 1.0 is required.
minorVersion - The minor API version number required, for example "0" if version 1.0 is required.

NaServer

public NaServer(java.lang.String serverName,
                int majorVersion,
                int minorVersion)
         throws java.net.UnknownHostException
Create a server API object with server type SERVER_TYPE_FILER

Parameters:
serverName - The name of the API server.
majorVersion - The major API version number required, for example "1" if version 1.0 is required.
minorVersion - The minor API version number required, for example "0" if version 1.0 is required.
Throws:
java.net.UnknownHostException - if the hostname is not known.
Method Detail

setApiVersion

public void setApiVersion(int majorVersion,
                          int minorVersion)
Set the API version for requests.

Parameters:
majorVersion - The major API version number required, for example "1" if version 1.0 is required.
minorVersion - The minor API version number required, for example "0" if version 1.0 is required.

close

public void close()
Close any connections used by this object.


setKeepAliveEnabled

public void setKeepAliveEnabled(boolean enabled)
Turn HTTP keep alives on or off. The default is off. If keep alives are enabled, you must call close() when you are done using this object.

Parameters:
enabled - Set to true to turn on keep alives.

setPort

public void setPort(int tcpPort)
Set the TCP port used for API invocations on the server.

Note: Following are the default ports on the storage system used for Data ONTAP API communication:

HTTP transport - 80

HTTPS transport - 443

Depending on the transport type settings, use the above port numbers as input to this API if Data ONTAP has default port settings.

Parameters:
tcpPort - The TCP server port to use.

getPort

public int getPort()
Get the TCP port used for API invocations on the server.


getServerType

public int getServerType()
Get the server type, which is one of the SERVER_TYPE_ values.


setServerType

public void setServerType(int serverType)
Set the URI and TCP port appropriate for the given server type.

Parameters:
serverType - The type of API server. Should be one of the NaServer.SERVER_TYPE_ values. The default on construction is SERVER_TYPE_FILER.
Throws:
java.lang.IllegalArgumentException - if server type is not valid.

getTransportType

public int getTransportType()
Get the transport type, which is one of the TRANSPORT_TYPE_ values.


setTransportType

public void setTransportType(int transportType)
Set the transport type.

After setting the transport type, call the setPort() to set the port number used for that transport type.

Parameters:
transportType - The type of transport. Should be one of the NaServer.TRANSPORT_TYPE_ values.
Throws:
java.lang.IllegalArgumentException - if transport is not valid.

setAdminUser

public void setAdminUser(java.lang.String login,
                         java.lang.String password)
Set the login and password used for authenticating when an ONTAPI API is invoked.

Parameters:
login - The login name (often "root").
password - The password.

setStyle

public void setStyle(int style)
Set the authentication style for subsequent ONTAPI authentications.

Parameters:
style - The style, must be one of: NaServer.STYLE_LOGIN_PASSWORD NaServer.STYLE_HOSTSEQUIV NaServer.STYLE_RPC
Throws:
java.lang.IllegalArgumentException - if style is not valid.

setSnoop

public void setSnoop(int level)
Set the snoop (debugging) level.

Parameters:
level - 0 (the default) means no debugging. -1 means to print the raw XML input and output.

getStyle

public int getStyle()
Get the current authentication style.

Returns:
Integer value (possible values: NaServer.STYLE_LOGIN_PASSWORD, NaServer.STYLE_HOSTSEQUIV, NaServer.STYLE_RPC)

invokeElem

public NaElement invokeElem(NaElement xi)
                     throws java.io.IOException,
                            NaAuthenticationException,
                            NaAPIFailedException,
                            NaProtocolException
Invoke a single ONTAPI API.

Parameters:
xi - The API element.
Returns:
Output results of the API.
Throws:
java.io.IOException - if there is a communication problem
NaAuthenticationException - if the login was not accepted
NaAPIFailedException - if the server returned a failure result.
NaProtocolException - if there is a protocol problem

getXMLParseInput

public NaElement getXMLParseInput(java.lang.String args)
                           throws java.io.IOException,
                                  org.xml.sax.SAXException,
                                  NaProtocolException
Throws:
java.io.IOException
org.xml.sax.SAXException
NaProtocolException

toString

public java.lang.String toString()

setVfilerTunneling

public void setVfilerTunneling(java.lang.String vfiler)
Set the name of the vfiler on which the API commands need to be invoked .