|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openafs.jafs.Server
An abstract representation of an AFS server. It holds information about
the server, such as what its processes are.
Constructing an instance of a Server
does not mean an actual
AFS server is created and added to a cell -- on the contrary, a
Server
object must be a representation of an already existing
AFS server. There is no way to create a new AFS server through this API.
See OpenAFS.org for information on how
to create a new AFS server.
A Server
object may represent either an AFS file server,
an AFS database server, or both if the same machine serves both
purposes.
Each Server
object has its own individual set of
Partition
s, Process
es, and Key
s.
This represents the properties and attributes of an actual AFS server.
The following is a simple example of how to construct and use a Server
object. This example constructs a Server
using the
Cell
representing teh AFS cell to which the server belongs,
and prints out the names of all the partitions residing on the server.
import org.openafs.jafs.Cell; import org.openafs.jafs.AFSException; import org.openafs.jafs.Partition; import org.openafs.jafs.Server; ... public class ... { ... private Cell cell; private Server server; ... public static void main(String[] args) throws Exception { String username = arg[0]; String password = arg[1]; String cellName = arg[2]; String serverName = arg[3]; token = new Token(username, password, cellName); cell = new Cell(token); server = new Server(serverName, cell); System.out.println("Partitions in Server " + server.getName() + ":"); if( server.isFileServer() ) { Partition[] partitions = server.getPartitions(); for (int i = 0; i < partitions.length; i++) { System.out.println(" -> " + partitions[i]); } } } ... }
Nested Class Summary | |
static class |
Server.ExecutableTime
|
Field Summary | |
protected ArrayList |
adminNames
|
protected ArrayList |
admins
|
protected boolean |
badDatabase
|
protected boolean |
badFileServer
|
protected Server.ExecutableTime |
binRestartTime
|
protected int |
bosHandle
|
protected boolean |
cachedInfo
|
protected Cell |
cell
|
protected boolean |
database
|
protected boolean |
fileServer
|
protected Server.ExecutableTime |
genRestartTime
|
protected String[] |
ipAddresses
|
protected ArrayList |
keys
|
protected String |
name
|
protected ArrayList |
partitionNames
|
protected ArrayList |
partitions
|
protected ArrayList |
processes
|
protected ArrayList |
processNames
|
protected int |
totalFreeSpace
|
protected int |
totalQuota
|
protected int |
totalSpace
|
protected int |
totalUsedSpace
|
protected int |
vosHandle
|
Constructor Summary | |
(package private) |
Server(Cell cell)
Constructs a blank Server object instance given the cell to
which the server belongs. |
|
Server(String name,
Cell cell)
Constructs a new Server object instance given the
name of the AFS server and the AFS cell, represented by
cell , to which it belongs. |
|
Server(String name,
Cell cell,
boolean preloadAllMembers)
Constructs a new Server object instance given the name
of the AFS server and the AFS cell, represented by cell ,
to which it belongs. |
Method Summary | |
void |
addAdmin(User admin)
Add a bos admin to the UserList file of this server, in order to given the AFS user represented by admin full bos
administrative privileges on this server. |
protected static void |
addBosAdmin(int serverHandle,
String adminName)
Adds the given to name to the list of bos administrators on that server. |
void |
close()
Unauthenticates all server-related tokens that have been obtained by this Server object, and shuts this server object down.
|
protected static void |
closeBosServerHandle(int bosHandle)
Closes the given currently open bos server handle. |
protected static void |
closeVosServerHandle(int vosHandle)
Closes the given currently open vos server handle. |
int |
compareTo(Object obj)
Comparable interface method. |
int |
compareTo(Server server)
Compares two Server objects respective to their names and does not factor any other attribute. |
boolean |
equals(Server otherServer)
Tests whether two Server objects are equal, based on their
names and hosting Cell. |
int |
getAdminCount()
Returns the number of BOS administrators assigned to this server. |
String[] |
getAdminNames()
Retrieves an array containing all of the names of bos admins associated with this Server . |
User[] |
getAdmins()
Retrieves an array containing all of the admin User objects
associated with this Server , each of which are an abstract
representation of an actual bos administrator of the AFS server.
|
Server.ExecutableTime |
getBinaryRestartTime()
Returns the BOS Server's binary restart time in the form of an ExecutableTime object. |
protected static int |
getBosAdminCount(int serverHandle)
Returns the total number of BOS administrators associated with the server denoted by serverHandle . |
protected static int |
getBosAdminsBegin(int serverHandle)
Begin the process of getting the bos amdinistrators on a server. |
protected static void |
getBosAdminsDone(int iterationId)
Signals that the iteration is complete and will not be accessed anymore. |
protected static int |
getBosAdminsNext(int cellHandle,
int iterationId,
User theUser)
Returns the next bos admin of the server. |
protected static String |
getBosAdminsNextString(int iterationId)
Returns the next bos admin of the server. |
protected int |
getBosHandle()
Returns this server's bos handle. |
protected static int |
getBosServerHandle(int cellHandle,
String serverName)
Opens a server for administrative bos use, based on the cell handle provided. |
Cell |
getCell()
Returns the Cell object with which this Server
was constructed. |
Server.ExecutableTime |
getGeneralRestartTime()
Returns the BOS Server's general restart time in the form of an ExecutableTime object. |
protected String |
getInfo()
Returns a String representation of this Server .
|
protected String |
getInfoKeys()
Returns a String containing the String
representations of all the keys of this Server . |
protected String |
getInfoPartitions()
Returns a String containing the String
representations of all the partitions of this Server . |
protected String |
getInfoProcesses()
Returns a String containing the String
representations of all the processes of this Server . |
String[] |
getIPAddresses()
Returns this server's IP address as a String. |
Key |
getKey(int keyVersion)
Retrieves the Key object (which is an abstract
representation of an actual AFS partition of this server) designated
by nkeyVersion . |
int |
getKeyCount()
Returns the number of keys on this server. |
protected static int |
getKeyCount(int serverHandle)
Returns the total number of keys hosted by the server denoted by serverHandle . |
Key[] |
getKeys()
Retrieves an array containing all of the Key objects
associated with this Server , each of which are an abstract
representation of an actual AFS key of the AFS server.
|
protected static int |
getKeysBegin(int serverHandle)
Begin the process of getting the keys of a server. |
protected static void |
getKeysDone(int iterationId)
Signals that the iteration is complete and will not be accessed anymore. |
protected static int |
getKeysNext(int iterationId,
Key theKey)
Returns the next key of the server. |
protected static String |
getLog(int serverHandle,
String logLocation)
Retrieves a specified bos log from a server. |
String |
getLog(String logLocation)
Gets the contents of a log file, in one large String .
|
String |
getName()
Returns the name of this server. |
Partition |
getPartition(String name)
Retrieves the Partition object (which is an abstract
representation of an actual AFS partition of this server) designated
by name (i.e. |
int |
getPartitionCount()
Returns the number of partitions on this server. |
protected static int |
getPartitionCount(int cellHandle,
int serverHandle)
Returns the total number of partitions hosted by the server denoted by serverHandle , if the server is a fileserver. |
String[] |
getPartitionNames()
Retrieves an array containing all of the names of partitions associated with this Server (i.e. |
Partition[] |
getPartitions()
Retrieves an array containing all of the Partition objects
associated with this Server , each of which are an abstract
representation of an actual AFS partition of the AFS server.
|
protected static int |
getPartitionsBegin(int cellHandle,
int serverHandle)
Begin the process of getting the partitions on a server. |
protected static void |
getPartitionsDone(int iterationId)
Signals that the iteration is complete and will not be accessed anymore. |
protected static int |
getPartitionsNext(int iterationId,
Partition thePartition)
Fills the next partition object of the server. |
protected static String |
getPartitionsNextString(int iterationId)
Returns the next partition of the server. |
Process |
getProcess(String name)
Retrieves the Process object (which is an abstract
representation of an actual AFS process of this server) designated
by name (i.e. |
int |
getProcessCount()
Returns the number of processes hosted by this server. |
protected static int |
getProcessCount(int serverHandle)
Returns the total number of processes hosted by the server denoted by serverHandle . |
Process[] |
getProcesses()
Retrieves an array containing all of the Process objects
associated with this Server , each of which are an abstract
representation of an actual AFS process of the AFS server.
|
protected static int |
getProcessesBegin(int serverHandle)
Begin the process of getting the processes on a server. |
protected static void |
getProcessesDone(int iterationId)
Signals that the iteration is complete and will not be accessed anymore. |
protected static int |
getProcessesNext(int serverHandle,
int iterationId,
Process theProcess)
Fills the next process object of the server. |
protected static String |
getProcessesNextString(int iterationId)
Returns the next process of the server. |
String[] |
getProcessNames()
Retrieves an array containing all of the names of processes associated with this Server (i.e. |
protected static void |
getServerInfo(int cellHandle,
String name,
Server server)
Fills in the information fields of the provided Server . |
int |
getTotalFreeSpace()
Returns the total free space on this server (a sum of the free space of all the partitions associated with this server). |
int |
getTotalSpace()
Returns the total space on this server (a sum of the space of all the partitions associated with this server). |
int |
getTotalUsedSpace()
Returns the total used space on this server (a sum of the used space of all the partitions associated with this server). |
protected int |
getVosHandle()
Returns this server's vos handle. |
protected static int |
getVosServerHandle(int cellHandle,
String serverName)
Opens a server for administrative vos use, based on the cell handle provided. |
boolean |
isBadDatabase()
Returns whether or not this server is a database machine AND either it isn't in reality (e.g. it's incorrectly configured) or it's currently down. |
boolean |
isBadFileServer()
Returns whether this machine thinks it's a file server AND either it isn't in reality (e.g. it's incorrectly configured) or it's currently down. |
boolean |
isDatabase()
Returns whether or not this server is a database machine, meaning it runs processes such as the "kaserver" and "vlserver", and participates in elections. |
boolean |
isFileServer()
Returns whether or not this server is a file server machine, meaning it runs the "fs" process and stores AFS volumes. |
protected static void |
reclaimServerMemory()
Reclaims all memory being saved by the server portion of the native library. |
void |
refresh()
Refreshes the properties of this Server object instance with values from the AFS server it represents. |
protected void |
refresh(boolean all)
Refreshes the properties of this Server object instance with values from the AFS server it represents. |
protected void |
refreshAdminNames()
Obtains the most current list of bos admin names of this server. |
protected void |
refreshAdmins()
Obtains the most current list of admin User objects of
this server. |
protected void |
refreshBinaryRestart()
Refreshes the binary restart time fields of this Server
to reflect the current state of the AFS server. |
protected void |
refreshGeneralRestart()
Refreshes the general restart time fields of this Server
to reflect the current state of the AFS server. |
protected void |
refreshInfo()
Refreshes the information fields of this Server to
reflect the current state of the AFS server. |
protected void |
refreshKeys()
Obtains the most current list of Key objects of this server. |
protected void |
refreshPartitionNames()
Obtains the most current list of partition names of this server. |
protected void |
refreshPartitions()
Obtains the most current list of Partition objects
of this server. |
protected void |
refreshPartitions(boolean refreshVolumes)
Obtains the most current list of Partition objects of
this server. |
protected void |
refreshProcesses()
Obtains the most current list of Process objects of
this server. |
protected void |
refreshProcessNames()
Obtains the most current list of process names of this server. |
void |
removeAdmin(User admin)
Remove a bos admin from the UserList file of this server, in order to take away from the AFS user represented by admin bos
administrative privileges on this machine. |
protected static void |
removeBosAdmin(int serverHandle,
String adminName)
Removes the given to name from the list of bos administrators on that server. |
void |
restartAllProcesses()
Restarts all bos processes on this server. |
protected static void |
restartAllProcesses(int serverHandle,
boolean restartBosServer)
Restart all server processes. |
void |
restartBosServer()
Restarts bos server and all bos processes on this server. |
void |
salvage()
Salvages (restores consistency to) this server. |
protected static void |
salvage(int cellHandle,
int serverHandle,
String partitionName,
String volName,
int numSalvagers,
String tempDir,
String logFile,
boolean inspectAllVolumes,
boolean removeBadlyDamaged,
boolean writeInodes,
boolean writeRootInodes,
boolean forceDirectory,
boolean forceBlockReads)
Salvages (restores consistency to) a volume, partition, or server |
void |
setBinaryRestartTime(Server.ExecutableTime executableTime)
Sets the BOS binary restart time. |
void |
setGeneralRestartTime(Server.ExecutableTime executableTime)
Sets the BOS general restart time. |
void |
startAllProcesses()
Starts up all bos processes on this server. |
protected static void |
startAllProcesses(int serverHandle)
Start all server processes. |
void |
stopAllProcesses()
Stops all bos processes on this server. |
protected static void |
stopAllProcesses(int serverHandle)
Stop all server processes. |
void |
syncServer()
Syncs this server to the VLDB. |
protected static void |
syncServerWithVLDB(int cellHandle,
int serverHandle,
int partition)
Synchronizes a particular server with the volume location database. |
void |
syncVLDB()
Syncs the VLDB to this server. |
protected static void |
syncVLDBWithServer(int cellHandle,
int serverHandle,
int partition,
boolean forceDeletion)
Synchronizes the volume location database with a particular server. |
String |
toString()
Returns the name of this Server |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected String name
protected Cell cell
protected int vosHandle
protected int bosHandle
protected boolean database
protected boolean fileServer
protected boolean badFileServer
protected boolean badDatabase
protected String[] ipAddresses
protected ArrayList partitionNames
protected ArrayList partitions
protected ArrayList adminNames
protected ArrayList admins
protected ArrayList keys
protected ArrayList processNames
protected ArrayList processes
protected int totalSpace
protected int totalQuota
protected int totalFreeSpace
protected int totalUsedSpace
protected Server.ExecutableTime genRestartTime
protected Server.ExecutableTime binRestartTime
protected boolean cachedInfo
Constructor Detail |
public Server(String name, Cell cell) throws AFSException
Server
object instance given the
name of the AFS server and the AFS cell, represented by
cell
, to which it belongs. This does not actually
create a new AFS server, it just represents an existing one.
If name
is not an actual AFS server, exceptions
will be thrown during subsequent method invocations on this
object.
name
- the name of the server to representcell
- the cell to which the server belongs.
AFSException
- If an error occurs in the native codepublic Server(String name, Cell cell, boolean preloadAllMembers) throws AFSException
Server
object instance given the name
of the AFS server and the AFS cell, represented by cell
,
to which it belongs. This does not actually
create a new AFS server, it just represents an existing one.
If name
is not an actual AFS server, exceptions
will be thrown during subsequent method invocations on this
object.
This constructor is ideal for point-in-time representation and
transient applications. It ensures all data member values are set
and available without calling back to the filesystem at the first
request for them. Use the refresh()
method to address any
coherency concerns.
name
- the name of the server to representcell
- the cell to which the server belongs.preloadAllMembers
- true will ensure all object members are
set upon construction;
otherwise members will be set upon access,
which is the default behavior.
AFSException
- If an error occurs in the native coderefresh()
Server(Cell cell) throws AFSException
Server
object instance given the cell to
which the server belongs. This blank object can then be passed into
other methods to fill out its properties.
cell
- the cell to which the server belongs.
AFSException
- If an error occurs in the native codeMethod Detail |
public void refresh() throws AFSException
Since in most environments administrative changes can be administered from an AFS command-line program or an alternate GUI application, this method provides a means to refresh the Java object representation and thereby ascertain any possible modifications that may have been made from such alternate administrative programs. Using this method before an associated instance accessor will ensure the highest level of representative accuracy, accommodating changes made external to the Java application space. If administrative changes to the underlying AFS system are only allowed via this API, then the use of this method is unnecessary.
AFSException
- If an error occurs in the native codeprotected void refresh(boolean all) throws AFSException
all
is
true
then all of the properties of this Server
object instance will be set, or renewed, according to the values of the
AFS server it represents, disregarding any previously set properties.
Thus, if all
is false
then properties that
are currently set will be refreshed and properties that are not set
will remain uninitialized.
See refresh()
for more information.
all
- if true set or renew all object properties;
otherwise renew all set properties
AFSException
- If an error occurs in the native coderefresh()
protected void refreshInfo() throws AFSException
Server
to
reflect the current state of the AFS server. These fields include
the IP addresses and the fileserver types.
AFSException
- If an error occurs in the native codeprotected void refreshGeneralRestart() throws AFSException
Server
to reflect the current state of the AFS server.
AFSException
- If an error occurs in the native codeprotected void refreshBinaryRestart() throws AFSException
Server
to reflect the current state of the AFS server.
AFSException
- If an error occurs in the native codeprotected void refreshPartitions() throws AFSException
Partition
objects
of this server.
AFSException
- If an error occurs in the native codeprotected void refreshPartitions(boolean refreshVolumes) throws AFSException
Partition
objects of
this server.
refreshVolumes
- force all volumes contained in each
partition to be refreshed.
AFSException
- If an error occurs in the native codeprotected void refreshPartitionNames() throws AFSException
AFSException
- If an error occurs in the native codeprotected void refreshAdminNames() throws AFSException
AFSException
- If an error occurs in the native codeprotected void refreshAdmins() throws AFSException
User
objects of
this server.
AFSException
- If an error occurs in the native codeprotected void refreshKeys() throws AFSException
Key
objects of this server.
AFSException
- If an error occurs in the native codeprotected void refreshProcessNames() throws AFSException
AFSException
- If an error occurs in the native codeprotected void refreshProcesses() throws AFSException
Process
objects of
this server.
AFSException
- If an error occurs in the native codepublic void addAdmin(User admin) throws AFSException
admin
full bos
administrative privileges on this server.
admin
- the admin to add
AFSException
- If an error occurs in the native codepublic void removeAdmin(User admin) throws AFSException
admin
bos
administrative privileges on this machine.
admin
- the admin to remove
AFSException
- If an error occurs in the native codepublic void syncServer() throws AFSException
AFSException
- If an error occurs in the native codepublic void syncVLDB() throws AFSException
AFSException
- If an error occurs in the native codepublic void salvage() throws AFSException
AFSException
- If an error occurs in the native codepublic void startAllProcesses() throws AFSException
AFSException
- If an error occurs in the native codepublic void stopAllProcesses() throws AFSException
AFSException
- If an error occurs in the native codepublic void restartAllProcesses() throws AFSException
AFSException
- If an error occurs in the native codepublic void restartBosServer() throws AFSException
AFSException
- If an error occurs in the native codepublic String getLog(String logLocation) throws AFSException
String
.
The log cannot be in AFS file space.
String
containing the contents of the log file
AFSException
- If an error occurs in the native codepublic void close() throws AFSException
Server
object, and shuts this server object down.
This method should only be called when this Server
or any
of the objects constructed using this Server
will not be
used anymore. Note that this does not effect the actual AFS server;
it merely closes the representation.
AFSException
- If an error occurs in the native codepublic String getName()
public Cell getCell()
Cell
object with which this Server
was constructed. It represents the actual AFS cell to which this
server belongs.
public int getAdminCount() throws AFSException
If the total list of admins or admin names have already been
collected (see getAdmins()
), then the returning value will
be calculated based upon the current list. Otherwise, AFS will be
explicitly queried for the information.
The product of this method is not saved, and is recalculated with every call.
AFSException
- If an error occurs
in any of the associated native methodsgetAdmins()
,
getAdminNames()
public User[] getAdmins() throws AFSException
User
objects
associated with this Server
, each of which are an abstract
representation of an actual bos administrator of the AFS server.
After this method is called once, it saves the array of
User
s and returns that saved array on subsequent calls,
until the refresh()
method is called and a more current list
is obtained.
User
array of the admins of the server.
AFSException
- If an error occurs in the native coderefresh()
public String[] getAdminNames() throws AFSException
Server
. After this method
is called once, it saves the array of String
s and returns
that saved array on subsequent calls, until the refresh()
method
is called and a more current list is obtained.
String
array of the bos admin of the server.
AFSException
- If an error occurs in the native coderefresh()
public int getPartitionCount() throws AFSException
If the total list of partitions or partition names have already been
collected (see getPartitions()
), then the returning value will
be calculated based upon the current list. Otherwise, AFS will be
explicitly queried for the information.
The product of this method is not saved, and is recalculated with every call.
AFSException
- If an error occurs
in any of the associated native methodsgetPartitions()
,
getPartitionNames()
public Partition getPartition(String name) throws AFSException
Partition
object (which is an abstract
representation of an actual AFS partition of this server) designated
by name
(i.e. "/vicepa", etc.). If a partition by
that name does not actually exist in AFS on the server
represented by this object, an AFSException
will be
thrown.
name
- the name of the partition to retrieve
Partition
designated by name
.
AFSException
- If an error occurs in the native code
NullPointerException
- If name
is
null
.public Partition[] getPartitions() throws AFSException
Partition
objects
associated with this Server
, each of which are an abstract
representation of an actual AFS partition of the AFS server.
After this method is called once, it saves the array of
Partition
s and returns that saved array on subsequent calls,
until the refresh()
method is called and a more current list
is obtained.
Partition
array of the Partition
objects of the server.
AFSException
- If an error occurs in the native coderefresh()
public String[] getPartitionNames() throws AFSException
Server
(i.e. "vicepa", etc.).
After this method is called once, it saves the array of
String
s and returns that saved array on subsequent calls,
until the refresh()
method is called and a more current
list is obtained.
String
array of the partitions of the server.
AFSException
- If an error occurs in the native coderefresh()
public Key getKey(int keyVersion) throws AFSException
Key
object (which is an abstract
representation of an actual AFS partition of this server) designated
by nkeyVersion
. If a key with
that version does not actually exist in AFS on the server
represented by this object, null
is returned.
keyVersion
- the version of the key to retrieve
Key
designated by keyVersion
.
AFSException
- If an error occurs in the native codepublic int getKeyCount() throws AFSException
If the total list of keys has already been
collected (see getKeys()
), then the returning value will
be calculated based upon the current list. Otherwise, AFS will be
explicitly queried for the information.
The product of this method is not saved, and is recalculated with every call.
AFSException
- If an error occurs
in any of the associated native methodsgetKeys()
public Key[] getKeys() throws AFSException
Key
objects
associated with this Server
, each of which are an abstract
representation of an actual AFS key of the AFS server.
After this method is called once, it saves the array of
Key
s and returns that saved array on subsequent calls,
until the refresh()
method is called and a more current list
is obtained.
Key
array of the Key
objects
of the server.
AFSException
- If an error occurs in the native coderefresh()
public Process getProcess(String name) throws AFSException
Process
object (which is an abstract
representation of an actual AFS process of this server) designated
by name
(i.e. "kaserver", etc.). If a process by
that name does not actually exist in AFS on the server
represented by this object, an AFSException
will be
thrown.
name
- the name of the process to retrieve
Process
designated by name
.
AFSException
- If an error occurs in the native code
NullPointerException
- If name
is
null
.public int getProcessCount() throws AFSException
If the total list of processes or process names have already been
collected (see getProcesses()
), then the returning value will
be calculated based upon the current list. Otherwise, AFS will be
explicitly queried for the information.
The product of this method is not saved, and is recalculated with every call.
AFSException
- If an error occurs
in any of the associated native methodsgetProcesses()
,
getProcessNames()
public Process[] getProcesses() throws AFSException
Process
objects
associated with this Server
, each of which are an abstract
representation of an actual AFS process of the AFS server.
After this method is called once, it saves the array of
Process
es and returns that saved array on subsequent calls,
until the refresh()
method is called and a more current list
is obtained.
Process
array of the Process
objects of the server.
AFSException
- If an error occurs in the native coderefresh()
public String[] getProcessNames() throws AFSException
Server
(i.e. "kaserver", etc.).
After this method is called once, it saves the array of
String
s and returns that saved array on subsequent calls,
until the refresh()
method is called and a more current
list is obtained.
String
array of the processes of the server.
AFSException
- If an error occurs in the native coderefresh()
public boolean isDatabase() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean isFileServer() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean isBadDatabase() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public boolean isBadFileServer() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public String[] getIPAddresses() throws AFSException
AFSException
- If an error occurs in the native coderefresh()
public Server.ExecutableTime getGeneralRestartTime() throws AFSException
refresh()
method
is called and a more current value is obtained.
AFSException
- If an error occurs in the native codeServer.ExecutableTime
,
refresh()
public Server.ExecutableTime getBinaryRestartTime() throws AFSException
refresh()
method
is called and a more current value is obtained.
AFSException
- If an error occurs in the native codeServer.ExecutableTime
,
refresh()
public int getTotalSpace() throws AFSException
refresh()
method
is called and a more current value is obtained.
AFSException
- If an error occurs in the native coderefresh()
public int getTotalFreeSpace() throws AFSException
refresh()
method
is called and a more current value is obtained.
AFSException
- If an error occurs in the native coderefresh()
public int getTotalUsedSpace() throws AFSException
refresh()
method
is called and a more current value is obtained.
AFSException
- If an error occurs in the native codegetTotalSpace()
,
getTotalFreeSpace()
protected int getVosHandle() throws AFSException
AFSException
- If an error occurs in the native codeprotected int getBosHandle() throws AFSException
AFSException
- If an error occurs in the native codepublic void setGeneralRestartTime(Server.ExecutableTime executableTime) throws AFSException
executableTime
- Executable time object that represents what
the BOS Server's general restart time should be.
AFSException
- If an error occurs in the native codeServer.ExecutableTime
public void setBinaryRestartTime(Server.ExecutableTime executableTime) throws AFSException
executableTime
- Executable time object that represents what
the BOS Server's binary restart time should be.
AFSException
- If an error occurs in the native codeServer.ExecutableTime
protected String getInfo()
String
representation of this Server
.
Contains the information fields and a list of partitions, admin, and
processes.
String
representation of the Server
protected String getInfoPartitions() throws AFSException
String
containing the String
representations of all the partitions of this Server
.
String
representation of the partitions
AFSException
Partition.getInfo()
protected String getInfoKeys() throws AFSException
String
containing the String
representations of all the keys of this Server
.
String
representation of the keys
AFSException
Key.getInfo()
protected String getInfoProcesses() throws AFSException
String
containing the String
representations of all the processes of this Server
.
String
representation of the processes
AFSException
Process.getInfo()
public int compareTo(Server server)
server
- The Server object to be compared to this
Server instance
public int compareTo(Object obj)
compareTo
in interface Comparable
compareTo(Server)
public boolean equals(Server otherServer)
Server
objects are equal, based on their
names and hosting Cell.
otherServer
- the Server to test
public String toString()
Server
toString
in class Object
Server
protected static int getVosServerHandle(int cellHandle, String serverName) throws AFSException
cellHandle
- a cell handle previously returned by
a call to Cell.getCellHandle()
serverName
- the name of the server for which to retrieve
a vos handle
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void closeVosServerHandle(int vosHandle) throws AFSException
vosHandle
- the vos server handle to close
AFSException
- If an error occurs in the native codeprotected static int getBosServerHandle(int cellHandle, String serverName) throws AFSException
cellHandle
- a cell handle previously returned by a call
to Cell.getCellHandle()
serverName
- the name of the server for which to retrieve
a bos handle
AFSException
- If an error occurs in the native codeCell.getCellHandle()
protected static void closeBosServerHandle(int bosHandle) throws AFSException
bosHandle
- the bos server handle to close
AFSException
- If an error occurs in the native codeprotected static void getServerInfo(int cellHandle, String name, Server server) throws AFSException
Server
.
cellHandle
- the handle of the cell to which the server belongsname
- the name of the server for which to get the informationserver
- the Server
object in which to fill in
the information
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
Server
protected static int getPartitionCount(int cellHandle, int serverHandle) throws AFSException
serverHandle
, if the server is a fileserver.
cellHandle
- the handle of the cell to which the server belongsserverHandle
- the vos handle of the server to which the
partitions belong
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getVosServerHandle(int, java.lang.String)
protected static int getPartitionsBegin(int cellHandle, int serverHandle) throws AFSException
getPartitionsNext
and getPartitionsDone
.
cellHandle
- the handle of the cell to which the server belongsserverHandle
- the vos handle of the server to which the
partitions belong
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getVosServerHandle(int, java.lang.String)
protected static String getPartitionsNextString(int iterationId) throws AFSException
null
if there are no more partitions.
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetPartitionsBegin(int, int)
protected static int getPartitionsNext(int iterationId, Partition thePartition) throws AFSException
iterationId
- the iteration ID of this iterationthePartition
- the Partition object in which to fill the
values of the next partition
AFSException
- If an error occurs in the native codegetPartitionsBegin(int, int)
protected static void getPartitionsDone(int iterationId) throws AFSException
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetPartitionsBegin(int, int)
protected static int getProcessCount(int serverHandle) throws AFSException
serverHandle
.
serverHandle
- the vos handle of the server to which the
processes belong
AFSException
- If an error occurs in the native codegetVosServerHandle(int, java.lang.String)
protected static int getProcessesBegin(int serverHandle) throws AFSException
getProcessesNext
and getProcessesDone
.
serverHandle
- the bos handle of the server to which the
processes belong
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static String getProcessesNextString(int iterationId) throws AFSException
null
if there are no more processes.
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetProcessesBegin(int)
protected static int getProcessesNext(int serverHandle, int iterationId, Process theProcess) throws AFSException
serverHandle
- the handle of the BOS server that hosts the processiterationId
- the iteration ID of this iterationtheProcess
- the Process object in which to fill the
values of the next process
AFSException
- If an error occurs in the native codegetBosHandle()
,
getProcessesBegin(int)
protected static void getProcessesDone(int iterationId) throws AFSException
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetProcessesBegin(int)
protected static int getKeyCount(int serverHandle) throws AFSException
serverHandle
.
serverHandle
- the vos handle of the server to which the
keys belong
AFSException
- If an error occurs in the native codegetVosServerHandle(int, java.lang.String)
protected static int getKeysBegin(int serverHandle) throws AFSException
getKeysNext
and getKeysDone
.
serverHandle
- the bos handle of the server to which the keys belong
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static int getKeysNext(int iterationId, Key theKey) throws AFSException
iterationId
- the iteration ID of this iterationtheKey
- a Key
object, in which to fill in the
properties of the next key.
AFSException
- If an error occurs in the native codegetKeysBegin(int)
protected static void getKeysDone(int iterationId) throws AFSException
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetKeysBegin(int)
protected static int getBosAdminCount(int serverHandle) throws AFSException
serverHandle
.
serverHandle
- the vos handle of the server to which the
BOS admins belong
AFSException
- If an error occurs in the native codegetVosServerHandle(int, java.lang.String)
protected static int getBosAdminsBegin(int serverHandle) throws AFSException
getBosAdminsNext
and getBosAdminsDone
.
serverHandle
- the bos handle of the server to which the
partitions belong
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static String getBosAdminsNextString(int iterationId) throws AFSException
null
if there are no more admins.
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetBosAdminsBegin(int)
protected static int getBosAdminsNext(int cellHandle, int iterationId, User theUser) throws AFSException
cellHandle
- the handle of the cell to which these admins belongiterationId
- the iteration ID of this iterationtheUser
- the user object in which to fill the values of this admin
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getBosAdminsBegin(int)
protected static void getBosAdminsDone(int iterationId) throws AFSException
iterationId
- the iteration ID of this iteration
AFSException
- If an error occurs in the native codegetBosAdminsBegin(int)
protected static void addBosAdmin(int serverHandle, String adminName) throws AFSException
serverHandle
- the bos handle of the server to which the
partitions belongadminName
- the name of the admin to add to the list
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static void removeBosAdmin(int serverHandle, String adminName) throws AFSException
serverHandle
- the bos handle of the server to which the
partitions belongadminName
- the name of the admin to remove from the list
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static void salvage(int cellHandle, int serverHandle, String partitionName, String volName, int numSalvagers, String tempDir, String logFile, boolean inspectAllVolumes, boolean removeBadlyDamaged, boolean writeInodes, boolean writeRootInodes, boolean forceDirectory, boolean forceBlockReads) throws AFSException
cellHandle
- the handle of the cell to which the volume belongsserverHandle
- the bos handle of the server on which the
volume residespartitionName
- the name of the partition to salvage,
can be null
only if volName is
null
volName
- the name of the volume to salvage,
can be null
numSalvagers
- the number of salvager processes to run in paralleltempDir
- directory to place temporary files, can be
null
logFile
- where salvager log will be written, can be
null
inspectAllVolumes
- whether or not to inspect all volumes,
not just those marked as active at crashremoveBadlyDamaged
- whether or not to remove a volume if it's
badly damagedwriteInodes
- whether or not to record a list of inodes modifiedwriteRootInodes
- whether or not to record a list of AFS
inodes owned by rootforceDirectory
- whether or not to salvage an entire directory
structureforceBlockReads
- whether or not to force the salvager to read
the partition
one block at a time and skip badly damaged
blocks. Use if partition has disk errors
AFSException
Cell.getCellHandle()
,
getBosServerHandle(int, java.lang.String)
protected static void syncServerWithVLDB(int cellHandle, int serverHandle, int partition) throws AFSException
cellHandle
- the handle of the cell to which the server belongsserverHandle
- the vos handle of the serverpartition
- the id of the partition to sync, can be -1 to ignore
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getVosServerHandle(int, java.lang.String)
protected static void syncVLDBWithServer(int cellHandle, int serverHandle, int partition, boolean forceDeletion) throws AFSException
cellHandle
- the handle of the cell to which the server belongsserverHandle
- the vos handle of the serverpartition
- the id of the partition to sync, can be -1 to ignoreforceDeletion
- whether or not to force the deletion of bad volumes
AFSException
- If an error occurs in the native codeCell.getCellHandle()
,
getVosServerHandle(int, java.lang.String)
protected static String getLog(int serverHandle, String logLocation) throws AFSException
serverHandle
- the bos handle of the server to which the key belongslogLocation
- the full path and name of the desired bos log
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static void startAllProcesses(int serverHandle) throws AFSException
serverHandle
- the bos handle of the server to which the
processes belong
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static void restartAllProcesses(int serverHandle, boolean restartBosServer) throws AFSException
serverHandle
- the bos handle of the server to which the
processes belongrestartBosServer
- whether or not to restart the bos server as well
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static void stopAllProcesses(int serverHandle) throws AFSException
serverHandle
- the bos handle of the server to which the
processes belong
AFSException
- If an error occurs in the native codegetBosServerHandle(int, java.lang.String)
protected static void reclaimServerMemory()
Server
objects are expected to be used.
|
JAFS API v2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |