Package com.sun.identity.cli
Class AuthenticatedCommand
- java.lang.Object
-
- com.sun.identity.cli.CLICommandBase
-
- com.sun.identity.cli.AuthenticatedCommand
-
- All Implemented Interfaces:
CLICommand
- Direct Known Subclasses:
AddAgentsToGroup
,AddAMSDKIdRepoPlugin
,AddAuthConfigurationEntry
,AddCircleOfTrustMembers
,AddResourceBundle
,ApplicationImpl
,ApplicationPrivilegeBase
,ApplicationTypeImpl
,BulkFederation
,BulkOperations
,CreateAgent
,CreateAgentGroup
,CreateAuthConfiguration
,CreateAuthInstance
,CreateCircleOfTrust
,CreateMetaDataTemplate
,CreateRealm
,CreateServerConfigXML
,CreateXACML
,DataStoreBase
,DeleteAgentGroups
,DeleteAgents
,DeleteAuthConfigurations
,DeleteAuthInstances
,DeleteCircleOfTrust
,DeleteMetaData
,DeleteRealm
,DeleteResourceBundle
,DeleteService
,DeleteXACML
,ExportMetaData
,ExportServiceConfiguration
,GetAuthConfigurationEntries
,GetAuthInstance
,GetResourceBundle
,GetSupportedAuthModules
,GetSupportedDataTypes
,IdentityCommand
,ImportBulkFederationData
,ImportMetaData
,ImportServiceConfiguration
,ListAgentGroupMembers
,ListAgentGroups
,ListAgentMembership
,ListAgents
,ListAuthConfigurations
,ListAuthInstances
,ListCircleOfTrustMembers
,ListCircleOfTrusts
,ListDataStoreTypes
,ListEntities
,ListXACML
,LoadSchema
,PolicyExport
,PolicyImport
,RealmAddServiceAttributes
,RealmAssignService
,RealmGetAssignableServices
,RealmGetAssignedServices
,RealmGetAttributeValues
,RealmGetServiceAttributeValues
,RealmModifyService
,RealmRemoveAttribute
,RealmRemoveServiceAttributes
,RealmSetAttributeValues
,RealmSetServiceAttributeValues
,RealmUnassignService
,RemoveAgentProperties
,RemoveAgentsFromGroup
,RemoveCircleOfTrustMembers
,SchemaCommand
,SearchRealms
,ServerConfigBase
,SessionCommand
,SetConfigurations
,ShowAgent
,ShowAgentGroup
,ShowAgentTypes
,ShowConfigurations
,SMSMigration
,StartRecord
,StatusRecord
,StopRecord
,UpdateAgent
,UpdateAgentGroup
,UpdateAuthConfigProperties
,UpdateAuthConfigurationEntries
,UpdateAuthInstance
,UpdateMetadataKeyInfo
,UpdateService
public abstract class AuthenticatedCommand extends CLICommandBase
This is the base class for all commands that require a user to be authenticated in order to execute a command.
-
-
Constructor Summary
Constructors Constructor Description AuthenticatedCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getAdminID()
protected String
getAdminPassword()
protected SSOToken
getAdminSSOToken()
void
handleRequest(RequestContext rc)
Authenticates the administrator.protected void
ldapLogin()
protected Map<String,Set<String>>
processFileAttributes(Map<String,Set<String>> attrs)
Post-process any attributes specified for the module instance (either via data file or on the command line) to resolve any file references.protected void
writeLog(int type, Level level, String msgid, String... msgdata)
-
Methods inherited from class com.sun.identity.cli.CLICommandBase
debugError, debugError, debugMessage, debugWarning, getCommandManager, getOutputWriter, getResourceString, getStringOptionValue, getStringOptionValue, isOptionSet, isVerbose, tokenize
-
-
-
-
Field Detail
-
ssoToken
protected SSOToken ssoToken
-
-
Method Detail
-
handleRequest
public void handleRequest(RequestContext rc) throws CLIException
Authenticates the administrator. Dervived classes needs to call this method from the dervived method,handleRequest(RequestContext rc)
. Override this method to get user name and passowrd.- Specified by:
handleRequest
in interfaceCLICommand
- Overrides:
handleRequest
in classCLICommandBase
- Parameters:
rc
- Request Context.- Throws:
CLIException
- if authentication fails.
-
getAdminPassword
protected String getAdminPassword()
-
getAdminID
protected String getAdminID()
-
getAdminSSOToken
protected SSOToken getAdminSSOToken()
-
ldapLogin
protected void ldapLogin() throws CLIException
- Throws:
CLIException
-
writeLog
protected void writeLog(int type, Level level, String msgid, String... msgdata) throws CLIException
- Overrides:
writeLog
in classCLICommandBase
- Throws:
CLIException
-
processFileAttributes
protected Map<String,Set<String>> processFileAttributes(Map<String,Set<String>> attrs) throws CLIException
Post-process any attributes specified for the module instance (either via data file or on the command line) to resolve any file references. Any attribute can be specified using a -file suffix on the attribute name. This will cause the value to be treated as a file name, and the associated file to be read in (in the platform default encoding) and used as the attribute value. The attribute will be renamed to remove the -file suffix during this process.- Parameters:
attrs
- the raw attributes read from the command line and/or data file.- Returns:
- the processed attributes with all file references resolved.
- Throws:
CLIException
- if a referenced file cannot be read or if an attribute is specified both normally and using a -file reference.
-
-