tw.net.ocs
Interface OCSServerUserInterface

All Known Implementing Classes:
OCSServer

public interface OCSServerUserInterface

An interface containing OCSServer methods accessible
to all users.

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

Calling these methods may require authentication,
just like calling methods on proxies in general. 
        

Author:
Tillmann Wegst
See Also:
OCSServer, OCSClient.getServerUserProxy(), OCSServerAdminInterface

Method Summary
 java.lang.String addSubject(java.lang.Object subject)
           Adds a subject to the server.
 java.lang.String addSubject(java.lang.Object subject, boolean gc)
           Adds a subject to the server.
 java.lang.String addSubject(java.lang.Object subject, java.lang.Class c, java.lang.String id)
           Adds a subject associated with some class to the server.
 java.lang.String addSubject(java.lang.Object subject, java.lang.Class c, java.lang.String id, boolean gc)
           Adds a subject associated with some class to the server.
 java.lang.String addSubject(java.lang.Object subject, java.lang.String id)
           Adds a subject to the server.
 java.lang.String addSubject(java.lang.Object subject, java.lang.String id, boolean gc)
           Adds a subject to the server.
 boolean existsSubject(java.lang.Class c)
          Tells whether at least one subject of a certain class exists on this server
 boolean existsSubject(java.lang.Class c, java.lang.String id)
          Tells whether a certain subject exists on this server
 java.lang.String getHostAddress()
          Returns the IP of the host
 java.lang.String getHostName()
          Returns the name of the host
 int getPort()
          Returns the port which this server listens at
 java.lang.Object getSubject(java.lang.Class c)
          Returns an arbitrary instance of a subject class
 java.lang.Object getSubject(java.lang.Class c, java.lang.String id)
           Returns an identified instance of a subject class.
 java.util.List<java.lang.Class> getSubjectClasses()
          Returns the classes of which instances (subjects) exist on this server
 java.lang.String getSubjectID(java.lang.Class c)
          Returns the ID of an arbitrary instance of a subject class
 java.util.List<java.lang.String> getSubjectNames(java.lang.Class c)
           Returns the names of subjects of a certain class.
 boolean isLocal()
          Tells whether the server is working in local mode, configured to be referenced directly by a client
 boolean removeSubject(java.lang.Class c, java.lang.String id)
          Removes a subject from this server
 boolean removeSubjects()
          Removes all subjects from this server
 boolean removeSubjects(java.lang.Class c)
          Removes all subjects of a given class from this server
 

Method Detail

getHostAddress

java.lang.String getHostAddress()
Returns the IP of the host

Returns:
the host address (IP)

getHostName

java.lang.String getHostName()
Returns the name of the host

Returns:
the host name

getPort

int getPort()
Returns the port which this server listens at

Returns:
the port number

addSubject

java.lang.String addSubject(java.lang.Object subject,
                            java.lang.Class c,
                            java.lang.String id,
                            boolean gc)
                            throws OCSException
Adds a subject associated with some class to the server.

The specified class may be a base class of the subject.
If the specified class is neither identical to the
subject's class nor one of its base classes, an
OCSException is thrown.

The subject will be associated with an ID.
If no ID is specified, it will be supplied automatically.

The subject can be marked for garbage collection so
that it will be removed if all proxies that may attach
to it detach from it again.
                

Parameters:
subject - the subject
c - the class of the subject or a base class thereof
id - the ID to associate the subject with (may be null)
gc - garbage collect the subject once all proxies detach from it?
Returns:
the ID of the subject
Throws:
OCSException
Since:
1.3

addSubject

java.lang.String addSubject(java.lang.Object subject,
                            java.lang.Class c,
                            java.lang.String id)
                            throws OCSException
Adds a subject associated with some class to the server.

The specified class may be a base class of the subject.
If the specified class is neither identical to the
subject's class nor one of its base classes, an
OCSException is thrown.

The subject will be associated with an ID.
If no ID is specified, it will be supplied automatically.

The subject is not marked for garbage collection,
so it will stay on if proxies that may attach to it
detach again.
                

Parameters:
subject - the subject
c - the class of the subject or a base class thereof
id - the ID to associate the subject with (may be null)
Returns:
the ID of the subject
Throws:
OCSException

addSubject

