com.ace.moab.api.credential
Class Credential

java.lang.Object
  extended by com.ace.moab.api.credential.Credential

public class Credential
extends java.lang.Object

This class represents a Moab Credential.

Author:
Trent Weber

Constructor Summary
Credential()
          Creates a credential with no identifying information.
Credential(CredentialType type, java.lang.String id)
          Creates a credential with a specified type and id.
 
Method Summary
 java.util.Vector<java.lang.String> getAccountList()
          Get the list of accounts that have access to this credential, may be null
 java.lang.String getClassDefault()
          Get the default class.
 java.util.Vector<java.lang.String> getClassList()
          Get the list of classes with access to this credential.
 java.lang.String getComment()
          Associates a comment string with the target credential.
 double getCredits()
          Returns the number of credits given to this credential.
 double getDedicatedResourceCost()
          Gets the dedicated resource cost for the credential.
 java.lang.String getDefaultAccount()
          Get the default account.
 java.lang.String getDefaultGroup()
          Get the default group.
 java.lang.String getDefaultQoS()
          Get the default QoS for the credential.
 java.lang.String getDefaultUser()
          Get the default user.
 java.lang.Long getDefaultWallClock()
          Get the default wall clock limit per job.
 java.lang.String getEmailAddress()
          Specifies the target email address for the user.
 double getFairShareTarget()
          Returns the target percentage or absolute usage value target wanted in association with the credential.
 com.moab.api.fairshare.FairshareType getFairshareType()
          Returns the type of fairshare to use in association with the credential.
 java.util.Vector<java.lang.String> getGroupList()
          Get the list of groups that have access to this credential.
 java.lang.String getID()
          Get the ID for the credential.
 java.lang.Long getIdleMaxWallClock()
           
 double getLienCredits()
          Returns the number of credits that have a lien on them.
 java.lang.Long getMaxWallClock()
          Returns the maximum wallclock limit this credential is allowed per job.
 java.lang.Long getMinWallClock()
          Get the minimum wallclock limit represented in seconds.
 java.lang.String getPartition()
          Get the partition for the credential.
 java.lang.String getPartitionDefault()
          Get the default partition for the credential.
 java.lang.Long getPriority()
          Get the priority of the credential.
 QOSCredentialInformation getQOSInformation()
          Get all attributes directly related to QOS credentials for this credential.
 java.util.Vector<java.lang.String> getQosList()
          Get the list of QOS levels that are associated with this credential.
 java.lang.String getReservation()
          Get the reservation associated with this credential.
 ResourceUsage getResourceUsage()
          Get the current resource usage of this credential.
 java.lang.String getRmList()
          Get the list of resource managers.
 CredentialType getType()
          Return the type of the credential (could be USER, QOS, CLASS, etc).
 double getUsedCredits()
          Returns the number of credits used by this credential.
 java.util.Vector<java.lang.String> getUserList()
          Get the list of Users that are associated with this credential.
 double getUtilizedResourceCost()
          Get the value for the utilized resource cost.
