com.perforce.p4java.impl.generic.admin
Class TriggerEntry

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.MapEntry
      extended by com.perforce.p4java.impl.generic.admin.TriggerEntry
All Implemented Interfaces:
ITriggerEntry, IMapEntry

public class TriggerEntry
extends MapEntry
implements ITriggerEntry

Default ITriggerEntry implementation class.

Note that the order of this trigger entry in the triggers table is part of the trigger entry key when pass to the server for updating the triggers table.

 Triggers0 example1 change-submit //depot/... "echo %changelist%"
 Triggers1 example1 change-submit //depot/abc/... "echo %changelist%"
 Triggers2 example2 form-save client "echo %client%"
 Triggers3 example3 change-submit //depot/... "echo %changelist%"
 Triggers4 example4 change-submit //depot/... "echo %changelist%"
 


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.perforce.p4java.admin.ITriggerEntry
ITriggerEntry.TriggerType
 
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IMapEntry
IMapEntry.EntryType
 
Field Summary
 
Fields inherited from class com.perforce.p4java.impl.generic.core.MapEntry
elementPattern, elementPatternStr, left, order, right, type
 
Fields inherited from interface com.perforce.p4java.core.IMapEntry
EXCLUDE_PREFIX, ORDER_UNKNOWN, OVERLAY_PREFIX
 
Constructor Summary
TriggerEntry()
          Default constructor.
TriggerEntry(int order, String name, ITriggerEntry.TriggerType triggerType, String path, String command)
          Explicit-value constructor.
TriggerEntry(String triggerEntry, int order)
          Constructs a TriggerEntry from the passed-in trigger as a string and its order.
 
Method Summary
 String getCommand()
          Gets the trigger command.
 String getName()
          Gets the trigger name.
 String getPath()
          For change and submit triggers, a file pattern to match files in the changelist.
 ITriggerEntry.TriggerType getTriggerType()
          Gets the trigger type.
 void setCommand(String command)
          Sets the trigger command.
 void setName(String name)
          Sets the trigger name.
 void setPath(String path)
          For change and submit triggers, a file pattern to match files in the changelist.
 void setTriggerType(ITriggerEntry.TriggerType triggerType)
          Sets the trigger type.
 String toString()
          An alias for this.toString(" ", true).
 
Methods inherited from class com.perforce.p4java.impl.generic.core.MapEntry
getLeft, getLeft, getOrder, getRight, getRight, getType, parseViewMappingString, quoteWhitespaceString, setLeft, setOrder, setRight, setType, stripTypePrefix, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.perforce.p4java.core.IMapEntry
getLeft, getLeft, getOrder, getRight, getRight, getType, setLeft, setOrder, setRight, setType, toString
 

Constructor Detail

TriggerEntry

public TriggerEntry()
Default constructor.


TriggerEntry

public TriggerEntry(int order,
                    String name,
                    ITriggerEntry.TriggerType triggerType,
                    String path,
                    String command)
Explicit-value constructor.


TriggerEntry

public TriggerEntry(String triggerEntry,
                    int order)
Constructs a TriggerEntry from the passed-in trigger as a string and its order.

Method Detail

getName

public String getName()
Description copied from interface: ITriggerEntry
Gets the trigger name.

Specified by:
getName in interface ITriggerEntry
Returns:
the trigger name
See Also:
ITriggerEntry.getName()

setName

public void setName(String name)
Description copied from interface: ITriggerEntry
Sets the trigger name.

Specified by:
setName in interface ITriggerEntry
Parameters:
name - the trigger name
See Also:
ITriggerEntry.setName(java.lang.String)

getTriggerType

public ITriggerEntry.TriggerType getTriggerType()
Description copied from interface: ITriggerEntry
Gets the trigger type.

Specified by:
getTriggerType in interface ITriggerEntry
Returns:
the trigger type
See Also:
ITriggerEntry.getTriggerType()

setTriggerType

public void setTriggerType(ITriggerEntry.TriggerType triggerType)
Description copied from interface: ITriggerEntry
Sets the trigger type.

Specified by:
setTriggerType in interface ITriggerEntry
Parameters:
triggerType - the trigger type
See Also:
ITriggerEntry.setTriggerType(com.perforce.p4java.admin.ITriggerEntry.TriggerType)

getPath

public String getPath()
Description copied from interface: ITriggerEntry
For change and submit triggers, a file pattern to match files in the changelist. This file pattern can be an exclusion mapping (-pattern), to exclude files. For form triggers, the name of the form (branch, client, etc). For fix triggers 'fix' is required as the path value. For authentication triggers, 'auth' is required as the path value. For archive triggers, a file pattern to match the name of the file being accessed in the archive. Note that, due to lazy copying when branching files, the name of the file in the archive can not be the same as the name of the file in the depot. For command triggers, use the name of the command to match, e.g. 'pre-user-$cmd' or a regular expression, e.g. '(pre|post)-user-add'. *

Specified by:
getPath in interface ITriggerEntry
Returns:
the depot file path pattern or form type
See Also:
ITriggerEntry.getPath()

setPath

public void setPath(String path)
Description copied from interface: ITriggerEntry
For change and submit triggers, a file pattern to match files in the changelist. This file pattern can be an exclusion mapping (-pattern), to exclude files. For form triggers, the name of the form (branch, client, etc). For fix triggers 'fix' is required as the path value. For authentication triggers, 'auth' is required as the path value. For archive triggers, a file pattern to match the name of the file being accessed in the archive. Note that, due to lazy copying when branching files, the name of the file in the archive can not be the same as the name of the file in the depot. For command triggers, use the name of the command to match, e.g. 'pre-user-$cmd' or a regular expression, e.g. '(pre|post)-user-add'. *

Specified by:
setPath in interface ITriggerEntry
Parameters:
path - the depot file path pattern or form type
See Also:
ITriggerEntry.setPath(java.lang.String)

getCommand

public String getCommand()
Description copied from interface: ITriggerEntry
Gets the trigger command. If the command contains spaces, enclose it in double quotes.

Specified by:
getCommand in interface ITriggerEntry
Returns:
the trigger comamnd
See Also:
ITriggerEntry.getCommand()

setCommand

public void setCommand(String command)
Description copied from interface: ITriggerEntry
Sets the trigger command. If the command contains spaces, enclose it in double quotes.

Specified by:
setCommand in interface ITriggerEntry
See Also:
ITriggerEntry.setCommand(java.lang.String)

toString

public String toString()
Description copied from class: MapEntry
An alias for this.toString(" ", true).

Specified by:
toString in interface IMapEntry
Overrides:
toString in class MapEntry
See Also:
Object.toString()


Copyright © 2015 Perforce Software. All Rights Reserved.