|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--tauzaman.TauZamanRemoteServiceImpl
TauZamanRemoteServiceImpl
class implements TauZamanRemoteService
remote interface and provides remote Calendar
related services.
It is instantiated via TauZamanSystem
.
// assume americanCalendricSystemUrl and defaultPropertyListUrl are alread declared and initialized TauZamanSystem tzs = new TauZamanSystem(); // this gets a default remote service if there is a local server. See TauZamanSystem class for detailed remote service // acquisition. TauZamanRemoteService tzrs = tzs.getTauZamanRemoteService("american", americanCalendricSystemUrl, defaultPropertyListUrl);
TauZamanSystem
,
Serialized FormField Summary | |
private TauZamanLocalService |
tzls
TauZamanRemoteService "has a" TauZamanLocalService |
Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
Fields inherited from class java.rmi.server.RemoteServer |
|
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
protected |
TauZamanRemoteServiceImpl(TauZamanSystem parentSystem,
java.lang.String calendricSystemName,
java.net.URL calendricSystemUrl,
java.net.URL defaultPropertyListUrl)
Constructs a TauZamanRemoteService object ready to serve. |
Method Summary | |
void |
dummy()
Test method for calculating RTT independent of any operation, but depending on Java RMI. |
Granularity |
getActiveCalendricSystemDefaultGranularity()
Returns default Granularity of active CalendricSystem . |
java.lang.String |
getActiveCalendricSystemName()
Returns name of active CalendricSystem of this service. |
java.lang.String |
getPropertyStackImage(java.lang.String propertyName)
Gets all the current Property information of a specific
Property name in a String. |
java.lang.String |
getPropertyStackImage(java.lang.String calendricSystemName,
java.lang.String propertyName)
Gets all the current Property information of a specific
Property name in a String. |
boolean |
isValidCalendricSystemName(java.lang.String calendricSystemName)
Returns true if given CalendricSystem name is actually mapped
to a loaded CalendricSystem object. |
void |
loadCalendricSystem(java.lang.String calendricSystemName,
java.net.URL calendricSystemUrl,
java.net.URL defaultPropertyListUrl)
Loads the CalendricSystem , whose specification file and default
Property list URLs are given. |
Granule[] |
parseInput(java.lang.String inputStr,
java.lang.String propertyName)
Returns an array of Granule objects formed by using input temporal constant and
given Property name. |
java.lang.String |
parseOutput(Granule[] granules,
java.lang.String propertyName,
java.lang.String cachedCalendricSystemName)
Converts a timestamp (in terms of Granule (s)) into temporal
constant as string. |
void |
propertyActivate(java.lang.String calendricSystemName,
java.net.URL propertyUrl,
java.lang.String[] focusPropertyNames)
Activates a Property from given URL of Property specification file.
|
void |
propertyActivate(java.net.URL propertyUrl,
java.lang.String[] focusPropertyNames)
Activates a Property from given Property specification file URL.
|
void |
propertyDeactivate(java.lang.String propertyName)
Deactivates a Property whose has the given name.
|
void |
propertyDeactivate(java.lang.String calendricSystemName,
java.lang.String propertyName)
Deactivates and removes any active Properties . |
void |
propertyDeactivateAll()
Deactivates and removes any active Properties . |
void |
propertyDeactivateAll(java.lang.String calendricSystemName)
Deactivates and removes any active Properties . |
void |
propertySetDefault(java.lang.String propertyName)
Sets Property (given by its name) to its default value. |
void |
propertySetDefault(java.lang.String calendricSystemName,
java.lang.String propertyName)
Sets Property (given by its name) to its default value. |
void |
propertySetDefaultAll()
Sets all active Properties to their default values.
|
void |
propertySetDefaultAll(java.lang.String calendricSystemName)
Sets all active Properties to their default values.
|
void |
setActiveCalendricSystem(java.lang.String calendricSystemName)
Sets given CalendricSystem name as active CalendricSystem of
this service. |
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 |
private TauZamanLocalService tzls
TauZamanRemoteService
"has a" TauZamanLocalService
Constructor Detail |
protected TauZamanRemoteServiceImpl(TauZamanSystem parentSystem, java.lang.String calendricSystemName, java.net.URL calendricSystemUrl, java.net.URL defaultPropertyListUrl) throws java.rmi.RemoteException, CalendricSystemFormationException, PropertyFormationException
TauZamanRemoteService
object ready to serve.
parentSystem
- parent TauZamanSystem
of this TauZamanLocalService
calendricSystemName
- String name of defaultly loaded CalendricSystem
calendricSystemUrl
- URL of defaultly loaded CalendricSystem
defaultPropertyListUrl
- URL of defaultly loaded Property
list
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
CalendricSystemFormationException
- if any abnormal condition occurs when
loading default CalendricSystem
PropertyFormationException
- if any abnormal condition occurs when
loading default Property
listMethod Detail |
public void dummy() throws java.rmi.RemoteException
dummy
in interface TauZamanRemoteService
java.rmi.RemoteException
public void loadCalendricSystem(java.lang.String calendricSystemName, java.net.URL calendricSystemUrl, java.net.URL defaultPropertyListUrl) throws java.rmi.RemoteException, CalendricSystemFormationException, PropertyFormationException
CalendricSystem
, whose specification file and default
Property
list URLs are given.
loadCalendricSystem
in interface TauZamanRemoteService
calendricSystemName
- String name of loaded CalendricSystem
calendricSystemUrl
- URL of loaded CalendricSystem
defaultPropertyListUrl
- URL of loaded Property
list
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
CalendricSystemFormationException
- if any abnormal condition occurs when
loading CalendricSystem
PropertyFormationException
- if any abnormal condition occurs when
loading Property
listpublic void setActiveCalendricSystem(java.lang.String calendricSystemName) throws java.rmi.RemoteException, CalendricSystemServiceException
CalendricSystem
name as active CalendricSystem
of
this service.
setActiveCalendricSystem
in interface TauZamanRemoteService
calendricSystemName
- String name of CalendricSystem
to be activated
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
CalendricSystemServiceException
- if any abnormal condition occurs when setting active
CalendricSystem
. Specifically it is thrown when provided a CalendricSystem
name, which is not already loaded.public java.lang.String getActiveCalendricSystemName() throws java.rmi.RemoteException
CalendricSystem
of this service.
getActiveCalendricSystemName
in interface TauZamanRemoteService
CalendricSystem
of this service
java.rmi.RemoteException
- if an abnormal condition occurs during remote connectionpublic Granularity getActiveCalendricSystemDefaultGranularity() throws java.rmi.RemoteException
Granularity
of active CalendricSystem
.
getActiveCalendricSystemDefaultGranularity
in interface TauZamanRemoteService
Granularity
java.rmi.RemoteException
- if any abnormal condition occurs during remote connectionpublic boolean isValidCalendricSystemName(java.lang.String calendricSystemName) throws java.rmi.RemoteException
CalendricSystem
name is actually mapped
to a loaded CalendricSystem
object. False otherwise.
isValidCalendricSystemName
in interface TauZamanRemoteService
calendricSystemName
- String name of CalendricSystem
that validity is checked.
CalendricSystem
name is actually mapped
to a loaded CalendricSystem
object. False otherwise.
java.rmi.RemoteException
- if an abnormal condition occurs during remote connectionpublic Granule[] parseInput(java.lang.String inputStr, java.lang.String propertyName) throws java.rmi.RemoteException, IOException
Granule
objects formed by using input temporal constant and
given Property
name.
parseInput
in interface TauZamanRemoteService
propertyName
- name of the Property
to be used when parsing input
Granule
objects
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
IOException
- if any error occurs while parsing an input
temporal constantpublic java.lang.String parseOutput(Granule[] granules, java.lang.String propertyName, java.lang.String cachedCalendricSystemName) throws java.rmi.RemoteException, IOException
Granule
(s)) into temporal
constant as string. Format of the output string, given Property
's
format template is used.
parseOutput
in interface TauZamanRemoteService
granules
- Calendar
parsed timestamppropertyName
- name of the Property
, which is used to
format of the output string, temporal constantcachedCalendricSystemName
- String name of the CalendricSystem
,
which was used during the formation of this timestamp
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
IOException
- if any error occurs
while converting a timestamp into a temporal constantpublic void propertyActivate(java.net.URL propertyUrl, java.lang.String[] focusPropertyNames) throws java.rmi.RemoteException, PropertyFormationException
Property
from given Property specification file URL.
This method updates PropertyManager
of active CalendricSystem
.
propertyActivate
in interface TauZamanRemoteService
focusPropertyNames
- names of Properties
that are wanted to be activated
residing in given file
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyFormationException
- if any problem occurs when activating the Property
or if maximum number of allowable Property
ies exceeded (not implemented yet).public void propertyDeactivateAll() throws java.rmi.RemoteException
Properties
. It will not deactivate
or remove any default Property
, so any attempt will only succeed to
deactivate and remove only non-default active Properties
.
This method updates PropertyManager
of active CalendricSystem
.
propertyDeactivateAll
in interface TauZamanRemoteService
java.rmi.RemoteException
- if an abnormal condition occurs during remote connectionpublic void propertyDeactivate(java.lang.String propertyName) throws java.rmi.RemoteException, PropertyServiceException
Property
whose has the given name.
This method updates PropertyManager
of active CalendricSystem
if calendricSystemName is null. Else it'll try to update CalendricSystem
,
which corresponds to calendricSystemName.
propertyDeactivate
in interface TauZamanRemoteService
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyServiceException
- if the name is an invalid Property
namepublic void propertySetDefaultAll() throws java.rmi.RemoteException
Properties
to their default values.
This method updates PropertyManager
of active CalendricSystem
.
propertySetDefaultAll
in interface TauZamanRemoteService
java.rmi.RemoteException
- if an abnormal condition occurs during remote connectionpublic void propertySetDefault(java.lang.String propertyName) throws java.rmi.RemoteException, PropertyServiceException
Property
(given by its name) to its default value. If the
Property
already has its default value active, then keep silent.
This method updates PropertyManager
of active CalendricSystem
.
propertySetDefault
in interface TauZamanRemoteService
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyServiceException
- if the name is an invalid Property
namepublic java.lang.String getPropertyStackImage(java.lang.String propertyName) throws java.rmi.RemoteException, PropertyServiceException
Property
information of a specific
Property name in a String. Format of the return string is;
{urlOfProperty}%{urOfProperty}%....%{urlOfProperty}
order is same as of Property stack from bottom to top.
getPropertyStackImage
in interface TauZamanRemoteService
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyServiceException
- if any abnormal condition occurs when
getting the image of Property
stack given its namepublic void propertyActivate(java.lang.String calendricSystemName, java.net.URL propertyUrl, java.lang.String[] focusPropertyNames) throws java.rmi.RemoteException, PropertyFormationException, CalendricSystemServiceException
Property
from given URL of Property specification file.
This method updates PropertyManager
of CalendricSystem
,
given its name.
propertyActivate
in interface TauZamanRemoteService
calendricSystemName
- String name, which should point to a URL of CalendricSystem
focusPropertyNames
- names of Properties
that are wanted to be activated
residing in given file
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyFormationException
- if any problem occurs when activating the Property
or if maximum number of allowable Property
ies exceeded (not implemented yet)
CalendricSystemServiceException
- if given CalendricSystem
calendricSystemName
is invalidpublic void propertyDeactivateAll(java.lang.String calendricSystemName) throws java.rmi.RemoteException, CalendricSystemServiceException
Properties
. It will not deactivate
or remove any default Property
, so any attempt will only succeed to
deactivate and remove only non-default active Properties
.
This method updates PropertyManager
of active CalendricSystem
.
propertyDeactivateAll
in interface TauZamanRemoteService
calendricSystemName
- String name, which should point to a URL of CalendricSystem
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
CalendricSystemServiceException
- if given CalendricSystem
calendricSystemName
is invalidpublic void propertyDeactivate(java.lang.String calendricSystemName, java.lang.String propertyName) throws java.rmi.RemoteException, PropertyServiceException, CalendricSystemServiceException
Properties
. It will not deactivate
or remove any default Property
, so any attempt will only succeed to
deactivate and remove only non-default active Properties
.
This method updates PropertyManager
of CalendricSystem
,
given its name.
propertyDeactivate
in interface TauZamanRemoteService
calendricSystemName
- String name, which should point to a URL of CalendricSystem
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyServiceException
- if given name is not a valid Property
name
CalendricSystemServiceException
- if given CalendricSystem
calendricSystemName
is invalidpublic void propertySetDefaultAll(java.lang.String calendricSystemName) throws java.rmi.RemoteException, CalendricSystemServiceException
Properties
to their default values.
This method updates PropertyManager
of CalendricSystem
,
given its name.
propertySetDefaultAll
in interface TauZamanRemoteService
calendricSystemName
- String name, which should point to a URL of CalendricSystem
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
CalendricSystemServiceException
- if given CalendricSystem
calendricSystemName
is invalidpublic void propertySetDefault(java.lang.String calendricSystemName, java.lang.String propertyName) throws java.rmi.RemoteException, PropertyServiceException, CalendricSystemServiceException
Property
(given by its name) to its default value. If the
Property
already has its default value active, then keep silent.
This method updates PropertyManager
of CalendricSystem
,
given its name.
propertySetDefault
in interface TauZamanRemoteService
calendricSystemName
- String name, which should point to a URL of CalendricSystem
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyServiceException
- if given name is not a valid Property
name
CalendricSystemServiceException
- if given CalendricSystem
calendricSystemName
is invalidpublic java.lang.String getPropertyStackImage(java.lang.String calendricSystemName, java.lang.String propertyName) throws java.rmi.RemoteException, PropertyServiceException, CalendricSystemServiceException
Property
information of a specific
Property name in a String. Format of the return string is;
{urlOfProperty}%{urOfProperty}%....%{urlOfProperty}
order is same as of Property stack from bottom to top.
getPropertyStackImage
in interface TauZamanRemoteService
calendricSystemName
- String name, which should point to a URL of CalendricSystem
java.rmi.RemoteException
- if an abnormal condition occurs during remote connection
PropertyServiceException
- if given name is not a valid Property
name
CalendricSystemServiceException
- if given CalendricSystem
calendricSystemName
is invalid
|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |