org.ourgrid.webstatus
Class WebStatusImpl

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.webstatus.WebStatusImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable, java.rmi.Remote, WebStatus

public class WebStatusImpl
extends java.rmi.server.UnicastRemoteObject
implements java.lang.Runnable, WebStatus, java.io.Serializable

Description: This is a fake peer, created to join the OurGrid Community and obtain the known peers list from the core peer and then talk to each known peer to get it's status information.

See Also:
Serialized Form

Field Summary
protected static java.lang.String CORE_PEER_PORT
          Core peer port property.
protected static java.lang.String CORE_PEER_URL
          Core peer url property,
protected static java.lang.String DEFAULT_CORE_PEER_PORT
          Default core peer port.
protected static java.lang.String DEFAULT_CORE_PEER_URL
          Default core peer url.
protected static int DEFAULT_REFRESH_TIME
          Refresh default time.
protected static int DEFAULT_WEBSTATUS_PORT
          Default port.
protected static java.lang.String WEBSTATUS_PORT
          Which port the webstatus will be bound property.
protected static java.lang.String WEBSTATUS_REFRESH_TIME
          The time to update property.
protected static java.lang.String WEBSTATUS_SELF_ID
           
protected static java.lang.String WEBSTATUS_URL
          WebStatus url property.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
WebStatusImpl()
           
WebStatusImpl(java.lang.String corepeerurl, int refreshTimeInteger, int port)
          Constructs a webstatus instance.
 
Method Summary
 void disableWebStatusAgent()
           
 java.util.Date getLastTimeOfSnapshot()
          Get the data/time value of last snapshot
 java.util.Collection<PeerInfoPack> getLocalPeerInfoList()
          Gets all peer status information from local peer list.
static void main(java.lang.String[] args)
           
 void run()
          From time to time, obtains the peer information.
 void shutdown()
          Set the flag to define if thread will be run.
 
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
 

Field Detail

WEBSTATUS_SELF_ID

protected static final java.lang.String WEBSTATUS_SELF_ID
See Also:
Constant Field Values

DEFAULT_CORE_PEER_URL

protected static final java.lang.String DEFAULT_CORE_PEER_URL
Default core peer url.

See Also:
Constant Field Values

DEFAULT_CORE_PEER_PORT

protected static final java.lang.String DEFAULT_CORE_PEER_PORT
Default core peer port.

See Also:
Constant Field Values

WEBSTATUS_PORT

protected static final java.lang.String WEBSTATUS_PORT
Which port the webstatus will be bound property.

See Also:
Constant Field Values

WEBSTATUS_URL

protected static final java.lang.String WEBSTATUS_URL
WebStatus url property.

See Also:
Constant Field Values

WEBSTATUS_REFRESH_TIME

protected static final java.lang.String WEBSTATUS_REFRESH_TIME
The time to update property.

See Also:
Constant Field Values

CORE_PEER_PORT

protected static final java.lang.String CORE_PEER_PORT
Core peer port property.

See Also:
Constant Field Values

CORE_PEER_URL

protected static final java.lang.String CORE_PEER_URL
Core peer url property,

See Also:
Constant Field Values

DEFAULT_REFRESH_TIME

protected static final int DEFAULT_REFRESH_TIME
Refresh default time.

See Also:
Constant Field Values

DEFAULT_WEBSTATUS_PORT

protected static final int DEFAULT_WEBSTATUS_PORT
Default port.

See Also:
Constant Field Values
Constructor Detail

WebStatusImpl

public WebStatusImpl()
              throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

WebStatusImpl

public WebStatusImpl(java.lang.String corepeerurl,
                     int refreshTimeInteger,
                     int port)
              throws java.net.MalformedURLException,
                     java.rmi.RemoteException,
                     java.rmi.NotBoundException
Constructs a webstatus instance.

Parameters:
corepeerurl - The core peer url.
refreshTimeInteger - The refresh time.
port - The port where it will be published.
Throws:
java.net.MalformedURLException
java.rmi.RemoteException
java.rmi.NotBoundException
Method Detail

getLocalPeerInfoList

public java.util.Collection<PeerInfoPack> getLocalPeerInfoList()
                                                        throws java.net.MalformedURLException,
                                                               java.rmi.RemoteException,
                                                               java.rmi.NotBoundException
Gets all peer status information from local peer list.

Specified by:
getLocalPeerInfoList in interface WebStatus
Returns:
A collection of PeerInfoPack, one for each known peer. *
Throws:
java.net.MalformedURLException - If the corepeer URL is invalid. This should never occurs.
java.rmi.RemoteException - If the corepeer could not be conctacted.
java.rmi.NotBoundException - If the corepeer is not online

getLastTimeOfSnapshot

public java.util.Date getLastTimeOfSnapshot()
Get the data/time value of last snapshot

Specified by:
getLastTimeOfSnapshot in interface WebStatus
Returns:
actual time of snapshot

shutdown

public void shutdown()
Set the flag to define if thread will be run.


run

public void run()
From time to time, obtains the peer information.

Specified by:
run in interface java.lang.Runnable

main

public static void main(java.lang.String[] args)

disableWebStatusAgent

public void disableWebStatusAgent()