org.ourgrid.corepeer
Class RestrictedCorePeerImpl

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.ourgrid.common.rmi.OurgridUnicastRemoteObject
                  extended by org.ourgrid.corepeer.CorePeerImpl
                      extended by org.ourgrid.corepeer.RestrictedCorePeerImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, CorePeer, CorePeerStatusProvider

public class RestrictedCorePeerImpl
extends CorePeerImpl
implements CorePeer, CorePeerStatusProvider

See Also:
Serialized Form

Field Summary
static java.lang.String ALLOWED_PEERS_FILE
          File with a list of allowed peers.
static long serialVersionUID
          Serial identification of the class.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RestrictedCorePeerImpl()
          Creates a CorePeer that can allow or not peers join the community.
 
Method Summary
 java.util.List<ObjectID> getKnownPeers(ObjectID peerId)
          Returns a list of known peers in the OurGrid Community.
 java.util.List<ObjectID> hereIAm(ObjectID peerId)
          Called when a peer wants to join the OurGrid Community.
 boolean isAnAllowedPeer(ObjectID peerId)
          Returns if the PeerId is allowed or not.
 
Methods inherited from class org.ourgrid.corepeer.CorePeerImpl
getPeerList, newPeerArrived, removePeer, setFailureDetector, setPingerFactory, shutdown
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ourgrid.corepeer.CorePeer
newPeerArrived, removePeer, shutdown
 
Methods inherited from interface org.ourgrid.corepeer.CorePeerStatusProvider
getPeerList
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial identification of the class. It need to be changed only if the class interface is changed.

See Also:
Constant Field Values

ALLOWED_PEERS_FILE

public static final java.lang.String ALLOWED_PEERS_FILE
File with a list of allowed peers.

See Also:
Constant Field Values
Constructor Detail

RestrictedCorePeerImpl

public RestrictedCorePeerImpl()
                       throws java.rmi.RemoteException
Creates a CorePeer that can allow or not peers join the community.

Throws:
java.rmi.RemoteException - If cannot create this CorePeer.
Method Detail

hereIAm

public java.util.List<ObjectID> hereIAm(ObjectID peerId)
                                 throws java.rmi.RemoteException
Description copied from interface: CorePeer
Called when a peer wants to join the OurGrid Community.

Specified by:
hereIAm in interface CorePeer
Overrides:
hereIAm in class CorePeerImpl
Parameters:
peerId - The id of the caller peer.
Returns:
the list of already known peers (including the caller peer).
Throws:
java.rmi.RemoteException - If cannot contact the core peer.
See Also:
CorePeer.hereIAm(ObjectID)

isAnAllowedPeer

public boolean isAnAllowedPeer(ObjectID peerId)
Returns if the PeerId is allowed or not.

Parameters:
peerId - A PeerId.
Returns:
true case the PeerId is allowed, false otherwise.

getKnownPeers

public java.util.List<ObjectID> getKnownPeers(ObjectID peerId)
                                       throws java.rmi.RemoteException
Description copied from interface: CorePeer
Returns a list of known peers in the OurGrid Community.

Specified by:
getKnownPeers in interface CorePeer
Overrides:
getKnownPeers in class CorePeerImpl
Parameters:
peerId - The identification of the caller "peer".
Returns:
The list of already known peers.
Throws:
java.rmi.RemoteException - If cannot contact the core peer.