Package com.redwood.scheduler.api.model
Interface Credential
-
- All Superinterfaces:
BusinessKeyObject
,PartitionableRootObject
,Root
,SchedulerEntity
,SchedulerEntityComp
public interface Credential extends PartitionableRootObject, BusinessKeyObject
A Credential for a given protocol, endpoint and user to enable access to an external system.
-
-
Field Summary
Fields Modifier and Type Field Description static String
OBJECT_TYPE
String that will be returned fromSchedulerEntity.getObjectType()
for "Credential" objects.static String
SEC_PRIV_CREATE
This privilege can be granted at a group level.static String
SEC_PRIV_DELETE
This privilege can be granted at a group level.static String
SEC_PRIV_EDIT
This privilege can be granted at a group level.static String
SEC_PRIV_VIEW
This privilege can be granted at a group level.static String
SEC_RANK_ALL
This rank is made of the following privileges: view , create , edit , deletestatic String
SEC_RANK_CREATE
This rank is made of the following privileges: createstatic String
SEC_RANK_DELETE
This rank is made of the following privileges: create , view , deletestatic String
SEC_RANK_EDIT
This rank is made of the following privileges: create , view , editstatic String
SEC_RANK_NONE
This rank has no privileges assigned to it.static String
SEC_RANK_VIEW
This rank is made of the following privileges: viewstatic QueryObjectType<Credential>
TYPE
Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...)
.static com.redwood.scheduler.infrastructure.logging.Versions
VERSION_CREDENTIAL
-
Fields inherited from interface com.redwood.scheduler.api.model.BusinessKeyObject
COPYRIGHT_MESSAGE_BKO, ID_BKO
-
Fields inherited from interface com.redwood.scheduler.api.model.PartitionableRootObject
VERSION_PARTITIONABLEROOTOBJECT
-
Fields inherited from interface com.redwood.scheduler.api.model.Root
VERSION_ROOT
-
Fields inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
ACTION_AUDIT, ACTION_EXPORT, ACTION_READ, BEHAVIOR_DEPRECATED, BEHAVIOR_NONE, BEHAVIOR_SYSTEM, VERSION_SCHEDULERENTITY
-
Fields inherited from interface com.redwood.scheduler.api.model.compatibility_14.SchedulerEntityComp
VERSION_SCHEDULERENTITYCOMP
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RequiredPermission
checkCreatePrivilege()
Check whether or not the create action can be performed on this object.RequiredPermission
checkDeletePrivilege()
Check whether or not the delete action can be performed on this object.RequiredPermission
checkEditPrivilege()
Check whether or not the edit action can be performed on this object.RequiredPermission
checkViewPrivilege()
Check whether or not the view action can be performed on this object.String
getComment()
Get the value for Comment.CredentialProtocol
getCredentialProtocol()
Get the CredentialProtocol.String
getDescription()
Get the value for Description.String
getEndpoint()
Get the value for Endpoint.String
getName()
Get the value for Name.String
getPassword()
Get the value for Password.String
getProtectedPassword()
Get a version of the password that can be decrypted using theSchedulerSession.unprotectPassword(String)
method.String
getRealUser()
Get the value for RealUser.String
getVirtualUser()
Get the value for VirtualUser.boolean
isExternallyAvailable()
Get the value for ExternallyAvailable.void
setComment(String newComment)
Set the value for Comment.void
setCredentialProtocol(CredentialProtocol newCredentialProtocol)
Set the value for CredentialProtocol.void
setDescription(String newDescription)
Set the value for Description.void
setEndpoint(String newEndpoint)
Set the value for Endpoint.void
setExternallyAvailable(boolean newExternallyAvailable)
Set the value for ExternallyAvailable.void
setName(String newName)
Set the value for Name.void
setPassword(String newPassword)
Set the value for Password.void
setRealUser(String newRealUser)
Set the value for RealUser.void
setVirtualUser(String newVirtualUser)
Set the value for VirtualUser.-
Methods inherited from interface com.redwood.scheduler.api.model.BusinessKeyObject
getBusinessKey
-
Methods inherited from interface com.redwood.scheduler.api.model.PartitionableRootObject
getPartition, setPartition
-
Methods inherited from interface com.redwood.scheduler.api.model.Root
getCreationTime, getLastModificationTime, getLastModifierSubject
-
Methods inherited from interface com.redwood.scheduler.api.model.SchedulerEntity
canPerform, createSubjectObjectPrivilegeGrant, deleteObject, getAuditTrail, getAuditTrailSize, getBehavior, getEffectiveBehavior, getErrorNameEN, getErrorNameKey, getLLPVersion, getLOV, getLOVSupport, getObjectType, getParentSchedulerEntities, getRuntime, getSubjectObjectPrivilegeGrantBySubject, getSubjectObjectPrivilegeGrants, getUniqueId, getUrl, getUrl, isCreated, isDeletable, isDeleted, isModifiable, isModified, isSelectVersioned, processRelatedObjects, processRelatedObjects, processRelatedObjects, refreshObject, resetObject, resetObject, resetValuesToDefault, selectForRead
-
-
-
-
Field Detail
-
VERSION_CREDENTIAL
static final com.redwood.scheduler.infrastructure.logging.Versions VERSION_CREDENTIAL
-
OBJECT_TYPE
static final String OBJECT_TYPE
String that will be returned fromSchedulerEntity.getObjectType()
for "Credential" objects.- See Also:
- Constant Field Values
-
TYPE
static final QueryObjectType<Credential> TYPE
Type that can be used inSchedulerSession.executeObjectQuery(QueryObjectType, String, Object...)
.
-
SEC_PRIV_VIEW
static final String SEC_PRIV_VIEW
This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
-
SEC_PRIV_CREATE
static final String SEC_PRIV_CREATE
This privilege can be granted at a group level.- See Also:
- Constant Field Values
-
SEC_PRIV_EDIT
static final String SEC_PRIV_EDIT
This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
-
SEC_PRIV_DELETE
static final String SEC_PRIV_DELETE
This privilege can be granted at a group level. This privilege can be granted at an instance level.- See Also:
- Constant Field Values
-
SEC_RANK_NONE
static final String SEC_RANK_NONE
This rank has no privileges assigned to it.- See Also:
- Constant Field Values
-
SEC_RANK_CREATE
static final String SEC_RANK_CREATE
This rank is made of the following privileges: create- See Also:
- Constant Field Values
-
SEC_RANK_VIEW
static final String SEC_RANK_VIEW
This rank is made of the following privileges: view- See Also:
- Constant Field Values
-
SEC_RANK_EDIT
static final String SEC_RANK_EDIT
This rank is made of the following privileges: create , view , edit- See Also:
- Constant Field Values
-
SEC_RANK_DELETE
static final String SEC_RANK_DELETE
This rank is made of the following privileges: create , view , delete- See Also:
- Constant Field Values
-
SEC_RANK_ALL
static final String SEC_RANK_ALL
This rank is made of the following privileges: view , create , edit , delete- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
String getName()
Get the value for Name. (Returns the concatenation of RealUser-EndPoint-CredentialProtocol.Name) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getComment
String getComment()
Get the value for Comment. (Optional comment)- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getDescription
String getDescription()
Get the value for Description. (Optional description)- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getEndpoint
String getEndpoint()
Get the value for Endpoint. (Endpoint is the target for the connection.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getRealUser
String getRealUser()
Get the value for RealUser. (The real user name.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getVirtualUser
String getVirtualUser()
Get the value for VirtualUser. (The virtual user name.)- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getPassword
String getPassword()
Get the value for Password. (The password for a connection. Encrypted when stored.) This value is mandatory, and therefore will not benull
if this object has been retrieved from the database.- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
isExternallyAvailable
boolean isExternallyAvailable()
Get the value for ExternallyAvailable. ( Whether this credential can be requested using API calls. If this flag is not set or false the credentials are only available to internal mechanisms such as 'RunAs' fields. If this flag is true the credentials can be used by customer code that can request the (encrypted) privileged information, through a combination of thegetProtectedPassword()
andSchedulerSession.unprotectPassword(String)
methods. )- Returns:
- the field
- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setName
void setName(String newName)
Set the value for Name. (Returns the concatenation of RealUser-EndPoint-CredentialProtocol.Name) This value is mandatory.- Parameters:
newName
- the new value for Name. If this isnull
, then the object cannot be persisted.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setComment
void setComment(String newComment)
Set the value for Comment. (Optional comment) This value is optional.- Parameters:
newComment
- the new value for Comment.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setDescription
void setDescription(String newDescription)
Set the value for Description. (Optional description) This value is optional.- Parameters:
newDescription
- the new value for Description.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setEndpoint
void setEndpoint(String newEndpoint)
Set the value for Endpoint. (Endpoint is the target for the connection.) This value is mandatory.- Parameters:
newEndpoint
- the new value for Endpoint. If this isnull
, then the object cannot be persisted.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setRealUser
void setRealUser(String newRealUser)
Set the value for RealUser. (The real user name.) This value is mandatory.- Parameters:
newRealUser
- the new value for RealUser. If this isnull
, then the object cannot be persisted.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setVirtualUser
void setVirtualUser(String newVirtualUser)
Set the value for VirtualUser. (The virtual user name.) This value is optional.- Parameters:
newVirtualUser
- the new value for VirtualUser.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setPassword
void setPassword(String newPassword)
Set the value for Password. (The password for a connection. Encrypted when stored.) This value is mandatory.- Parameters:
newPassword
- the new value for Password. If this isnull
, then the object cannot be persisted.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
setExternallyAvailable
void setExternallyAvailable(boolean newExternallyAvailable)
Set the value for ExternallyAvailable. ( Whether this credential can be requested using API calls. If this flag is not set or false the credentials are only available to internal mechanisms such as 'RunAs' fields. If this flag is true the credentials can be used by customer code that can request the (encrypted) privileged information, through a combination of thegetProtectedPassword()
andSchedulerSession.unprotectPassword(String)
methods. )- Parameters:
newExternallyAvailable
- the new value for ExternallyAvailable.- Throws:
ObjectNotAttachedToSessionException
- This will be thrown if this method is called while the object is not attached to a session.
-
getProtectedPassword
String getProtectedPassword() throws CredentialNotExternallyAvailableException, CredentialEncodingException
Get a version of the password that can be decrypted using theSchedulerSession.unprotectPassword(String)
method. This returns an encrypted version of the password that is valid for this server only. It can be passed toSchedulerSession.unprotectPassword(String)
only. It can be called only on those credentials that have theExternallyAvailable
flag set.- Returns:
- The protected (encrypted) version of the password
- Throws:
CredentialNotExternallyAvailableException
-Credential.getProtectedPassword()
may only called for credentials with theExternallyAvailable
flag set.CredentialEncodingException
- Failed to encode/decode the credentials.
-
getCredentialProtocol
CredentialProtocol getCredentialProtocol()
Get the CredentialProtocol.- Returns:
- CredentialProtocol
- Throws:
ObjectDeletedException
- If this method is called when the object has been marked for deletion.ObjectNotAttachedToSessionException
- If this method is called when the object has been removed from it's session.
-
setCredentialProtocol
void setCredentialProtocol(CredentialProtocol newCredentialProtocol)
Set the value for CredentialProtocol. This value is mandatory.- Parameters:
newCredentialProtocol
- is the object to set CredentialProtocol to. What protocol is used for the credential? If this isnull
, then the object cannot be persisted.
-
checkViewPrivilege
RequiredPermission checkViewPrivilege()
Check whether or not the view action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
checkCreatePrivilege
RequiredPermission checkCreatePrivilege()
Check whether or not the create action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
checkEditPrivilege
RequiredPermission checkEditPrivilege()
Check whether or not the edit action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
checkDeletePrivilege
RequiredPermission checkDeletePrivilege()
Check whether or not the delete action can be performed on this object.- Returns:
- a
RequiredPermission
instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
-
-