001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019:
020: package org.wso2.esb.registry;
021:
022: import org.apache.synapse.registry.RegistryEntry;
023:
024: import java.net.URI;
025: import java.util.Date;
026:
027: public class ESBRegistryEntry implements RegistryEntry {
028:
029: private String key = null;
030: private String name = null;
031: private long version = Long.MIN_VALUE;
032: private URI type = null;
033: private String description;
034: private long created;
035: private long lastModified;
036: private long cachableDuration;
037:
038: public String getKey() {
039: return key;
040: }
041:
042: public void setKey(String key) {
043: this .key = key;
044: }
045:
046: public String getName() {
047: return name;
048: }
049:
050: public void setName(String name) {
051: this .name = name;
052: }
053:
054: public long getVersion() {
055: return version;
056: }
057:
058: public void setVersion(long version) {
059: this .version = version;
060: }
061:
062: public URI getType() {
063: return type;
064: }
065:
066: public void setType(URI type) {
067: this .type = type;
068: }
069:
070: public String getDescription() {
071: return description;
072: }
073:
074: public void setDescription(String description) {
075: this .description = description;
076: }
077:
078: public long getCreated() {
079: return created;
080: }
081:
082: public void setCreated(long created) {
083: this .created = created;
084: }
085:
086: public long getLastModified() {
087: return lastModified;
088: }
089:
090: public void setLastModified(long lastModified) {
091: this .lastModified = lastModified;
092: }
093:
094: public long getCachableDuration() {
095: return cachableDuration;
096: }
097:
098: public void setCachableDuration(long cachableDuration) {
099: this .cachableDuration = cachableDuration;
100: }
101:
102: public String toString() {
103: StringBuffer sb = new StringBuffer();
104: sb.append("RegistryEntry {").append(" Key : " + key).append(
105: " Name : " + name).append(" Ver : " + version).append(
106: " Type : " + type).append(" Desc : " + description)
107: .append(" Created : " + new Date(created)).append(
108: " Modified : " + new Date(lastModified))
109: .append(
110: " Cacheable for : " + (cachableDuration / 1000)
111: + "sec").append("}");
112: return sb.toString();
113: }
114: }
|