View Javadoc

1   
2   package edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector;
3   
4   import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.RDBMSDataConnector.DATA_TYPES;
5   
6   /**
7    * Describes how to express a given result set column as an attribute and value.
8    */
9   public class RDBMSColumnDescriptor {
10  
11      /** Name of the database column. */
12      private String columnName;
13  
14      /** Name of the attribute to map the column to. */
15      private String attributeName;
16  
17      /** Java data type to express the database value as. */
18      private DATA_TYPES dataType;
19  
20      /**
21       * Constructor.
22       * 
23       * @param column name of the database column
24       * @param attribute name of the attribute to map the column to
25       * @param type Java data type to express the database value as
26       */
27      public RDBMSColumnDescriptor(String column, String attribute, DATA_TYPES type) {
28          columnName = column;
29          attributeName = attribute;
30          dataType = type;
31      }
32  
33      /**
34       * Gets the name of the database column.
35       * 
36       * @return name of the database column
37       */
38      public String getColumnName() {
39          return columnName;
40      }
41  
42      /**
43       * Gets the name of the attribute to map the column to.
44       * 
45       * @return name of the attribute to map the column to
46       */
47      public String getAttributeID() {
48          return attributeName;
49      }
50  
51      /**
52       * Gets the Java data type to express the database value as.
53       * 
54       * @return Java data type to express the database value as
55       */
56      public DATA_TYPES getDataType() {
57          return dataType;
58      }
59  
60      /** {@inheritDoc} */
61      public String toString() {
62          return "RBDMSColumnDescriptor{columnName=" + columnName + ", attributeId=" + attributeName + ", dataType="
63                  + dataType + "}";
64      }
65  }