tw.net.ocs
Interface OCSServerAdminInterface

All Known Implementing Classes:
OCSServer

public interface OCSServerAdminInterface

An interface containing OCSServer methods accessible
to administrators.

A proxy of this interface can be obtained from an OCSClient
to invoke admin methods on the OCSServer associated with
this client.

Calling admin methods requires admin authentication.
        

Author:
Tillmann Wegst
See Also:
OCSServer, OCSClient.getServerAdminProxy(), OCSServerUserInterface

Method Summary
 void addAdminPassword(java.lang.String pw)
           Adds a password allowing administrative access to the server.
 void addAdminPasswords(java.lang.String[] pw)
          Adds one or more password(s) allowing administrative access to the server.
 void addUserPassword(java.lang.String pw)
           Adds a password allowing user access to the server.
 void addUserPasswords(java.lang.String[] pw)
          Adds one or more password(s) allowing user access to the server.
 void allowClientIP(java.lang.String pattern)
           Adds an IP address or address pattern for clients acceptable by this server.
 void allowClientIPs(java.lang.String[] pattern)
          Adds one or more IP address patterns for clients acceptable by this server.
 void allowSubjectClass(java.lang.Class c)
           Allows the hosting of subjects of a certain class.
 void allowSubjectClasses(java.lang.String[] cc)
           Allows the hosting of subjects of certain classes.
 void encryptAccordingToClient(boolean value)
           Sets the server to accept both encrypting and non-encrypting clients.
 void forbidClientIP(java.lang.String pattern)
           Adds an IP address or address pattern for clients not acceptable by this server.
 void forbidClientIPs(java.lang.String[] pattern)
          Adds one or more IP address patterns for clients not acceptable by this server.
 void forbidSubjectClass(java.lang.Class c)
           Forbids the hosting of subjects of a certain class.
 void forbidSubjectClasses(java.lang.String[] cc)
           Forbids the hosting of subjects of certain classes.
 int getPriority()
           
 int hashCode()
           
 boolean isDaemon()
           
 boolean ping()
          A convenience method to check the server's accessibility
 void pleaseStop()
           
 boolean removeAdminPassword(java.lang.String pw)
          Adds one or more password(s) allowing administrative access to the server.
 void removeAdminPasswords()
          Removes all passwords allowing administrative access to the server.
 boolean removeUserPassword(java.lang.String pw)
          Removes a password allowing user access to the server.
 void removeUserPasswords()
          Removes all passwords allowing user access to the server.
 void setDaemon(boolean a)
           
 void setEncryptionKey(java.lang.String key)
           Sets the key for encrypted data transmission.
 void setPriority(int a)
           
 void setVerbose(boolean a)
           
 java.lang.String toString()
           
 

Method Detail

allowClientIP

void allowClientIP(java.lang.String pattern)
Adds an IP address or address pattern for clients acceptable
by this server.

To allow a whole range of IPs, one or more numbers
can be replaced by the asterisk *, e.g. "123.45.*.6"
allows clients with the IPs in range 123.45.0.6 through
123.45.255.6.

Instead of using trailing wildcards, a pattern can be
abbreviated, e.g. instead of "123.45.*.*" you can simply
use "123.45".

Note that it is possible both to allow and to forbid
client IPs.
The possible scenarios are evaluated like this:

If both an allow and a forbid pattern match on a given
        IP, the more specific of the two takes effect.
        (A pattern is more specific, if its leftmost wildcard
        is more to the right than in another pattern.)

        If the allow and forbid patterns are equal, the
        forbid pattern takes precedence: the IP is forbidden.

If only an allow pattern matches,
        the IP is allowed.

If only a forbid pattern matches,
        the IP is forbidden.

