tauZaman
v0.1

tauzaman
Class TauZamanSystem

java.lang.Object
  |
  +--tauzaman.TauZamanSystem

public class TauZamanSystem
extends java.lang.Object

TauZamanSystem is the entrance point for TauZaman services. It contains methods, which provides services to interact further Calendar related services. It contains all repositories, which will be used as a database for all services.

Status:
design complete, implementation complete

Field Summary
private static TauZamanService activeService
          Active TauZamanService of this TauZamanSystem
private  CalendarRepository cr
          A handle to unique CalendarRepository of this TauZamanSystem
private  CalendricSystemRepository csr
          A handle to unique CalendricSystemRepository of this TauZamanSystem
private  FVSupportRepository fvsr
          A handle to unique FVSupportRepository of this TauZamanSystem
private  PropertyRepository pr
          A handle to unique PropertyRepository of this TauZamanSystem
private  java.lang.String serverRegistryName
          Name that is used for RMI registry name binding
private  TauZamanRemoteServiceHandler tzRemoteServiceHandler
          TauZamanRemoteServiceHandler object, which handles remote services of this TauZamanSystem when it is set as server
 
Constructor Summary
TauZamanSystem()
          Constructs a TauZamanSystem object, which provides local or remote TauZamanServices, and also has the capability of being a TauZaman server.
 
Method Summary
static TauZamanService getActiveService()
          Returns a handle to active TauZamanService object of this TauZamanSystem.
protected  CalendricSystemRepository getCalendricSystemRepository()
          Returns a handle to CalendricSystemRepository object, which provides all Calendar related services of this system.
protected  FVSupportRepository getFVSupportRepository()
          Returns a handle to FVSupportRepository object, which provides all FVSupport related services of this system.
 TauZamanLocalService getLocalService(java.lang.String calendricSystemName, java.net.URL calendricSystemUrl, java.net.URL defaultPropertyListUrl)
          Returns a local TauZamanService object, with a default CalendricSystem and a default Properties, ready to serve.
protected  PropertyRepository getPropertyRepository()
          Returns a handle to PropertyRepository object, which provides all Property related services of this system.
 TauZamanRemoteService getRemoteService(java.lang.String host, java.lang.String port, java.lang.String serviceName, java.lang.String calendricSystemName, java.net.URL calendricSystemUrl, java.net.URL defaultPropertyListUrl)
          Returns a remote TauZamanService object, with a default CalendricSystem and a default Property table, ready to serve.
 TauZamanRemoteService getRemoteService(java.lang.String calendricSystemName, java.net.URL calendricSystemUrl, java.net.URL defaultPropertyListUrl)
          Returns a remote TauZamanService object, with a default CalendricSystem and a default Property table, ready to serve.
 void setActiveService(TauZamanLocalService tzls)
          Sets a TauZamanLocalService object as the active TauZamanService of this TauZamanSystem.
 void setActiveService(TauZamanRemoteService tzrs)
          Sets a TauZamanRemoteService object as the active TauZamanService of this TauZamanSystem.
 void setActiveService(TauZamanService tzs)
          Sets a TauZamanService object as the active TauZamanService of this TauZamanSystem.
 boolean setRemoteService(boolean log)
          Sets this TauZamanService as a server, which provides Calendar related services, by using Java RMI, to various TauZaman clients.
 boolean setRemoteService(java.lang.String port, java.lang.String serviceName, boolean log)
          Sets this TauZamanService as a server, which provides Calendar related services, by using Java RMI, to various TauZaman clients.
 boolean unsetRemoteService()
          Unsets this TauZamanService as a server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tzRemoteServiceHandler

private TauZamanRemoteServiceHandler tzRemoteServiceHandler
TauZamanRemoteServiceHandler object, which handles remote services of this TauZamanSystem when it is set as server


csr

private CalendricSystemRepository csr
A handle to unique CalendricSystemRepository of this TauZamanSystem


pr

private PropertyRepository pr
A handle to unique PropertyRepository of this TauZamanSystem


fvsr

private FVSupportRepository fvsr
A handle to unique FVSupportRepository of this TauZamanSystem


cr

private CalendarRepository cr
A handle to unique CalendarRepository of this TauZamanSystem


activeService

private static TauZamanService activeService
Active TauZamanService of this TauZamanSystem


serverRegistryName

private java.lang.String serverRegistryName
Name that is used for RMI registry name binding

Constructor Detail

TauZamanSystem

public TauZamanSystem()
Constructs a TauZamanSystem object, which provides local or remote TauZamanServices, and also has the capability of being a TauZaman server.

See Also:
CalendricSystemRepository, CalendarRepository, FVSupportRepository, PropertyRepository, TauZamanService
Method Detail

getLocalService

public TauZamanLocalService getLocalService(java.lang.String calendricSystemName,
                                            java.net.URL calendricSystemUrl,
                                            java.net.URL defaultPropertyListUrl)
                                     throws TauZamanException
Returns a local TauZamanService object, with a default CalendricSystem and a default Properties, ready to serve. Additionally, this TauZamanService will be set as active TauZamanService in this system. And also loaded default CalendricSystem will be set as active CalendricSystem in this TauZamanService service.

Parameters:
calendricSystemName - String name, given by user, which loaded default CalendricSystem will be referred as
calendricSystemUrl - default CalendricSystem for this TauZamanService
Returns:
a TauZamanLocalService ready to serve
Throws:
TauZamanException - if any abnormal condition occurs when getting a local service

