├── .classpath
├── .gitignore
├── .project
├── ChangeLog
├── README.md
├── README.txt
├── build.xml
├── doc
├── manual_en.pdf
└── protocol_en.pdf
├── lib
├── antlr-2.7.7.jar
├── c3p0-0.9.2-pre4.jar
├── commons-codec-1.7.jar
├── dom4j-1.6.1.jar
├── ehcache-core-2.6.0.jar
├── hibernate-c3p0-4.1.7.Final.jar
├── hibernate-commons-annotations-4.0.1.Final.jar
├── hibernate-core-4.1.7.Final.jar
├── hibernate-ehcache-4.1.7.Final.jar
├── hibernate-entitymanager-4.1.7.Final.jar
├── hibernate-jpa-2.0-api-1.0.1.Final.jar
├── javassist-3.15.0-GA.jar
├── jboss-logging-3.1.0.GA.jar
├── jboss-transaction-api_1.1_spec-1.0.0.Final.jar
├── log4j-1.2.17.jar
├── mchange-commons-java-0.2.2.jar
├── mysql-connector-java-5.1.22-bin.jar
├── slf4j-api-1.7.1.jar
└── slf4j-jdk14-1.7.1.jar
├── scripts
├── CreateZoneDirs.sh
├── SlaveSync.sh
└── slave_install.sh
└── src
├── META-INF
├── ehcache.xml
└── persistence.xml
└── br
└── registro
└── dnsshim
├── common
├── repository
│ ├── FileSystemUtil.java
│ └── GenericRepository.java
└── server
│ ├── AbstractDecoderOutput.java
│ ├── AbstractEncoderOutput.java
│ ├── AbstractProtocolDecoder.java
│ ├── AbstractProtocolEncoder.java
│ ├── ClientConfig.java
│ ├── DnsshimProtocolException.java
│ ├── ErrorMessage.java
│ ├── IoFilter.java
│ ├── IoFilterChain.java
│ ├── IoSession.java
│ ├── ProtocolStatusCode.java
│ ├── Server.java
│ ├── ServerConfig.java
│ ├── TcpAcceptor.java
│ ├── TcpIoSession.java
│ ├── UdpAcceptor.java
│ ├── UdpClientIoSession.java
│ └── UdpIoSession.java
├── domain
├── A.java
├── Aaaa.java
├── Cert.java
├── CertType.java
├── Cname.java
├── Dname.java
├── DnsClass.java
├── Dnskey.java
├── DnskeyAlgorithm.java
├── DnskeyFlags.java
├── DnskeyProtocol.java
├── DnskeyType.java
├── Ds.java
├── DsDigestType.java
├── DsInfo.java
├── FingerprintAlgorithm.java
├── FingerprintType.java
├── GenericResourceRecord.java
├── Hinfo.java
├── Ipseckey.java
├── IpseckeyAlgorithm.java
├── IpseckeyGatewayType.java
├── Loc.java
├── Minfo.java
├── Mx.java
├── Naptr.java
├── Ns.java
├── Nsec.java
├── Nsec3.java
├── Nsec3Param.java
├── Opt.java
├── OwnernameComparator.java
├── Ptr.java
├── Rdata.java
├── RdataABuilder.java
├── RdataAaaaBuilder.java
├── RdataBuilder.java
├── RdataCertBuilder.java
├── RdataCnameBuilder.java
├── RdataDnameBuilder.java
├── RdataDnskeyBuilder.java
├── RdataDsBuilder.java
├── RdataHinfoBuilder.java
├── RdataIpseckeyBuilder.java
├── RdataLocBuilder.java
├── RdataMinfoBuilder.java
├── RdataMxBuilder.java
├── RdataNaptrBuilder.java
├── RdataNsBuilder.java
├── RdataNsec3Builder.java
├── RdataNsec3ParamBuilder.java
├── RdataNsecBuilder.java
├── RdataPtrBuilder.java
├── RdataRrsigBuilder.java
├── RdataSoaBuilder.java
├── RdataSrvBuilder.java
├── RdataSshfpBuilder.java
├── RdataTlsaBuilder.java
├── RdataTsigBuilder.java
├── RdataTxtBuilder.java
├── ResourceRecord.java
├── ResourceRecordFactory.java
├── RrList.java
├── RrType.java
├── RrTypeComparator.java
├── Rrset.java
├── Rrsig.java
├── Soa.java
├── Srv.java
├── Sshfp.java
├── Tlsa.java
├── TlsaMatchingType.java
├── TlsaSelector.java
├── TlsaUsage.java
├── Tsig.java
├── Txt.java
├── Zone.java
├── ZoneIncrement.java
└── logic
│ ├── CacheException.java
│ ├── CacheStrategy.java
│ ├── Cacheable.java
│ ├── DsCalc.java
│ └── TsigCalc.java
├── migration
├── Migration.java
└── SchemaCreator.java
├── resources
├── ca
│ ├── dnsshim_cert
│ └── server.keystore
└── templates
│ └── xml
│ └── schema
│ ├── AddUser.xsd
│ ├── AddZoneUser.xsd
│ ├── ChangeKeyStatus.xsd
│ ├── ChangePassword.xsd
│ ├── Hello.xsd
│ ├── ImportKey.xsd
│ ├── ImportZone.xsd
│ ├── ListKeys.xsd
│ ├── ListSlaveGroup.xsd
│ ├── ListSlaves.xsd
│ ├── ListTsigKeys.xsd
│ ├── ListZones.xsd
│ ├── ListZonesBySlaveGroup.xsd
│ ├── Login.xsd
│ ├── Logout.xsd
│ ├── NewKey.xsd
│ ├── NewTsigKey.xsd
│ ├── NewZone.xsd
│ ├── PrintSlaveGroup.xsd
│ ├── PrintZone.xsd
│ ├── PubZone.xsd
│ ├── RemoveKey.xsd
│ ├── RemoveTsigKey.xsd
│ ├── RemoveZone.xsd
│ ├── RemoveZoneUser.xsd
│ ├── Rr.xsd
│ ├── SetExpirationPeriod.xsd
│ ├── Shutdown.xsd
│ ├── Slave.xsd
│ ├── SlaveGroup.xsd
│ ├── ZoneExists.xsd
│ └── ZoneVersion.xsd
├── signer
├── dao
│ └── filesystem
│ │ ├── KeyInfoDao.java
│ │ └── SignerConfigDao.java
├── domain
│ ├── KeyInfo.java
│ ├── SignData.java
│ └── logic
│ │ ├── DnskeyCalc.java
│ │ ├── KeyInfoCache.java
│ │ ├── KeyInfoFactory.java
│ │ ├── RrsigEnvelopeFactory.java
│ │ └── SignerConfigManager.java
├── protocol
│ ├── Decoder.java
│ ├── DecoderOutput.java
│ ├── Encoder.java
│ ├── EncoderOutput.java
│ ├── GenerateKeyRequest.java
│ ├── ImportKeyRequest.java
│ ├── KeyResponse.java
│ ├── OperationType.java
│ ├── RemoveKeyRequest.java
│ ├── RemoveKeyResponse.java
│ ├── ResponseStatus.java
│ ├── SignRequest.java
│ ├── SignRequestHeader.java
│ └── SignResponse.java
├── repository
│ ├── KeyInfoRepository.java
│ └── SignerConfigRepository.java
├── server
│ └── SignerServer.java
└── service
│ ├── KeyService.java
│ ├── KeyServiceImpl.java
│ ├── SignService.java
│ └── SignServiceImpl.java
├── util
├── Base32.java
├── ByteUtil.java
├── DatabaseUtil.java
├── DateUtil.java
├── DomainNameUtil.java
├── HealthMonitor.java
└── ResourceRecordUtil.java
└── xfrd
├── dao
└── filesystem
│ ├── SlaveDao.java
│ ├── SlaveGroupDao.java
│ ├── UserDao.java
│ ├── XfrdConfigDao.java
│ ├── ZoneDao.java
│ ├── ZoneDataDao.java
│ ├── ZoneDataPrePublishDao.java
│ ├── ZoneIncrementDao.java
│ ├── ZoneIncrementPrePublish.java
│ ├── ZoneIncrementPrePublishDao.java
│ ├── ZoneInfoDao.java
│ └── ZonePrePublishDao.java
├── dns
├── axfr
│ └── AxfrClient.java
├── notifier
│ ├── client
│ │ └── NotifierClient.java
│ ├── domain
│ │ └── ZoneNotify.java
│ └── logic
│ │ ├── NotifierManager.java
│ │ └── ZoneNotifier.java
├── protocol
│ ├── AnyMessageBuilder.java
│ ├── AxfrMessageBuilder.java
│ ├── ClientDecoderOutput.java
│ ├── Decoder.java
│ ├── DecoderOutput.java
│ ├── DnsHeader.java
│ ├── DnsMessage.java
│ ├── DnsMessageBuilder.java
│ ├── DnsPacket.java
│ ├── DnsQuestion.java
│ ├── EmptyMessageBuilder.java
│ ├── Encoder.java
│ ├── EncoderOutput.java
│ ├── IxfrMessageBuilder.java
│ ├── Opcode.java
│ ├── QueryType.java
│ ├── RecordMessageBuilder.java
│ └── ResponseCode.java
├── server
│ └── DnsServer.java
└── util
│ └── DnsMessageUtil.java
├── domain
├── DnskeyInfo.java
├── DnskeyStatus.java
├── PublicationType.java
├── Slave.java
├── SlaveConfig.java
├── SlaveGroup.java
├── TsigKeyInfo.java
├── User.java
├── XfrdConfig.java
├── ZoneData.java
├── ZoneDataPrePublish.java
├── ZoneInfo.java
├── ZoneSync.java
├── Zonename.java
└── logic
│ ├── DnsshimSession.java
│ ├── DnsshimSessionCache.java
│ ├── DnsshimSessionCollector.java
│ ├── DnsshimSessionCollectorManager.java
│ ├── ExecThread.java
│ ├── RrsigUtil.java
│ ├── SlaveGroupDumper.java
│ ├── SlaveGroupDumperManager.java
│ ├── XfrdConfigManager.java
│ ├── ZoneDataCache.java
│ └── ZoneDataPrePublishCache.java
├── migration
├── DbMigration.java
├── Migration.java
├── SlaveGroupMigration.java
├── TsigMigration.java
├── UserMigration.java
└── ZoneMigration.java
├── scheduler
├── ResignScheduler.java
└── domain
│ └── ZoneResign.java
├── server
└── XfrdLauncher.java
├── service
├── KeyService.java
├── KeyServiceImpl.java
├── PublicationService.java
├── PublicationServiceImpl.java
├── SignService.java
├── SignServiceImpl.java
├── SlaveGroupService.java
├── SlaveGroupServiceImpl.java
├── TsigKeyService.java
├── TsigKeyServiceImpl.java
├── UserService.java
├── UserServiceImpl.java
├── ZoneService.java
└── ZoneServiceImpl.java
├── signerclient
├── Decoder.java
├── DecoderOutput.java
├── Encoder.java
├── EncoderOutput.java
└── SignerClient.java
├── ui
├── protocol
│ ├── AddSlaveRequest.java
│ ├── AddSlaveResponse.java
│ ├── AddUserRequest.java
│ ├── ChangeKeyStatusRequest.java
│ ├── ChangeKeyStatusResponse.java
│ ├── ChangePasswordRequest.java
│ ├── Decoder.java
│ ├── DecoderOutput.java
│ ├── Encoder.java
│ ├── EncoderOutput.java
│ ├── HelloRequest.java
│ ├── ImportKeyRequest.java
│ ├── ImportKeyResponse.java
│ ├── ImportZoneRequest.java
│ ├── ImportZoneResponse.java
│ ├── ListKeysRequest.java
│ ├── ListKeysResponse.java
│ ├── ListSlaveGroupRequest.java
│ ├── ListSlaveGroupResponse.java
│ ├── ListSlavesRequest.java
│ ├── ListSlavesResponse.java
│ ├── ListTsigKeysRequest.java
│ ├── ListTsigKeysResponse.java
│ ├── ListZonesBySlaveGroupRequest.java
│ ├── ListZonesBySlaveGroupResponse.java
│ ├── ListZonesRequest.java
│ ├── ListZonesResponse.java
│ ├── LoginRequest.java
│ ├── LoginResponse.java
│ ├── LogoutRequest.java
│ ├── NewKeyRequest.java
│ ├── NewKeyResponse.java
│ ├── NewSlaveGroupResponse.java
│ ├── NewTsigKeyRequest.java
│ ├── NewTsigKeyResponse.java
│ ├── NewZoneRequest.java
│ ├── NewZoneResponse.java
│ ├── PrintSlaveGroupRequest.java
│ ├── PrintSlaveGroupResponse.java
│ ├── PrintZoneRequest.java
│ ├── PrintZoneResponse.java
│ ├── PubZoneRequest.java
│ ├── PubZoneResponse.java
│ ├── RemoveKeyRequest.java
│ ├── RemoveKeyResponse.java
│ ├── RemoveSlaveGroupResponse.java
│ ├── RemoveSlaveResponse.java
│ ├── RemoveTsigKeyRequest.java
│ ├── RemoveTsigKeyResponse.java
│ ├── RemoveZoneRequest.java
│ ├── RemoveZoneResponse.java
│ ├── Response.java
│ ├── RestrictOperation.java
│ ├── RrOperation.java
│ ├── RrRequest.java
│ ├── RrResponse.java
│ ├── SessionFilter.java
│ ├── SetExpirationPeriodRequest.java
│ ├── SetExpirationPeriodResponse.java
│ ├── ShutdownRequest.java
│ ├── SlaveGroupRequest.java
│ ├── SlaveOperation.java
│ ├── SlaveRequest.java
│ ├── SlaveResponse.java
│ ├── UiResponseFactory.java
│ ├── ZoneExistsRequest.java
│ ├── ZoneFilter.java
│ ├── ZoneOperation.java
│ ├── ZoneUserRequest.java
│ ├── ZoneUserResponse.java
│ ├── ZoneVersionRequest.java
│ ├── ZoneVersionResponse.java
│ ├── parser
│ │ ├── AddUserParser.java
│ │ ├── AddZoneUserParser.java
│ │ ├── ChangeKeyStatusParser.java
│ │ ├── ChangePasswordParser.java
│ │ ├── HelloParser.java
│ │ ├── ImportKeyParser.java
│ │ ├── ImportZoneParser.java
│ │ ├── ListKeysParser.java
│ │ ├── ListSlaveGroupParser.java
│ │ ├── ListSlaveParser.java
│ │ ├── ListTsigKeysParser.java
│ │ ├── ListZonesBySlaveGroupParser.java
│ │ ├── ListZonesParser.java
│ │ ├── LoginParser.java
│ │ ├── LogoutParser.java
│ │ ├── NewKeyParser.java
│ │ ├── NewTsigKeyParser.java
│ │ ├── NewZoneParser.java
│ │ ├── PrintSlaveGroupParser.java
│ │ ├── PrintZoneParser.java
│ │ ├── PubZoneParser.java
│ │ ├── RemoveKeyParser.java
│ │ ├── RemoveRrParser.java
│ │ ├── RemoveTsigKeyParser.java
│ │ ├── RemoveZoneParser.java
│ │ ├── RemoveZoneUserParser.java
│ │ ├── RequestParserFactory.java
│ │ ├── RrParser.java
│ │ ├── SetExpirationPeriodParser.java
│ │ ├── ShutdownParser.java
│ │ ├── SlaveGroupParser.java
│ │ ├── SlaveParser.java
│ │ ├── UiRequestParser.java
│ │ ├── ZoneExistsParser.java
│ │ └── ZoneVersionParser.java
│ └── writer
│ │ ├── ChangeKeyStatusResponseWriter.java
│ │ ├── DefaultResponseWriter.java
│ │ ├── ImportKeyResponseWriter.java
│ │ ├── ImportZoneResponseWriter.java
│ │ ├── ListKeysResponseWriter.java
│ │ ├── ListSlaveGroupResponseWriter.java
│ │ ├── ListSlavesResponseWriter.java
│ │ ├── ListTsigKeysResponseWriter.java
│ │ ├── ListZonesBySlaveGroupResponseWriter.java
│ │ ├── ListZonesResponseWriter.java
│ │ ├── LoginResponseWriter.java
│ │ ├── NewKeyResponseWriter.java
│ │ ├── NewTsigKeyResponseWriter.java
│ │ ├── NewZoneResponseWriter.java
│ │ ├── PrintSlaveGroupResponseWriter.java
│ │ ├── PrintZoneResponseWriter.java
│ │ ├── PubZoneResponseWriter.java
│ │ ├── RemoveKeyResponseWriter.java
│ │ ├── RemoveTsigKeyResponseWriter.java
│ │ ├── RemoveZoneResponseWriter.java
│ │ ├── RrResponseWriter.java
│ │ ├── SetExpirationPeriodResponseWriter.java
│ │ ├── SlaveResponseWriter.java
│ │ ├── UiResponseWriter.java
│ │ └── ZoneVersionResponseWriter.java
└── server
│ └── UiServer.java
└── util
├── CloseDatabaseSessionFilter.java
├── OpenDatabaseSessionFilter.java
├── ServerContext.java
├── SortedProperties.java
└── ZoneParser.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 | build
3 | dnsshim-dist
4 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | dnsshim
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ChangeLog:
--------------------------------------------------------------------------------
1 | DNSSHIM: NIC.br's DNS Secure Hidden Master
2 |
3 | version 2.2.2
4 | * Fix to allow AXFR responses bigger than 32767 bytes
5 |
6 | version 2.2.1
7 | * Fix for list-zones and change-password
8 | * Added hook to capture a shutdown signal from the Operating System
9 |
10 | version 2.2
11 | * TLS certificate import fix
12 | * overwrite_mname is now an option on xfrd config file
13 |
14 | version 2.1
15 | * Support TLSA record
16 |
17 | version 2.0
18 | * Uses a database to store metadata
19 | * New auto-balance option to balance among several slave-groups
20 | * Various bugfixes
21 | * Please read how to migrate from previous version on manual_en.pdf
22 |
23 | version 1.2
24 | * Avoid having to load zone configurations file for every DNS query
25 | * After reading a zone configuration file, no need to write it back to disk
26 | * Allocate 1k instead of 64k for the incoming DNS query via UDP
27 | * Graceful shutdown via client command
28 |
29 | version 1.1
30 | * domain name validation
31 | * remove unused files after zone removal
32 | * minor bugfixes
33 |
34 | version 1.0
35 | * Slave synchronization done via rndc (only on BIND 9.7.2)
36 | * SOA version by default uses Julian Date format
37 | Bug fixes
38 | * DS RR: keytag is now unsigned in presentation mode
39 | * DS RR: printing algorithm and digest values instead strings
40 | * Resign scheduler shall respect high/low priority interval.
41 | * Always keep a well formed configuration file.
42 | * Imported zones aren't signed by default
43 | * Rollback zone properly when publication fails
44 |
45 | version 0.1beta3 (2009-06-23):
46 | Bug Fixes:
47 | * CNAME RR handling. Don't allow for an ownername to have a CNAME and other RRs.
48 |
49 | version 0.1beta2 (2009-05-29):
50 | Bug Fixes:
51 | * Domain names must be in lower case form for signing
52 |
53 | version 0.1beta1 (2009-05-22):
54 | * First Public Beta Release!
55 |
--------------------------------------------------------------------------------
/doc/manual_en.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/doc/manual_en.pdf
--------------------------------------------------------------------------------
/doc/protocol_en.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/doc/protocol_en.pdf
--------------------------------------------------------------------------------
/lib/antlr-2.7.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/antlr-2.7.7.jar
--------------------------------------------------------------------------------
/lib/c3p0-0.9.2-pre4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/c3p0-0.9.2-pre4.jar
--------------------------------------------------------------------------------
/lib/commons-codec-1.7.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/commons-codec-1.7.jar
--------------------------------------------------------------------------------
/lib/dom4j-1.6.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/dom4j-1.6.1.jar
--------------------------------------------------------------------------------
/lib/ehcache-core-2.6.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/ehcache-core-2.6.0.jar
--------------------------------------------------------------------------------
/lib/hibernate-c3p0-4.1.7.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/hibernate-c3p0-4.1.7.Final.jar
--------------------------------------------------------------------------------
/lib/hibernate-commons-annotations-4.0.1.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/hibernate-commons-annotations-4.0.1.Final.jar
--------------------------------------------------------------------------------
/lib/hibernate-core-4.1.7.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/hibernate-core-4.1.7.Final.jar
--------------------------------------------------------------------------------
/lib/hibernate-ehcache-4.1.7.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/hibernate-ehcache-4.1.7.Final.jar
--------------------------------------------------------------------------------
/lib/hibernate-entitymanager-4.1.7.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/hibernate-entitymanager-4.1.7.Final.jar
--------------------------------------------------------------------------------
/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar
--------------------------------------------------------------------------------
/lib/javassist-3.15.0-GA.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/javassist-3.15.0-GA.jar
--------------------------------------------------------------------------------
/lib/jboss-logging-3.1.0.GA.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/jboss-logging-3.1.0.GA.jar
--------------------------------------------------------------------------------
/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar
--------------------------------------------------------------------------------
/lib/log4j-1.2.17.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/log4j-1.2.17.jar
--------------------------------------------------------------------------------
/lib/mchange-commons-java-0.2.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/mchange-commons-java-0.2.2.jar
--------------------------------------------------------------------------------
/lib/mysql-connector-java-5.1.22-bin.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/mysql-connector-java-5.1.22-bin.jar
--------------------------------------------------------------------------------
/lib/slf4j-api-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/slf4j-api-1.7.1.jar
--------------------------------------------------------------------------------
/lib/slf4j-jdk14-1.7.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/lib/slf4j-jdk14-1.7.1.jar
--------------------------------------------------------------------------------
/scripts/CreateZoneDirs.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Copyright (C) 2009 Registro.br. All rights reserved.
3 | #
4 | # Redistribution and use in source and binary forms, with or without
5 | # modification, are permitted provided that the following conditions are
6 | # met:
7 | # 1. Redistribution of source code must retain the above copyright
8 | # notice, this list of conditions and the following disclaimer.
9 | # 2. Redistributions in binary form must reproduce the above copyright
10 | # notice, this list of conditions and the following disclaimer in the
11 | # documentation and/or other materials provided with the distribution.
12 | #
13 | # THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
14 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 | # WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
16 | # EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
19 | # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
21 | # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22 | # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23 | # DAMAGE.
24 |
25 |
26 | hex="0 1 2 3 4 5 6 7 8 9 a b c d e f"
27 | for d1 in $hex;
28 | do
29 | for d2 in $hex;
30 | do
31 | for d3 in $hex;
32 | do
33 | mkdir -p dnsshim/$d1/$d2/$d3
34 | done
35 | done
36 | done
37 |
--------------------------------------------------------------------------------
/src/META-INF/ehcache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/src/META-INF/persistence.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 | org.hibernate.ejb.HibernatePersistence
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/common/repository/GenericRepository.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.common.repository;
25 |
26 | import java.io.IOException;
27 |
28 | public interface GenericRepository {
29 | public void save(T t) throws IOException;
30 | }
31 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/common/server/AbstractProtocolEncoder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.common.server;
25 |
26 | import java.io.IOException;
27 |
28 |
29 | public abstract class AbstractProtocolEncoder {
30 | private AbstractEncoderOutput output;
31 |
32 | public AbstractEncoderOutput getOutput() {
33 | return output;
34 | }
35 |
36 | public void setOutput(AbstractEncoderOutput output) {
37 | this.output = output;
38 | }
39 |
40 | public abstract void encodeErrorMessage(ErrorMessage message, IoSession session) throws DnsshimProtocolException, IOException;
41 | public abstract void encode(Object message, IoSession session) throws DnsshimProtocolException, IOException;
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/common/server/IoFilter.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.common.server;
25 |
26 | public interface IoFilter {
27 | public void filter(Object message, IoSession session) throws DnsshimProtocolException;
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/common/server/IoFilterChain.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.common.server;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | public class IoFilterChain {
30 | private List filterChain = new ArrayList();
31 |
32 | public IoFilterChain add(IoFilter filter) {
33 | filterChain.add(filter);
34 | return this;
35 | }
36 |
37 | public void filter(Object message, IoSession session) throws DnsshimProtocolException{
38 | for (IoFilter filter : filterChain) {
39 | filter.filter(message, session);
40 | }
41 | }
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/common/server/IoSession.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.common.server;
25 |
26 | import java.io.IOException;
27 | import java.net.InetSocketAddress;
28 |
29 | import br.registro.dnsshim.common.server.Server.TransportType;
30 |
31 | public interface IoSession {
32 | public int read(byte[] b) throws IOException;
33 | public int read(byte[] b, int off, int len) throws IOException;
34 | public int read() throws IOException;
35 | public void write(byte[] buffer) throws IOException;
36 | public void close() throws IOException;
37 | public InetSocketAddress getRemoteAddress();
38 | public TransportType getTransportType();
39 | public void setAttachment(Object attachment);
40 | public Object getAttachment();
41 |
42 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/DnskeyProtocol.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | public enum DnskeyProtocol {
27 | // RFC 3755 - 4.4
28 | PROTOCOL((byte) 3);
29 |
30 | private DnskeyProtocol(byte value) {
31 | this.value = value;
32 | }
33 |
34 | private byte value;
35 |
36 | public byte getValue() {
37 | return value;
38 | }
39 |
40 | public void setValue(byte value) {
41 | this.value = value;
42 | }
43 |
44 | public static DnskeyProtocol fromValue(byte value)
45 | throws IllegalArgumentException {
46 | DnskeyProtocol[] values = DnskeyProtocol.values();
47 | for (DnskeyProtocol type : values) {
48 | if (type.getValue() == value) {
49 | return type;
50 | }
51 | }
52 | throw new IllegalArgumentException();
53 | }
54 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/DnskeyType.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | public enum DnskeyType {
27 | ZSK,
28 | KSK;
29 | }
30 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/DsInfo.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | public class DsInfo {
27 | private int keytag;
28 | private DsDigestType digestType;
29 | private String digest;
30 |
31 | public int getKeytag() {
32 | return keytag;
33 | }
34 | public void setKeytag(int keytag) {
35 | this.keytag = keytag;
36 | }
37 | public DsDigestType getDigestType() {
38 | return digestType;
39 | }
40 | public void setDigestType(DsDigestType digestType) {
41 | this.digestType = digestType;
42 | }
43 | public String getDigest() {
44 | return digest;
45 | }
46 | public void setDigest(String digest) {
47 | this.digest = digest;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/GenericResourceRecord.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | public class GenericResourceRecord extends ResourceRecord {
27 | public GenericResourceRecord(String ownername,
28 | RrType type, DnsClass dnsClass, int ttl, Rdata rdata) {
29 | super(ownername, type, dnsClass, ttl, rdata);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | public interface RdataBuilder {
27 | public static final int DNSSEC_ALGORITHM_LEN = 1;
28 | public static final int DNSSEC_KEYTAG_LEN = 2;
29 | }
30 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataCnameBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public class RdataCnameBuilder implements RdataBuilder {
29 | public static Rdata get(String canonicalName) {
30 | return new Rdata(DomainNameUtil.toWireFormat(canonicalName));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataDnameBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public class RdataDnameBuilder implements RdataBuilder {
29 | public static Rdata get(String canonicalName) {
30 | return new Rdata(DomainNameUtil.toWireFormat(canonicalName));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataMxBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | import br.registro.dnsshim.util.ByteUtil;
27 | import br.registro.dnsshim.util.DomainNameUtil;
28 |
29 | public class RdataMxBuilder implements RdataBuilder {
30 | public static Rdata get(short preference, String exchange) {
31 |
32 | byte[] name = DomainNameUtil.toWireFormat(exchange);
33 | byte preference_byte[] = ByteUtil.toByteArray(preference);
34 |
35 | byte data[] = new byte[preference_byte.length + name.length];
36 |
37 | System.arraycopy(preference_byte, 0, data, 0, preference_byte.length);
38 | System.arraycopy(name, 0, data, preference_byte.length, name.length);
39 |
40 | return new Rdata(data);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataNsBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public class RdataNsBuilder implements RdataBuilder {
29 | public static Rdata get(String nameserver) {
30 | return new Rdata(DomainNameUtil.toWireFormat(nameserver));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataPtrBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public class RdataPtrBuilder implements RdataBuilder {
29 | public static Rdata get(String ptrDname) {
30 | return new Rdata(DomainNameUtil.toWireFormat(ptrDname));
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RdataTlsaBuilder.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.domain;
2 |
3 | public class RdataTlsaBuilder implements RdataBuilder {
4 |
5 | public static Rdata get(TlsaUsage usage, TlsaSelector selector, TlsaMatchingType matchingType, byte[] cert) {
6 | int rdLength = 1 + 1 + 1 + cert.length; // usage + selector + matchingType + cert
7 | byte[] data = new byte[rdLength];
8 | int pos = 0;
9 |
10 | // usage
11 | data[pos] = usage.getValue();
12 | pos += 1;
13 |
14 | // selector
15 | data[pos] = selector.getValue();
16 | pos += 1;
17 |
18 | // matchingType
19 | data[pos] = matchingType.getValue();
20 | pos += 1;
21 |
22 | // cert
23 | System.arraycopy(cert, 0, data, pos, cert.length);
24 |
25 | return new Rdata(data);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/RrTypeComparator.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain;
25 |
26 | import java.util.Comparator;
27 |
28 | public class RrTypeComparator implements Comparator {
29 |
30 | @Override
31 | public int compare(RrType o1, RrType o2) {
32 |
33 | if ((o1 == RrType.SOA) && (o2 != RrType.SOA)) {
34 | return -1;
35 | } else if (o1 != RrType.SOA && o2 == RrType.SOA) {
36 | return 1;
37 | }
38 |
39 | if (o1.getValue() < o2.getValue()) {
40 | return -1;
41 | } else if (o1.getValue() > o2.getValue()) {
42 | return 1;
43 | } else {
44 | return 0;
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/TlsaMatchingType.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.domain;
2 |
3 | public enum TlsaMatchingType {
4 | NO_HASH((byte) 0),
5 | SHA_256((byte) 1),
6 | SHA_512((byte) 2);
7 |
8 | private byte value;
9 | private TlsaMatchingType(byte value) {
10 | this.value = value;
11 | }
12 |
13 | public byte getValue() {
14 | return value;
15 | }
16 |
17 | @Override
18 | public String toString() {
19 | return name();
20 | }
21 |
22 | public static TlsaMatchingType fromValue(short value) throws IllegalArgumentException {
23 | TlsaMatchingType[] values = TlsaMatchingType.values();
24 | for (TlsaMatchingType type : values) {
25 | if (type.getValue() == value) {
26 | return type;
27 | }
28 | }
29 |
30 | throw new IllegalArgumentException("Invalido "+value);
31 |
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/TlsaSelector.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.domain;
2 |
3 | public enum TlsaSelector {
4 | FULL_CERT((byte) 0),
5 | SUBJECT_PUB_KEY_INFO((byte) 1);
6 |
7 | private byte value;
8 |
9 | private TlsaSelector(byte value) {
10 | this.value = value;
11 | }
12 |
13 | public byte getValue() {
14 | return value;
15 | }
16 |
17 | @Override
18 | public String toString() {
19 | return name();
20 | }
21 |
22 | public static TlsaSelector fromValue(byte value) throws IllegalArgumentException {
23 | TlsaSelector[] values = TlsaSelector.values();
24 | for (TlsaSelector type : values) {
25 | if (type.getValue() == value) {
26 | return type;
27 | }
28 | }
29 |
30 | throw new IllegalArgumentException("Invalido "+value);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/TlsaUsage.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.domain;
2 |
3 | public enum TlsaUsage {
4 | CA_CONSTRAINT((byte) 0),
5 | SERVICE_CERT_CONSTRAINT((byte) 1),
6 | TRUST_ANCHOR_ASSERTION((byte) 2),
7 | DOMAIN_ISSUED_CERT((byte) 3);
8 |
9 | private byte value;
10 |
11 | private TlsaUsage(byte value) {
12 | this.value = value;
13 | }
14 |
15 | public byte getValue() {
16 | return value;
17 | }
18 |
19 | @Override
20 | public String toString() {
21 | return name();
22 | }
23 |
24 | public static TlsaUsage fromValue(byte value) throws IllegalArgumentException {
25 | TlsaUsage[] values = TlsaUsage.values();
26 | for (TlsaUsage type : values) {
27 | if (type.getValue() == value) {
28 | return type;
29 | }
30 | }
31 |
32 | throw new IllegalArgumentException("Invalido "+value);
33 |
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/logic/CacheException.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain.logic;
25 |
26 | public class CacheException extends RuntimeException {
27 | private static final long serialVersionUID = 1L;
28 | private String message;
29 |
30 | public CacheException(String message) {
31 | this.message = message;
32 | }
33 |
34 | @Override
35 | public String getMessage() {
36 | return this.message;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/domain/logic/Cacheable.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.domain.logic;
25 |
26 | public interface Cacheable {
27 | public K getCacheKey();
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/migration/Migration.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.migration;
2 |
3 |
4 | public class Migration {
5 | public static void main(String[] args) {
6 | SchemaCreator.dropTablesIfExists();
7 | SchemaCreator.createAllTables();
8 | }
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/ca/dnsshim_cert:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/src/br/registro/dnsshim/resources/ca/dnsshim_cert
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/ca/server.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/interlegis/dnsshim/72b8a8f8b1a7d51b3427c27badab570ce067da65/src/br/registro/dnsshim/resources/ca/server.keystore
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/AddUser.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/AddZoneUser.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ChangeKeyStatus.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ChangePassword.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/Hello.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ImportKey.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ImportZone.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ListKeys.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ListSlaveGroup.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ListSlaves.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ListTsigKeys.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ListZones.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ListZonesBySlaveGroup.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/Login.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/Logout.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/NewKey.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/NewTsigKey.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/NewZone.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/PrintSlaveGroup.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/PrintZone.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/PubZone.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/RemoveKey.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/RemoveTsigKey.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/RemoveZone.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/RemoveZoneUser.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/Rr.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/SetExpirationPeriod.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/Shutdown.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/Slave.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/SlaveGroup.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ZoneExists.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/resources/templates/xml/schema/ZoneVersion.xsd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/domain/logic/SignerConfigManager.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.domain.logic;
25 |
26 | import java.io.IOException;
27 |
28 | import br.registro.dnsshim.common.server.ServerConfig;
29 | import br.registro.dnsshim.signer.dao.filesystem.SignerConfigDao;
30 | import br.registro.dnsshim.signer.repository.SignerConfigRepository;
31 |
32 | public abstract class SignerConfigManager {
33 | private static ServerConfig config;
34 | private static final SignerConfigRepository repository = new SignerConfigDao();
35 |
36 | public static ServerConfig getConfigInstance() throws IOException {
37 | if (config == null) {
38 | config = repository.load();
39 | }
40 |
41 | return config;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/protocol/EncoderOutput.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.protocol;
25 |
26 | import java.io.IOException;
27 | import java.nio.ByteBuffer;
28 |
29 | import br.registro.dnsshim.common.server.AbstractEncoderOutput;
30 | import br.registro.dnsshim.common.server.DnsshimProtocolException;
31 | import br.registro.dnsshim.common.server.IoSession;
32 |
33 | public class EncoderOutput extends AbstractEncoderOutput {
34 |
35 | @Override
36 | public void doOutput(Object message, IoSession session) throws DnsshimProtocolException, IOException {
37 | ByteBuffer buffer = (ByteBuffer) message;
38 | session.write(buffer.array());
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/protocol/RemoveKeyRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.protocol;
25 |
26 | public class RemoveKeyRequest {
27 | private String keyName;
28 |
29 | public RemoveKeyRequest() {
30 | keyName = "";
31 | }
32 |
33 | public String getKeyName() {
34 | return keyName;
35 | }
36 |
37 | public void setKeyName(String keyName) {
38 | this.keyName = keyName;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/protocol/RemoveKeyResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.protocol;
25 |
26 | public class RemoveKeyResponse {
27 | private OperationType operation;
28 | private ResponseStatus responseStatus;
29 |
30 | public OperationType getOperation() {
31 | return operation;
32 | }
33 | public void setOperation(OperationType operation) {
34 | this.operation = operation;
35 | }
36 | public ResponseStatus getResponseStatus() {
37 | return responseStatus;
38 | }
39 | public void setResponseStatus(ResponseStatus responseStatus) {
40 | this.responseStatus = responseStatus;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/repository/KeyInfoRepository.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.repository;
25 |
26 | import java.util.List;
27 | import java.util.Map;
28 |
29 | import br.registro.dnsshim.common.repository.GenericRepository;
30 | import br.registro.dnsshim.signer.domain.KeyInfo;
31 |
32 | public interface KeyInfoRepository extends GenericRepository {
33 | public KeyInfo findByName(String name) throws Exception;
34 | public Map findAll() throws Exception;
35 | public List findAllKeyNames();
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/repository/SignerConfigRepository.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.repository;
25 |
26 | import java.io.IOException;
27 |
28 | import br.registro.dnsshim.common.repository.GenericRepository;
29 | import br.registro.dnsshim.common.server.ServerConfig;
30 |
31 | public interface SignerConfigRepository extends GenericRepository {
32 | public ServerConfig load() throws IOException;
33 | }
34 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/signer/service/SignService.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.signer.service;
25 |
26 | import java.util.List;
27 |
28 | import br.registro.dnsshim.common.server.DnsshimProtocolException;
29 | import br.registro.dnsshim.domain.ResourceRecord;
30 | import br.registro.dnsshim.domain.Rrset;
31 | import br.registro.dnsshim.signer.domain.SignData;
32 |
33 | public interface SignService {
34 |
35 | public List sign(SignData signData,
36 | List keyIdentifiers, Rrset rrset) throws DnsshimProtocolException;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/util/DateUtil.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.util;
25 |
26 | import java.util.Date;
27 |
28 | public class DateUtil {
29 | /*
30 | * Instead of the miliseconds, the seconds are stored in the Rdata from the epoch
31 | */
32 | public static long removeMillisFromEpoch(long date) {
33 | date /= 1000;
34 | return date;
35 | }
36 |
37 | public static long putMillisFromEpoch(Date expiration) {
38 | long data = expiration.getTime() * 1000;
39 | return data;
40 | }
41 |
42 | public static long putMillisFromEpoch(long expiration) {
43 | long data = expiration * 1000;
44 | return data;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/util/HealthMonitor.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.util;
2 |
3 | import java.lang.management.ManagementFactory;
4 | import java.lang.management.ThreadInfo;
5 | import java.lang.management.ThreadMXBean;
6 |
7 | import org.apache.log4j.Logger;
8 |
9 | public class HealthMonitor {
10 | private static final Logger logger = Logger.getLogger(HealthMonitor.class);
11 |
12 | public static void findDeadLocks() {
13 | ThreadMXBean tmx = ManagementFactory.getThreadMXBean();
14 | long[] ids = tmx.findDeadlockedThreads();
15 | if (ids != null) {
16 | ThreadInfo[] infos = tmx.getThreadInfo(ids, true, true);
17 | logger.fatal("The following threads are deadlocked:");
18 | for (ThreadInfo ti : infos) {
19 | logger.fatal(ti.toString());
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/dao/filesystem/SlaveDao.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.dao.filesystem;
2 |
3 | import javax.persistence.EntityManager;
4 |
5 | import br.registro.dnsshim.xfrd.domain.Slave;
6 |
7 | public class SlaveDao {
8 | private EntityManager entityManager;
9 |
10 | public SlaveDao(EntityManager entityManager) {
11 | this.entityManager = entityManager;
12 | }
13 |
14 | public void save(Slave slave) {
15 | entityManager.persist(slave);
16 | }
17 |
18 | public Slave findByAddress(String address) {
19 | return entityManager.find(Slave.class, address);
20 | }
21 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/dao/filesystem/ZoneIncrementPrePublish.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.dao.filesystem;
25 |
26 | import java.io.IOException;
27 |
28 | public class ZoneIncrementPrePublish extends ZoneIncrementDao {
29 |
30 | public ZoneIncrementPrePublish() throws IOException {
31 | super();
32 | setSuffix(".pre-publish");
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/dao/filesystem/ZonePrePublishDao.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.dao.filesystem;
25 |
26 |
27 | public class ZonePrePublishDao extends ZoneDao {
28 |
29 | public ZonePrePublishDao(){
30 | super();
31 | setSuffix(".pre-publish");
32 | }
33 |
34 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/dns/protocol/ClientDecoderOutput.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.dns.protocol;
25 |
26 | import br.registro.dnsshim.common.server.AbstractDecoderOutput;
27 | import br.registro.dnsshim.common.server.IoSession;
28 |
29 | public class ClientDecoderOutput extends AbstractDecoderOutput{
30 | private Object response;
31 |
32 | public Object getResponse() {
33 | return response;
34 | }
35 |
36 | public void setResponse(Object response) {
37 | this.response = response;
38 | }
39 |
40 | @Override
41 | public void doOutput(Object message, IoSession session) {
42 | this.response = message;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/dns/protocol/EmptyMessageBuilder.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.dns.protocol;
25 |
26 | import br.registro.dnsshim.domain.Opt;
27 |
28 | public class EmptyMessageBuilder extends DnsMessageBuilder {
29 |
30 | public EmptyMessageBuilder() {
31 | super();
32 | }
33 |
34 | public EmptyMessageBuilder(Opt opt) {
35 | this.opt = opt;
36 | }
37 |
38 | @Override
39 | public void process() {
40 | if (response == null) {
41 | response = createNewPacket(true);
42 | }
43 | DnsHeader header = response.getHeader();
44 | header.setAnswerCount((short) response.getAnswer().size());
45 | addResponsePacket(createNewPacket(true));
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/domain/DnskeyStatus.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.domain;
25 |
26 | public enum DnskeyStatus {
27 | SIGN, PUBLISH, NONE;
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/domain/PublicationType.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.domain;
25 |
26 | public enum PublicationType {
27 | FULL, INCREMENTAL;
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/domain/ZoneSync.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.domain;
2 |
3 | import javax.persistence.Entity;
4 | import javax.persistence.GeneratedValue;
5 | import javax.persistence.GenerationType;
6 | import javax.persistence.Id;
7 | import javax.persistence.JoinColumn;
8 | import javax.persistence.ManyToOne;
9 | import javax.persistence.Table;
10 |
11 | import org.hibernate.annotations.Cache;
12 | import org.hibernate.annotations.CacheConcurrencyStrategy;
13 |
14 | @Entity
15 | @Table(name="zone_sync")
16 | @Cache(usage=CacheConcurrencyStrategy.READ_WRITE, region="dnsshim")
17 | public class ZoneSync {
18 |
19 | public enum Operation {
20 | ADD,
21 | REMOVE
22 | }
23 |
24 | @Id
25 | @GeneratedValue(strategy=GenerationType.IDENTITY)
26 | private int id;
27 |
28 | private String zonename;
29 |
30 | @ManyToOne
31 | @JoinColumn(name="slavegroup")
32 | @Cache(usage=CacheConcurrencyStrategy.READ_WRITE, region="dnsshim")
33 | private SlaveGroup slaveGroup;
34 |
35 | private Operation operation;
36 |
37 | public int getId() {
38 | return id;
39 | }
40 |
41 | public void setId(int id) {
42 | this.id = id;
43 | }
44 |
45 | public String getZonename() {
46 | return zonename;
47 | }
48 |
49 | public void setZonename(String zonename) {
50 | this.zonename = zonename;
51 | }
52 |
53 | public SlaveGroup getSlaveGroup() {
54 | return slaveGroup;
55 | }
56 |
57 | public void setSlaveGroup(SlaveGroup slaveGroup) {
58 | this.slaveGroup = slaveGroup;
59 | }
60 |
61 | public Operation getOperation() {
62 | return operation;
63 | }
64 |
65 | public void setOperation(Operation operation) {
66 | this.operation = operation;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/domain/logic/DnsshimSessionCollectorManager.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.domain.logic;
25 |
26 | import java.util.concurrent.Executors;
27 | import java.util.concurrent.ScheduledExecutorService;
28 | import java.util.concurrent.TimeUnit;
29 |
30 | public class DnsshimSessionCollectorManager {
31 | private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
32 |
33 | public static void launch() {
34 | scheduler.scheduleAtFixedRate(new DnsshimSessionCollector(), 30, 30, TimeUnit.SECONDS);
35 | }
36 |
37 | public static void shutdown() {
38 | scheduler.shutdown();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/domain/logic/ExecThread.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.domain.logic;
2 |
3 | import java.io.BufferedReader;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 | import java.io.InputStreamReader;
7 |
8 | import org.apache.log4j.Logger;
9 |
10 | public class ExecThread extends Thread {
11 | private static final Logger logger = Logger.getLogger(ExecThread.class);
12 | private String command;
13 | public ExecThread(String command) {
14 | this.command = command;
15 | }
16 |
17 | public void run() {
18 | try {
19 | Process p = Runtime.getRuntime().exec(command);
20 | InputStream is = p.getInputStream();
21 | InputStreamReader isr = new InputStreamReader(is);
22 | BufferedReader br = new BufferedReader(isr);
23 | String line = null;
24 | while ( (line = br.readLine()) != null) {
25 | logger.debug(line);
26 | }
27 |
28 | int exitValue = p.waitFor();
29 | logger.debug("Command exited with value " + exitValue);
30 | } catch (IOException e) {
31 | logger.error(e.getMessage(), e);
32 | } catch (InterruptedException e) {
33 | logger.error(e.getMessage(), e);
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/domain/logic/SlaveGroupDumperManager.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.domain.logic;
25 |
26 | import java.util.concurrent.Executors;
27 | import java.util.concurrent.ScheduledExecutorService;
28 | import java.util.concurrent.TimeUnit;
29 |
30 | import br.registro.dnsshim.xfrd.domain.XfrdConfig;
31 |
32 | public class SlaveGroupDumperManager {
33 | private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
34 |
35 | public static void launch() {
36 | XfrdConfig config = XfrdConfigManager.getInstance();
37 | scheduler.scheduleAtFixedRate(new SlaveGroupDumper(), 0, config.getSlaveSyncPeriod(), TimeUnit.SECONDS);
38 | }
39 |
40 | public static void shutdown() {
41 | scheduler.shutdown();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/migration/DbMigration.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.migration;
2 |
3 | import java.io.IOException;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import javax.persistence.EntityManager;
8 |
9 | import br.registro.dnsshim.util.DatabaseUtil;
10 |
11 |
12 | public class DbMigration {
13 |
14 | public static void main(String[] args) throws IOException {
15 | EntityManager entityManager = DatabaseUtil.getInstance();
16 |
17 | List migrationList = new ArrayList();
18 | migrationList.add(new UserMigration(entityManager));
19 | migrationList.add(new SlaveGroupMigration(entityManager));
20 | migrationList.add(new TsigMigration(entityManager));
21 | migrationList.add(new ZoneMigration(entityManager));
22 |
23 | for (Migration migration : migrationList) {
24 | entityManager.getTransaction().begin();
25 | migration.migrate();
26 | entityManager.getTransaction().commit();
27 | }
28 |
29 | entityManager.close();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/migration/Migration.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.migration;
2 |
3 | public interface Migration {
4 | public void migrate();
5 | }
6 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/migration/UserMigration.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.migration;
2 |
3 | import java.io.File;
4 | import java.io.FileInputStream;
5 | import java.io.IOException;
6 | import java.util.Properties;
7 |
8 | import javax.persistence.EntityManager;
9 |
10 | import br.registro.dnsshim.xfrd.dao.filesystem.UserDao;
11 | import br.registro.dnsshim.xfrd.domain.User;
12 |
13 | public class UserMigration implements Migration {
14 | private UserDao dao;
15 | private String path;
16 |
17 | public UserMigration(EntityManager em) {
18 | dao = new UserDao(em);
19 |
20 | StringBuilder filePath = new StringBuilder();
21 | // {DNSSHIM_HOME|user.home}/dnsshim/xfrd/zones/SHA1#1/SHA1#2/SHA1#3/.properties
22 | if (System.getenv("DNSSHIM_HOME") == null) {
23 | filePath.append(System.getProperty("user.home"));
24 | filePath.append(File.separatorChar);
25 | filePath.append("dnsshim");
26 | } else {
27 | filePath.append(System.getenv("DNSSHIM_HOME"));
28 | }
29 | filePath.append(File.separatorChar);
30 | filePath.append("xfrd");
31 | filePath.append(File.separatorChar);
32 | filePath.append("conf");
33 | filePath.append(File.separatorChar);
34 | filePath.append("users.properties");
35 | path = filePath.toString();
36 | }
37 |
38 | public void migrate() {
39 | File file = new File(path);
40 | Properties conf = new Properties();
41 |
42 | try {
43 | FileInputStream fis = new FileInputStream(file);
44 | conf.load(fis);
45 |
46 | for (Object key : conf.keySet()) {
47 | String username = (String) key;
48 | String password = conf.getProperty(username);
49 | User user = new User();
50 | user.setUsername(username);
51 | user.setPassword(password);
52 | dao.save(user);
53 | }
54 | fis.close();
55 | } catch (IOException e) {
56 | e.printStackTrace();
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/service/PublicationService.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.service;
25 |
26 | import java.io.IOException;
27 |
28 | import br.registro.dnsshim.common.server.DnsshimProtocolException;
29 | import br.registro.dnsshim.xfrd.ui.protocol.PubZoneResponse;
30 |
31 |
32 | public interface PublicationService {
33 | public PubZoneResponse full(String zonename, long newSoaVersion)
34 | throws IOException, DnsshimProtocolException;
35 | public PubZoneResponse incremental(String zonename, long newSoaVersion)
36 | throws IOException, DnsshimProtocolException;
37 | }
38 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/signerclient/EncoderOutput.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.signerclient;
25 |
26 | import java.io.IOException;
27 | import java.nio.ByteBuffer;
28 |
29 | import br.registro.dnsshim.common.server.AbstractEncoderOutput;
30 | import br.registro.dnsshim.common.server.IoSession;
31 |
32 | public class EncoderOutput extends AbstractEncoderOutput {
33 |
34 | @Override
35 | public void doOutput(Object message, IoSession session) throws IOException {
36 | ByteBuffer buffer = (ByteBuffer) message;
37 | session.write(buffer.array());
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/AddSlaveRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class AddSlaveRequest extends ZoneOperation {
27 | private String slave;
28 | private int port;
29 |
30 | public AddSlaveRequest() {
31 | slave = "";
32 | port = 53;
33 | }
34 |
35 | public String getSlave() {
36 | return slave;
37 | }
38 |
39 | public void setSlave(String slave) {
40 | this.slave = slave;
41 | }
42 |
43 | public int getPort() {
44 | return port;
45 | }
46 |
47 | public void setPort(int port) {
48 | this.port = port;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/AddSlaveResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class AddSlaveResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/AddUserRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class AddUserRequest {
27 | private String username;
28 | private String password;
29 |
30 | public String getUsername() {
31 | return username;
32 | }
33 |
34 | public void setUsername(String username) {
35 | this.username = username;
36 | }
37 |
38 | public String getPassword() {
39 | return password;
40 | }
41 |
42 | public void setPassword(String password) {
43 | this.password = password;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ChangeKeyStatusResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.domain.DsInfo;
27 |
28 | public class ChangeKeyStatusResponse extends Response {
29 | private DsInfo dsInfo;
30 |
31 | public ChangeKeyStatusResponse() {
32 | super();
33 | dsInfo = new DsInfo();
34 | }
35 |
36 | public DsInfo getDsInfo() {
37 | return dsInfo;
38 | }
39 | public void setDsInfo(DsInfo dsInfo) {
40 | this.dsInfo = dsInfo;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/EncoderOutput.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import java.io.IOException;
27 | import java.nio.ByteBuffer;
28 |
29 | import br.registro.dnsshim.common.server.AbstractEncoderOutput;
30 | import br.registro.dnsshim.common.server.IoSession;
31 |
32 | public class EncoderOutput extends AbstractEncoderOutput {
33 |
34 | @Override
35 | public void doOutput(Object message, IoSession session) throws IOException {
36 | ByteBuffer buffer = (ByteBuffer) message;
37 | byte[] bytes = buffer.array();
38 | session.write(bytes);
39 | }
40 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/HelloRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class HelloRequest extends RestrictOperation {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ImportZoneResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ImportZoneResponse extends Response {
27 | private String zone;
28 |
29 | public ImportZoneResponse() {
30 | super();
31 | zone = "";
32 | }
33 |
34 | public String getZone() {
35 | return zone;
36 | }
37 |
38 | public void setZone(String zone) {
39 | this.zone = zone;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListKeysRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 |
27 | public class ListKeysRequest extends ZoneOperation {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListSlaveGroupRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ListSlaveGroupRequest extends RestrictOperation {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListSlaveGroupResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | public class ListSlaveGroupResponse extends Response {
30 | private List groups = new ArrayList();
31 |
32 | public List getSlaveGroups() {
33 | return groups;
34 | }
35 |
36 | public void setSlaveGroups(List groups) {
37 | this.groups = groups;
38 | }
39 |
40 | public void addSlaveGroup(String slaveGroup) {
41 | this.groups.add(slaveGroup);
42 | }
43 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListSlavesRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public class ListSlavesRequest {
29 | private String zone;
30 |
31 | public ListSlavesRequest() {
32 | zone = "";
33 | }
34 |
35 | public String getZone() {
36 | return zone;
37 | }
38 |
39 | public void setZone(String zone) {
40 | this.zone = DomainNameUtil.trimDot(zone.trim().toLowerCase());
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListTsigKeysRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ListTsigKeysRequest extends RestrictOperation {
27 | private String host;
28 |
29 | public String getHost() {
30 | return host;
31 | }
32 | public void setHost(String host) {
33 | this.host = host;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListTsigKeysResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import java.util.Map;
27 | import java.util.TreeMap;
28 |
29 | public class ListTsigKeysResponse extends Response {
30 | private String host;
31 | private Map keys;
32 |
33 | public ListTsigKeysResponse() {
34 | super();
35 | host = "";
36 | keys = new TreeMap();
37 | }
38 |
39 | public String getHost() {
40 | return host;
41 | }
42 | public void setHost(String host) {
43 | this.host = host;
44 | }
45 |
46 | public Map getKeys() {
47 | return keys;
48 | }
49 | public void setKeys(Map keys) {
50 | this.keys = keys;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListZonesBySlaveGroupRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ListZonesBySlaveGroupRequest extends RestrictOperation {
27 | private String slaveGroup;
28 |
29 | public ListZonesBySlaveGroupRequest() {
30 | slaveGroup= "";
31 | }
32 |
33 | public String getSlaveGroup() {
34 | return slaveGroup;
35 | }
36 |
37 | public void setSlaveGroup(String slaveGroup) {
38 | this.slaveGroup = slaveGroup;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListZonesRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ListZonesRequest extends RestrictOperation {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ListZonesResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | public class ListZonesResponse extends Response {
30 | private List zones = new ArrayList();
31 |
32 | public List getZones() {
33 | return zones;
34 | }
35 |
36 | public void setZones(List zones) {
37 | this.zones = zones;
38 | }
39 |
40 | public void addZonename(String zonename) {
41 | this.zones.add(zonename);
42 | }
43 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/LoginRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 |
27 | public class LoginRequest {
28 | private String username;
29 | private String password;
30 |
31 | public String getUsername() {
32 | return username;
33 | }
34 |
35 | public void setUsername(String username) {
36 | this.username = username;
37 | }
38 |
39 | public String getPassword() {
40 | return password;
41 | }
42 |
43 | public void setPassword(String password) {
44 | this.password = password;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/LoginResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class LoginResponse extends Response {
27 | private long sessionId;
28 |
29 | public long getSessionId() {
30 | return sessionId;
31 | }
32 |
33 | public void setSessionId(long sessionId) {
34 | this.sessionId = sessionId;
35 | }
36 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/LogoutRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class LogoutRequest extends RestrictOperation {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/NewSlaveGroupResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class NewSlaveGroupResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/NewTsigKeyRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class NewTsigKeyRequest extends RestrictOperation {
27 | private String keyName;
28 | private String host;
29 |
30 | public String getKeyName() {
31 | return keyName;
32 | }
33 | public void setKeyName(String keyName) {
34 | this.keyName = keyName;
35 | }
36 | public String getHost() {
37 | return host;
38 | }
39 | public void setHost(String host) {
40 | this.host = host;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/NewTsigKeyResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class NewTsigKeyResponse extends Response {
27 | private String host;
28 | private String keyName;
29 | private String secret;
30 |
31 | public String getHost() {
32 | return host;
33 | }
34 | public void setHost(String host) {
35 | this.host = host;
36 | }
37 | public String getKeyName() {
38 | return keyName;
39 | }
40 | public void setKeyName(String keyName) {
41 | this.keyName = keyName;
42 | }
43 | public String getSecret() {
44 | return secret;
45 | }
46 | public void setSecret(String secret) {
47 | this.secret = secret;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/PrintSlaveGroupRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class PrintSlaveGroupRequest extends RestrictOperation {
27 | private String slaveGroup;
28 |
29 | public PrintSlaveGroupRequest() {
30 | slaveGroup = "";
31 | }
32 |
33 | public String getSlaveGroup() {
34 | return slaveGroup;
35 | }
36 |
37 | public void setSlaveGroup(String slaveGroup) {
38 | this.slaveGroup = slaveGroup.trim().toLowerCase();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/PrintZoneRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 |
27 | public class PrintZoneRequest extends ZoneOperation {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/PubZoneRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.xfrd.domain.PublicationType;
27 |
28 | public class PubZoneRequest extends ZoneOperation {
29 | private long serial;
30 | private PublicationType pubType;
31 |
32 | public PubZoneRequest() {
33 | serial = 0;
34 | pubType = PublicationType.FULL;
35 | }
36 |
37 | public long getSerial() {
38 | return serial;
39 | }
40 |
41 | public void setSerial(long serial) {
42 | this.serial = serial;
43 | }
44 |
45 | public PublicationType getPubType() {
46 | return pubType;
47 | }
48 |
49 | public void setPubType(PublicationType pubType) {
50 | this.pubType = pubType;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/PubZoneResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class PubZoneResponse extends Response {
27 | private String zone;
28 | private long serial;
29 |
30 | public PubZoneResponse() {
31 | zone = "";
32 | serial = 0;
33 | }
34 |
35 | public String getZone() {
36 | return zone;
37 | }
38 |
39 | public void setZone(String zone) {
40 | this.zone = zone;
41 | }
42 |
43 | public long getSerial() {
44 | return serial;
45 | }
46 |
47 | public void setSerial(long serial) {
48 | this.serial = serial;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveKeyRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 |
27 | public class RemoveKeyRequest extends ZoneOperation {
28 | private String key;
29 |
30 | public RemoveKeyRequest() {
31 | key = "";
32 | }
33 |
34 | public String getKey() {
35 | return key;
36 | }
37 |
38 | public void setKey(String key) {
39 | this.key = key;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveKeyResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveKeyResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveSlaveGroupResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveSlaveGroupResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveSlaveResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveSlaveResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveTsigKeyRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveTsigKeyRequest extends RestrictOperation {
27 | private String host;
28 | private String keyName;
29 |
30 | public String getHost() {
31 | return host;
32 | }
33 | public void setHost(String host) {
34 | this.host = host;
35 | }
36 |
37 | public String getKeyName() {
38 | return keyName;
39 | }
40 | public void setKeyName(String keyName) {
41 | this.keyName = keyName;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveTsigKeyResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveTsigKeyResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveZoneRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveZoneRequest extends ZoneOperation {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RemoveZoneResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RemoveZoneResponse extends Response {
27 | private String zone;
28 |
29 | public RemoveZoneResponse() {
30 | super();
31 | zone = "";
32 | }
33 |
34 | public String getZone() {
35 | return zone;
36 | }
37 |
38 | public void setZone(String zone) {
39 | this.zone = zone;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/Response.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.common.server.ProtocolStatusCode;
27 |
28 | public class Response {
29 | protected ProtocolStatusCode status = ProtocolStatusCode.OK;
30 | protected String msg = "";
31 |
32 |
33 | public ProtocolStatusCode getStatus() {
34 | return status;
35 | }
36 |
37 | public void setStatus(ProtocolStatusCode status) {
38 | this.status = status;
39 | }
40 |
41 | public String getMsg() {
42 | return msg;
43 | }
44 |
45 | public void setMsg(String msg) {
46 | this.msg = msg;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RestrictOperation.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public abstract class RestrictOperation {
27 | private String sessionId;
28 | private String zone;
29 |
30 | public String getSessionId() {
31 | return sessionId;
32 | }
33 |
34 | public void setSessionId(String sessionId) {
35 | this.sessionId = sessionId;
36 | }
37 |
38 | public String getZone() {
39 | return zone;
40 | }
41 |
42 | public void setZone(String zone) {
43 | this.zone = zone;
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RrOperation.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public enum RrOperation {
27 | ADD,
28 | REMOVE;
29 | }
30 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RrRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.domain.ResourceRecord;
27 |
28 | public class RrRequest extends ZoneOperation {
29 | private ResourceRecord rr;
30 | private RrOperation op;
31 |
32 | public ResourceRecord getRr() {
33 | return rr;
34 | }
35 | public void setRr(ResourceRecord rr) {
36 | this.rr = rr;
37 | }
38 |
39 | public RrOperation getOp() {
40 | return op;
41 | }
42 | public void setOp(RrOperation op) {
43 | this.op = op;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/RrResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class RrResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/SetExpirationPeriodResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class SetExpirationPeriodResponse extends Response {
27 | private String zone;
28 | private int expirationPeriod;
29 |
30 | public SetExpirationPeriodResponse() {
31 | super();
32 | this.zone = "";
33 | }
34 |
35 | public String getZone() {
36 | return zone;
37 | }
38 |
39 | public void setZone(String zone) {
40 | this.zone = zone;
41 | }
42 |
43 | public int getExpirationPeriod() {
44 | return expirationPeriod;
45 | }
46 | public void setExpirationPeriod(int expirationPeriod) {
47 | this.expirationPeriod = expirationPeriod;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ShutdownRequest.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.ui.protocol;
2 |
3 | public class ShutdownRequest extends RestrictOperation {
4 | private String secret;
5 |
6 | public String getSecret() {
7 | return secret;
8 | }
9 |
10 | public void setSecret(String secret) {
11 | this.secret = secret;
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/SlaveOperation.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public enum SlaveOperation {
27 | ADD,
28 | REMOVE,
29 | ASSIGN,
30 | UNASSIGN;
31 | }
32 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/SlaveResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class SlaveResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ZoneExistsRequest.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.ui.protocol;
2 |
3 | import br.registro.dnsshim.util.DomainNameUtil;
4 |
5 | public class ZoneExistsRequest extends RestrictOperation {
6 | private String zone;
7 |
8 | public String getZone() {
9 | return zone;
10 | }
11 |
12 | public void setZone(String zone) {
13 | this.zone = DomainNameUtil.trimDot(zone.trim().toLowerCase());;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ZoneOperation.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public abstract class ZoneOperation extends RestrictOperation {
29 | private String zone;
30 |
31 | public String getZone() {
32 | return zone;
33 | }
34 |
35 | public void setZone(String zone) {
36 | this.zone = DomainNameUtil.trimDot(zone.trim().toLowerCase());;
37 | }
38 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ZoneUserRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ZoneUserRequest extends RestrictOperation {
27 | public enum ZoneUserRequestType { ADD, REMOVE };
28 |
29 | private ZoneUserRequestType type;
30 | private String username;
31 |
32 | public String getUsername() {
33 | return username;
34 | }
35 |
36 | public void setUsername(String username) {
37 | this.username = username;
38 | }
39 |
40 | public ZoneUserRequestType getType() {
41 | return type;
42 | }
43 |
44 | public void setType(ZoneUserRequestType type) {
45 | this.type = type;
46 | }
47 |
48 |
49 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ZoneUserResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ZoneUserResponse extends Response {
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ZoneVersionRequest.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | import br.registro.dnsshim.util.DomainNameUtil;
27 |
28 | public class ZoneVersionRequest extends RestrictOperation {
29 | private String zone;
30 |
31 | public ZoneVersionRequest() {
32 | zone = "";
33 | }
34 |
35 | public String getZone() {
36 | return zone;
37 | }
38 |
39 | public void setZone(String zone) {
40 | this.zone = DomainNameUtil.trimDot(zone.trim().toLowerCase());
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/ZoneVersionResponse.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol;
25 |
26 | public class ZoneVersionResponse extends Response {
27 | private String zone;
28 | private long serial;
29 |
30 | public ZoneVersionResponse() {
31 | zone = "";
32 | serial = 0;
33 | }
34 |
35 | public String getZone() {
36 | return zone;
37 | }
38 |
39 | public void setZone(String zone) {
40 | this.zone = zone;
41 | }
42 |
43 | public long getSerial() {
44 | return serial;
45 | }
46 |
47 | public void setSerial(long serial) {
48 | this.serial = serial;
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/parser/ZoneExistsParser.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.ui.protocol.parser;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 |
6 | import org.w3c.dom.Document;
7 | import org.w3c.dom.Node;
8 | import org.w3c.dom.NodeList;
9 | import org.xml.sax.SAXException;
10 |
11 | import br.registro.dnsshim.xfrd.ui.protocol.ZoneExistsRequest;
12 |
13 | public class ZoneExistsParser extends UiRequestParser {
14 | private static ZoneExistsParser instance;
15 |
16 | private ZoneExistsParser() {
17 | }
18 |
19 | @Override
20 | protected InputStream loadXsd() {
21 | if (xsd == null) {
22 | xsd = this.getClass().getClassLoader().getResourceAsStream("br/registro/dnsshim/resources/templates/xml/schema/ZoneExists.xsd");
23 | }
24 | return xsd;
25 | }
26 |
27 | @Override
28 | public Object parse(Document xml) throws SAXException, IOException {
29 | validate(xml);
30 | Node requestNode = extractNodeContent(xml, "zoneExists");
31 | NodeList childNodes = requestNode.getChildNodes();
32 |
33 | ZoneExistsRequest request = new ZoneExistsRequest();
34 | for (int i = 0; i < childNodes.getLength(); i++) {
35 | Node childNode = childNodes.item(i);
36 | if (childNode.getNodeType() != Node.ELEMENT_NODE) {
37 | continue;
38 | }
39 |
40 | String nodeName = childNode.getNodeName();
41 | Node valueNode = childNode.getFirstChild();
42 | if (nodeName.equals("zone")) {
43 | request.setZone(valueNode.getNodeValue());
44 | } else if (nodeName.equals("sessionId")) {
45 | request.setSessionId(valueNode.getNodeValue());
46 | }
47 | }
48 | return request;
49 | }
50 |
51 | public static synchronized ZoneExistsParser getInstance() {
52 | if (instance == null) {
53 | instance = new ZoneExistsParser();
54 | }
55 | return instance;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/ui/protocol/writer/UiResponseWriter.java:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2009 Registro.br. All rights reserved.
2 | *
3 | * Redistribution and use in source and binary forms, with or without
4 | * modification, are permitted provided that the following conditions are
5 | * met:
6 | * 1. Redistribution of source code must retain the above copyright
7 | * notice, this list of conditions and the following disclaimer.
8 | * 2. Redistributions in binary form must reproduce the above copyright
9 | * notice, this list of conditions and the following disclaimer in the
10 | * documentation and/or other materials provided with the distribution.
11 | *
12 | * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS'' AND ANY EXPRESS OR
13 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 | * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
15 | * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
16 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
17 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
18 | * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
19 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
20 | * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
21 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
22 | * DAMAGE.
23 | */
24 | package br.registro.dnsshim.xfrd.ui.protocol.writer;
25 |
26 | import java.io.IOException;
27 |
28 | import javax.xml.stream.XMLStreamException;
29 |
30 | import br.registro.dnsshim.xfrd.ui.protocol.Response;
31 |
32 | public abstract class UiResponseWriter {
33 | protected static final String ENCODING = "UTF-8";
34 | protected static final String ENCODING_VERSION = "1.0";
35 | protected static final String DNSSHIM_PROTOCOL_VERSION = "1.1";
36 | public abstract String write(T response) throws XMLStreamException, IOException;
37 | }
38 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/util/CloseDatabaseSessionFilter.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.util;
2 |
3 | import javax.persistence.EntityManager;
4 |
5 | import org.apache.log4j.Logger;
6 |
7 | import br.registro.dnsshim.common.server.DnsshimProtocolException;
8 | import br.registro.dnsshim.common.server.IoFilter;
9 | import br.registro.dnsshim.common.server.IoSession;
10 |
11 | public class CloseDatabaseSessionFilter implements IoFilter {
12 |
13 | private static final Logger logger = Logger.getLogger(CloseDatabaseSessionFilter.class);
14 |
15 | @Override
16 | public void filter(Object message, IoSession session) throws DnsshimProtocolException {
17 |
18 | EntityManager entityManager = ServerContext.getEntityManager();
19 |
20 | if (entityManager == null) {
21 | logger.error("Connection is null. Cannot close database connection in filter.");
22 | return;
23 | }
24 |
25 | if (entityManager.getTransaction().isActive()) {
26 | entityManager.getTransaction().commit();
27 | }
28 |
29 | if (entityManager.isOpen()) {
30 | entityManager.close();
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/util/OpenDatabaseSessionFilter.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.util;
2 |
3 | import javax.persistence.EntityManager;
4 |
5 | import br.registro.dnsshim.common.server.DnsshimProtocolException;
6 | import br.registro.dnsshim.common.server.IoFilter;
7 | import br.registro.dnsshim.common.server.IoSession;
8 | import br.registro.dnsshim.util.DatabaseUtil;
9 |
10 | public class OpenDatabaseSessionFilter implements IoFilter {
11 |
12 | @Override
13 | public void filter(Object message, IoSession session) throws DnsshimProtocolException {
14 | EntityManager entityManager = DatabaseUtil.getInstance();
15 | entityManager.getTransaction().begin();
16 | ServerContext.setEntityManager(entityManager);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/util/ServerContext.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.util;
2 |
3 | import javax.persistence.EntityManager;
4 |
5 | public class ServerContext {
6 | private static final ThreadLocal context = new ThreadLocal();
7 |
8 | public static void setEntityManager(EntityManager entityManager) {
9 | context.set(entityManager);
10 | }
11 |
12 | public static EntityManager getEntityManager() {
13 | return context.get();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/br/registro/dnsshim/xfrd/util/SortedProperties.java:
--------------------------------------------------------------------------------
1 | package br.registro.dnsshim.xfrd.util;
2 |
3 | import java.util.Collections;
4 | import java.util.Enumeration;
5 | import java.util.Properties;
6 | import java.util.Vector;
7 |
8 | @SuppressWarnings("serial")
9 | public class SortedProperties extends Properties {
10 |
11 | @SuppressWarnings({ "unchecked", "rawtypes" })
12 | public synchronized Enumeration keys() {
13 | Enumeration keysEnum = super.keys();
14 | Vector keyList = new Vector();
15 | while (keysEnum.hasMoreElements()) {
16 | keyList.add(keysEnum.nextElement());
17 | }
18 | Collections.sort(keyList);
19 | return keyList.elements();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------