If no pattern matches, the outcome depends on the
        existence of allow and forbid patterns:
        If there exist forbid patterns (that don't match
        the IP), the IP is allowed.
        If there are no forbid patterns but allow patterns
        (that don't match the IP), the IP is forbidden.
        If there are no patterns of any kind, access is
        unrestricted: the IP is allowed.
                

Parameters:
pattern - an IP address or a pattern of such
See Also:
forbidClientIP(java.lang.String)

allowClientIPs

void allowClientIPs(java.lang.String[] pattern)
Adds one or more IP address patterns for clients acceptable by this server.

Parameters:
pattern - an Array of IP addresses or patterns of such
See Also:
allowClientIP(java.lang.String)

forbidClientIP

void forbidClientIP(java.lang.String pattern)
Adds an IP address or address pattern for clients
not acceptable by this server.

To forbid a whole range of IPs, one or more numbers
can be replaced by the asterisk *, e.g. "123.45.*.6"
allows clients with the IPs in range 123.45.0.6 through
123.45.255.6.

Instead of using trailing wildcards, a pattern can be
abbreviated, e.g. instead of "123.45.*.*" you can simply
use "123.45".

Note that it is possible both to allow and to forbid
client IPs.
The possible scenarios are evaluated like this:

If both an allow and a forbid pattern match on a given
        IP, the more specific of the two takes effect.
        (A pattern is more specific, if its leftmost wildcard
        is more to the right than in another pattern.)

        If the allow and forbid patterns are equal, the
        forbid pattern takes precedence: the IP is forbidden.

If only an allow pattern matches,
        the IP is allowed.

If only a forbid pattern matches,
        the IP is forbidden.

If no pattern matches, the outcome depends on the
        existence of allow and forbid patterns:
        If there exist forbid patterns (that don't match
        the IP), the IP is allowed.
        If there are no forbid patterns but allow patterns
        (that don't match the IP), the IP is forbidden.
        If there are no patterns of any kind, access is
        unrestricted: the IP is allowed.
                

Parameters:
pattern - an IP address or a pattern of such
Since:
1.3
See Also:
allowClientIP(java.lang.String)

forbidClientIPs

void forbidClientIPs(java.lang.String[] pattern)
Adds one or more IP address patterns for clients not acceptable by this server.

Parameters:
pattern - an Array of IP addresses or patterns of such
Since:
1.3
See Also:
forbidClientIP(java.lang.String)

addUserPassword

void addUserPassword(java.lang.String pw)
Adds a password allowing user access to the server.

Several passwords may be used, each independently allowing
access.

If no password has been set, access to the server is
unrestricted. (Note that this is different from the
policy used with admin passwords, where the absence
of passwords means access to admin methods is forbidden.)

Note that passwords are only checked when methods are called
via proxies, i.e. thru an OCSClient. OCSServer method invocations
directly using an OCSServer object do not require authentification.
                

Parameters:
pw - the password
See Also:
addUserPasswords(java.lang.String[]), addAdminPassword(java.lang.String)

addUserPasswords

void addUserPasswords(java.lang.String[] pw)
Adds one or more password(s) allowing user access to the server.

Parameters:
pw - an array of password
See Also:
addUserPassword(java.lang.String)

removeUserPassword

boolean removeUserPassword(java.lang.String pw)
Removes a password allowing user access to the server.

Parameters:
pw - the password
Returns:
true if and only if the specified password existed and could be removed

removeUserPasswords

void removeUserPasswords()
Removes all passwords allowing user access to the server.


addAdminPassword

void addAdminPassword(java.lang.String pw)
Adds a password allowing administrative access to the server.

Several admin passwords may be used, each independently allowing
access.

If no admin password has been set, access to administration methods
of OCSServer is forbidden. (Note that this is different from the
policy used with user passwords, where the absence of passwords
means access to user methods is unlimited.)

Note that passwords are only checked when methods are called
via proxies, i.e. thru an OCSClient. OCSServer method invocations
directly using an OCSServer object do not require authentification.
                

Parameters:
pw - the password
See Also:
addAdminPasswords(java.lang.String[]), addUserPassword(java.lang.String)

addAdminPasswords

void addAdminPasswords(java.lang.String[] pw)
Adds one or more password(s) allowing administrative access to the server.

Parameters:
pw - an array of password
See Also:
addAdminPassword(java.lang.String)

removeAdminPassword

boolean removeAdminPassword(java.lang.String pw)
Adds one or more password(s) allowing administrative access to the server.

Parameters:
pw - an array of password
See Also:
addAdminPassword(java.lang.String)

removeAdminPasswords

void removeAdminPasswords()
Removes all passwords allowing administrative access to the server.


setEncryptionKey

void setEncryptionKey(java.lang.String key)
Sets the key for encrypted data transmission.

Setting a key means that encryption begins.

To stop encryption, call the method with a
null argument.

(Encryption is inactive if the server is
used locally.)
                

Parameters:
key - the encryption key or null
Since:
1.3
See Also:
encryptAccordingToClient(boolean)

encryptAccordingToClient

void encryptAccordingToClient(boolean value)
Sets the server to accept both encrypting and non-encrypting clients.

Setting this option is relevant only if the server runs in encrypting mode:

If set, an encrypting server accepts and serves non-encrypting clients
as well.
If not set, an encrypting server turns non-encrypting clients away.

Per default, this option is not set.

Note that setting this option alone, does not put a server in
encrypting mode. To do this, use setEncryptionKey() with a non-empty
argument.
                

Parameters:
value - allow both encrypting and non-encrypting clients?
Since:
1.3
See Also:
setEncryptionKey(java.lang.String)

allowSubjectClass

void allowSubjectClass(java.lang.Class c)
Allows the hosting of subjects of a certain class.

Note that allowing a subject class includes
allowing all of this class' superclasses.

If at least one class is explicitly allowed to be hosted, the
hosting of all classes not explicitly allowed
is forbidden - provided there is no forbid specification:

If at least one class has been forbidden to be hosted,
allow specifications are ignored and all classes
not explicitely forbidden are allowed.
                

Parameters:
c - the class of which instances may be hosted
See Also:
forbidSubjectClass(java.lang.Class)

allowSubjectClasses

void allowSubjectClasses(java.lang.String[] cc)
                         throws java.lang.ClassNotFoundException
Allows the hosting of subjects of certain classes.

Specify classes by their qualified names, as for
use by Class.forName().
                

Parameters:
cc - an array of class names
Throws:
java.lang.ClassNotFoundException
See Also:
allowSubjectClass(java.lang.Class)

forbidSubjectClass

void forbidSubjectClass(java.lang.Class c)
Forbids the hosting of subjects of a certain class.

Note that forbidding a subject class includes
forbidding all of this class' subclasses.

If there are both forbid and allow specifications,
the latter are ignored.
                

Parameters:
c - the class of which instances must not be hosted
See Also:
allowSubjectClass(java.lang.Class)

forbidSubjectClasses

void forbidSubjectClasses(java.lang.String[] cc)
                          throws java.lang.ClassNotFoundException
Forbids the hosting of subjects of certain classes.

Specify classes by their qualified names, as for
use by Class.forName().
                

Parameters:
cc - an array of class names
Throws:
java.lang.ClassNotFoundException
See Also:
forbidSubjectClass(java.lang.Class)

ping

boolean ping()
A convenience method to check the server's accessibility

Returns:
true come rain or come shine

pleaseStop

void pleaseStop()

setVerbose

void setVerbose(boolean a)

setDaemon

void setDaemon(boolean a)

isDaemon

boolean isDaemon()

setPriority

void setPriority(int a)

getPriority

int getPriority()

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object


OCSelot @ www.ocselot.net www.ocselot.net