01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: /**
18: * @author Hugo Beilis
19: * @author Leonardo Soler
20: * @author Gabriel Miretti
21: * @version 1.0
22: */package org.apache.harmony.jndi.tests.javax.naming.spi.mock.ldap;
23:
24: import javax.naming.ldap.Control;
25:
26: /**
27: * <p>Implementation of the interfaces Control. This class has the intention of
28: * give us a Control to test another classes.</p>
29: *
30: */
31: public class MockControl implements Control {
32:
33: /**
34: *
35: */
36: private static final long serialVersionUID = 1L;
37: private String id;
38: private boolean criticality;
39: private byte[] value;
40:
41: /**
42: * Constructor method to the our control.
43: * @param id The Id field of this control.
44: * @param crit The citicality of the control.
45: * @param value The BER value of the control.
46: */
47: public MockControl(String id, boolean crit, byte[] value) {
48: this .id = id;
49: this .criticality = crit;
50: this .value = value;
51: }
52:
53: /**
54: * Constructor method to the our control.
55: * @param id The Id field of this control.
56: */
57: public MockControl(String id) {
58: this .id = id;
59: this .criticality = false;
60: this .value = null;
61: }
62:
63: /**
64: * This method give us the Id of the control.
65: * @return The Id of the control.
66: */
67: public String getID() {
68: // TODO Auto-generated method stub
69: return id;
70: }
71:
72: /**
73: * This method give us the criticality of the control.
74: * @return The criticality.
75: */
76: public boolean isCritical() {
77: // TODO Auto-generated method stub
78: return criticality;
79: }
80:
81: /**
82: * This method give us the BER value of the control.
83: * @return The BER value.
84: */
85: public byte[] getEncodedValue() {
86: // TODO Auto-generated method stub
87: return value;
88: }
89:
90: }
|