Ganga :: GPIDev :: Credentials :: AfsToken :: AfsToken :: Class AfsToken
[hide private]
[frames] | no frames]

Class AfsToken

source code

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

Class for working with AFS token

Nested Classes [hide private]

Inherited from Base.Objects.GangaObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, middleware="")
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
buildOpts(self, command, clear=True) 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)
Dummy method - returns empty string
source code
 
renew(self, validity="", maxTry=0, minValidity="", check=True)
Renew credential.
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 ICredential.ICredential: timeInSeconds

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 = ICredential._schema.inherit_copy()
  _name = "AfsToken"
  _hidden = 1
  _enable_config = 1

Inherited from ICredential.ICredential (private): _category, _exportmethods

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, middleware="")
(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.

Overrides: ICredential.ICredential.create
(inherited documentation)

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

Overrides: ICredential.ICredential.destroy
(inherited documentation)

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

Overrides: ICredential.ICredential.isAvailable
(inherited documentation)

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.

Overrides: ICredential.ICredential.isValid
(inherited documentation)

location(self)

source code 

Dummy method - returns empty string

Overrides: ICredential.ICredential.location

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.

Overrides: ICredential.ICredential.renew
(inherited documentation)

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

Overrides: ICredential.ICredential.timeleft
(inherited documentation)

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

Overrides: ICredential.ICredential.timeleftInHMS
(inherited documentation)