java.lang.String addSubject(java.lang.Object subject,
                            java.lang.String id,
                            boolean gc)
                            throws OCSException
Adds a subject to the server.

The subject will be associated with an ID.
If no ID is specified, it will be supplied automatically.

The subject can be marked for garbage collection so
that it will be removed if all proxies that may attach
to it detach from it again.
                

Parameters:
subject - the subject
id - the ID to associate the subject with (may be null)
gc - garbage collect the subject once all proxies detach from it?
Returns:
the ID of the subject
Throws:
OCSException
Since:
1.3

addSubject

java.lang.String addSubject(java.lang.Object subject,
                            java.lang.String id)
                            throws OCSException
Adds a subject to the server.

The subject gets associated with an ID.
If none is specified, the ID is supplied automatically.

The subject is not marked for garbage collection,
so it will stay on if proxies that may attach to it
detach again.
                

Parameters:
subject - the subject
id - the ID to associate the subject with (may be null)
Returns:
the ID of the subject
Throws:
OCSException

addSubject

java.lang.String addSubject(java.lang.Object subject,
                            boolean gc)
                            throws OCSException
Adds a subject to the server.

The subject's ID is supplied automatically.

The subject can be marked for garbage collection so
that it will be removed if all proxies that may attach
to it detach from it again.
                

Parameters:
subject - the subject
gc - garbage collect the subject once all proxies detach from it?
Returns:
the automatically generated ID of the subject
Throws:
OCSException
Since:
1.3

addSubject

java.lang.String addSubject(java.lang.Object subject)
                            throws OCSException
Adds a subject to the server.

The subject's ID is supplied automatically.

The subject is not marked for garbage collection,
so it will stay on if proxies that may attach to it
detach again.
                

Parameters:
subject - the subject
Returns:
the automatically generated ID of the subject
Throws:
OCSException

removeSubject

boolean removeSubject(java.lang.Class c,
                      java.lang.String id)
Removes a subject from this server

Parameters:
c - the class of the subject
id - the ID of the subject
Returns:
true if and only if the subject was found and removed

removeSubjects

boolean removeSubjects(java.lang.Class c)
Removes all subjects of a given class from this server

Parameters:
c - the class of the subject
Returns:
true if and only if at least one subject was found and removed

removeSubjects

boolean removeSubjects()
Removes all subjects from this server

Returns:
true if and only if at least one subject was found and removed

existsSubject

boolean existsSubject(java.lang.Class c)
Tells whether at least one subject of a certain class exists on this server

Parameters:
c - the class of the subject
Returns:
true if and only if a subject of this class exists

existsSubject

boolean existsSubject(java.lang.Class c,
                      java.lang.String id)
Tells whether a certain subject exists on this server

Parameters:
c - the class of the subject
id - the ID of the subject
Returns:
true if and only if a subject so identified exists

getSubjectNames

java.util.List<java.lang.String> getSubjectNames(java.lang.Class c)
Returns the names of subjects of a certain class.

If null is specified for the class, the names
of all subjects of whatever class are returned.
                

Parameters:
c - the class to which the request is restricted
Returns:
a list of names of subjects of the specified class

getSubjectClasses

java.util.List<java.lang.Class> getSubjectClasses()
Returns the classes of which instances (subjects) exist on this server

Returns:
a list of Class objects

getSubjectID

java.lang.String getSubjectID(java.lang.Class c)
Returns the ID of an arbitrary instance of a subject class

Parameters:
c - the subject class
Returns:
the ID of an arbitrary instance of the specified class

getSubject

java.lang.Object getSubject(java.lang.Class c,
                            java.lang.String id)
Returns an identified instance of a subject class.

Note: If null is specified as the ID, null will be
returned.
Use getSubject(Class c) to retrieve an arbitrary instance
of a subject class.
                

Parameters:
c - the class of the requested subject
id - the ID of the subject
Returns:
the subject or null
Since:
1.5.1

getSubject

java.lang.Object getSubject(java.lang.Class c)
Returns an arbitrary instance of a subject class

Parameters:
c - the class of the requested subject
Returns:
an arbitrary subject of the class or null
Since:
1.5.1

isLocal

boolean isLocal()
Tells whether the server is working in local mode, configured to be referenced directly by a client

Returns:
true if the server is configured for local mode


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