static boolean hasChanged(java.lang.String credentialValue, java.lang.String textField)
           
 boolean hasThresholds()
          Returns true if the credential is a QoS and if the QoS has at least one threshold value set.
 boolean isProfilingEnabled()
          If true, statistical profiling is kept track for this credential.
 void setAccountList(java.util.Vector<java.lang.String> accountList)
          Set the list of accounts that are associated with this credential.
 void setClassDefault(java.lang.String defaultClass)
          Set the default class value.
 void setClassList(java.util.Vector<java.lang.String> classList)
          Set the list of classes that have access to the object associated with this credential.
 void setComment(java.lang.String comments)
          Set the value of the comment for this credential.
 void setCredits(double credits)
          Sets the number of credits for this credential.
 void setDedicatedResourceCost(double dedicatedResourceCost)
          Set the dedicated resource cost for this credential.
 void setDefaultAccount(java.lang.String defaultAccount)
          Set the default account for the credential.
 void setDefaultGroup(java.lang.String defaultGroup)
          The default group used by the credential.
 void setDefaultQoS(java.lang.String defaultQoS)
          Set the default QoS used by this credential.
 void setDefaultUser(java.lang.String defaultUser)
          The default user associated with the credential.
 void setDefaultValues(Credential credential)
          Sets Default Values for this credential.
 void setDefaultWallClock(java.lang.Long defaultWallClock)
          Set the default wall clock value that will be assigned to a submitted job if the user does not specify the wall clock time.
 void setEmailAddress(java.lang.String emailAddress)
          Set the email address.
 void setEnableProfiling(boolean enableProfiling)
          Specify whether profiling should be enabled or not.
 void setFairShareTarget(double fairshareTarget)
          Set the target fairshare amount for this credential.
 void setFairshareType(com.moab.api.fairshare.FairshareType fairsharetype)
          Set the fairshare type associated with the fairshare target value.
 void setGroupList(java.util.Vector<java.lang.String> groupList)
          Set the group list associated with the credential.
 void setID(java.lang.String id)
          Set the credential ID value.
 void setIdleMaxWallClock(java.lang.Long idleMaxWallClock)
          Set the idle maximum wall clock time.
 void setLienCredits(double lienCredits)
          Sets the number of credits associated with this credential that have a lien on them.
 void setMaxWallClock(java.lang.Long maxWallClock)
          Sets the maximum wallclock time this credential is allowed per job.
 void setMinWallClock(java.lang.Long minWallClock)
          Set the minimum wall clock value that a user is allowed to specify.
 void setPartition(java.lang.String partition)
          Set the partition.
 void setPartitionDefault(java.lang.String defaultPartition)
          Set the default partition used by this credential
 void setPriority(java.lang.Long priority)
          Set the priority value
 void setQOSInformation(QOSCredentialInformation info)
           
 void setQosList(java.util.Vector<java.lang.String> qosList)
          Set the list of QoSes used by this credential.
 void setReservation(java.lang.String reservation)
          Set the name of the reservation associated with this credential.
 void setResourceUsage(ResourceUsage resourceUsage)
          Set the resource usage object for the credential.
 void setRmList(java.lang.String rmList)
          Set the resource manager list.
 void setType(CredentialType credentialType)
           
 void setUsedCredits(double usedCredits)
          Sets the number of credits used by this credential.
 void setUserList(java.util.Vector<java.lang.String> userList)
          Set the list of users that have access to this credential
 void setUtilizedResourceCost(double utilizedResourceCost)
          Set the utilized resource cost value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Credential

public Credential()
Creates a credential with no identifying information.


Credential

public Credential(CredentialType type,
                  java.lang.String id)
Creates a credential with a specified type and id.

Parameters:
type - the type of credential.
id - the id or name of the credential.
Method Detail

getAccountList

public java.util.Vector<java.lang.String> getAccountList()
Get the list of accounts that have access to this credential, may be null

Returns:
the list of accounts that have access to this credential, may be null

getClassDefault

public java.lang.String getClassDefault()
Get the default class. Can be null.

Returns:
the default class

getClassList

public java.util.Vector<java.lang.String> getClassList()
Get the list of classes with access to this credential. Can be null.

Returns:
the list of classes with access to this credential

getComment

public java.lang.String getComment()
Associates a comment string with the target credential.

Can be null.

Returns:
the comments attached to this credential

getCredits

public double getCredits()
Returns the number of credits given to this credential.

Returns:
the number of credits given to this credential.

getDedicatedResourceCost

public double getDedicatedResourceCost()
Gets the dedicated resource cost for the credential. This is a sum of all the costs associated with the resources dedicated to this credential.

Returns:
the dedicated resource cost for the credential

getDefaultAccount

public java.lang.String getDefaultAccount()
Get the default account. Can be null.

Returns:
the default account

getDefaultGroup

public java.lang.String getDefaultGroup()
Get the default group. Can be null.

Returns:
the default group

getDefaultUser

public java.lang.String getDefaultUser()
Get the default user. Can be null.

Returns:
the default user

getDefaultWallClock

public java.lang.Long getDefaultWallClock()
Get the default wall clock limit per job.

Returns:
the default wall clock value

getEmailAddress

public java.lang.String getEmailAddress()
Specifies the target email address for the user. This only applies to credentials of type user.

Can be null.

Returns:
the email address

getFairShareTarget

public double getFairShareTarget()
Returns the target percentage or absolute usage value target wanted in association with the credential.

Returns:
the target percentage or absolute usage value target wanted in association with the credential.

getFairshareType

public com.moab.api.fairshare.FairshareType getFairshareType()
Returns the type of fairshare to use in association with the credential.

Returns:
the type of fairshare to use in association with the credential.

getGroupList

public java.util.Vector<java.lang.String> getGroupList()
Get the list of groups that have access to this credential.

Returns:
the list of groups that can access this credential

getID

public java.lang.String getID()
Get the ID for the credential.

Can be null.

Returns:
the credential id

getIdleMaxWallClock

public java.lang.Long getIdleMaxWallClock()
Returns:
idle max wallclock limit

getMaxWallClock

public java.lang.Long getMaxWallClock()
Returns the maximum wallclock limit this credential is allowed per job. Submitting a job whose wallclock limit exceeds this value will cause the job to be rejected. If this value is null than the user does not have a maximum wallclock limitation

Returns:
the maximum wallclock limit

getMinWallClock