getRemoteService

public TauZamanRemoteService getRemoteService(java.lang.String host,
                                              java.lang.String port,
                                              java.lang.String serviceName,
                                              java.lang.String calendricSystemName,
                                              java.net.URL calendricSystemUrl,
                                              java.net.URL defaultPropertyListUrl)
                                       throws TauZamanException
Returns a remote TauZamanService object, with a default CalendricSystem and a default Property table, ready to serve. Additionally, this TauZamanService will be set as active TauZamanService in this system. And also loaded default CalendricSystem will be set as active CalendricSystem in this TauZamanService service.

Parameters:
host - url of remote TauZaman system
port - port of remote TauZaman system
serviceName - String name under which remote TauZaman system serves
calendricSystemName - String name, given by user, which loaded default CalendricSystem will be referred as
calendricSystemUrl - default CalendricSystem for this TauZamanService
Returns:
a TauZamanRemoteService ready to serve
Throws:
TauZamanException - if any abnormal condition occurs when getting requested remote service

getRemoteService

public TauZamanRemoteService getRemoteService(java.lang.String calendricSystemName,
                                              java.net.URL calendricSystemUrl,
                                              java.net.URL defaultPropertyListUrl)
                                       throws TauZamanException
Returns a remote TauZamanService object, with a default CalendricSystem and a default Property table, ready to serve. Additionally, this TauZamanService will be set as active TauZamanService in this system. And also loaded default CalendricSystem will be set as active CalendricSystem in this TauZamanService service.

Parameters:
calendricSystemName - String name, given by user, which loaded default CalendricSystem will be referred as
calendricSystemUrl - default CalendricSystem for this TauZamanService
Returns:
a TauZamanRemoteService ready to serve
Throws:
TauZamanException - if any abnormal condition occurs when getting requested remote service

setRemoteService

public boolean setRemoteService(java.lang.String port,
                                java.lang.String serviceName,
                                boolean log)
                         throws TauZamanException
Sets this TauZamanService as a server, which provides Calendar related services, by using Java RMI, to various TauZaman clients.

Parameters:
port - port of host registry that this server will make use of for publishing remote service
serviceName - String name of remote service that clients can use for their connection
log - a boolean value, which determines if this server will keep logs of remote calls. If it is true, server keeps log, o.w. server will not keep log
Returns:
true if remote service is set successfully, and returns false if and only if this TauZamanSystem is already set as a server
Throws:
TauZamanException - if any abnormal condition occurs when setting this TauZamanSystem as a server. A frequent exception might be using a service name, which is already in use. A possible solution is to use package-like names for services, such as; myTauZaman.myRemoteService

setRemoteService

public boolean setRemoteService(boolean log)
                         throws TauZamanException
Sets this TauZamanService as a server, which provides Calendar related services, by using Java RMI, to various TauZaman clients.

Parameters:
log - a boolean value, which determines if this server will keep logs of remote calls. If it is true, server keeps log, o.w. server will not keep log
Returns:
true if remote service is set successfully, and returns false if and only if this TauZamanSystem is already set as a server
Throws:
TauZamanException - if any abnormal condition occurs when setting this TauZamanSystem as a server.A frequent exception might be using a service name, which is already in use

unsetRemoteService

public boolean unsetRemoteService()
                           throws TauZamanException
Unsets this TauZamanService as a server.

Returns:
true when this TauZamanService successfully unset. Returns false if and only if this TauZamanService was never set as a server.
Throws:
TauZamanException - if any abnormal condition occurs when unsetting this TauZamanSystem as a server.

setActiveService

public void setActiveService(TauZamanLocalService tzls)
                      throws TauZamanException
Sets a TauZamanLocalService object as the active TauZamanService of this TauZamanSystem.

Parameters:
tzls - TauZamanLocalService object to be set active
Throws:
TauZamanException - if this service was not set to a valid TauZamanLocalService
See Also:
TauZamanLocalService

setActiveService

public void setActiveService(TauZamanService tzs)
Sets a TauZamanService object as the active TauZamanService of this TauZamanSystem.

Parameters:
tzs - TauZamanService object to be set active
See Also:
TauZamanService

setActiveService

public void setActiveService(TauZamanRemoteService tzrs)
                      throws TauZamanException
Sets a TauZamanRemoteService object as the active TauZamanService of this TauZamanSystem.

Parameters:
tzrs - TauZamanRemoteService object to be set active
Throws:
TauZamanException - if this service was not set to a valid TauZamanRemoteService
See Also:
TauZamanRemoteService

getActiveService

public static TauZamanService getActiveService()
Returns a handle to active TauZamanService object of this TauZamanSystem.

Returns:
a handle to active TauZamanService
See Also:
TauZamanService

getCalendricSystemRepository

protected CalendricSystemRepository getCalendricSystemRepository()
Returns a handle to CalendricSystemRepository object, which provides all Calendar related services of this system.

Returns:
a handle to CalendricSystemRepository object
See Also:
CalendricSystemRepository

getPropertyRepository

protected PropertyRepository getPropertyRepository()
Returns a handle to PropertyRepository object, which provides all Property related services of this system.

Returns:
a handle to PropertyRepository object
See Also:
PropertyRepository

getFVSupportRepository

protected FVSupportRepository getFVSupportRepository()
Returns a handle to FVSupportRepository object, which provides all FVSupport related services of this system.

Returns:
a handle to FVSupportRepository object
See Also:
FVSupport

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project