public class CreateChannelCommand
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
access |
protected java.lang.String |
archLabel |
static int |
CHANNEL_LABEL_MIN_LENGTH |
protected static java.lang.String |
CHANNEL_LABEL_REGEX |
static int |
CHANNEL_NAME_MAX_LENGTH |
static int |
CHANNEL_NAME_MIN_LENGTH |
protected static java.lang.String |
CHANNEL_NAME_REGEX |
protected java.lang.String |
checksum |
protected java.lang.String |
description |
protected boolean |
globallySubscribable |
protected static java.lang.String |
GPG_FP_REGEX |
protected static java.lang.String |
GPG_KEY_REGEX |
protected static java.lang.String |
GPG_URL_REGEX |
protected java.lang.String |
gpgKeyFp |
protected java.lang.String |
gpgKeyId |
protected java.lang.String |
gpgKeyUrl |
protected java.lang.String |
label |
protected java.lang.String |
maintainerEmail |
protected java.lang.String |
maintainerName |
protected java.lang.String |
maintainerPhone |
protected java.lang.String |
name |
protected java.lang.Long |
parentId |
protected java.lang.String |
parentLabel |
protected static java.lang.String |
REDHAT_REGEX |
protected java.lang.String |
summary |
protected java.lang.String |
supportPolicy |
protected User |
user |
protected static java.lang.String |
WEB_CHANNEL_CREATED |
Constructor and Description |
---|
CreateChannelCommand()
default constructor.
|
Modifier and Type | Method and Description |
---|---|
Channel |
create()
Creates the Channel based on the parameters that were set.
|
void |
setAccess(java.lang.String acc) |
void |
setArchLabel(java.lang.String archLabelIn) |
void |
setChecksumLabel(java.lang.String checksumLabelIn) |
void |
setDescription(java.lang.String desc) |
void |
setGloballySubscribable(boolean globallySubscribableIn) |
void |
setGpgKeyFp(java.lang.String fp) |
void |
setGpgKeyId(java.lang.String id) |
void |
setGpgKeyUrl(java.lang.String url) |
void |
setLabel(java.lang.String labelIn) |
void |
setMaintainerEmail(java.lang.String email) |
void |
setMaintainerName(java.lang.String mname) |
void |
setMaintainerPhone(java.lang.String phone) |
void |
setName(java.lang.String nameIn) |
protected void |
setParentChannel(Channel affected,
User usr,
java.lang.String lbl,
java.lang.Long pid)
sets the parent channel of the given affected channel if pLabel or pid
is given.
|
void |
setParentId(java.lang.Long pid) |
void |
setParentLabel(java.lang.String parentLabelIn) |
void |
setSummary(java.lang.String summaryIn) |
void |
setSupportPolicy(java.lang.String policy) |
void |
setUser(User userIn) |
protected void |
validateChannel(ChannelArch ca,
ChecksumType ct) |
protected void |
verifyChannelLabel(java.lang.String clabel) |
protected void |
verifyChannelName(java.lang.String cname) |
protected void |
verifyGpgInformation() |
protected void |
verifyRequiredParameters()
Verifies that the required parameters are not null.
|
public static final int CHANNEL_NAME_MIN_LENGTH
public static final int CHANNEL_NAME_MAX_LENGTH
public static final int CHANNEL_LABEL_MIN_LENGTH
protected static final java.lang.String CHANNEL_NAME_REGEX
protected static final java.lang.String CHANNEL_LABEL_REGEX
protected static final java.lang.String REDHAT_REGEX
protected static final java.lang.String GPG_KEY_REGEX
protected static final java.lang.String GPG_URL_REGEX
protected static final java.lang.String GPG_FP_REGEX
protected static final java.lang.String WEB_CHANNEL_CREATED
protected User user
protected java.lang.String label
protected java.lang.String name
protected java.lang.String summary
protected java.lang.String description
protected java.lang.String archLabel
protected java.lang.String parentLabel
protected java.lang.Long parentId
protected java.lang.String gpgKeyUrl
protected java.lang.String gpgKeyId
protected java.lang.String gpgKeyFp
protected java.lang.String checksum
protected java.lang.String maintainerName
protected java.lang.String maintainerEmail
protected java.lang.String maintainerPhone
protected java.lang.String supportPolicy
protected java.lang.String access
protected boolean globallySubscribable
public void setArchLabel(java.lang.String archLabelIn)
archLabelIn
- The archLabel to set.public void setLabel(java.lang.String labelIn)
labelIn
- The label to set.public void setName(java.lang.String nameIn)
nameIn
- The name to set.public void setChecksumLabel(java.lang.String checksumLabelIn)
checksumLabelIn
- The name to set.public void setParentLabel(java.lang.String parentLabelIn)
parentLabelIn
- The parentLabel to set.public void setParentId(java.lang.Long pid)
pid
- The parent id to set.public void setGpgKeyFp(java.lang.String fp)
fp
- gpgkey fingerprintpublic void setGpgKeyId(java.lang.String id)
id
- gpgkey idpublic void setGpgKeyUrl(java.lang.String url)
url
- gpgkey urlpublic void setMaintainerEmail(java.lang.String email)
email
- maintainer's email addresspublic void setMaintainerName(java.lang.String mname)
mname
- maintainers namepublic void setMaintainerPhone(java.lang.String phone)
phone
- maintainer's phone number (string)public void setSupportPolicy(java.lang.String policy)
policy
- support policypublic void setSummary(java.lang.String summaryIn)
summaryIn
- The summary to set.public void setDescription(java.lang.String desc)
desc
- The description.public void setUser(User userIn)
userIn
- The user to set.public void setAccess(java.lang.String acc)
acc
- public, protected, or privatepublic void setGloballySubscribable(boolean globallySubscribableIn)
globallySubscribableIn
- if the channel should be globally subscribableprotected void validateChannel(ChannelArch ca, ChecksumType ct)
public Channel create() throws InvalidChannelLabelException, InvalidChannelNameException, InvalidParentChannelException
InvalidChannelLabelException
- thrown if label is in use or invalid.InvalidChannelNameException
- throw if name is in use or invalid.java.lang.IllegalArgumentException
- thrown if label, name or user are null.InvalidParentChannelException
- thrown if parent label is not a
valid base channel.protected void setParentChannel(Channel affected, User usr, java.lang.String lbl, java.lang.Long pid)
affected
- The Channel to receive a new parent, if one is found.usr
- The usrlbl
- The parent Channel label, can be null.pid
- The parent Channel id, can be null.protected void verifyRequiredParameters()
java.lang.IllegalArgumentException
- thrown if label, name, user or summary
are null.protected void verifyChannelName(java.lang.String cname) throws InvalidChannelNameException
InvalidChannelNameException
protected void verifyChannelLabel(java.lang.String clabel) throws InvalidChannelLabelException
InvalidChannelLabelException
protected void verifyGpgInformation()