public java.lang.Long getMinWallClock()
Get the minimum wallclock limit represented in seconds.

Returns:
the minimum wallclock limit

getPartition

public java.lang.String getPartition()
Get the partition for the credential.

Can be null.

Returns:
the partition

getPartitionDefault

public java.lang.String getPartitionDefault()
Get the default partition for the credential.

Can be null.

Returns:
the default partition

getPriority

public java.lang.Long getPriority()
Get the priority of the credential.

Returns:
the prionity value

getDefaultQoS

public java.lang.String getDefaultQoS()
Get the default QoS for the credential.

Can be null.

Returns:
the default QoS

getQOSInformation

public QOSCredentialInformation getQOSInformation()
Get all attributes directly related to QOS credentials for this credential. This should only be used when the credential is of type QOS.

Returns:
the QOS Information associated with this credential.
Throws:
InvalidCredentialException - if this object is not of type QOS

getQosList

public java.util.Vector<java.lang.String> getQosList()
Get the list of QOS levels that are associated with this credential. Example: a user can have access to QOS groups "administrator", "mathematics", and "debug".

Can be null.

Returns:
a vector of the list of QOS groups the credential belongs to

getReservation

public java.lang.String getReservation()
Get the reservation associated with this credential.

Can be null.

Returns:
the reservation associated with this credential

getResourceUsage

public ResourceUsage getResourceUsage()
Get the current resource usage of this credential. The returned object contains hard limits, soft limits, as well as utilized resources.

Returns:
the resourceUsage

getRmList

public java.lang.String getRmList()
Get the list of resource managers.

Can be null.

Returns:
the list of resource managers

getType

public CredentialType getType()
Return the type of the credential (could be USER, QOS, CLASS, etc).

Returns:
the type of the credential

getUsedCredits

public double getUsedCredits()
Returns the number of credits used by this credential.

Returns:
the number of credits used by this credential.

getUserList

public java.util.Vector<java.lang.String> getUserList()
Get the list of Users that are associated with this credential. Example: a class can have a user list like "administrator", "john", and "sam".

Can be null.

Returns:
a vector of the list of users, may be null

getUtilizedResourceCost

public double getUtilizedResourceCost()
Get the value for the utilized resource cost.

Returns:
the utilized resource cost

hasThresholds

public boolean hasThresholds()
Returns true if the credential is a QoS and if the QoS has at least one threshold value set.

Returns:
true if the credential is a QoS and if the QoS has at least one threshold value set.

isProfilingEnabled

public boolean isProfilingEnabled()
If true, statistical profiling is kept track for this credential.

Returns:
true if statistical profiling is kept track for this credential.

setAccountList

public void setAccountList(java.util.Vector<java.lang.String> accountList)
Set the list of accounts that are associated with this credential.

Can be null.

Parameters:
accountList - the list of accounts

setClassDefault

public void setClassDefault(java.lang.String defaultClass)
Set the default class value.

Can be null.

Parameters:
defaultClass - the default class value

setClassList

public void setClassList(java.util.Vector<java.lang.String> classList)
Set the list of classes that have access to the object associated with this credential.

Can be null.

Parameters:
classList - the list of classes

setComment

public void setComment(java.lang.String comments)
Set the value of the comment for this credential.

Can be null.

Parameters:
comments - the comment to be set

setCredits

public void setCredits(double credits)
Sets the number of credits for this credential.

Parameters:
credits - the number of credits for this credential.

setDedicatedResourceCost

public void setDedicatedResourceCost(double dedicatedResourceCost)
Set the dedicated resource cost for this credential. This is a sum of all the costs associated with the resources dedicated to this credential.

Parameters:
dedicatedResourceCost - the dedicated resource cost for this credential

setDefaultAccount

public void setDefaultAccount(java.lang.String defaultAccount)
Set the default account for the credential.

Can be null.

Parameters:
defaultAccount - the default account

setDefaultGroup

public void setDefaultGroup(java.lang.String defaultGroup)
The default group used by the credential.

Can be null.

Parameters:
defaultGroup -

setDefaultUser

public void setDefaultUser(java.lang.String defaultUser)
The default user associated with the credential.

Can be null.

Parameters:
defaultUser -

setDefaultValues

public void setDefaultValues(Credential credential)
                      throws InvalidMoabArgumentException
Sets Default Values for this credential. For every attribute not explicitly set, this method sets the attributes to equal that of the other Credential object. This is useful in Moab where a user can specify default values but can explicitly set other attributes that override the defaults. This method checks each attribute to see if it has already been set, and if not sets the attribute to equal that of the other Credential.

Parameters:
credential - The object that contains all resource information that will be used in the defaults of the original object
Throws:
InvalidMoabArgumentException

setDefaultWallClock

