Cisco Systems, Inc.

com.pcube.apps.engage.policy
Class ProtocolRedirectIndexNameArray

java.lang.Object
  extended by com.pcube.apps.engage.policy.ProtocolRedirectIndexNameArray
All Implemented Interfaces:
Formattable, java.io.Serializable, java.lang.Cloneable

public class ProtocolRedirectIndexNameArray
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, Formattable

An array containing the logical name for the index of the redirectable Protocols' redirect strings.

See Also:
Serialized Form

Method Summary
 int add(java.lang.String name)
          Adds a new index name.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          add a vetoable change listener: veto redirect set deletion
 java.lang.Object clone()
           
 boolean contains(java.lang.String name)
          Check is a certain name is assigned to an index.
 void fromStream(java.io.BufferedReader in, Formatter f)
          Method fromStream
 int getIndex(java.lang.String redirectIndexName)
          Gets the index number the name is assigned to.
 java.lang.String[] getRedirectIndexNames()
          Gets the names of the indeices in this ProtocolRedirectIndexNameArray.
 int getSize()
          Gets the number of index names defined in the array.
 java.beans.VetoableChangeSupport getVetoableRemoveNotification()
           
 int remove(java.lang.String name)
          Removes the assignment of a certain name to an index.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          remove a votable change listener: veto notification deletion
 void set(java.lang.String name, int index)
          Sets an index name.
 void toStream(java.io.PrintStream out, Formatter f)
          Method toStream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
add a vetoable change listener: veto redirect set deletion

Parameters:
listener -

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
remove a votable change listener: veto notification deletion

Parameters:
listener -

getVetoableRemoveNotification

public java.beans.VetoableChangeSupport getVetoableRemoveNotification()

add

public int add(java.lang.String name)
        throws DuplicateItemException,
               ItemNotFoundException,
               java.lang.IllegalArgumentException
Adds a new index name.

Parameters:
name - the new index name
Returns:
the index the name is assigned to
Throws:
DuplicateItemException - if such a name is pre-assigned
ItemNotFoundException - if there are no indices free
java.lang.IllegalArgumentException - if the name is an empty String

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
See Also:
Object.clone()

contains

public boolean contains(java.lang.String name)
Check is a certain name is assigned to an index.

Parameters:
name - the queried name
Returns:
true if assigned, false otherwise

fromStream

public void fromStream(java.io.BufferedReader in,
                       Formatter f)
                throws ImportExportException
Description copied from interface: Formattable
Method fromStream

Specified by:
fromStream in interface Formattable
Throws:
ImportExportException
See Also:
Formattable.fromStream(java.io.BufferedReader, com.pcube.apps.engage.common.Formatter)

getIndex

public int getIndex(java.lang.String redirectIndexName)
Gets the index number the name is assigned to. If the name is not defined -1 is returned.

Parameters:
redirectIndexName - the queried index name
Returns:
the corresponding index , or -1 if such a definition was not created

getRedirectIndexNames

public java.lang.String[] getRedirectIndexNames()
Gets the names of the indeices in this ProtocolRedirectIndexNameArray. The returned String array is MAX_REDIRECT_STRING_ARRAY long.

Returns:
- a MAX_REDIRECT_STRING_ARRAY long string array. The name of the index x appears at the position x in the array. If the index x is not in use, the String array at index x will have null.

getSize

public int getSize()
Gets the number of index names defined in the array.

Returns:
the number of index names defined in the array

remove

public int remove(java.lang.String name)
           throws ItemNotFoundException,
                  java.lang.IllegalArgumentException
Removes the assignment of a certain name to an index.

Parameters:
name - the name assigned to a certain index
Returns:
the freed index that the name was assigned to
Throws:
ItemNotFoundException - if the name is not assigned to any index
java.lang.IllegalArgumentException - if the name is assigned to an index used by a certain ServiceElement

set

public void set(java.lang.String name,
                int index)
         throws DuplicateItemException,
                ItemNotFoundException,
                java.lang.IllegalArgumentException
Sets an index name.

Parameters:
name - the new index name
index - the desired index
Throws:
DuplicateItemException - if such a name is pre-assigned
ItemNotFoundException - if there is no such index (index out of bound)
java.lang.IllegalArgumentException - if the name is an empty String

toStream

public void toStream(java.io.PrintStream out,
                     Formatter f)
Description copied from interface: Formattable
Method toStream

Specified by:
toStream in interface Formattable
See Also:
Formattable.toStream(java.io.PrintStream, com.pcube.apps.engage.common.Formatter)

Cisco Systems, Inc.

Copyright © 2013 Cisco Systems, Inc. Confidential.