1 /*
2 * Copyright 2003 - 2013 The eFaps Team
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * Revision: $Rev$
17 * Last Changed: $Date$
18 * Last Changed By: $Author$
19 */
20
21 package org.efaps.admin.ui;
22
23 import java.util.UUID;
24
25 import org.efaps.ci.CIAdminUserInterface;
26 import org.efaps.util.cache.CacheReloadException;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30 /**
31 * @author The eFaps Team
32 * @version $Id$
33 * TODO: description
34 */
35 public class Command
36 extends AbstractCommand
37 {
38 /**
39 * Logger for this class.
40 */
41 protected static final Logger LOG = LoggerFactory.getLogger(Command.class);
42
43 /**
44 * Needed for serialization.
45 */
46 private static final long serialVersionUID = 1L;
47
48 /**
49 * Constructor to set the id and name of the command object.
50 *
51 * @param _id id of the command to set
52 * @param _uuid UUID of the command to set
53 * @param _name name of the command to set
54 */
55 public Command(final Long _id,
56 final String _uuid,
57 final String _name)
58 {
59 super(_id, _uuid, _name);
60 }
61
62 /**
63 * Returns for given parameter <i>UUID</i> the instance of class
64 * {@link Command}.
65 *
66 * @param _uuid UUID to search in the cache
67 * @return instance of class {@link Command}
68 * @throws CacheReloadException on error
69 */
70 public static Command get(final UUID _uuid)
71 throws CacheReloadException
72 {
73 return AbstractUserInterfaceObject.<Command>get(_uuid, Command.class, CIAdminUserInterface.Command.getType());
74 }
75
76 /**
77 * Returns for given parameter <i>_id</i> the instance of class
78 * {@link Command}.
79 *
80 * @param _id id to search in the cache
81 * @return instance of class {@link Command}
82 * @throws CacheReloadException on error
83 */
84 public static Command get(final long _id)
85 throws CacheReloadException
86 {
87 return AbstractUserInterfaceObject.<Command>get(_id, Command.class, CIAdminUserInterface.Command.getType());
88 }
89
90 /**
91 * Returns for given parameter <i>_name</i> the instance of class
92 * {@link Command}.
93 *
94 * @param _name name to search in the cache
95 * @return instance of class {@link Command}
96 * @throws CacheReloadException on error
97 */
98 public static Command get(final String _name)
99 throws CacheReloadException
100 {
101 return AbstractUserInterfaceObject.<Command>get(_name, Command.class, CIAdminUserInterface.Command.getType());
102 }
103 }