public void setDefaultWallClock(java.lang.Long defaultWallClock)
Set the default wall clock value that will be assigned to a submitted job if the user does not specify the wall clock time.

Parameters:
defaultWallClock - the default wall clock value

setEmailAddress

public void setEmailAddress(java.lang.String emailAddress)
Set the email address.

Can be null.

Parameters:
emailAddress -

setEnableProfiling

public void setEnableProfiling(boolean enableProfiling)
Specify whether profiling should be enabled or not.

Parameters:
enableProfiling - true to enable profiling, and false to disable it

setFairShareTarget

public void setFairShareTarget(double fairshareTarget)
Set the target fairshare amount for this credential. These targets allow fairshare information to affect job priority

Parameters:
fairshareTarget - the target fairshare amount for this credential.

setFairshareType

public void setFairshareType(com.moab.api.fairshare.FairshareType fairsharetype)
Set the fairshare type associated with the fairshare target value. Can return null.

Parameters:
fairsharetype - the fairshare type associated with the fairshare target value.

setGroupList

public void setGroupList(java.util.Vector<java.lang.String> groupList)
Set the group list associated with the credential.

Can be null.

Parameters:
groupList - the list of groups

setID

public void setID(java.lang.String id)
Set the credential ID value.

Can be null.

Parameters:
id - the id of this credential

setIdleMaxWallClock

public void setIdleMaxWallClock(java.lang.Long idleMaxWallClock)
Set the idle maximum wall clock time.

Parameters:
idleMaxWallClock -

setMaxWallClock

public void setMaxWallClock(java.lang.Long maxWallClock)
Sets the maximum wallclock time this credential is allowed per job. Passing in null indicates that there is no maximum wallclock limit.

Parameters:
maxWallClock - the maximum wall clock value

setMinWallClock

public void setMinWallClock(java.lang.Long minWallClock)
Set the minimum wall clock value that a user is allowed to specify. Any jobs submitted with a wall clock value must have a value at least this large.

Parameters:
minWallClock - the minimum wall clock value

setPartition

public void setPartition(java.lang.String partition)
Set the partition.

Can be null.

Parameters:
partition -

setPartitionDefault

public void setPartitionDefault(java.lang.String defaultPartition)
Set the default partition used by this credential

Parameters:
defaultPartition - the default partition

setPriority

public void setPriority(java.lang.Long priority)
Set the priority value

Parameters:
priority -

setDefaultQoS

public void setDefaultQoS(java.lang.String defaultQoS)
Set the default QoS used by this credential.

Can be null.

Parameters:
defaultQoS -

setQOSInformation

public void setQOSInformation(QOSCredentialInformation info)
                       throws InvalidCredentialException
Parameters:
info - the qOSInformation to set
Throws:
InvalidCredentialException

setQosList

public void setQosList(java.util.Vector<java.lang.String> qosList)
Set the list of QoSes used by this credential.

Can be null.

Parameters:
qosList - the list of QoS values

setReservation

public void setReservation(java.lang.String reservation)
Set the name of the reservation associated with this credential.

Can be null.

Parameters:
reservation - the reservation name

setResourceUsage

public void setResourceUsage(ResourceUsage resourceUsage)
                      throws java.lang.IllegalArgumentException
Set the resource usage object for the credential.

Can not be null.

Parameters:
resourceUsage - the resourceUsage to set
Throws:
java.lang.IllegalArgumentException

setRmList

public void setRmList(java.lang.String rmList)
Set the resource manager list.

Can be null.

Parameters:
rmList - the list of resource managers

setType

public void setType(CredentialType credentialType)
Parameters:
credentialType -

setUsedCredits

public void setUsedCredits(double usedCredits)
Sets the number of credits used by this credential.

Parameters:
usedCredits - the number of credits used by this credential.

setUserList

public void setUserList(java.util.Vector<java.lang.String> userList)
Set the list of users that have access to this credential

Can be null.

Parameters:
userList - the list of users with access to the credential

setUtilizedResourceCost

public void setUtilizedResourceCost(double utilizedResourceCost)
Set the utilized resource cost value.

Can be null.

Parameters:
utilizedResourceCost -

hasChanged

public static boolean hasChanged(java.lang.String credentialValue,
                                 java.lang.String textField)

getLienCredits

public double getLienCredits()
Returns the number of credits that have a lien on them. This is done when the credits are reserved, but are waiting to be charged or released pending some action.

Returns:
the number of credits that have a lien on them.
Since:
Moab 5.3

setLienCredits

public void setLienCredits(double lienCredits)
Sets the number of credits associated with this credential that have a lien on them.

Parameters:
lienCredits - the number of credits associated with this credential that have a lien on them.
Since:
Moab 5.3

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.