org.siebengeisslein.net
Class RemoteConnection

java.lang.Object
  extended by org.siebengeisslein.util.HasLog
      extended by org.siebengeisslein.net.RemoteConnection
All Implemented Interfaces:
Connection

public class RemoteConnection
extends HasLog
implements Connection


Field Summary
 
Fields inherited from interface org.siebengeisslein.server.Connection
NULL_LOCAL_REF, ROOT_OID
 
Constructor Summary
RemoteConnection(MessageSocket socket, java.lang.String username, java.lang.String password, ServerCallback callback, AccessGroupFactory accessFactory)
           
RemoteConnection(java.lang.String host, int port, java.lang.String username, java.lang.String password, ServerCallback callback, AccessGroupFactory accessFactory)
           
 
Method Summary
 void abortTransaction(Transaction t)
           
 void addEntry(Transaction t, long oid, CoreEntry entry)
           
 void close()
          Might be called, even if Connection is already closed.
 void commitTransaction(Transaction t)
           
 Transaction createTransaction()
           
 void createUserLocal(Transaction t, long oid)
           
 void expireOids(java.util.Set<java.lang.Long> removed)
          This method is called, when the client determines, that some oids are not active anymore.
 java.util.Map<java.lang.Long,CoreEntry> getEntry(long oid)
          Returns the CoreEntry for he given oid.
 long getRoot(java.lang.String name)
           
 long getUserLocal(long oid)
           
 java.util.Set<java.lang.Integer> getWriteGroups()
          Set of groups this connection is allowed to write to.
 void removeRoot(Transaction t, java.lang.String name)
           
 void setEntry(Transaction t, long oid, CoreEntry entry)
           
 void setRoot(Transaction t, java.lang.String name, long oid)
           
 void setUserLocal(Transaction t, long userLocalOid, long valueOid)
           
 
Methods inherited from class org.siebengeisslein.util.HasLog
getLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteConnection

public RemoteConnection(java.lang.String host,
                        int port,
                        java.lang.String username,
                        java.lang.String password,
                        ServerCallback callback,
                        AccessGroupFactory accessFactory)
                 throws java.io.IOException,
                        LoginException
Throws:
java.io.IOException
LoginException

RemoteConnection

public RemoteConnection(MessageSocket socket,
                        java.lang.String username,
                        java.lang.String password,
                        ServerCallback callback,
                        AccessGroupFactory accessFactory)
                 throws java.io.IOException,
                        LoginException
Throws:
java.io.IOException
LoginException
Method Detail

getRoot

public long getRoot(java.lang.String name)
             throws java.io.IOException,
                    CoreException,
                    UnknownRootException
Specified by:
getRoot in interface Connection
Throws:
java.io.IOException
CoreException
UnknownRootException

setRoot

public void setRoot(Transaction t,
                    java.lang.String name,
                    long oid)
             throws java.io.IOException,
                    CoreException,
                    AccessControlException
Specified by:
setRoot in interface Connection
Throws:
java.io.IOException
CoreException
AccessControlException

removeRoot

public void removeRoot(Transaction t,
                       java.lang.String name)
                throws java.io.IOException,
                       CoreException,
                       AccessControlException
Specified by:
removeRoot in interface Connection
Throws:
java.io.IOException
CoreException
AccessControlException

getEntry

public java.util.Map<java.lang.Long,CoreEntry> getEntry(long oid)
                                                 throws java.io.IOException,
                                                        CoreException,
                                                        UnknownOIDException,
                                                        AccessControlException
Description copied from interface: Connection
Returns the CoreEntry for he given oid. The Connection may choose to return more CoreEntries than the requested one.

Specified by:
getEntry in interface Connection
Throws:
java.io.IOException
CoreException
UnknownOIDException
AccessControlException

expireOids

public void expireOids(java.util.Set<java.lang.Long> removed)
                throws java.io.IOException,
                       CoreException
Description copied from interface: Connection
This method is called, when the client determines, that some oids are not active anymore. In this case the server does not have to inform the client about changes to these objects anymore.

Specified by:
expireOids in interface Connection
Throws:
CoreException
java.io.IOException

setEntry

public void setEntry(Transaction t,
                     long oid,
                     CoreEntry entry)
              throws java.io.IOException,
                     CoreException,
                     UnknownOIDException
Specified by:
setEntry in interface Connection
Throws:
java.io.IOException
CoreException
UnknownOIDException

addEntry

public void addEntry(Transaction t,
                     long oid,
                     CoreEntry entry)
              throws java.io.IOException,
                     CoreException,
                     UnknownOIDException
Specified by:
addEntry in interface Connection
Throws:
java.io.IOException
CoreException
UnknownOIDException

createUserLocal

public void createUserLocal(Transaction t,
                            long oid)
                     throws CoreException,
                            java.io.IOException
Specified by:
createUserLocal in interface Connection
Throws:
CoreException
java.io.IOException

setUserLocal

public void setUserLocal(Transaction t,
                         long userLocalOid,
                         long valueOid)
                  throws CoreException,
                         java.io.IOException
Specified by:
setUserLocal in interface Connection
valueOid - OID of an object or Connection.NULL_LOCAL_REF to set the user local to null for this user.
Throws:
CoreException
java.io.IOException

getUserLocal

public long getUserLocal(long oid)
                  throws CoreException,
                         java.io.IOException
Specified by:
getUserLocal in interface Connection
Throws:
CoreException
java.io.IOException

createTransaction

public Transaction createTransaction()
                              throws java.io.IOException,
                                     CoreException
Specified by:
createTransaction in interface Connection
Throws:
java.io.IOException
CoreException

commitTransaction

public void commitTransaction(Transaction t)
                       throws java.io.IOException,
                              CoreException,
                              UnknownOIDException
Specified by:
commitTransaction in interface Connection
Throws:
java.io.IOException
CoreException
UnknownOIDException

abortTransaction

public void abortTransaction(Transaction t)
                      throws java.io.IOException,
                             CoreException
Specified by:
abortTransaction in interface Connection
Throws:
java.io.IOException
CoreException

close

public void close()
Might be called, even if Connection is already closed.

Specified by:
close in interface Connection

getWriteGroups

public java.util.Set<java.lang.Integer> getWriteGroups()
Description copied from interface: Connection
Set of groups this connection is allowed to write to.

Specified by:
getWriteGroups in interface Connection