Package Ganga :: Package GPIDev :: Package Credentials :: Module ICredential :: Class ICredential
[hide private]
[frames] | no frames]

Class ICredential

source code

          object --+        
                   |        
   Base.Objects.Node --+    
                       |    
Base.Objects.GangaObject --+
                           |
                          ICredential

Interface class for working with credentials

Nested Classes [hide private]

Inherited from Base.Objects.GangaObject: __metaclass__

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
create(self, validity="", maxTry=0, minValidity="", check=False)
Create credential.
source code
 
destroy(self, allowed_exit=[0])
Destroy credential
source code
 
isAvailable(self)
Check whether credential is available with system/configuration used
source code
 
isValid(self, validity="", log=False, force_check=False)
Check validity
source code
 
location(self)
Determine credential location
source code
 
renew(self, validity="", maxTry=0, minValidity="", check=True)
Renew credential.
source code
 
timeInSeconds(self, timeString="")
Convert time string to time in seconds
source code
 
timeleft(self, units="hh:mm:ss", force_check=False)
Check time for which credential is valid.
source code
 
timeleftInHMS(self, force_check=False)
Determine remaining validity of credential in hours, minutes and seconds
source code

Inherited from Base.Objects.GangaObject: __construct__, __deepcopy__, __getstate__, __setstate__, _attribute_filter__set__, _auto__init__, accept, getJobObject

Inherited from Base.Objects.Node: __copy__, __eq__, __ne__, clone, copyFrom, printSummaryTree, printTree

Inherited from Base.Objects.Node (private): _getParent, _getRoot, _setParent

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from Base.Objects.GangaObject (private): _declared_property

Class Variables [hide private]
  _schema = Schema(Version(1, 0), {"maxTry": SimpleItem(defvalue...
  _category = "credentials"
  _name = "ICredential"
  _hidden = 1
  _exportmethods = ["create", "destroy", "isAvailable", "isValid...

Inherited from Base.Objects.GangaObject (private): _proxyClass, _registry

Inherited from Base.Objects.Node (private): _index_cache, _parent

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

create(self, validity="", maxTry=0, minValidity="", check=False)

source code 

Create credential.

Arguments other than self:
   validity    - Validity with which credential should be created,
                 specified as string of format "hh:mm"
                 [ Defaults to value of self.validityAtCreation ]
   maxTry      - Number of password attempts allowed
                 [ Defaults to value of self.maxTry ]
   minValidity - Minimum validity in case checking of
                 pre-existing credential is performed,
                 specified as strong of format "hh:mm"
                 [ Defaults to value of self.minValidity ]
   check       - Flag to request checking of pre-existing
                 credential; if flag is set to true, then new
                 credential is created only if the validity of
                 any pre-existing credential is less than the
                 value of minValidity
                 [ Default: False ] 

Note: create is the same as renew, except for the default value of check

Return value: True if credential is created successfully, and False
otherwise.

destroy(self, allowed_exit=[0])

source code 

Destroy credential

Argument other than self:
   allowed_exit - List of exit codes accepted without error
                  when issuing system command for destroying credential

Return value: False if command for destroying credential is undefined,
              or True otherwise

isAvailable(self)

source code 

Check whether credential is available with system/configuration used

No arguments other than self

Return value: True if credential is available, false otherwise

isValid(self, validity="", log=False, force_check=False)

source code 

Check validity

Arguments other than self:
   validity    - Minimum time for which credential should be valid,
                 specified as string of format "hh:mm"
                 [ Defaults to valud of self.minValidity ]

   log         - Print logger messages if credential not valid 

   force_check - Force credential check, rather than relying on cache

Return value: True if credential is valid for required time, False
otherwise.

location(self)

source code 

Determine credential location

No arguments other than self

Return value: Path to credential if found, or empty string otherwise

renew(self, validity="", maxTry=0, minValidity="", check=True)

source code 

Renew credential.

Arguments other than self:
   validity    - Validity with which credential should be created,
                 specified as string of format "hh:mm"
                 [ Defaults to value of self.validityAtCreation ]
   maxTry      - Number of password attempts allowed
                 [ Defaults to value of self.maxTry ]
   minValidity - Minimum validity in case checking of
                 pre-existing credential is performed,
                 specified as strong of format "hh:mm"
                 [ Defaults to value of self.minValidity ]
   check       - Flag to request checking of pre-existing
                 credential; if flag is set to true, then new
                 credential is created only if the validity of
                 any pre-existing credential is less than the
                 value of minValidity
                 [ Default: True ] 

Note: renew is the same as create, except for the default value of check

Return value: True if new credential is created successfully, and False
otherwise.

timeInSeconds(self, timeString="")

source code 

Convert time string to time in seconds

Arguments other than self:
   timeString - Time specified as string of format "hh:mm:ss"

Return value: Time in seconds (integer)

timeleft(self, units="hh:mm:ss", force_check=False)

source code 

Check time for which credential is valid.

Arguments other than self:
   units       - String specifying units in which time is returned

   force_check - Force credential check, rather than relying on cache

Allowed values for units are:
   "hours"              - time returned as in hours
   "minutes"            - time returned in minutes
   "seconds"            - time returned in seconds
   "hh:mm:ss" [default] - time returned as hours, minutes seconds


Return value: Credential validity as string giving time in requested
   units, or empty string if command for querying credential validity
   is unavailable

timeleftInHMS(self, force_check=False)

source code 

Determine remaining validity of credential in hours, minutes and seconds

Argument other than self:
   force_check - Force credential check, rather than relying on cache

Return value: String giving credential validity, or empty string
   if command for querying credential validity is unavailable


Class Variable Details [hide private]

_schema

Value:
Schema(Version(1, 0), {"maxTry": SimpleItem(defvalue= 1, doc= "Number \
of password attempts allowed when creating credential"), "minValidity"\
: SimpleItem(defvalue= "00:15", doc= "Default minimum validity"), "val\
idityAtCreation": SimpleItem(defvalue= "24:00", doc= "Default credenti\
al validity at creation"), "command": ComponentItem(category= "credent\
ial_commands", defvalue= "ICommandSet", doc= "Set of commands to be us\
ed for credential-related operations")})

_exportmethods

Value:
["create", "destroy", "isAvailable", "isValid", "location", "renew", "\
timeleft"]